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

Classes

enum  Cut
 This is the enum for pi+ cut types. More...
 

Public Member Functions

 PionCandidate (int ipart)
 
LorentzVector getLorentzVector ()
 
boolean cut_FORWARD ()
 
boolean cut_CHI2PID ()
 
boolean cut_DC_FIDUCIAL_REG1 ()
 
boolean cut_DC_FIDUCIAL_REG2 ()
 
boolean cut_DC_FIDUCIAL_REG3 ()
 
boolean cut_DELTA_VZ ()
 
boolean ispim ()
 
boolean ispim (Cut ...applycuts)
 
boolean ispip ()
 
boolean ispip (Cut ...applycuts)
 
int pipfailedpid ()
 
int pipfailedpid (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 PionCandidate getPionCandidate (int ipart, Bank recbank, 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::PionCandidate::Cut

enum uconn::utils::pid::stefan::PionCandidate::Cut

This is the enum for pi+ cut types.

Enumerator
CHI2PID_CUT cut on chi2pid
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
DELTA_VZ cut on difference between VZ of Pion candidate and trigger particle
FORWARD only forward detector
PID cut on PDG code

Constructor & Destructor Documentation

◆ PionCandidate()

PionCandidate ( int  ipart)
inline

A Constructor

Parameters
ipartparticle index
34 {
35 super(ipart);
36 }

Member Function Documentation

◆ cut_CHI2PID()

boolean cut_CHI2PID ( )
inline
Returns
chi2pid cut
100 {
101 if(pid==null || chi2pid==null || p==null) return false;
102 return HadronCuts.Chi2pid_cut(chi2pid, p, pid);
103 }
Float chi2pid
chi2pid value
Definition: Candidate.java:53
Float p
momentum
Definition: Candidate.java:47
Integer pid
particle PID
Definition: Candidate.java:64

◆ cut_DC_FIDUCIAL_REG1()

boolean cut_DC_FIDUCIAL_REG1 ( )
inline
Returns
DC fiducial region 1
109 {
110 if(dc_sector==null || traj_x1==null || traj_y1==null || traj_z1==null || pid==null) return false;
111 if(field==MagField.INBENDING)
112 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 1, traj_x1, traj_y1, traj_z1, pid, field==MagField.INBENDING);
113 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 1, traj_x1, traj_y1, pid, field==MagField.INBENDING);
114 }
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
Float traj_z1
z-position of the track at the detector surface (cm) at region 1
Definition: Candidate.java:57
MagField field
magnetic field, INBENDING by default
Definition: Candidate.java:36
INBENDING
inbending
Definition: Candidate.java:12
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
DC fiducial region 2
120 {
121 if(dc_sector==null || traj_x2==null || traj_y2==null || traj_z2==null || pid==null) return false;
122 if(field==MagField.INBENDING)
123 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 2, traj_x2, traj_y2, traj_z2, pid, field==MagField.INBENDING);
124 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 2, traj_x2, traj_y2, pid, field==MagField.INBENDING);
125 }
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
Float traj_z2
z-position of the track at the detector surface (cm) at region 2
Definition: Candidate.java:60

◆ cut_DC_FIDUCIAL_REG3()

boolean cut_DC_FIDUCIAL_REG3 ( )
inline
Returns
DC fiducial region 3
131 {
132 if(dc_sector==null || traj_x3==null || traj_y3==null || traj_z3==null || pid==null) return false;
133 if(field==MagField.INBENDING)
134 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 3, traj_x3, traj_y3, traj_z3, pid, field==MagField.INBENDING);
135 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 3, traj_x3, traj_y3, pid, field==MagField.INBENDING);
136 }
Float traj_x3
x-position of the track at the detector surface (cm) at region 3
Definition: Candidate.java:61
Float traj_z3
z-position of the track at the detector surface (cm) at region 3
Definition: Candidate.java:63
Float traj_y3
y-position of the track at the detector surface (cm) at region 3
Definition: Candidate.java:62

◆ cut_DELTA_VZ()

boolean cut_DELTA_VZ ( )
inline
Returns
delta vz cut
142 {
143 if(pid==null || dvz==null) return false;
144 return HadronCuts.Delta_vz_cut(pid, dvz);
145 }
Float dvz
the difference between trigger particle vz and candidate vz
Definition: Candidate.java:54

◆ cut_FORWARD()

boolean cut_FORWARD ( )
inline
Returns
if it is detected in forward
91 {
92 if(status==null) return false;
93 return status>=2000 && status<4000;
94 }
Short status
particle status
Definition: Candidate.java:66

◆ getLorentzVector()

LorentzVector getLorentzVector ( )
inline
Returns
LorentzVector instance
78 {
79 LorentzVector vec = null;
80 if(px!=null && py!=null && pz!=null) {
81 vec = new LorentzVector();
82 vec.setPxPyPzM(px,py,pz,0.13957);
83 }
84 return vec;
85 }
Float py
px momentum
Definition: Candidate.java:49
Float px
px momentum
Definition: Candidate.java:48
Float pz
px momentum
Definition: Candidate.java:50

◆ getPionCandidate()

static PionCandidate getPionCandidate ( int  ipart,
Bank  recbank,
Bank  trajbank,
boolean  isinbending 
)
inlinestatic

return PionCandidate instance

