Particle ID and event selection
Classes | Public Member Functions | Static Public Member Functions | List of all members
ElectronCandidate Class Reference
Inheritance diagram for ElectronCandidate:
Candidate

Classes

enum  Cut
 This is the enum for electron cut types. More...
 

Public Member Functions

 ElectronCandidate (int ipart)
 
LorentzVector getLorentzVector ()
 
boolean cut_PID ()
 
boolean cut_NPHE ()
 
boolean cut_EC_OUTER_VS_INNER ()
 
boolean cut_EC_SAMPLING ()
 
boolean cut_EC_FIDUCIAL ()
 
boolean cut_EC_FIDUCIAL (Level eclevel)
 
boolean cut_DC_FIDUCIAL_REG1 ()
 
boolean cut_DC_FIDUCIAL_REG2 ()
 
boolean cut_DC_FIDUCIAL_REG3 ()
 
boolean cut_DC_VERTEX ()
 
int failedpid ()
 
int failedpid (Cut ...applycuts)
 
boolean iselectron ()
 
boolean iselectron (Cut ...applycuts)
 
- Public Member Functions inherited from Candidate
 Candidate (int ipart)
 
void setINBENDING ()
 
void setOUTBENDING ()
 
void setPxyz (Number px, Number py, Number pz)
 
void setVZ (Number vz)
 
void setBETA (Number beta)
 
void setCHI2PID (Number chi2pid)
 
void setDVZ (Number dvz)
 
void setPID (Number pid)
 
void setStatus (Number status)
 
void setNPHE (Number nphe)
 
void setPCALsector (Number sector)
 
void setPCALenergy (Number energy)
 
void setECINenergy (Number energy)
 
void setECOUTenergy (Number energy)
 
void setPCALvw (Number lv, Number lw)
 
void setPCALxyz (Number x, Number y, Number z)
 
Integer getPCALsector ()
 
Integer getDCsector ()
 
Float getDC1x ()
 
Float getDC1y ()
 
Float getDC1z ()
 
void setDCxyz (int region, Number x, Number y, Number z)
 

Static Public Member Functions

static ElectronCandidate getElectronCandidate (int ipart, Bank recbank, Bank calbank, Bank ccbank, Bank trajbank, boolean isinbending)
 

Additional Inherited Members

- Public Attributes inherited from Candidate
final int ipart
 
- Protected Attributes inherited from Candidate
MagField field = MagField.INBENDING
 magnetic field, INBENDING by default
 
Float nphe = null
 number of photoelectrons
 
Integer pcal_sector = null
 pcal sector
 
Float pcal_energy = null
 energy deposited in PCAL
 
Float ecin_energy = 0f
 energy deposited in ECin
 
Float ecout_energy = 0f
 energy deposited in ECout
 
Float pcal_lv = null
 distance on V-side
 
Float pcal_lw = null
 distance on W-side
 
Float pcal_x = null
 X from PCAL.
 
Float pcal_y = null
 Y from PCAL.
 
Float pcal_z = null
 Z from PCAL.
 
Float p = null
 momentum
 
Float px = null
 px momentum
 
Float py = null
 px momentum
 
Float pz = null
 px momentum
 
Float vz = null
 z vertex
 
Float beta = null
 beta value
 
Float chi2pid = null
 chi2pid value
 
Float dvz = null
 the difference between trigger particle vz and candidate vz
 
Float traj_x1 = null
 x-position of the track at the detector surface (cm) at region 1
 
Float traj_y1 = null
 y-position of the track at the detector surface (cm) at region 1
 
Float traj_z1 = null
 z-position of the track at the detector surface (cm) at region 1
 
Float traj_x2 = null
 x-position of the track at the detector surface (cm) at region 2
 
Float traj_y2 = null
 y-position of the track at the detector surface (cm) at region 2
 
Float traj_z2 = null
 z-position of the track at the detector surface (cm) at region 2
 
Float traj_x3 = null
 x-position of the track at the detector surface (cm) at region 3
 
Float traj_y3 = null
 y-position of the track at the detector surface (cm) at region 3
 
Float traj_z3 = null
 z-position of the track at the detector surface (cm) at region 3
 
Integer pid = null
 particle PID
 
Integer dc_sector = null
 dc sector
 
Short status = null
 particle status
 

Class Documentation

◆ uconn::utils::pid::stefan::ElectronCandidate::Cut

