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

Classes

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

Public Member Functions

 ProtonCandidate (int ipart)
 
LorentzVector getLorentzVector ()
 
boolean cut_PID ()
 
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 isproton ()
 
boolean isproton (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 ProtonCandidate getProtonCandidate (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::ProtonCandidate::Cut

enum uconn::utils::pid::stefan::ProtonCandidate::Cut

This is the enum for proton cut types.

Enumerator
CHI2PID 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 Proton candidate and trigger particle
FORWARD only forward detector
PID cut on PDG code

Constructor & Destructor Documentation

◆ ProtonCandidate()

ProtonCandidate ( int  ipart)
inline

A Constructor

Parameters
ipartparticle index
26 {
27 super(ipart);
28 }

Member Function Documentation

◆ cut_CHI2PID()

boolean cut_CHI2PID ( )
inline
Returns
chi2pid cut
104 {
105 if(pid==null || chi2pid==null || p==null) return false;
106 return HadronCuts.Chi2pid_cut(chi2pid, p, pid);
107 }
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
114 {
115 if(dc_sector==null || traj_x1==null || traj_y1==null || traj_z1==null || pid==null) return false;
116 if(field==MagField.INBENDING)
117 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 1, traj_x1, traj_y1, traj_z1, pid, field==MagField.INBENDING);
118 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 1, traj_x1, traj_y1, pid, field==MagField.INBENDING);
119 }
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
126 {
127 if(dc_sector==null || traj_x2==null || traj_y2==null || traj_z2==null || pid==null) return false;
128 if(field==MagField.INBENDING)
129 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 2, traj_x2, traj_y2, traj_z2, pid, field==MagField.INBENDING);
130 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 2, traj_x2, traj_y2, pid, field==MagField.INBENDING);
131 }
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
138 {
139 if(dc_sector==null || traj_x3==null || traj_y3==null || traj_z3==null || pid==null) return false;
140 if(field==MagField.INBENDING)
141 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 3, traj_x3, traj_y3, traj_z3, pid, field==MagField.INBENDING);
142 return ElectronCuts.DC_fiducial_cut_XY(dc_sector, 3, traj_x3, traj_y3, pid, field==MagField.INBENDING);
143 }
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
cut on vertex position
150 {
151 if(pid==null || dvz==null) return false;
152 return HadronCuts.Delta_vz_cut(pid, dvz);
153 }
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
94 {
95 if(status==null) return false;
96 return status>=2000 && status<4000;
97 }
Short status
particle status
Definition: Candidate.java:66

◆ cut_PID()

boolean cut_PID ( )
inline
Returns
pid cut
84 {
85 if(pid == null) return false;
86 return pid == 2212;
87 }

◆ getLorentzVector()

LorentzVector getLorentzVector ( )
inline
Returns
LorentzVector instance
70 {
71 LorentzVector vec = null;
72 if(px!=null && py!=null && pz!=null) {
73 vec = new LorentzVector();
74 vec.setPxPyPzM(px,py,pz,0.938272);
75 }
76 return vec;
77 }
Float py
px momentum
Definition: Candidate.java:49
Float px
px momentum
Definition: Candidate.java:48
Float pz
px momentum
Definition: Candidate.java:50

◆ getProtonCandidate()

static ProtonCandidate getProtonCandidate ( int  ipart,
Bank  recbank,
Bank  trajbank,
boolean  isinbending 
)
inlinestatic

return ProtonCandidate instance

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

◆ isproton() [1/2]

boolean isproton ( )
inline

testing against all proton cuts

160 {
161 return isproton(Cut.values());
162 }
boolean isproton()
Definition: ProtonCandidate.java:160

◆ isproton() [2/2]

boolean isproton ( Cut ...  applycuts)
inline

assembly of multiple proton cuts

Parameters
applycutsthe list of cuts required to apply
170 {
171 for(Cut thiscut: applycuts) {
172 if(thiscut == Cut.PID) {
173 if(!cut_PID()) return false;
174
175 } else if(thiscut == Cut.CHI2PID) {
176 if(!cut_CHI2PID()) return false;
177
178 } else if(thiscut == Cut.FORWARD) {
179 if(!cut_FORWARD()) return false;
180
181 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
182 if(!cut_DC_FIDUCIAL_REG1()) return false;
183
184 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
185 if(!cut_DC_FIDUCIAL_REG2()) return false;
186
187 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
188 if(!cut_DC_FIDUCIAL_REG3()) return false;
189
190 } else if(thiscut == Cut.DELTA_VZ) {
191 if(!cut_DELTA_VZ()) return false;
192
193 } else {
194 return false;
195 }
196 }
197 return true;
198 }
boolean cut_PID()
Definition: ProtonCandidate.java:84
boolean cut_FORWARD()
Definition: ProtonCandidate.java:94
boolean cut_DELTA_VZ()
Definition: ProtonCandidate.java:150
boolean cut_CHI2PID()
Definition: ProtonCandidate.java:104
boolean cut_DC_FIDUCIAL_REG3()
Definition: ProtonCandidate.java:138
boolean cut_DC_FIDUCIAL_REG2()
Definition: ProtonCandidate.java:126
boolean cut_DC_FIDUCIAL_REG1()
Definition: ProtonCandidate.java:114

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