Skip to content

Commit d5b699d

Browse files
committed
different electron pid for zero-torus
1 parent c1fa07d commit d5b699d

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

reconstruction/eb/src/main/java/org/jlab/rec/eb/EBUtil.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,27 @@ public static boolean isSimpleElectron(DetectorParticle p,EBCCDBConstants ccdb)
9999

100100
return true;
101101
}
102+
103+
/**
104+
* Perform a basic true/false identification for electrons.
105+
*/
106+
public static boolean isZeroFieldElectron(DetectorParticle p,EBCCDBConstants ccdb) {
107+
108+
// require ECAL:
109+
final int sector = p.getSector(DetectorType.ECAL);
110+
if (sector<1) return false;
111+
112+
// requre HTCC photoelectrons:
113+
final double nphe = p.getNphe(DetectorType.HTCC);
114+
if (nphe < ccdb.getDouble(EBCCDBEnum.HTCC_NPHE_CUT)) return false;
115+
116+
// require PCAL minimum energy:
117+
final double minPcalEnergy = ccdb.getSectorDouble(EBCCDBEnum.ELEC_PCAL_min_energy,sector);
118+
final double pcalEnergy = p.getEnergy(DetectorType.ECAL,DetectorLayer.PCAL);
119+
if (pcalEnergy < minPcalEnergy) return false;
120+
121+
return true;
122+
}
102123

103124
/**
104125
* Calculate timing resolution from EventBuilder constants:

reconstruction/eb/src/main/java/org/jlab/service/eb/EBAnalyzer.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public void assignBetas(DetectorEvent event,final boolean useStartTimeFromFT){
350350
}
351351
public void assignPids(DetectorEvent event,final boolean useStartTimeFromFT) {
352352

353-
PIDHypothesis pidHyp = new PIDHypothesis();
353+
PIDHypothesis pidHyp = new PIDHypothesis(event.getEventHeader().getTorus());
354354
pidHyp.setEvent(event);
355355
pidHyp.setUseStartTimeFromFT(useStartTimeFromFT);
356356

@@ -382,12 +382,13 @@ else if (p.getCharge()<0) {
382382

383383
public class PIDHypothesis {
384384

385+
private float torus = 0;
385386
private int theoryPID = -1;
386387
private double PIDquality = 0.0;
387388
private DetectorEvent event;
388389
private boolean useStartTimeFromFT = false;
389390

390-
public PIDHypothesis() {}
391+
public PIDHypothesis(float t) {torus=t;}
391392

392393
public void setEvent(DetectorEvent e) {event = e;}
393394

@@ -405,7 +406,9 @@ public void PIDMatch(DetectorParticle p, int pid) {
405406

406407
final boolean pidFromTimingCheck = pid==pidFromTiming && p.getTheoryBeta(pid)>0;
407408

408-
final boolean isElectron = EBUtil.isSimpleElectron(p,ccdb);
409+
final boolean isElectron = Math.abs(torus)>1e-8 ?
410+
EBUtil.isSimpleElectron(p,ccdb) :
411+
EBUtil.isZeroFieldElectron(p, ccdb);
409412

410413
final boolean htccSignalCheck = p.getNphe(DetectorType.HTCC)>ccdb.getDouble(EBCCDBEnum.HTCC_NPHE_CUT);
411414
final boolean ltccSignalCheck = p.getNphe(DetectorType.LTCC)>ccdb.getDouble(EBCCDBEnum.LTCC_NPHE_CUT);

0 commit comments

Comments
 (0)