enum uconn::utils::pid::stefan::ElectronCandidate::Cut

This is the enum for electron cut types.

Enumerator
CC_NPHE nphe cut
DC_FIDUCIAL_REG1 fiducial DC cut for region 1
DC_FIDUCIAL_REG2 fiducial DC cut for region 2
DC_FIDUCIAL_REG3 fiducial DC cut for region 3
DC_VERTEX cut on DC Z vertex
EC_FIDUCIAL fiducial EC cut
EC_OUTER_VS_INNER outer vs inner energy deposit
EC_SAMPLING sampling fraction
PID cut on PDG code

Constructor & Destructor Documentation

◆ ElectronCandidate()

ElectronCandidate ( int  ipart)
inline

A Constructor

Parameters
ipartparticle index
36 {
37 super(ipart);
38 }

Member Function Documentation

◆ cut_DC_FIDUCIAL_REG1()

boolean cut_DC_FIDUCIAL_REG1 ( )
inline
Returns
fiducial cut on DC region 1
165 {
166 if(dc_sector==null || traj_x1==null || traj_y1==null || pid==null) return false;
167 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 1, traj_x1, traj_y1, pid, field==MagField.INBENDING);
168 }
Integer dc_sector
dc sector
Definition: Candidate.java:65
Float traj_y1
y-position of the track at the detector surface (cm) at region 1
Definition: Candidate.java:56
MagField field
magnetic field, INBENDING by default
Definition: Candidate.java:36
INBENDING
inbending
Definition: Candidate.java:12
Integer pid
particle PID
Definition: Candidate.java:64
Float traj_x1
x-position of the track at the detector surface (cm) at region 1
Definition: Candidate.java:55

◆ cut_DC_FIDUCIAL_REG2()

boolean cut_DC_FIDUCIAL_REG2 ( )
inline
Returns
fiducial cut on DC region 2
175 {
176 if(dc_sector==null || traj_x2==null || traj_y2==null || pid==null) return false;
177 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 2, traj_x2, traj_y2, pid, field==MagField.INBENDING);
178 }
Float traj_x2
x-position of the track at the detector surface (cm) at region 2
Definition: Candidate.java:58
Float traj_y2
y-position of the track at the detector surface (cm) at region 2
Definition: Candidate.java:59

◆ cut_DC_FIDUCIAL_REG3()

boolean cut_DC_FIDUCIAL_REG3 ( )
inline
Returns
fiducial cut on DC region 3
185 {
186 if(dc_sector==null || traj_x3==null || traj_y3==null || pid==null) return false;
187 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 3, traj_x3, traj_y3, pid, field==MagField.INBENDING);
188 }
Float traj_x3
x-position of the track at the detector surface (cm) at region 3
Definition: Candidate.java:61
Float traj_y3
y-position of the track at the detector surface (cm) at region 3
Definition: Candidate.java:62

◆ cut_DC_VERTEX()

boolean cut_DC_VERTEX ( )
inline
Returns
195 {
196 if(pcal_sector==null || vz==null) return false;
197 return ElectronCuts.DC_z_vertex_cut(pcal_sector, vz, field==MagField.INBENDING);
198 }
Float vz
z vertex
Definition: Candidate.java:51
Integer pcal_sector
pcal sector
Definition: Candidate.java:38

◆ cut_EC_FIDUCIAL() [1/2]

boolean cut_EC_FIDUCIAL ( )
inline
Returns
fiducial cut on EC
146 {
147 return cut_EC_FIDUCIAL(Level.LOOSE);
148 }
boolean cut_EC_FIDUCIAL()
Definition: ElectronCandidate.java:146

◆ cut_EC_FIDUCIAL() [2/2]

boolean cut_EC_FIDUCIAL ( Level  eclevel)
inline
Returns
fiducial cut on EC
155 {
156 if(pcal_sector==null || pcal_lv==null || pcal_lw==null) return false;
157 return ElectronCuts.EC_hit_position_fiducial_cut_homogeneous(pcal_sector, pcal_lv, pcal_lw, eclevel);
158 }
Float pcal_lw
distance on W-side
Definition: Candidate.java:43
Float pcal_lv
distance on V-side
Definition: Candidate.java:42

◆ cut_EC_OUTER_VS_INNER()

