Skip to content

Commit

Permalink
merge in master; add a nospacing readout driver
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyyugo committed Dec 13, 2024
2 parents 33e3358 + 7329532 commit 2434fe3
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,38 +142,34 @@ public void process(EventHeader event) {
// System.out.println(this.getClass().getName()+":: starting trigger determination");
Collection<Cluster> clusters = null;
Collection<HodoscopePattern> hodoPatterns = null;
ArrayList<HodoscopePattern> hodoPatternList = null;
ArrayList<HodoscopePattern> hodoPatternList = new ArrayList<>();
if(doNoSpacing)
localTime=ReadoutDataManager.getCurrentTime(); // just overwrite local time on every event

if(ReadoutDataManager.checkCollectionStatus(inputCollectionNameEcal, localTime) && ReadoutDataManager.checkCollectionStatus(inputCollectionNameHodo, localTime)) {
if(debug) System.out.println(this.getClass().getName()+":: checkCollectionStatus worked. Getting collection in time window = ["+localTime+","+(localTime+4.0)+"]");
clusters = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameEcal, Cluster.class);
hodoPatterns = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameHodo, HodoscopePattern.class);
if(debug) System.out.println(this.getClass().getName()+":: checkCollectionStatus worked Ecal size = "+clusters.size()+" Hodo size = "+ hodoPatterns.size());

localTime += 4.0;
//this is backwards of what I wanted, but whatever...
// if(doNoSpacing&&(clusters.size() == 0 || hodoPatterns.size() == 0)) return;
// if(!doNoSpacing&&(clusters.size() == 0 && hodoPatterns.size() == 0)) return;
// if(doNoSpacing&&(clusters.size() == 0 || hodoPatterns.size() == 0)) return;

//just quit if 0 clusters.
// if(clusters.size() == 0)
// return;
/*
* I feel like this should be "and" as one of
* the triggers doesn't require hodo, right?
*/
//this is the cut that's in master
if(clusters.size() == 0 || hodoPatterns.size() == 0) return;
hodoPatternList = new ArrayList<>(hodoPatterns);

} else {
if(debug)System.out.println(this.getClass().getName()+":: checkCollectionStatus did not find one of Ecal or Hodo at time = "+localTime);
return;
}

if(triggerType.equals("singles3")) {
if(ReadoutDataManager.checkCollectionStatus(inputCollectionNameEcal, localTime) && ReadoutDataManager.checkCollectionStatus(inputCollectionNameHodo, localTime)) {
clusters = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameEcal, Cluster.class);
hodoPatterns = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameHodo, HodoscopePattern.class);

localTime += 4.0;

if(clusters.size() == 0 || hodoPatterns.size() == 0) return;

hodoPatternList.addAll(hodoPatterns);

} else { return; }
}
else {
if(ReadoutDataManager.checkCollectionStatus(inputCollectionNameEcal, localTime)) {
clusters = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameEcal, Cluster.class);

localTime += 4.0;

if(clusters.size() == 0) return;

} else { return; }
}

// Track whether or not a trigger was seen.
boolean triggered = false;

Expand All @@ -195,7 +191,7 @@ public void process(EventHeader event) {
// not available during readout, so crystal indices must
// be obtained directly from the calorimeter geometry.
java.awt.Point ixy = ecal.getCellIndices(cluster.getCalorimeterHits().get(0).getCellID());
System.out.println(this.getClass().getName()+
if(debug)System.out.println(this.getClass().getName()+
":: looping over clusters; number of hits = "+TriggerModule2019.getClusterHitCount(cluster)
+" seed energy value = " + TriggerModule2019.getValueClusterSeedEnergy(cluster)
+" total energy of cluster = "+ TriggerModule2019.getValueClusterTotalEnergy(cluster));
Expand All @@ -222,7 +218,7 @@ public void process(EventHeader event) {
continue;
}

System.out.println(this.getClass().getName()+":: made it past basic cluster cuts");
if(debug)System.out.println(this.getClass().getName()+":: made it past basic cluster cuts");

// In the setup calorimeter geometry, range of X coordinates is [-23, -1] and [1, 23].
// The hardware uses cluster X coordinates [-22,0] and [1,23].
Expand All @@ -237,13 +233,13 @@ public void process(EventHeader event) {
if(debug)System.out.println(this.getClass().getName()+":: did not satisfy cluster x cut (low)");
continue;
}
System.out.println(this.getClass().getName()+":: made it past xMin cut ");
if(debug)System.out.println(this.getClass().getName()+":: made it past xMin cut ");
// XMin cut has been applied.
if(triggerModule.getCutEn(TriggerModule2019.CLUSTER_PDE_EN) && !triggerModule.clusterPDECut(cluster, clusterX)) {
if(debug)System.out.println(this.getClass().getName()+":: did not satisfy cluster PDE cut");
continue;
}
System.out.println(this.getClass().getName()+":: made it past PDE cut ");
if(debug)System.out.println(this.getClass().getName()+":: made it past PDE cut ");

}

Expand All @@ -254,7 +250,7 @@ public void process(EventHeader event) {
if(debug)System.out.println(this.getClass().getName()+":: did not satisfy cluster-hodo matching cut");
continue;
}
System.out.println(this.getClass().getName()+":: made it past cluster-hodo matching cut ");
if(debug)System.out.println(this.getClass().getName()+":: made it past cluster-hodo matching cut ");

}
if(debug)System.out.println(this.getClass().getName()+":: made it through all non-moller cuts");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,17 @@ public void findMollers(List<ReconstructedParticle> electrons) {
botElectrons.add(electron);
}
}

if (topElectrons.size() > 1 || botElectrons.size() > 1) {
return;
}
// ---- This requirement is too strict, and cuts out a lot of events.
// It can cut *all* moller events if both KF and GBL are used.
//
// if (topElectrons.size() > 1 || botElectrons.size() > 1) {
// return;
// }

// Iterate over the collection of electrons and create e-e- pairs
for (ReconstructedParticle topElectron : topElectrons) {
for (ReconstructedParticle botElectron : botElectrons) {
// Don't vertex a GBL track with a SeedTrack.
// Don't vertex a GBL track with a SeedTrack or KF track.
if (TrackType.isGBL(topElectron.getType()) != TrackType.isGBL(botElectron.getType())) {
continue;
}
Expand Down
Loading

0 comments on commit 2434fe3

Please sign in to comment.