1 #include "TruthUtils.hxx" 2 #include "ConstituentsUtils.hxx" 19 if( abs(true_track->
GParentPDG)!=211)
continue;
20 if( abs(true_track->
ParentPDG)!=13 )
continue;
21 if( abs(true_track->
PDG)!=11 )
continue;
35 Float_t dist = -9999999;
37 for (Int_t idet = 0; idet < trueTrack.
nDetCrossings; idet++) {
46 if (distz_temp > distz)
65 if((UInt_t)ntracks>NMAXTRUEPARTICLES) ntracks = NMAXTRUEPARTICLES;
67 for (
int i=0; i<ntracks; i++){
73 outTraj[count++] = track;
87 for(Int_t i = 0; i <
event.nTrueParticles;i++){
101 outTraj[count++] = track;
116 if (det > SubDetId::kDSECAL && det < SubDetId::kTPC){
117 std::cout<<
"anaUtils::TrueParticleEntersDet() WARNING: " << det <<
" is not available from true info " << std::endl;
140 Float_t surf_pos[4] = {
141 DetDef::tecalTLmin[1],
142 DetDef::tecalBLmax[1],
143 DetDef::tecalLmin[0],
154 if(!(cross->
Detector & (1<<SubDetId::kTECAL)) || !cross->
InActive)
continue;
192 Float_t surf_pos[4] = {
193 DetDef::smrdTLmin[1],
194 DetDef::smrdBLmax[1],
195 DetDef::smrd6Lmin[0],
207 if(!(cross->
Detector & (1<<SubDetId::kSMRD)))
268 if(sep>DetDef::fgdXYModuleWidth)
287 Float_t dist=-999999.;
303 if(sep>dist) dist=sep;
329 det[count++] = SubDetId::kTopTECAL;
332 det[count++] = SubDetId::kBottomTECAL;
335 det[count++] = SubDetId::kLeftTECAL;
338 det[count++] = SubDetId::kRightTECAL;
346 det[count++] = SubDetId::kTopPECAL;
349 det[count++] = SubDetId::kBottomPECAL;
352 det[count++] = SubDetId::kLeftPECAL;
355 det[count++] = SubDetId::kRightPECAL;
358 det[count++] = SubDetId::kDSECAL;
382 det[count++] = SubDetId::kTopSMRD;
385 det[count++] = SubDetId::kBottomSMRD;
388 det[count++] = SubDetId::kLeftSMRD;
391 det[count++] = SubDetId::kRightSMRD;
410 det[count++] = SubDetId::kFGD1;
414 det[count++] = SubDetId::kFGD2;
428 if (!track)
return cross;
436 if (det_bit == SubDetId::kInvalid)
continue;
438 if (det_bit != det)
continue;
bool TrueParticleCrossesTECal(const AnaTrueParticleB *track, Float_t min_sep=50.)
bool InActive
If the particle passes through an active part of the subdetector.
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
bool TrueParticleEntersDet(const AnaTrueParticleB *track, SubDetId::SubDetEnum det)
Whether a true track enters a given sub-detector.
int nDetCrossings
The number of DetCrossing objects.
int nTrueParticles
How many true particles are associated with this vertex.
Float_t ExitPosition[4]
for each subdetector tell the exit position
static bool IsFGDDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a FGD or not.
int GetECalDetCrossed(const AnaTrueParticleB *track, SubDetId::SubDetEnum det[])
ECal detectors crossed: split based on geom info PECal and TECal sub-detectors, this may not be very ...
Int_t GetNMichelElectrons(const AnaTrueVertexB &trueVertex, SubDetId::SubDetEnum det=SubDetId::kFGD1)
Get the number of true michel electrons.
Representation of a true Monte Carlo vertex.
Float_t GetExitMomentum(const AnaDetCrossingB &cross)
Get the momentum value from AnaDetCrossing.
Int_t GParentPDG
The PDG code of this particle's grandparent, or 0 if there is no grandparent.
bool TrueParticleCrossesTPC(const AnaTrueParticleB *track, SubDetId::SubDetEnum det=SubDetId::kTPC)
Whether a true track crosses a TPC so to be able to reconstruct an object.
int GetAllChargedTrajsInFgdECalInBunch(const AnaEventB &event, AnaTrueParticleB *outTraj[], SubDetId::SubDetEnum det)
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
AnaTrueParticleB ** TrueParticles
The true particles associated with this vertex.
float GetSeparationSquared(const Float_t *pos1, const Float_t *pos2)
Calculate the distance between two points.
int GetAllChargedTrajInBunch(const AnaEventB &event, AnaTrueParticleB *traj[])
bool TrueParticleCrossesFGD(const AnaTrueParticleB *track, SubDetId::SubDetEnum det=SubDetId::kFGD)
Whether a true track crosses a FGD so to be able to deposit charge in at least two layers...
Representation of a true Monte Carlo trajectory/particle.
Float_t GetEntranceMomentum(const AnaDetCrossingB &cross)
Get the momentum value from AnaDetCrossing.
Float_t Position[4]
The position the true interaction happened at.
int GetSMRDDetCrossed(const AnaTrueParticleB *track, SubDetId::SubDetEnum det[])
SMRD detectors crossed.
bool TrueParticleCrossesSMRD(const AnaTrueParticleB *track, Float_t min_sep=48.)
Float_t EntrancePosition[4]
for each subdetector tell the entrance position
static bool IsTPCDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a TPC or not.
AnaDetCrossingB ** DetCrossings
Representation of a detector crossing info for a true particle (G4 trajectory).
SubDetEnum
Enumeration of all detector systems and subdetectors.
Int_t PDG
The PDG code of this particle.
Int_t ParentPDG
The PDG code of this particle's immediate parent, or 0 if there is no parent.
Int_t Bunch
The index of this bunch (0-7).
AnaDetCrossingB * GetAnaDetCrossing(const AnaTrueParticleB *track, SubDetId::SubDetEnum det)
static SubDetId::SubDetEnum GetSubdetectorEnum(unsigned long BitField)
Get the single subdetector that this track is from.
Float_t ExitMomentum[3]
for each subdetector tell the exit momentum
int GetAllTrajsInECalInBunch(const AnaEventB &event, AnaTrueParticleB *outTraj[])
int GetFGDDetCrossed(const AnaTrueParticleB *track, SubDetId::SubDetEnum det[])
FGD detectors crossed.
Float_t GetTrueLinearLengthInTPC(const AnaTrueParticleB &trueTrack, Float_t &distz)
Return the true linear length traversed in the TPC.
bool InFiducialVolume(SubDetId::SubDetEnum det, const Float_t *pos, const Float_t *FVdefmin, const Float_t *FVdefmax)
Float_t EntranceMomentum[3]
for each subdetector tell the entrance momentum