boolean cut_EC_OUTER_VS_INNER ( )
inline
Returns
cut on PCAL energy
126 {
127 if(pcal_energy==null) return false;
128 return ElectronCuts.EC_outer_vs_EC_inner_cut(pcal_energy);
129 }
Float pcal_energy
energy deposited in PCAL
Definition: Candidate.java:39

◆ cut_EC_SAMPLING()

boolean cut_EC_SAMPLING ( )
inline
Returns
cut on EC sampling
136 {
137 if(p==null || pcal_sector==null || pcal_energy==null || ecin_energy==null || ecout_energy==null) return false;
138 return ElectronCuts.EC_sampling_fraction_cut(p, pcal_sector, pcal_energy, ecin_energy, ecout_energy);
139 }
Float p
momentum
Definition: Candidate.java:47
Float ecout_energy
energy deposited in ECout
Definition: Candidate.java:41
Float ecin_energy
energy deposited in ECin
Definition: Candidate.java:40

◆ cut_NPHE()

boolean cut_NPHE ( )
inline
Returns
cut on number of photoelectrons
116 {
117 if(nphe==null) return false;
118 return ElectronCuts.CC_nphe_cut(nphe);
119 }
Float nphe
number of photoelectrons
Definition: Candidate.java:37

◆ cut_PID()

boolean cut_PID ( )
inline
Returns
cut on PID
106 {
107 if(pid==null) return false;
108 return pid == 11;
109 }

◆ failedpid() [1/2]

int failedpid ( )
inline

testing against all electron cuts

205 {
206 return failedpid(Cut.values());
207 }
int failedpid()
Definition: ElectronCandidate.java:205

◆ failedpid() [2/2]

int failedpid ( Cut ...  applycuts)
inline

assembly of multiple electron cuts

Parameters
applycutsthe list of cuts required to apply
215 {
216 int ifail = 0;
217 for(Cut thiscut: applycuts) {
218 if(thiscut == Cut.PID) {
219 if(!cut_PID()) return ifail;
220
221 } else if(thiscut == Cut.CC_NPHE) {
222 if(!cut_NPHE()) return ifail;
223
224 } else if(thiscut == Cut.EC_OUTER_VS_INNER) {
225 if(!cut_EC_OUTER_VS_INNER()) return ifail;
226
227 } else if(thiscut == Cut.EC_SAMPLING) {
228 if(!cut_EC_SAMPLING()) return ifail;
229
230 } else if(thiscut == Cut.EC_FIDUCIAL) {
231 if(!cut_EC_FIDUCIAL()) return ifail;
232
233 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
234 if(!cut_DC_FIDUCIAL_REG1()) return ifail;
235
236 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
237 if(!cut_DC_FIDUCIAL_REG2()) return ifail;
238
239 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
240 if(!cut_DC_FIDUCIAL_REG3()) return ifail;
241
242 } else if(thiscut == Cut.DC_VERTEX) {
243 if(!cut_DC_VERTEX()) return ifail;
244
245 } else {
246 return ifail;
247 }
248
249 ifail++;
250 }
251 return -1;
252 }
boolean cut_EC_OUTER_VS_INNER()
Definition: ElectronCandidate.java:126
boolean cut_NPHE()
Definition: ElectronCandidate.java:116
boolean cut_EC_SAMPLING()
Definition: ElectronCandidate.java:136
boolean cut_PID()
Definition: ElectronCandidate.java:106
boolean cut_DC_VERTEX()
Definition: ElectronCandidate.java:195
boolean cut_DC_FIDUCIAL_REG3()
Definition: ElectronCandidate.java:185
boolean cut_DC_FIDUCIAL_REG2()
Definition: ElectronCandidate.java:175
boolean cut_DC_FIDUCIAL_REG1()
Definition: ElectronCandidate.java:165

◆ getElectronCandidate()

static ElectronCandidate getElectronCandidate ( int  ipart,
Bank  recbank,
Bank  calbank,
Bank  ccbank,
Bank  trajbank,
boolean  isinbending 
)
inlinestatic

return ElectronCandidate instance

