From eaa8af84b0c7b48ed41b05fe89aaa00efca98e0c Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Tue, 31 Mar 2020 10:34:09 +0100 Subject: [PATCH 01/11] Added attenuation calculation functions from CNDAtt'.java, added column elements to CNDEnergy::calib, added lines for Att' values to CNDEnergy::saveRow(). --- .../jlab/calib/services/cnd/CNDEnergy.java | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java b/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java index 1cde32f..e831e64 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java @@ -126,7 +126,7 @@ public CNDEnergy() { filename = nextFileName(); calib = new CalibrationConstants(3, - "mip_dir_L/F:mip_dir_L_err/F:mip_indir_L/F:mip_indir_L_err/F:mip_dir_R/F:mip_dir_R_err/F:mip_indir_R/F:mip_indir_R_err/F"); + "mip_dir_L/F:mip_dir_L_err/F:mip_indir_L/F:mip_indir_L_err/F:mip_dir_R/F:mip_dir_R_err/F:mip_indir_R/F:mip_indir_R_err/F:attlen_L/F:attlen_L_err/F:attlen_R/F:attlen_R_err/F"); calib.setName("/calibration/cnd/Energy"); calib.setPrecision(5); } @@ -1303,6 +1303,68 @@ public Double getMIPindirRight(int sector, int layer, int component) { return MIPindirRight; } + public Double getAttLenLeft(int sector, int layer, int component) { + + double attLenLeft = 0.0; + double overrideVal = constants.getItem(sector, layer, component)[OVERRIDE_LEFT]; + + if (overrideVal != UNDEFINED_OVERRIDE) { + attLenLeft = overrideVal; + } else { + double gradient = dataGroups.getItem(sector, layer, component).getF1D("funcLdir").getParameter(1); + attLenLeft = -2. / gradient; + } + return attLenLeft; + } + + public Double getAttLenLeftError(int sector, int layer, int component) { + + double attLenLeft = 0.0; + double attLenLefterror = 0.0; + double overrideVal = constants.getItem(sector, layer, component)[OVERRIDE_LEFT]; + + if (overrideVal != UNDEFINED_OVERRIDE) { + attLenLeft = overrideVal; + } else { + double gradient = dataGroups.getItem(sector, layer, component).getF1D("funcLdir").getParameter(1); + double gradienterror = dataGroups.getItem(sector, layer, component).getF1D("funcLdir").parameter(1).error(); + attLenLeft = -2. / gradient; + attLenLefterror = gradienterror*attLenLeft*attLenLeft/2.; + } + return attLenLefterror; + } + + public Double getAttLenRight(int sector, int layer, int component) { + + double attLenRight = 0.0; + double overrideVal = constants.getItem(sector, layer, component)[OVERRIDE_RIGHT]; + + if (overrideVal != UNDEFINED_OVERRIDE) { + attLenRight = overrideVal; + } else { + double gradient = dataGroups.getItem(sector, layer, component).getF1D("funcRdir").getParameter(1); + attLenRight = -2. / gradient; + } + return attLenRight; + } + + public Double getAttLenRightError(int sector, int layer, int component) { + + double attLenRight = 0.0; + double attLenRighterror = 0.0; + double overrideVal = constants.getItem(sector, layer, component)[OVERRIDE_RIGHT]; + + if (overrideVal != UNDEFINED_OVERRIDE) { + attLenRight = overrideVal; + } else { + double gradient = dataGroups.getItem(sector, layer, component).getF1D("funcRdir").getParameter(1); + double gradienterror = dataGroups.getItem(sector, layer, component).getF1D("funcRdir").parameter(1).error(); + attLenRight = -2. / gradient; + attLenRighterror = gradienterror* attLenRight* attLenRight/2.; + } + return attLenRighterror; + } + @Override public void saveRow(int sector, int layer, int component) { @@ -1322,6 +1384,14 @@ public void saveRow(int sector, int layer, int component) { "mip_indir_R", sector, layer, component); calib.setDoubleValue(ALLOWED_DIFF, "mip_indir_R_err", sector, layer, component); + calib.setDoubleValue(getAttLenLeft(sector, layer, component), + "attlen_L", sector, layer, component); + calib.setDoubleValue(getAttLenLeftError(sector, layer, component), + "attlen_L_err", sector, layer, component); + calib.setDoubleValue(getAttLenRight(sector, layer, component), + "attlen_R", sector, layer, component); + calib.setDoubleValue(getAttLenRightError(sector, layer, component), + "attlen_R_err", sector, layer, component); } @Override From 65704434ce23cccda39920d39f32116d42a661b7 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Tue, 31 Mar 2020 16:27:12 +0100 Subject: [PATCH 02/11] Overrode writeFile() to write out two files whilst maintaining the previous format of output. --- .../services/cnd/CNDCalibrationEngine.java | 33 ++++++++- .../jlab/calib/services/cnd/CNDEnergy.java | 70 ++++++++++++++++++- 2 files changed, 100 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDCalibrationEngine.java b/src/main/java/org/jlab/calib/services/cnd/CNDCalibrationEngine.java index aa6200c..6e59aba 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDCalibrationEngine.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDCalibrationEngine.java @@ -64,7 +64,8 @@ public class CNDCalibrationEngine extends CalibrationEngine { public String stepName = "Unknown"; public String fileNamePrefix = "Unknown"; public String filename = "Unknown.txt"; - + public String fileNamePrefix2 = "Unknown"; //--PN + public String filename2 = "Unknown.txt"; // --PN // configuration public int calDBSource = 0; public static final int CAL_DEFAULT = 0; @@ -346,6 +347,36 @@ public String nextFileName() { return filePrefix + "." + newFileNum + ".txt"; } + //added for the purposes of updating name of a second file --PN + public String nextFileName2() { + + // Get the next file name + Date today = new Date(); + DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String todayString = dateFormat.format(today); + String filePrefix = fileNamePrefix2 + todayString; + int newFileNum = 0; + + File dir = new File("."); + File[] filesList = dir.listFiles(); + + for (File file : filesList) { + if (file.isFile()) { + String fileName = file.getName(); + if (fileName.matches(filePrefix + "[.]\\d+[.]txt")) { + String fileNumString = fileName.substring( + fileName.indexOf('.') + 1, + fileName.lastIndexOf('.')); + int fileNum = Integer.parseInt(fileNumString); + if (fileNum >= newFileNum) + newFileNum = fileNum + 1; + + } + } + } + return filePrefix + "." + newFileNum + ".txt"; + } + public void customFit(int sector, int layer, int paddle) { // overridden in calibration step class } diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java b/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java index e831e64..2121742 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java @@ -3,6 +3,9 @@ import java.awt.BorderLayout; import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; @@ -122,11 +125,12 @@ public CNDEnergy() { stepName = "ADC-to-Energy conversion"; fileNamePrefix = "CND_CALIB_Energy_"; + fileNamePrefix2 = "CND_CALIB_ATTENUATION_"; // --PN // get file name here so that each timer update overwrites it filename = nextFileName(); - + filename2 = nextFileName2(); // --PN calib = new CalibrationConstants(3, - "mip_dir_L/F:mip_dir_L_err/F:mip_indir_L/F:mip_indir_L_err/F:mip_dir_R/F:mip_dir_R_err/F:mip_indir_R/F:mip_indir_R_err/F:attlen_L/F:attlen_L_err/F:attlen_R/F:attlen_R_err/F"); + "attlen_L/F:attlen_L_err/F:attlen_R/F:attlen_R_err/F:mip_dir_L/F:mip_dir_L_err/F:mip_indir_L/F:mip_indir_L_err/F:mip_dir_R/F:mip_dir_R_err/F:mip_indir_R/F:mip_indir_R_err/F"); calib.setName("/calibration/cnd/Energy"); calib.setPrecision(5); } @@ -1394,6 +1398,68 @@ public void saveRow(int sector, int layer, int component) { "attlen_R_err", sector, layer, component); } + @Override //split table contents into the two files --PN + public void writeFile(String filename) { + + //indexes for what is to be written out in lines of the file --PN + int[] writeCols = {1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3}; + + try { + + // Open the output file + File outputFile = new File(filename); + FileWriter outputFw = new FileWriter(outputFile.getAbsoluteFile()); + BufferedWriter outputBw = new BufferedWriter(outputFw); + + for (int i=0; i Date: Wed, 1 Apr 2020 09:46:34 +0100 Subject: [PATCH 03/11] Added calcs from CNDUturnTloss'.java, added params to CNDEffV'.java::calib object, and added filling of values to CNDEffV'.java::saveRow(). --- .../services/cnd/CNDEffVEventListener.java | 72 ++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java index 48154d3..3118372 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java @@ -128,7 +128,7 @@ public CNDEffVEventListener() { filename = nextFileName(); calib = new CalibrationConstants(3, - "veff_L/F:veff_L_err/F:veff_R/F:veff_R_err/F"); + "veff_L/F:veff_L_err/F:veff_R/F:veff_R_err/F:uturn_tloss/F:adjusted_LR_offset/F"); // calib = new CalibrationConstants(3, // "tdc_conv_left/F:tdc_conv_right/F"); @@ -959,6 +959,67 @@ public Double getVeffRError(int sector, int layer, int paddle){ return veffError; } + public Double getUturnTloss(int sector, int layer, int component) { + + double cLeft = 0.0; + double cRight = 0.0; + double overrideLeftVal = constants.getItem(sector, layer, component)[OVERRIDE_LEFT]; + double overrideRightVal = constants.getItem(sector, layer, component)[OVERRIDE_RIGHT]; + + if (overrideLeftVal != UNDEFINED_OVERRIDE) { + cLeft = overrideLeftVal; + } + else { + double intercept = dataGroups.getItem(sector,layer,component).getF1D("funcL").getParameter(0); + cLeft = -1 * intercept; + } + + if (overrideRightVal != UNDEFINED_OVERRIDE) { + cRight = overrideRightVal; + } + else { + double intercept = dataGroups.getItem(sector,layer,component).getF1D("funcR").getParameter(0); + cRight = -1 * intercept; + } + + CNDPaddlePair tempPaddlePair = new CNDPaddlePair(sector,layer,1); + double uturnTloss = cLeft + cRight - (tempPaddlePair.paddleLength() * ( (1./getEffVLeft(sector, layer, component))+(1./getEffVRight(sector, layer, component)) )); + + if (sector == 1){ + System.out.println("cLeft = " + cLeft); + System.out.println("cRight = " + cRight); + System.out.println("tempPaddlePair.paddleLength() = " + tempPaddlePair.paddleLength()); + System.out.println("Other term = " + ( (1./getEffVLeft(sector, layer, component))+(1./getEffVRight(sector, layer, component)) )); + + } + + return uturnTloss; + } + + public Double getLRoffsetAdjust(int sector, int layer, int component){ + + double LRoffsetAdjust = 0.0; + + double gradientL = dataGroups.getItem(sector,layer,component).getF1D("funcL") + .getParameter(1); + double gradientR = dataGroups.getItem(sector,layer,component).getF1D("funcR") + .getParameter(1); + + double Cleft = dataGroups.getItem(sector,layer,component).getF1D("funcL").getParameter(0); + double CRight = dataGroups.getItem(sector,layer,component).getF1D("funcR").getParameter(0); + + CNDPaddlePair tempPaddlePair = new CNDPaddlePair(sector,layer,1); + + LRoffsetAdjust = CRight - Cleft; + + System.out.println(); + System.out.println("CleftErr = " + Cleft); + System.out.println("CRightErr = " + CRight); + System.out.println("utlossError = " + LRoffsetAdjust); + + return LRoffsetAdjust+leftRightValues.getDoubleValue("time_offset_LR", sector, layer, component); + } + @Override public void saveRow(int sector, int layer, int component) { @@ -979,8 +1040,15 @@ public void saveRow(int sector, int layer, int component) { // "veff_R_err", sector, layer, component); calib.setDoubleValue(getVeffRError(sector, layer, component), "veff_R_err", sector, layer, component); + + calib.setDoubleValue(getUturnTloss(sector, layer, component), + "uturn_tloss", sector, layer, component); + // calib.setDoubleValue(getUturnTlossError(sector, layer, component), + // "uturn_tloss_err", sector, layer, component); - } + calib.setDoubleValue(getLRoffsetAdjust(sector, layer, component), + "adjusted_LR_offset", sector, layer, component); +} @Override public boolean isGoodPaddle(int sector, int layer, int paddle) { From 62a125ab53f8a1c5c02b09be67f51191e7334dd2 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Thu, 2 Apr 2020 09:16:16 +0100 Subject: [PATCH 04/11] Overrode writeFile() to write out uturn/LRadj files; Overrode nextFile2() to account for fileprefix on output of uturn/LRadj files and increment properly by adjusting regex test criteria. --- .../services/cnd/CNDEffVEventListener.java | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java index 3118372..0543a54 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java @@ -1,9 +1,13 @@ package org.jlab.calib.services.cnd; import java.awt.BorderLayout; + import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; +import java.io.File; +import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -45,6 +49,9 @@ import org.jlab.io.task.DataSourceProcessorPane; import org.jlab.io.task.IDataEventListener; import org.jlab.utils.groups.IndexedList; +import java.util.Date; +import java.text.DateFormat; +import java.text.SimpleDateFormat; /** * CND Calibration suite @@ -124,8 +131,10 @@ public CNDEffVEventListener() { stepName = "EffV"; fileNamePrefix = "CND_CALIB_EFFV_"; + fileNamePrefix2 = "CND_CALIB_UTURNTLOSS_"; // get file name here so that each timer update overwrites it filename = nextFileName(); + filename2 = nextFileName2(); // --PN calib = new CalibrationConstants(3, "veff_L/F:veff_L_err/F:veff_R/F:veff_R_err/F:uturn_tloss/F:adjusted_LR_offset/F"); @@ -1020,6 +1029,123 @@ public Double getLRoffsetAdjust(int sector, int layer, int component){ return LRoffsetAdjust+leftRightValues.getDoubleValue("time_offset_LR", sector, layer, component); } + @Override + public void writeFile(String filename) { + + //indexes for what is to be written out in lines of the file --PN + int[] writeCols = {1, 1, 1, 2, 2, 2, 2, 3, 4}; + + try { //EffV output + + // Open the output file + File outputFile = new File(filename); + FileWriter outputFw = new FileWriter(outputFile.getAbsoluteFile()); + BufferedWriter outputBw = new BufferedWriter(outputFw); + + for (int i=0; i= newFileNum) + newFileNum = fileNum + 1; + + } + } + } + return filePrefix + "." + newFileNum + ".txt"; + } + @Override public void saveRow(int sector, int layer, int component) { From b7a0252a2152b655935e7f9e4bfd0443c42bd9a5 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Thu, 2 Apr 2020 12:47:13 +0100 Subject: [PATCH 05/11] Corrected misnamed variable 'maxtime' which stopped max value set in preamble being set. --- .../calib/services/cnd/CNDTimeOffsetslayerEventListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDTimeOffsetslayerEventListener.java b/src/main/java/org/jlab/calib/services/cnd/CNDTimeOffsetslayerEventListener.java index d13c000..4520806 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDTimeOffsetslayerEventListener.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDTimeOffsetslayerEventListener.java @@ -187,9 +187,11 @@ public void resetEventListener() { } if(CNDCalibration.mintime!=0.0){ HIST_X_MIN =CNDCalibration.mintime; + System.out.println("MIN VALUE SEEN INSIDE GLOB::resetEventListener() : " + CNDCalibration.mintime); } - if(CNDCalibration.maxtimeLR!=0.0){ + if(CNDCalibration.maxtime!=0.0){ HIST_X_MAX =CNDCalibration.maxtime; + System.out.println("MAX VALUE SEEN INSIDE GLOB::resetEventListener() : " + CNDCalibration.maxtime); } // GM perform init processing From 0ecea380a9a25f0a20cd99f27c104ea7a26bf234 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Thu, 2 Apr 2020 15:53:24 +0100 Subject: [PATCH 06/11] Removed Uturn' and Attenuation choices from list in Select steps panel of config window. --- src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java index 60b4b8c..7b79b10 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java @@ -1090,7 +1090,7 @@ public void configure() { int gridy=0; for (int i=0; i< engines.length; i++) { - if(i== HV || i== TIME_OFFSETS_RF || i== TDC_CONV )continue; + if(i== HV || i== TIME_OFFSETS_RF || i== TDC_CONV || i== UTURN_TLOSS || i== ATTENUATION)continue; //added exceptions for attenuation and LR_offset --PN c.gridx = 0; c.gridy = gridy; gridy++; c.anchor = c.WEST; From 5bfd2bba74afaa4bda71bb172f8405907690cd18 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Thu, 2 Apr 2020 16:32:07 +0100 Subject: [PATCH 07/11] Suppressed step choices and settings tabs for Attenuation and uTurn/LR_adj. Added these to the names of the engines in EffV and Energy engines. Edited Instructions panel to match new tab names. --- .../calib/services/cnd/CNDCalibration.java | 24 +++++++++++-------- .../services/cnd/CNDEffVEventListener.java | 2 +- .../jlab/calib/services/cnd/CNDEnergy.java | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java index 7b79b10..f9c10da 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java @@ -1058,7 +1058,7 @@ public void configure() { Panel.add(intro1,c1); c1.gridx = 0; c1.gridy = 4; - JLabel intro2= new JLabel("- In \"Select Steps\" choose the calibration you want to perform"); + JLabel intro2= new JLabel("- In \"Select Step\" choose the calibration you want to perform"); Panel.add(intro2,c1); c1.gridx = 0; c1.gridy = 5; @@ -1066,7 +1066,7 @@ public void configure() { Panel.add(intro3,c1); c1.gridx = 0; c1.gridy = 6; - JLabel intro4= new JLabel("- In \"Tracking options\" add some cuts on the match CVT tracks. WARNING these cuts are used for every calibration step."); + JLabel intro4= new JLabel("- In \"Tracking / General\" add some cuts on the match CVT tracks. WARNING these cuts are used for every calibration step."); Panel.add(intro4,c1); c1.gridx = 0; c1.gridy = 7; @@ -1131,7 +1131,7 @@ public void configure() { - configPane.add("Select steps", stepOuterPanel); + configPane.add("Select Step", stepOuterPanel); // Previous calibration values JPanel confOuterPanel = new JPanel(new BorderLayout()); @@ -1161,6 +1161,10 @@ public void configure() { confPanel.add(engPanels[i-2]); } + /* YOU ARE HERE! + * PLAY AROUND WITH THIS LINE FROM CNDPrevConfigPanel: + * this.setBorder(BorderFactory.createTitledBorder(engine.stepName)) + * CAN THIS BE USED TO MANUALLY SET THE LABLES ON THESE BORDERS? */ // Previously: // for (int i=3; i< engines.length; i++) { @@ -1172,7 +1176,7 @@ public void configure() { confOuterPanel.add(confPanel, BorderLayout.NORTH); confOuterPanel.add(butPage2, BorderLayout.SOUTH); - configPane.add("Previous calibration values", confOuterPanel); + configPane.add("Previous Calibration Values", confOuterPanel); // Tracking options JPanel trOuterPanel = new JPanel(new BorderLayout()); @@ -1443,10 +1447,10 @@ public void configure() { JPanel butPage6 = new configButtonPanel(this, true, "Next"); effVOuterPanel.add(butPage6, BorderLayout.SOUTH); - configPane.add("Effective Velocity", effVOuterPanel); + configPane.add("Effective Velocity, Uturn-TimeLoss & Adjusted LR-Offset", effVOuterPanel); - - // ut options +//Suppress tabs for uturn' and Attenuation. -- PN +/* // ut options JPanel utOuterPanel = new JPanel(new BorderLayout()); JPanel utPanel = new JPanel(new GridBagLayout()); utOuterPanel.add(utPanel, BorderLayout.NORTH); @@ -1593,7 +1597,7 @@ public void configure() { JPanel butPage8= new configButtonPanel(this, true, "Next"); attOuterPanel.add(butPage8, BorderLayout.SOUTH); configPane.add("Attenuation", attOuterPanel); - +*/ //Suppress tabs for uturn' and Attenuation. -- PN //LR offset JPanel timeOuterPanel = new JPanel(new BorderLayout()); @@ -1627,7 +1631,7 @@ public void configure() { JPanel butPagetime = new configButtonPanel(this, true, "Next"); timeOuterPanel.add(butPagetime, BorderLayout.SOUTH); - configPane.add("Global time Offset", timeOuterPanel); + configPane.add("Global TimeOffset", timeOuterPanel); @@ -1727,7 +1731,7 @@ public void configure() { JPanel butPage9 = new configButtonPanel(this, true, "Finish"); energyOuterPanel.add(butPage9, BorderLayout.SOUTH); - configPane.add("Energy", energyOuterPanel); + configPane.add("Attenuation & Energy", energyOuterPanel); diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java index 0543a54..5cd69d0 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java @@ -129,7 +129,7 @@ public class CNDEffVEventListener extends CNDCalibrationEngine { public CNDEffVEventListener() { - stepName = "EffV"; + stepName = "EffV, Uturn-Loss & LR-Adj."; fileNamePrefix = "CND_CALIB_EFFV_"; fileNamePrefix2 = "CND_CALIB_UTURNTLOSS_"; // get file name here so that each timer update overwrites it diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java b/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java index 2121742..cb7bd56 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java @@ -123,7 +123,7 @@ public class CNDEnergy extends CNDCalibrationEngine{ public CNDEnergy() { - stepName = "ADC-to-Energy conversion"; + stepName = "Attenuation & ADC-to-Energy Conversion"; fileNamePrefix = "CND_CALIB_Energy_"; fileNamePrefix2 = "CND_CALIB_ATTENUATION_"; // --PN // get file name here so that each timer update overwrites it From 963cf60064ddd54f735f02a3da8464b0e6af52aa Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Fri, 3 Apr 2020 13:10:23 +0100 Subject: [PATCH 08/11] Added change of lable for Previous Calibration panels, as engine names now less meaningful. --- .../jlab/calib/services/cnd/CNDCalibration.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java index f9c10da..ea418ee 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java @@ -1158,13 +1158,19 @@ public void configure() { for (int i=2; i< 5; i++) { engPanels[i-2] = new CNDPrevConfigPanel(engines[i]); + // Override the Prev.Calib titles with more instructive labled after changing engine names --PN + if (i-2 == 0) { + engPanels[i-2].setBorder(BorderFactory.createTitledBorder("TimeOffset_LR [Adj. LR-Offset for Global TimeOffset step]")); + } + if (i-2 == 1) { + engPanels[i-2].setBorder(BorderFactory.createTitledBorder("Effective Velocity")); + } + if (i-2 == 2) { + engPanels[i-2].setBorder(BorderFactory.createTitledBorder("Adjusted LR-Offset / Uturn-TimeLoss")); + } confPanel.add(engPanels[i-2]); - } - /* YOU ARE HERE! - * PLAY AROUND WITH THIS LINE FROM CNDPrevConfigPanel: - * this.setBorder(BorderFactory.createTitledBorder(engine.stepName)) - * CAN THIS BE USED TO MANUALLY SET THE LABLES ON THESE BORDERS? */ + } // Previously: // for (int i=3; i< engines.length; i++) { From fabcbd6673dc50bb61a81ba6ca7efc9d1d046129 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Fri, 3 Apr 2020 13:35:45 +0100 Subject: [PATCH 09/11] pull test --- src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java index ea418ee..878926b 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java @@ -77,6 +77,8 @@ public class CNDCalibration implements IDataEventListener, ActionListener, CalibrationConstantsListener, DetectorListener, ChangeListener { +// pull test + // main panel JPanel pane = null; JFrame innerConfigFrame = new JFrame("Configure CND calibration settings"); From d792e05dff41bbffb2c20980a892efd850455065 Mon Sep 17 00:00:00 2001 From: Paul Naidoo Date: Mon, 6 Apr 2020 15:44:20 +0100 Subject: [PATCH 10/11] Added exeption to writeFile() to stop white space being added at the end of row in EffV/Att' files. --- .../java/org/jlab/calib/services/cnd/CNDEffVEventListener.java | 2 +- src/main/java/org/jlab/calib/services/cnd/CNDEnergy.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java index 5cd69d0..1e6b87f 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDEffVEventListener.java @@ -1047,7 +1047,7 @@ public void writeFile(String filename) { for (int j=0; j Date: Mon, 6 Apr 2020 15:49:13 +0100 Subject: [PATCH 11/11] Removed pull test comment. --- src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java index 878926b..ea418ee 100644 --- a/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java +++ b/src/main/java/org/jlab/calib/services/cnd/CNDCalibration.java @@ -77,8 +77,6 @@ public class CNDCalibration implements IDataEventListener, ActionListener, CalibrationConstantsListener, DetectorListener, ChangeListener { -// pull test - // main panel JPanel pane = null; JFrame innerConfigFrame = new JFrame("Configure CND calibration settings");