Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
updated services
Browse files Browse the repository at this point in the history
  • Loading branch information
zieglerv committed Dec 8, 2017
1 parent 4d82c72 commit abf12f1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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",
};

Expand Down Expand Up @@ -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<Hit> hits = new ArrayList<Hit>();
//I) get the hits
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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",
};

Expand Down Expand Up @@ -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
//-------------------
Expand All @@ -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();
Expand Down Expand Up @@ -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<Hit> hits = new ArrayList<Hit>();
//I) get the hits
Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -261,7 +263,7 @@ public boolean processDataEvent(DataEvent event) {
}

rbc.fillAllHBBanks(event, rbc, fhits, clusters, segments, crosses, trkcands);

event.show();
return true;
}

Expand Down
23 changes: 12 additions & 11 deletions reconstruction/dc/src/main/java/org/jlab/service/dc/DCTBEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
Expand Down Expand Up @@ -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;
}

Expand All @@ -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<FittedHit> hits = new ArrayList<FittedHit>();
//I) get the hits
if(hitRead.get_TBHits().size()==0) {
Expand All @@ -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);
Expand Down Expand Up @@ -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 !");
Expand Down

0 comments on commit abf12f1

Please sign in to comment.