Parameters
ipartparticle index
recbank,calbank,ccbank,trajbankparticle, calorimeter, cherenkov and trajectory banks
isinbendingtrue for inbending, false for outbending
48 {
49 ElectronCandidate candidate = new ElectronCandidate(ipart);
50 if(!isinbending) candidate.setOUTBENDING();
51
52 if(recbank!=null) {
53 candidate.setPID(recbank.getInt("pid",ipart));
54 candidate.setVZ(recbank.getFloat("vz",ipart));
55 candidate.setPxyz(recbank.getFloat("px",ipart), recbank.getFloat("py",ipart), recbank.getFloat("pz",ipart));
56 }
57 if(ccbank!=null) IntStream.range(0,ccbank.getRows()).filter(i -> ccbank.getShort("pindex",i) == ipart && ccbank.getByte("detector",i) == DetectorType.HTCC.getDetectorId())
58 .findFirst().ifPresent(i -> candidate.setNPHE(ccbank.getFloat("nphe", i)));
59
60 if(calbank!=null) IntStream.range(0,calbank.getRows())
61 .filter(i -> calbank.getShort("pindex",i) == ipart && calbank.getByte("detector",i) == DetectorType.ECAL.getDetectorId())
62 .forEach(i -> {
63 if(calbank.getByte("layer",i) == 1) {
64 candidate.setPCALsector(calbank.getByte("sector",i));
65 candidate.setPCALenergy(calbank.getFloat("energy",i));
66 candidate.setPCALvw(calbank.getFloat("lv",i), calbank.getFloat("lw",i));
67 } else if(calbank.getByte("layer",i) == 4)
68 candidate.setECINenergy(calbank.getFloat("energy",i));
69 else if(calbank.getByte("layer",i) == 7)
70 candidate.setECOUTenergy(calbank.getFloat("energy",i));
71 });
72
73 if(trajbank!=null) IntStream.range(0,trajbank.getRows())
74 .filter(i -> trajbank.getShort("pindex",i) == ipart && trajbank.getByte("detector",i) == DetectorType.DC.getDetectorId())
75 .forEach(i -> {
76 if(trajbank.getByte("layer",i) == 6)
77 candidate.setDCxyz(1, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
78 else if(trajbank.getByte("layer",i) == 18)
79 candidate.setDCxyz(2, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
80 else if(trajbank.getByte("layer",i) == 36)
81 candidate.setDCxyz(3, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
82 });
83
84 return candidate;
85 }
ElectronCandidate(int ipart)
Definition: ElectronCandidate.java:36

◆ getLorentzVector()

LorentzVector getLorentzVector ( )
inline
Returns
LorentzVector instance
92 {
93 LorentzVector vec = null;
94 if(px!=null && py!=null && pz!=null) {
95 vec = new LorentzVector();
96 vec.setPxPyPzM(px,py,pz,0.000511);
97 }
98 return vec;
99 }
Float py
px momentum
Definition: Candidate.java:49
Float px
px momentum
Definition: Candidate.java:48
Float pz
px momentum
Definition: Candidate.java:50

◆ iselectron() [1/2]

boolean iselectron ( )
inline

testing against all electron cuts

259 {
260 return iselectron(Cut.values());
261 }
boolean iselectron()
Definition: ElectronCandidate.java:259

◆ iselectron() [2/2]

boolean iselectron ( Cut ...  applycuts)
inline

assembly of multiple electron cuts

Parameters
applycutsthe list of cuts required to apply
269 {
270 for(Cut thiscut: applycuts) {
271 if(thiscut == Cut.PID) {
272 if(!cut_PID()) return false;
273
274 } else if(thiscut == Cut.CC_NPHE) {
275 if(!cut_NPHE()) return false;
276
277 } else if(thiscut == Cut.EC_OUTER_VS_INNER) {
278 if(!cut_EC_OUTER_VS_INNER()) return false;
279
280 } else if(thiscut == Cut.EC_SAMPLING) {
281 if(!cut_EC_SAMPLING()) return false;
282
283 } else if(thiscut == Cut.EC_FIDUCIAL) {
284 if(!cut_EC_FIDUCIAL()) return false;
285
286 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
287 if(!cut_DC_FIDUCIAL_REG1()) return false;
288
289 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
290 if(!cut_DC_FIDUCIAL_REG2()) return false;
291
292 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
293 if(!cut_DC_FIDUCIAL_REG3()) return false;
294
295 } else if(thiscut == Cut.DC_VERTEX) {
296 if(!cut_DC_VERTEX()) return false;
297
298 } else {
299 return false;
300 }
301 }
302 return true;
303 }

The documentation for this class was generated from the following file: