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::andrey::ProtonCandidate::Cut

enum uconn::utils::pid::andrey::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
28 {
29 super(ipart);
30 }

Member Function Documentation

◆ cut_CHI2PID()

boolean cut_CHI2PID ( )
inline
Returns
chi2pid cut
106 {
107 if(pid==null || chi2pid==null || p==null) return false;
108 return HadronCuts.Chi2pid_cut(chi2pid, p, pid);
109 }
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
fiducial cut on DC region1
116 {
117 if(dc_sector==null || traj_x1==null || traj_y1==null || traj_z1==null || pid==null) return false;
118 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 1, traj_x1, traj_y1, traj_z1, 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
fiducial cut on DC region2
126 {
127 if(dc_sector==null || traj_x2==null || traj_y2==null || traj_z2==null || pid==null) return false;
128 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 2, traj_x2, traj_y2, traj_z2, pid, field==MagField.INBENDING);
129 }
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
fiducial cut on DC region3
136 {
137 if(dc_sector==null || traj_x3==null || traj_y3==null || traj_z3==null || pid==null) return false;
138 return HadronCuts.DC_fiducial_cut_theta_phi(dc_sector, 3, traj_x3, traj_y3, traj_z3, pid, field==MagField.INBENDING);
139 }
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
146 {
147 if(pid==null || dvz==null) return false;
148 return HadronCuts.Delta_vz_cut(pid, dvz);
149 }
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
96 {
97 if(status==null) return false;
98 return status>=2000 && status<4000;
99 }
Short status
particle status
Definition: Candidate.java:66

◆ cut_PID()

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

◆ getLorentzVector()

LorentzVector getLorentzVector ( )
inline
Returns
LorentzVector instance
72 {
73 LorentzVector vec = null;
74 if(px!=null && py!=null && pz!=null) {
75 vec = new LorentzVector();
76 vec.setPxPyPzM(px,py,pz,0.938272);
77 }
78 return vec;
79 }
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
40 {
41 ProtonCandidate candidate = new ProtonCandidate(ipart);
42 if(!isinbending) candidate.setOUTBENDING();
43
44 if(recbank!=null) {
45 candidate.setPID(recbank.getInt("pid",ipart));
46 candidate.setStatus(recbank.getShort("status",ipart));
47 candidate.setCHI2PID(recbank.getFloat("chi2pid",ipart));
48 candidate.setVZ(recbank.getFloat("vz",ipart));
49 candidate.setDVZ(recbank.getFloat("vz",ipart) - recbank.getFloat("vz",0));
50 candidate.setPxyz(recbank.getFloat("px",ipart), recbank.getFloat("py",ipart), recbank.getFloat("pz",ipart));
51 }
52
53 if(trajbank!=null) IntStream.range(0,trajbank.getRows())
54 .filter(i -> trajbank.getShort("pindex",i) == ipart && trajbank.getByte("detector",i) == DetectorType.DC.getDetectorId())
55 .forEach(i -> {
56 if(trajbank.getByte("layer",i) == 6)
57 candidate.setDCxyz(1, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
58 else if(trajbank.getByte("layer",i) == 18)
59 candidate.setDCxyz(2, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
60 else if(trajbank.getByte("layer",i) == 36)
61 candidate.setDCxyz(3, trajbank.getFloat("x",i), trajbank.getFloat("y",i), trajbank.getFloat("z",i));
62 });
63
64 return candidate;
65 }
ProtonCandidate(int ipart)
Definition: ProtonCandidate.java:28

◆ isproton() [1/2]

boolean isproton ( )
inline

testing against all proton cuts

156 {
157 return isproton(Cut.values());
158 }
boolean isproton()
Definition: ProtonCandidate.java:156

◆ isproton() [2/2]

boolean isproton ( Cut ...  applycuts)
inline

assembly of multiple proton cuts

Parameters
applycutsthe list of cuts required to apply
166 {
167 for(Cut thiscut: applycuts) {
168 if(thiscut == Cut.PID) {
169 if(!cut_PID()) return false;
170
171 } else if(thiscut == Cut.CHI2PID) {
172 if(!cut_CHI2PID()) return false;
173
174 } else if(thiscut == Cut.FORWARD) {
175 if(!cut_FORWARD()) return false;
176
177 } else if(thiscut == Cut.DC_FIDUCIAL_REG1) {
178 if(!cut_DC_FIDUCIAL_REG1()) return false;
179
180 } else if(thiscut == Cut.DC_FIDUCIAL_REG2) {
181 if(!cut_DC_FIDUCIAL_REG2()) return false;
182
183 } else if(thiscut == Cut.DC_FIDUCIAL_REG3) {
184 if(!cut_DC_FIDUCIAL_REG3()) return false;
185
186 } else if(thiscut == Cut.DELTA_VZ) {
187 if(!cut_DELTA_VZ()) return false;
188
189 } else {
190 return false;
191 }
192 }
193 return true;
194 }
boolean cut_PID()
Definition: ProtonCandidate.java:86
boolean cut_FORWARD()
Definition: ProtonCandidate.java:96
boolean cut_DELTA_VZ()
Definition: ProtonCandidate.java:146
boolean cut_CHI2PID()
Definition: ProtonCandidate.java:106
boolean cut_DC_FIDUCIAL_REG3()
Definition: ProtonCandidate.java:136
boolean cut_DC_FIDUCIAL_REG2()
Definition: ProtonCandidate.java:126
boolean cut_DC_FIDUCIAL_REG1()
Definition: ProtonCandidate.java:116

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