From abf12f11fca3bee5beebc49059c281e14e0b1072 Mon Sep 17 00:00:00 2001 From: Veronique Ziegler Date: Fri, 8 Dec 2017 11:40:01 -0500 Subject: [PATCH] updated services --- .../java/org/jlab/service/dc/DCHBEngine.java | 15 ++++++---- .../jlab/service/dc/DCHBLayerEffsEngine.java | 28 ++++++++++--------- .../java/org/jlab/service/dc/DCTBEngine.java | 23 +++++++-------- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java index b967b46653..80492aa0d3 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBEngine.java @@ -39,7 +39,7 @@ import org.jlab.detector.calib.utils.DatabaseConstantProvider; import org.jlab.detector.geant4.v2.DCGeant4Factory; import org.jlab.geom.base.ConstantProvider; -import org.jlab.utils.groups.IndexedTable; + public class DCHBEngine extends ReconstructionEngine { @@ -64,7 +64,8 @@ public boolean init() { DCSwimmer.getMagneticFields(); String[] dcTables = new String[]{ "/calibration/dc/signal_generation/doca_resolution", - "/calibration/dc/time_to_distance/t2d", + // "/calibration/dc/time_to_distance/t2d", + "/calibration/dc/time_to_distance/time2dist", // "/calibration/dc/time_corrections/T0_correction", }; @@ -152,7 +153,8 @@ public boolean processDataEvent(DataEvent event) { // event.appendBank(rbc.fillR3CrossfromMCTrack(event)); HitReader hitRead = new HitReader(); - hitRead.fetch_DCHits(event, noiseAnalysis, parameters, results, T0, T0ERR, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector); + //hitRead.fetch_DCHits(event, noiseAnalysis, parameters, results, T0, T0ERR, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector); + hitRead.fetch_DCHits(event, noiseAnalysis, parameters, results, T0, T0ERR, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), dcDetector); List hits = new ArrayList(); //I) get the hits @@ -212,8 +214,9 @@ public boolean processDataEvent(DataEvent event) { } } - CrossList crosslist = crossLister.candCrossLists(crosses, false, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector, null); - + //CrossList crosslist = crossLister.candCrossLists(crosses, false, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector, null); + CrossList crosslist = crossLister.candCrossLists(crosses, false, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), dcDetector, null); + if(crosslist.size()==0) { rbc.fillAllHBBanks(event, rbc, fhits, clusters, segments, crosses, null); @@ -312,7 +315,7 @@ public static void main(String[] args) throws FileNotFoundException, EvioExcepti // Processing TB en2.processDataEvent(event); System.out.println(" EVENT "+counter); - if (counter > 200) { + if (counter > 20) { break; } //event.show(); diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBLayerEffsEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBLayerEffsEngine.java index 823acef7c5..b0e6d590c2 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBLayerEffsEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCHBLayerEffsEngine.java @@ -39,7 +39,6 @@ import org.jlab.detector.calib.utils.DatabaseConstantProvider; import org.jlab.detector.geant4.v2.DCGeant4Factory; import org.jlab.geom.base.ConstantProvider; -import org.jlab.utils.groups.IndexedTable; public class DCHBLayerEffsEngine extends ReconstructionEngine { @@ -64,7 +63,8 @@ public boolean init() { DCSwimmer.getMagneticFields(); String[] dcTables = new String[]{ "/calibration/dc/signal_generation/doca_resolution", - "/calibration/dc/time_to_distance/t2d", + // "/calibration/dc/time_to_distance/t2d", + "/calibration/dc/time_to_distance/time2dist", // "/calibration/dc/time_corrections/T0_correction", }; @@ -104,13 +104,13 @@ public boolean init() { @Override public boolean processDataEvent(DataEvent event) { - //setRunConditionsParameters( event) ; - if(event.hasBank("RUN::config")==false ) { - System.err.println("RUN CONDITIONS NOT READ!"); - return true; - } - - DataBank bank = event.getBank("RUN::config"); + //setRunConditionsParameters( event) ; + if(event.hasBank("RUN::config")==false ) { + System.err.println("RUN CONDITIONS NOT READ!"); + return true; + } + + DataBank bank = event.getBank("RUN::config"); // Load the constants //------------------- @@ -123,7 +123,7 @@ public boolean processDataEvent(DataEvent event) { DCSwimmer.setMagneticFieldsScales(SOLSCALE, TORSCALE); System.out.println(" Got the correct geometry "+dcDetector.getWireMidpoint(0, 0, 0)); Run = newRun; - } + } // init SNR Clas12NoiseResult results = new Clas12NoiseResult(); Clas12NoiseAnalysis noiseAnalysis = new Clas12NoiseAnalysis(); @@ -152,7 +152,8 @@ public boolean processDataEvent(DataEvent event) { // event.appendBank(rbc.fillR3CrossfromMCTrack(event)); HitReader hitRead = new HitReader(); - hitRead.fetch_DCHits(event, noiseAnalysis, parameters, results, T0, T0ERR, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector); + //hitRead.fetch_DCHits(event, noiseAnalysis, parameters, results, T0, T0ERR, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector); + hitRead.fetch_DCHits(event, noiseAnalysis, parameters, results, T0, T0ERR, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), dcDetector); List hits = new ArrayList(); //I) get the hits @@ -212,7 +213,8 @@ public boolean processDataEvent(DataEvent event) { } } - CrossList crosslist = crossLister.candCrossLists(crosses, false, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector, null); + //CrossList crosslist = crossLister.candCrossLists(crosses, false, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector, null); + CrossList crosslist = crossLister.candCrossLists(crosses, false, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), dcDetector, null); if(crosslist.size()==0) { @@ -261,7 +263,7 @@ public boolean processDataEvent(DataEvent event) { } rbc.fillAllHBBanks(event, rbc, fhits, clusters, segments, crosses, trkcands); - +event.show(); return true; } diff --git a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java index f68b02d00d..5fceca5fe4 100644 --- a/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java +++ b/reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java @@ -28,7 +28,6 @@ import org.jlab.rec.dc.track.Track; import org.jlab.rec.dc.track.TrackCandListFinder; import org.jlab.rec.dc.trajectory.RoadFinder; -import org.jlab.utils.groups.IndexedTable; import org.jlab.detector.geant4.v2.DCGeant4Factory; import org.jlab.geom.base.ConstantProvider; @@ -41,16 +40,17 @@ public DCTBEngine() { int Run = 0; double[][][][] T0 ; - double[][][][] T0ERR ; - DCGeant4Factory dcDetector; + double[][][][] T0ERR ; + DCGeant4Factory dcDetector; - double TORSCALE; - double SOLSCALE; + double TORSCALE; + double SOLSCALE; @Override public boolean init() { String[] dcTables = new String[]{ "/calibration/dc/signal_generation/doca_resolution", - "/calibration/dc/time_to_distance/t2d", + // "/calibration/dc/time_to_distance/t2d", + "/calibration/dc/time_to_distance/time2dist", // "/calibration/dc/time_corrections/T0_correction", }; requireConstants(Arrays.asList(dcTables)); @@ -104,7 +104,8 @@ public boolean processDataEvent(DataEvent event) { //CCDBTables.add(this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_corrections/T0_correction")); TORSCALE = (double)bank.getFloat("torus", 0); SOLSCALE = (double)bank.getFloat("solenoid", 0); - TableLoader.Fill(this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d")); + // TableLoader.Fill(this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d")); + TableLoader.Fill(this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist")); Run = newRun; } @@ -124,11 +125,11 @@ public boolean processDataEvent(DataEvent event) { HitReader hitRead = new HitReader(); hitRead.read_HBHits(event, this.getConstantsManager().getConstants(newRun, "/calibration/dc/signal_generation/doca_resolution"), - this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), + this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), T0, T0ERR, dcDetector, tde); hitRead.read_TBHits(event, this.getConstantsManager().getConstants(newRun, "/calibration/dc/signal_generation/doca_resolution"), - this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), tde); + this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), tde); List hits = new ArrayList(); //I) get the hits if(hitRead.get_TBHits().size()==0) { @@ -148,7 +149,7 @@ public boolean processDataEvent(DataEvent event) { //2) find the clusters from these hits ClusterFinder clusFinder = new ClusterFinder(); - clusters = clusFinder.FindTimeBasedClusters(hits, cf, ct, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector, tde); + clusters = clusFinder.FindTimeBasedClusters(hits, cf, ct, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), dcDetector, tde); if(clusters.size()==0) { rbc.fillAllTBBanks(event, rbc, hits, null, null, null, null); @@ -202,7 +203,7 @@ public boolean processDataEvent(DataEvent event) { //5) make list of crosses consistent with a track candidate CrossListFinder crossLister = new CrossListFinder(); - CrossList crosslist = crossLister.candCrossLists(crosses, true, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/t2d"), dcDetector, tde); + CrossList crosslist = crossLister.candCrossLists(crosses, true, this.getConstantsManager().getConstants(newRun, "/calibration/dc/time_to_distance/time2dist"), dcDetector, tde); if(crosslist.size()==0) { //System.out.println(" Failed on cross list !");