From 95ad9b33181c80cfbd1106384330b689c5dc2c14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Oct 2020 09:11:34 -0400 Subject: [PATCH 1/7] Bump junit from 4.12 to 4.13.1 in /parent (#614) Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md) - [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index fb175699f0..166f0c4955 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -23,7 +23,7 @@ junit junit - 4.12 + 4.13.1 test From 0cf2ef0d6b71481a6a17f8146f95671b814918bd Mon Sep 17 00:00:00 2001 From: raffaelladevita Date: Wed, 14 Oct 2020 10:09:35 -0400 Subject: [PATCH 2/7] =?UTF-8?q?decoder:=20added=201-click=20tolerance=20in?= =?UTF-8?q?=20timeStamp=20check=20for=20TI=20master=20cra=E2=80=A6=20(#615?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * decoder: added 1-click tolerance in timeStamp check for TI master crate (address issue with test setups) * minor cleanup Co-authored-by: Nathan Baltzell --- .../detector/decode/CodaEventDecoder.java | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java index 3908e00bd3..9da3bc4236 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java @@ -48,7 +48,8 @@ public class CodaEventDecoder { JsonObject epicsData = new JsonObject(); private final long timeStampTolerance = 0L; - + private int tiMaster = -1; + public CodaEventDecoder(){ } @@ -128,29 +129,45 @@ public byte getHelicityLevel3() { } public void setTimeStamp(EvioDataEvent event) { + + long ts = -1; + List tiEntries = this.getDataEntries_TI(event); - boolean tiSync=true; - if(tiEntries.size()>0) { - long ts = tiEntries.get(0).getTimeStamp(); - for(int i=1; ithis.timeStampTolerance) { + + if(tiEntries.size()==1) { + ts = tiEntries.get(0).getTimeStamp(); + } + else if(tiEntries.size()>1) { + // check sychronization + boolean tiSync=true; + int i0 = -1; + // set reference timestamp from first entry which is not the tiMaster + for(int i=0; ideltaTS) { tiSync=false; if(this.timeStampErrors<100) { - System.out.println("WARNING: mismatch in TI time stamps: crate " + System.err.println("WARNING: mismatch in TI time stamps: crate " + tiEntries.get(i).getDescriptor().getCrate() + " reports " + tiEntries.get(i).getTimeStamp() + " instead of the " + ts - + " from crate " + tiEntries.get(0).getDescriptor().getCrate()); - this.timeStampErrors++; + + " from crate " + tiEntries.get(i0).getDescriptor().getCrate()); + } + else if(this.timeStampErrors==100) { + System.err.println("WARNING: reached the maximum number of timeStamp errors (100), supressing future warnings."); } - } - if(this.timeStampErrors==100) { - System.out.println("Reached the maximum number of timeStamp errors (100)"); this.timeStampErrors++; } } - if(tiSync) this.timeStamp = ts ; - else this.timeStamp = -1 ; + if(tiSync) ts = tiEntries.get(i0).getTimeStamp(); } + this.timeStamp = ts ; } public long getTriggerBits() { @@ -236,7 +253,7 @@ public List getDataEntries(EvioDataEvent event, int crate){ // This is regular integrated pulse mode, used for FTOF // FTCAL and EC/PCAL //return this.getDataEntries_57602(crate, node, event); - + this.tiMaster = crate; this.readHeaderBank(crate, node, event); //return this.getDataEntriesMode_7(crate,node, event); } From acd410ace7c35d5254f59440a401f3b34b9b317b Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Wed, 14 Oct 2020 14:46:58 -0400 Subject: [PATCH 3/7] bugfix for IndexedTable when #indices!=3 --- .../src/main/java/org/jlab/utils/groups/IndexedTable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-tools/clas-utils/src/main/java/org/jlab/utils/groups/IndexedTable.java b/common-tools/clas-utils/src/main/java/org/jlab/utils/groups/IndexedTable.java index b1394fd8cd..6af9990427 100644 --- a/common-tools/clas-utils/src/main/java/org/jlab/utils/groups/IndexedTable.java +++ b/common-tools/clas-utils/src/main/java/org/jlab/utils/groups/IndexedTable.java @@ -202,9 +202,9 @@ public void addEntryFromString(String[] values){ for(int i = 0; i < this.entryNames.size(); i++){ if(entryTypes.get(entryNames.get(i)).compareTo("D")==0){ - entries.getItem(index).setValue(i, Double.parseDouble(values[i+3])); + entries.getItem(index).setValue(i, Double.parseDouble(values[i+indexNames.size()])); } else { - entries.getItem(index).setValue(i, Integer.parseInt(values[i+3])); + entries.getItem(index).setValue(i, Integer.parseInt(values[i+indexNames.size()])); } } } From eed2cd0936f3ced40b9154d94d1f3133825baa4e Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Fri, 16 Oct 2020 13:41:54 -0400 Subject: [PATCH 4/7] Iss611 swaps refactor (#620) * add swap service * swap service cleanup * fix index table usage and refactor/cleanup * more cleanup * switch to different IndexedTable setter (which will work after its bug is fixed) * cleanup, fix bank names * bank modification off by default, add singleton * move SwapManager/SwapTable to common-tools * add bank/event convenience getters * final cleanup * bugfix in YAML vars --- build-coatjava.sh | 1 + .../org/jlab/detector/swaps/SwapManager.java | 267 ++++++++++++++++++ .../org/jlab/detector/swaps/SwapTable.java | 124 ++++++++ etc/services/swaps.yaml | 23 ++ reconstruction/pom.xml | 1 + reconstruction/swaps/pom.xml | 72 +++++ .../org/jlab/service/swaps/SwapEngine.java | 106 +++++++ 7 files changed, 594 insertions(+) create mode 100644 common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java create mode 100644 common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapTable.java create mode 100644 etc/services/swaps.yaml create mode 100644 reconstruction/swaps/pom.xml create mode 100644 reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java diff --git a/build-coatjava.sh b/build-coatjava.sh index e4620bc385..c66d03575d 100755 --- a/build-coatjava.sh +++ b/build-coatjava.sh @@ -111,5 +111,6 @@ cp reconstruction/fvt/target/clas12detector-fmt-*-SNAPSHOT.jar coatjava/lib/serv cp reconstruction/eb/target/clas12detector-eb-*-SNAPSHOT.jar coatjava/lib/services/ cp reconstruction/band/target/clas12detector-band-*-SNAPSHOT.jar coatjava/lib/services/ cp reconstruction/rtpc/target/clas12detector-rtpc-*-SNAPSHOT.jar coatjava/lib/services/ +cp reconstruction/swaps/target/clas12detector-swaps-*-SNAPSHOT.jar coatjava/lib/services/ echo "COATJAVA SUCCESSFULLY BUILT !" diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java new file mode 100644 index 0000000000..8b2fa9be91 --- /dev/null +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java @@ -0,0 +1,267 @@ +package org.jlab.detector.swaps; + +import org.jlab.detector.swaps.SwapTable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.jlab.detector.calib.utils.ConstantsManager; +import org.jlab.io.base.DataBank; +import org.jlab.io.base.DataEvent; +import org.jlab.jnp.hipo4.data.SchemaFactory; +import org.jlab.utils.groups.IndexedTable; + +/** + * + * Cache manager for cable swaps across multiple run numbers and CCDB tables, + * interpreted from two ConstantsManager instances, implemented to enable + * transforming a decoded HIPO file's sector/layer/component/order from the + * translation tables used at decoding time into a different one. + * + * @author baltzell + */ +public class SwapManager { + + public static final String DEF_CURRENT_CCDB_VARIATION = "swaps"; + public static final String DEF_PREVIOUS_CCDB_VARIATION = "default"; + public static final String[] DEF_DETECTOR_NAMES = { + "FTCAL", + "FTHODO", + "FTTRK", + "LTCC", + "ECAL", + "FTOF", + "HTCC", + "DC", + "CTOF", + "CND", + "BST", + "RF", + "BMT", + "FMT", + "RICH", + "HEL", + "BAND", + "RTPC" + }; + + private final HashMap> swaps = new HashMap<>(); + private final Map banksToTables = new HashMap<>(); + private final Map> detsToBanks = new HashMap<>(); + private final Map detsToTables = new HashMap<>(); + private ConstantsManager prevConman = null; + private ConstantsManager currConman = null; + + private static SwapManager instance = null; + + public Set getDetectors() { + return this.detsToBanks.keySet(); + } + public String getTable(String detectorName) { + return this.detsToTables.get(detectorName); + } + public List getBanks(String detectorName) { + return this.detsToBanks.get(detectorName); + } + + private SwapManager() {} + + public static SwapManager getInstance() { + if (instance == null) { + instance = new SwapManager(); + } + return instance; + } + + /** + * @param detectorNames + * @param prevTimestamp in CCDB format: MM/DD/YYYY + * @param currTimestamp in CCDB format: MM/DD/YYYY + */ + public SwapManager(List detectorNames, String prevTimestamp,String currTimestamp) { + this.initialize(detectorNames, prevTimestamp, currTimestamp); + } + + /** + * @param detectorNames + * @param previous timestamp/variation used for translation tables during decoding + * @param current timestamp/variation with correct translation tables + */ + public SwapManager(List detectorNames,ConstantsManager previous,ConstantsManager current) { + this.initialize(detectorNames, previous, current); + } + + /** + * @param detectorNames + * @param prevTimestamp in CCDB format: MM/DD/YYYY + * @param currTimestamp in CCDB format: MM/DD/YYYY + */ + public void initialize(List detectorNames, String prevTimestamp,String currTimestamp) { + this.initDetectors(detectorNames); + this.prevConman = new ConstantsManager(); + this.currConman = new ConstantsManager(); + this.prevConman.setTimeStamp(prevTimestamp); + this.prevConman.setVariation(DEF_PREVIOUS_CCDB_VARIATION); + this.prevConman.init(new ArrayList<>(this.banksToTables.values())); + if (currTimestamp != null) this.currConman.setTimeStamp(currTimestamp); + this.currConman.setVariation(DEF_CURRENT_CCDB_VARIATION); + this.currConman.init(new ArrayList<>(this.banksToTables.values())); + } + + /** + * @param detectorNames + * @param previous timestamp/variation used for translation tables during decoding + * @param current timestamp/variation with correct translation tables + */ + public void initialize(List detectorNames,ConstantsManager previous,ConstantsManager current) { + this.initDetectors(detectorNames); + this.prevConman = previous; + this.currConman = current; + } + + /** + * @param run run number + * @param tableName CCDB translation table name, e.g. "/dat/tt/ecal" + * @param slco array of old indices (sector,layer,component,order) + * @return array of new table indices (sector/layer/component/order) + */ + public int[] get(int run, String tableName, int... slco) { + if (this.currConman == null || this.prevConman == null) { + return slco; + } + if (!this.swaps.containsKey(run)) { + this.add(run); + } + if (this.swaps.get(run).containsKey(tableName)) { + return this.swaps.get(run).get(tableName).get(slco); + } + else { + return slco; + } + } + + /** + * @param run run number + * @param tableName CCDB translation table name, e.g. "/daq/tt/ecal" + * @param varName name of new index to retrieve (sector/layer/component/order) + * @param slco array of old indices (sector/layer/component/order) + * @return new value of the requested index (sector/layer/component/order) + */ + public int get(int run,String tableName,String varName,int... slco) { + return this.get(run,tableName,slco)[SwapTable.getVariableIndex(varName)]; + } + + /** + * @param run run number + * @param bank ADC/TDC bank + * @param row row index in bank + * @return array of new table indices (sector/layer/component/order) + */ + public int[] get(int run, DataBank bank, int row) { + final int sector = bank.getByte("sector", row); + final int layer = bank.getByte("layer", row); + final int comp = bank.getShort("component", row); + final int order = bank.getByte("order", row); + return this.get(run,banksToTables.get(bank.getDescriptor().getName()),sector,layer,comp,order); + } + + /** + * @param event the HIPO event + * @param bankName name of ADC/TDC bank + * @param row row index in bank + * @return array of new table indices (sector/layer/component/order) + */ + public int[] get(DataEvent event, String bankName, int row) { + if (event.hasBank("RUN::config")) { + if (event.hasBank(bankName)) { + final int run = event.getBank("RUN::config").getInt("run",0); + return this.get(run,event.getBank(bankName),row); + } + } + return null; + } + + /** + * Initialize the swaps for a given run number. + * @param run + */ + private void add(int run) { + this.swaps.put(run,new HashMap<>()); + for (String tableName : this.banksToTables.values()) { + IndexedTable prev = prevConman.getConstants(run, tableName); + IndexedTable curr = currConman.getConstants(run, tableName); + this.swaps.get(run).put(tableName,new SwapTable(prev,curr)); + } + } + + @Override + public String toString() { + String ret = ""; + for (int run : this.swaps.keySet()) { + for (String table : this.swaps.get(run).keySet()) { + ret += this.swaps.get(run).get(table); + } + } + return ret; + } + + /** + * Initialize the appropriate bank names and corresponding translation + * table names, based on the given detector names. + */ + private final void initDetectors(List detectorNames) { + + // register the detector names: + List thisDets = new ArrayList<>(); + List allDets = Arrays.asList(DEF_DETECTOR_NAMES); + if (detectorNames == null || detectorNames.isEmpty()) { + thisDets.addAll(allDets); + } + else { + for (String detectorName : detectorNames) { + if (allDets.contains(detectorName)) { + thisDets.add(detectorName); + } + else { + thisDets.clear(); + throw new RuntimeException("[SwapManager] --> Invalid detector name: "+detectorName); + } + } + } + + // set their bank/table names: + SchemaFactory schema = new SchemaFactory(); + schema.initFromDirectory(System.getenv("CLAS12DIR")+"/etc/bankdefs/hipo4"); + for (String detName : thisDets) { + // some detectors broke the bank/table naming convention: + String tableName = detName.equals("BST") ? "/daq/tt/svt" : "/daq/tt/"+detName.toLowerCase(); + for (String suffix : new String[]{"::adc","::tdc"}) { + if (schema.hasSchema(detName+suffix)) { + this.banksToTables.put(detName+suffix,tableName); + this.detsToTables.put(detName,tableName); + if (!this.detsToBanks.containsKey(detName)) { + this.detsToBanks.put(detName,new ArrayList()); + } + this.detsToBanks.get(detName).add(detName+suffix); + } + } + } + } + + public static void main(String[] args) { + + SwapManager noman = getInstance(); + System.out.println(Arrays.toString(noman.get(11014, "/daq/tt/bmt",3,5,320,0))); + + SwapManager man = new SwapManager(Arrays.asList("BMT"),"08/10/2020","10/13/2020"); + man.get(11014,man.getTable("BMT"),"sector",3,6,8,0); + System.out.println("SwapManager:\n"+man); + System.out.println(man.get(11014,man.getTable("BMT"),"sector",99,22,33,44)); + System.out.println(Arrays.toString(man.get(11014,man.getTable("BMT"),99,22,33,44))); + System.out.println(Arrays.toString(man.get(11014,man.getTable("BMT"),3,5,320,0))); + + } + +} diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapTable.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapTable.java new file mode 100644 index 0000000000..d9c76f7e02 --- /dev/null +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapTable.java @@ -0,0 +1,124 @@ +package org.jlab.detector.swaps; + +import java.util.HashMap; +import java.util.Map; +import org.jlab.utils.groups.IndexedTable; + +/** + * + * Interpret the sector/layer/component/order mapping between two CCDB "/daq/tt" + * translation tables, based on their shared crate/slot/channel/order, and store + * it in a new IndexedTable for access. + * + * @author baltzell + */ +public class SwapTable { + + public static final String[] VAR_NAMES = {"sector", "layer", "component", "order"}; + private static final Map VAR_INDEX_MAP = new HashMap() {{ + put(VAR_NAMES[0],0); + put(VAR_NAMES[1],1); + put(VAR_NAMES[2],2); + put(VAR_NAMES[3],3); + }}; + + private IndexedTable table = null; + + /** + * @param varName name of new variable to retrieve (sector/layer/component/order) + * @param slco array of old variables (sector/layer/component/order) + * @return new value of the requested variable + */ + public int get(String varName,int... slco) { + if (this.table.hasEntry(slco)) { + return this.table.getIntValue(varName,slco); + } + else { + return slco[getVariableIndex(varName)]; + } + } + + /** + * @param slco array of old variables (sector/layer/component/order) + * @return new value of the requested variable + */ + public int[] get(int... slco) { + int[] ret = new int[4]; + for (int ivar=0; ivar %d/%d/%d/%d\n", + prev[0],prev[1],prev[2],prev[3], + curr[0],curr[1],curr[2],curr[3]); + } + return ret; + } + +} \ No newline at end of file diff --git a/etc/services/swaps.yaml b/etc/services/swaps.yaml new file mode 100644 index 0000000000..662ded5423 --- /dev/null +++ b/etc/services/swaps.yaml @@ -0,0 +1,23 @@ +# Just an example of configuring SwapEngine. +# Note, it must come before all other services. +io-services: + reader: + class: org.jlab.clas.std.services.convertors.HipoToHipoReader + name: HipoToHipoReader + writer: + class: org.jlab.clas.std.services.convertors.HipoToHipoWriter + name: HipoToHipoWriter +services: + - class: org.jlab.service.swaps.SwapEngine + name: SWAPS +configuration: + io-services: + writer: + compression: 2 + services: + SWAPS: + timestamp: 10/13/2020 + previousTimestamp: 08/10/2020 + detectors: "BMT" +mime-types: + - binary/data-hipo diff --git a/reconstruction/pom.xml b/reconstruction/pom.xml index 14f54e94df..7755fb5120 100644 --- a/reconstruction/pom.xml +++ b/reconstruction/pom.xml @@ -27,5 +27,6 @@ eb band rtpc + swaps diff --git a/reconstruction/swaps/pom.xml b/reconstruction/swaps/pom.xml new file mode 100644 index 0000000000..e85341282e --- /dev/null +++ b/reconstruction/swaps/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + org.jlab.clas12.detector + clas12detector-swaps + 1.0-SNAPSHOT + jar + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + + + org.jlab.clas + clas12rec + ../../parent/pom.xml + 6.5.11-SNAPSHOT + + + + + clas12maven + https://clasweb.jlab.org/clas12maven + + + + + + + org.jlab.clas + clas-utils + 6.5.11-SNAPSHOT + + + + org.jlab.clas + clas-detector + 6.5.11-SNAPSHOT + + + + org.jlab.clas + clas-io + 6.5.11-SNAPSHOT + + + + org.jlab.clas + clas-reco + 6.5.11-SNAPSHOT + + + + org.jlab.clas + clas-analysis + 6.5.11-SNAPSHOT + + + + diff --git a/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java new file mode 100644 index 0000000000..94dd6bb2ba --- /dev/null +++ b/reconstruction/swaps/src/main/java/org/jlab/service/swaps/SwapEngine.java @@ -0,0 +1,106 @@ +package org.jlab.service.swaps; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.jlab.detector.swaps.SwapManager; +import org.jlab.clas.reco.ReconstructionEngine; +import org.jlab.io.base.DataEvent; +import org.jlab.io.base.DataBank; + +/** + * + * Initializes SwapManager singleton based on two CCDB timestamps to allow + * fixing cable swaps in decoded HIPO files. Optionally modifies ADC/TDC banks. + * + * @author baltzell + */ +public class SwapEngine extends ReconstructionEngine { + + private SwapManager swapman = null; + private boolean modifyBanks = false; + + public SwapEngine() { + super("SwapEngine","baltzell","1.0"); + } + + private void updateBank(int run,DataBank bank) { + for (int irow=0; irow SwapEngine does not honor variation in YAML."); + return false; + } + + // get timestamp for old translation tables: + String previousTimestamp = this.getEngineConfigString("previousTimestamp"); + if (previousTimestamp == null) { + System.err.println("["+this.getName()+"] --> Missing previousTimestamp in YAML."); + return false; + } + + // get timestamp for new translation tables: + String currentTimestamp = this.getEngineConfigString("timestamp"); + + // select detector list, initialize bank and translation table names: + List dets = new ArrayList<>(); + if (this.getEngineConfigString("detectors") == null) { + System.out.println("["+this.getName()+"] --> No detectors specified in YAML, assuming all."); + } + else { + dets.addAll(Arrays.asList(this.getEngineConfigString("detectors").split(","))); + } + + if (this.getEngineConfigString("modifyBanks") != null) { + if (this.getEngineConfigString("modifyBanks").equals("true")) { + this.modifyBanks = true; + } + } + + System.out.println("["+this.getName()+"] --> Setting current variation : "+SwapManager.DEF_CURRENT_CCDB_VARIATION); + System.out.println("["+this.getName()+"] --> Setting previous variation : "+SwapManager.DEF_PREVIOUS_CCDB_VARIATION); + System.out.println("["+this.getName()+"] --> Setting current timestamp : "+currentTimestamp); + System.out.println("["+this.getName()+"] --> Setting previous timestamp : "+previousTimestamp); + System.out.println("["+this.getName()+"] --> Setting detectors : "+this.getEngineConfigString("detectors")); + if (this.modifyBanks) { + System.out.println("["+this.getName()+"] --> Modifying ADC/TDC banks!"); + } + + this.swapman = SwapManager.getInstance(); + this.swapman.initialize(dets,previousTimestamp,currentTimestamp); + + System.out.println("["+this.getName()+"] --> swaps are ready...."); + return true; + } + +} From 62ac36b01c10d8c52e95acefd33398530794ea88 Mon Sep 17 00:00:00 2001 From: raffaelladevita Date: Fri, 16 Oct 2020 22:45:53 -0400 Subject: [PATCH 5/7] BAND: add check energy constants entry key (#622) * BAND: add check energy constants entry key * moving fix for llaaser hits to CalibrationConstantsLoader --- .../java/org/jlab/rec/band/banks/RecoBankWriter.java | 11 ++++++----- .../band/constants/CalibrationConstantsLoader.java | 7 +++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/reconstruction/band/src/main/java/org/jlab/rec/band/banks/RecoBankWriter.java b/reconstruction/band/src/main/java/org/jlab/rec/band/banks/RecoBankWriter.java index ebc092c31f..251fa5e0e4 100755 --- a/reconstruction/band/src/main/java/org/jlab/rec/band/banks/RecoBankWriter.java +++ b/reconstruction/band/src/main/java/org/jlab/rec/band/banks/RecoBankWriter.java @@ -44,11 +44,12 @@ public static DataBank fillBandHitBanks(DataEvent event, ArrayList hitl bank.setShort("component",i, (short) hitlist.get(i).GetComponent()); int barKey = hitlist.get(i).GetSector()*100+hitlist.get(i).GetLayer()*10+hitlist.get(i).GetComponent(); - double energyconvert_params[] = CalibrationConstantsLoader.ENERGY_CONVERT.get( Integer.valueOf(barKey) ); - double parA = energyconvert_params[0]; - double parB = energyconvert_params[1]; - double parC = energyconvert_params[2]; - double combo_adc = Math.sqrt(hitlist.get(i).GetAdcLeft() * hitlist.get(i).GetAdcRight()); + double energyconvert_params[] = CalibrationConstantsLoader.ENERGY_CONVERT.get( Integer.valueOf(barKey) ); + double parA = energyconvert_params[0]; + double parB = energyconvert_params[1]; + double parC = energyconvert_params[2]; + + double combo_adc = Math.sqrt(hitlist.get(i).GetAdcLeft() * hitlist.get(i).GetAdcRight()); combo_adc = parA + parB*combo_adc + parC*combo_adc*combo_adc; //bank.setFloat("energy", i, (float) Math.sqrt(hitlist.get(i).GetAdcLeft() * hitlist.get(i).GetAdcRight())); diff --git a/reconstruction/band/src/main/java/org/jlab/rec/band/constants/CalibrationConstantsLoader.java b/reconstruction/band/src/main/java/org/jlab/rec/band/constants/CalibrationConstantsLoader.java index 577e8eb7f1..fd316bc15e 100755 --- a/reconstruction/band/src/main/java/org/jlab/rec/band/constants/CalibrationConstantsLoader.java +++ b/reconstruction/band/src/main/java/org/jlab/rec/band/constants/CalibrationConstantsLoader.java @@ -48,6 +48,11 @@ public CalibrationConstantsLoader() { public static int CUT_NHITS_BAND = 5; public static int CUT_LASERHITS_BAND = 100; + public static int LASER_SECTOR = 6; + public static int LASER_LAYER = 6; + public static int LASER_COMPONENT = 6; + public static double[] LASER_CONV = {0,1,0}; + public static synchronized void Load(int runno, String var, ConstantsManager manager) { //System.out.println("*Loading calibration constants*"); @@ -89,6 +94,8 @@ public static synchronized void Load(int runno, String var, ConstantsManager man double convert_params[] = {parA,parB,parC}; ENERGY_CONVERT.put(Integer.valueOf(key), convert_params); } + // Add laser channel + ENERGY_CONVERT.put(LASER_SECTOR*100+LASER_LAYER*10+LASER_SECTOR, LASER_CONV); //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Global offsets for each bar for FADC and TDC From 2bbcbd3bb15cb556ba1c6df556a3bfcfef097272 Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Fri, 23 Oct 2020 14:26:17 +0200 Subject: [PATCH 6/7] switch to groot 3.0.0 --- common-tools/clas-analysis/pom.xml | 2 +- .../src/main/java/org/jlab/analysis/plotting/TCanvasP.java | 5 +++-- common-tools/clas-detector/pom.xml | 2 +- common-tools/clas-reco/pom.xml | 2 +- reconstruction/cvt/pom.xml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/common-tools/clas-analysis/pom.xml b/common-tools/clas-analysis/pom.xml index c8f8dc149f..841b21e963 100644 --- a/common-tools/clas-analysis/pom.xml +++ b/common-tools/clas-analysis/pom.xml @@ -60,7 +60,7 @@ org.jlab groot - 2.2.0-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/plotting/TCanvasP.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/plotting/TCanvasP.java index 3ed8d76755..cbc4a5bb31 100644 --- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/plotting/TCanvasP.java +++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/plotting/TCanvasP.java @@ -21,8 +21,8 @@ public TCanvasP(String name, int xsize, int ysize, int nColumns, int nRows) { this.divide(nColumns, nRows); } - @Override - public void divide(int nColumns, int nRows) { + @Override + public TCanvasP divide(int nColumns, int nRows) { super.divide(nColumns, nRows); this.nColumns = nColumns; this.nRows = nRows; @@ -30,6 +30,7 @@ public void divide(int nColumns, int nRows) { else if(nColumns*nRows > 9 && nColumns*nRows <= 16) setFontSizes(20); else if(nColumns*nRows > 16 && nColumns*nRows <= 25) setFontSizes(16); else setFontSizes(14); + return this; } public void setFontSizes(int size) { diff --git a/common-tools/clas-detector/pom.xml b/common-tools/clas-detector/pom.xml index 16bb8e226d..89e837edef 100644 --- a/common-tools/clas-detector/pom.xml +++ b/common-tools/clas-detector/pom.xml @@ -54,7 +54,7 @@ org.jlab groot - 2.2.0-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/common-tools/clas-reco/pom.xml b/common-tools/clas-reco/pom.xml index 49d442dde8..42f1ce0b8e 100644 --- a/common-tools/clas-reco/pom.xml +++ b/common-tools/clas-reco/pom.xml @@ -37,7 +37,7 @@ org.jlab groot - 2.2.0-SNAPSHOT + 3.0.0-SNAPSHOT diff --git a/reconstruction/cvt/pom.xml b/reconstruction/cvt/pom.xml index 6ffde39709..fd91f4d54c 100644 --- a/reconstruction/cvt/pom.xml +++ b/reconstruction/cvt/pom.xml @@ -106,7 +106,7 @@ org.jlab groot - 2.2.0-SNAPSHOT + 3.0.0-SNAPSHOT From 3775ffbbc6fd7d60a2e53f8ce8467bc203fb8b9a Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Fri, 23 Oct 2020 14:26:40 +0200 Subject: [PATCH 7/7] version bump --- common-tools/clas-analysis/pom.xml | 14 +++++++------- common-tools/clas-detector/pom.xml | 10 +++++----- common-tools/clas-geometry/pom.xml | 4 ++-- common-tools/clas-io/pom.xml | 6 +++--- common-tools/clas-jcsg/pom.xml | 8 ++++---- common-tools/clas-math/pom.xml | 4 ++-- common-tools/clas-physics/pom.xml | 4 ++-- common-tools/clas-reco/pom.xml | 14 +++++++------- common-tools/clas-utils/pom.xml | 4 ++-- common-tools/cnuphys/ced/pom.xml | 8 ++++---- common-tools/cnuphys/magfield/pom.xml | 2 +- common-tools/cnuphys/swimmer/pom.xml | 2 +- common-tools/coat-lib/deployDistribution.sh | 2 +- common-tools/coat-lib/pom.xml | 20 ++++++++++---------- common-tools/parent/pom.xml | 2 +- common-tools/pom.xml | 4 ++-- common-tools/swim-tools/pom.xml | 6 +++--- parent/pom.xml | 2 +- pom.xml | 4 ++-- reconstruction/band/pom.xml | 2 +- reconstruction/cnd/pom.xml | 2 +- reconstruction/cvt/pom.xml | 10 +++++----- reconstruction/dc/pom.xml | 12 ++++++------ reconstruction/eb/pom.xml | 10 +++++----- reconstruction/ec/pom.xml | 14 +++++++------- reconstruction/ft/pom.xml | 8 ++++---- reconstruction/fvt/pom.xml | 6 +++--- reconstruction/htcc/pom.xml | 8 ++++---- reconstruction/ltcc/pom.xml | 6 +++--- reconstruction/pom.xml | 4 ++-- reconstruction/rich/pom.xml | 8 ++++---- reconstruction/rtpc/pom.xml | 6 +++--- reconstruction/swaps/pom.xml | 12 ++++++------ reconstruction/tof/pom.xml | 4 ++-- 34 files changed, 116 insertions(+), 116 deletions(-) diff --git a/common-tools/clas-analysis/pom.xml b/common-tools/clas-analysis/pom.xml index 841b21e963..600ea9cfc7 100644 --- a/common-tools/clas-analysis/pom.xml +++ b/common-tools/clas-analysis/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-analysis - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT @@ -30,31 +30,31 @@ org.jlab.clas clas-utils - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT org.jlab.clas clas-physics - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT org.jlab.clas clas-io - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT org.jlab.clas clas-geometry - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT org.jlab.clas clas-detector - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT diff --git a/common-tools/clas-detector/pom.xml b/common-tools/clas-detector/pom.xml index 89e837edef..5f67f53402 100644 --- a/common-tools/clas-detector/pom.xml +++ b/common-tools/clas-detector/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-detector - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT @@ -30,7 +30,7 @@ org.jlab.clas clas-utils - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT @@ -42,13 +42,13 @@ org.jlab.clas clas-io - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT org.jlab.clas clas-geometry - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT diff --git a/common-tools/clas-geometry/pom.xml b/common-tools/clas-geometry/pom.xml index cafc6a1782..17bc50ee84 100644 --- a/common-tools/clas-geometry/pom.xml +++ b/common-tools/clas-geometry/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-geometry - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT diff --git a/common-tools/clas-io/pom.xml b/common-tools/clas-io/pom.xml index 244f4481de..1cee661fc3 100644 --- a/common-tools/clas-io/pom.xml +++ b/common-tools/clas-io/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-io - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT @@ -75,7 +75,7 @@ org.jlab.clas clas-utils - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT diff --git a/common-tools/clas-jcsg/pom.xml b/common-tools/clas-jcsg/pom.xml index 83b33109f4..90045cd2c1 100644 --- a/common-tools/clas-jcsg/pom.xml +++ b/common-tools/clas-jcsg/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-jcsg - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT @@ -40,12 +40,12 @@ org.jlab.clas clas-geometry - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT org.jlab.clas clas-detector - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT java3d diff --git a/common-tools/clas-math/pom.xml b/common-tools/clas-math/pom.xml index 62fd5f13d2..9490adeba0 100644 --- a/common-tools/clas-math/pom.xml +++ b/common-tools/clas-math/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-math - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT diff --git a/common-tools/clas-physics/pom.xml b/common-tools/clas-physics/pom.xml index f4f3e68473..99336706f8 100644 --- a/common-tools/clas-physics/pom.xml +++ b/common-tools/clas-physics/pom.xml @@ -4,7 +4,7 @@ org.jlab.clas clas-physics - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar @@ -23,7 +23,7 @@ org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT diff --git a/common-tools/clas-reco/pom.xml b/common-tools/clas-reco/pom.xml index 42f1ce0b8e..78220ad47f 100644 --- a/common-tools/clas-reco/pom.xml +++ b/common-tools/clas-reco/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-reco - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT @@ -67,7 +67,7 @@ org.jlab.clas clas-math - 6.5.11-SNAPSHOT + 6.5.12-SNAPSHOT