Parameters
ipartparticle index
recbank,trajbankparticle and trajectory banks
isinbendingtrue for inbending, false for outbending
46 {
47 PionCandidate candidate = new PionCandidate(ipart);
48 if(!isinbending) candidate.setOUTBENDING();
49
50 if(recbank!=null) {
51 candidate.setPID(recbank.getInt("pid",ipart));
52 candidate.setStatus(recbank.getShort("status",ipart));
53 candidate.setCHI2PID(recbank.getFloat("chi2pid",ipart));
54 candidate.setVZ(recbank.getFloat("vz",ipart));
55 candidate.setDVZ(recbank.getFloat("vz",ipart) - recbank.getFloat("vz",0));
56 candidate.setPxyz(recbank.getFloat("px",ipart), recbank.getFloat("py",ipart), recbank.getFloat("pz",ipart));
57 }
58
59 if(trajbank!=null) IntStream.range(0,trajbank.getRows())
60 .filter(i -> trajbank.getShort("pindex",i) == ipart && trajbank.getByte("detector",i) == DetectorType.DC.getDetectorId())
61 .forEach(i -> {
62 if(trajbank.getByte("layer",i) == 6)
63 candidate.setDCxyz(1, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
64 else if(trajbank.getByte("layer",i) == 18)
65 candidate.setDCxyz(2, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
66 else if(trajbank.getByte("layer",i) == 36)
67 candidate.setDCxyz(3, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
68 });
69
70 return candidate;
71 }
PionCandidate(int ipart)
Definition: PionCandidate.java:34

◆ ispim() [1/2]

boolean ispim ( )
inline

testing against all pi- cuts

151 {
152 return ispim(Cut.values());
153 }
boolean ispim()
Definition: PionCandidate.java:151

◆ ispim() [2/2]

boolean ispim ( Cut ...  applycuts)
inline

assembly of multiple pi- cuts

Parameters
applycutsthe list of cuts required to apply
161 {
162 for(Cut thiscut: applycuts) {
163 if(thiscut == Cut.PID) {
164 if(pid == null) return false;
165 else if(pid != -211) return false;
166
167 } else if(thiscut == Cut.FORWARD) {
168 if(!cut_FORWARD()) return false;
169
170 } else if(thiscut == Cut.CHI2PID_CUT) {
171 if(!cut_CHI2PID()) return false;
172
173 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
174 if(!cut_DC_FIDUCIAL_REG1()) return false;
175
176 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
177 if(!cut_DC_FIDUCIAL_REG2()) return false;
178
179 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
180 if(!cut_DC_FIDUCIAL_REG3()) return false;
181
182 } else if(thiscut == Cut.DELTA_VZ) {
183 if(!cut_DELTA_VZ()) return false;
184
185 } else {
186 return false;
187 }
188 }
189 return true;
190 }
boolean cut_FORWARD()
Definition: PionCandidate.java:91
boolean cut_DELTA_VZ()
Definition: PionCandidate.java:142
boolean cut_CHI2PID()
Definition: PionCandidate.java:100
boolean cut_DC_FIDUCIAL_REG3()
Definition: PionCandidate.java:131
boolean cut_DC_FIDUCIAL_REG2()
Definition: PionCandidate.java:120
boolean cut_DC_FIDUCIAL_REG1()
Definition: PionCandidate.java:109

◆ ispip() [1/2]

boolean ispip ( )
inline

testing against all pi+ cuts

197 {
198 return ispip(Cut.values());
199 }
boolean ispip()
Definition: PionCandidate.java:197

◆ ispip() [2/2]

boolean ispip ( Cut ...  applycuts)
inline

assembly of multiple pi+ cuts

Parameters
applycutsthe list of cuts required to apply
207 {
208 for(Cut thiscut: applycuts) {
209 if(thiscut == Cut.PID) {
210 if(pid == null) return false;
211 else if(pid != 211) return false;
212
213 } else if(thiscut == Cut.FORWARD) {
214 if(!cut_FORWARD()) return false;
215
216 } else if(thiscut == Cut.CHI2PID_CUT) {
217 if(!cut_CHI2PID()) return false;
218
219 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
220 if(!cut_DC_FIDUCIAL_REG1()) return false;
221
222 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
223 if(!cut_DC_FIDUCIAL_REG2()) return false;
224
225 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
226 if(!cut_DC_FIDUCIAL_REG3()) return false;
227
228 } else if(thiscut == Cut.DELTA_VZ) {
229 if(!cut_DELTA_VZ()) return false;
230
231 } else {
232 return false;
233 }
234 }
235 return true;
236 }

◆ pipfailedpid() [1/2]

int pipfailedpid ( )
inline

testing against all pi+ cuts

243 {
244 return pipfailedpid(Cut.values());
245 }
int pipfailedpid()
Definition: PionCandidate.java:243

◆ pipfailedpid() [2/2]

int pipfailedpid ( Cut ...  applycuts)
inline

assembly of multiple pi+ cuts

Parameters
applycutsthe list of cuts required to apply
253 {
254 int ifail = 0;
255 for(Cut thiscut: applycuts) {
256 if(thiscut == Cut.PID) {
257 if(pid == null) return ifail;
258 else if(pid != 211) return ifail;
259
260 } else if(thiscut == Cut.FORWARD) {
261 if(!cut_FORWARD()) return ifail;
262
263 } else if(thiscut == Cut.CHI2PID_CUT) {
264 if(!cut_CHI2PID()) return ifail;
265
266 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
267 if(!cut_DC_FIDUCIAL_REG1()) return ifail;
268
269 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
270 if(!cut_DC_FIDUCIAL_REG2()) return ifail;
271
272 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
273 if(!cut_DC_FIDUCIAL_REG3()) return ifail;
274
275 } else if(thiscut == Cut.DELTA_VZ) {
276 if(!cut_DELTA_VZ()) return ifail;
277
278 } else {
279 return ifail;
280 }
281 ifail++;
282 }
283 return -1;
284 }

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