CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackInformation Class Reference

#include <TrackInformation.h>

Inheritance diagram for TrackInformation:

Public Member Functions

bool caloIDChecked () const
 
double caloSurfaceParticleP () const
 
int caloSurfaceParticlePID () const
 
bool crossedBoundary () const
 
double genParticleP () const
 
int genParticlePID () const
 
int getCastorHitPID () const
 
int getIDCaloVolume () const
 
int getIDLastVolume () const
 
int getIDonCaloSurface () const
 
const math::XYZTLorentzVectorFgetMomentumAtBoundary () const
 
const math::XYZTLorentzVectorFgetPositionAtBoundary () const
 
bool hasCastorHit () const
 
bool hasHits () const
 
bool isAncestor () const
 
bool isBTLlooper () const
 
bool isExtSecondary () const
 
bool isFromBTLtoT () const
 
bool isFromTtoBTL () const
 
bool isGeneratedSecondary () const
 
bool isInHistory () const
 
bool isInTrkFromBackscattering () const
 
bool isPrimary () const
 
int mcTruthID () const
 
void operator delete (void *TrackInformation)
 
void * operator new (size_t)
 
void Print () const override
 
void putInHistory ()
 
void setAncestor ()
 
void setBTLlooper ()
 
void setCaloIDChecked (bool f)
 
void setCaloSurfaceParticleP (double p)
 
void setCaloSurfaceParticlePID (int id)
 
void setCastorHitPID (const int pid)
 
void setCrossedBoundary (const G4Track *track)
 
void setExtSecondary ()
 
void setFromBTLtoT ()
 
void setFromTtoBTL ()
 
void setGeneratedSecondary (bool v)
 
void setGenParticleP (double p)
 
void setGenParticlePID (int id)
 
void setHasHits (bool v)
 
void setIDonCaloSurface (int id, int ical, int last, int pdgID, double p)
 
void setInTrkFromBackscattering ()
 
void setMCTruthID (int id)
 
void setPrimary (bool v)
 
void setStartedInFineVolume (bool flag=true)
 
void setStoreTrack ()
 can only be set to true, cannot be reset to false! More...
 
bool startedInFineVolume () const
 
bool startedInFineVolumeIsSet ()
 
bool storeTrack () const
 
 TrackInformation ()
 
 ~TrackInformation () override=default
 

Private Attributes

bool caloIDChecked_ {false}
 
double caloSurfaceParticleP_ {0.}
 
int caloSurfaceParticlePID_ {0}
 
int castorHitPID_ {0}
 
bool crossedBoundary_ {false}
 
bool flagAncestor_ {false}
 
double genParticleP_ {0.}
 
int genParticlePID_ {-1}
 
bool hasCastorHit_ {false}
 
bool hasHits_ {false}
 
int idCaloVolume_ {-1}
 
int idLastVolume_ {-1}
 
int idOnCaloSurface_ {0}
 
bool isGeneratedSecondary_ {false}
 
bool isInHistory_ {false}
 
bool isPrimary_ {false}
 
int mcTruthID_ {-1}
 
math::XYZTLorentzVectorF momentumAtBoundary_
 
uint8_t mtdStatus_ {0}
 
math::XYZTLorentzVectorF positionAtBoundary_
 
bool startedInFineVolume_ {false}
 
bool startedInFineVolumeIsSet_ {false}
 
bool storeTrack_ {false}
 

Detailed Description

Definition at line 10 of file TrackInformation.h.

Constructor & Destructor Documentation

◆ TrackInformation()

TrackInformation::TrackInformation ( )
inline

Definition at line 12 of file TrackInformation.h.

12 {};

◆ ~TrackInformation()

TrackInformation::~TrackInformation ( )
overridedefault

Member Function Documentation

◆ caloIDChecked()

bool TrackInformation::caloIDChecked ( ) const
inline

Definition at line 53 of file TrackInformation.h.

References caloIDChecked_.

Referenced by Print(), and CaloTrkProcessing::update().

53 { return caloIDChecked_; }

◆ caloSurfaceParticleP()

double TrackInformation::caloSurfaceParticleP ( ) const
inline

Definition at line 57 of file TrackInformation.h.

References caloSurfaceParticleP_.

57 { return caloSurfaceParticleP_; }

◆ caloSurfaceParticlePID()

int TrackInformation::caloSurfaceParticlePID ( ) const
inline

Definition at line 55 of file TrackInformation.h.

References caloSurfaceParticlePID_.

◆ crossedBoundary()

bool TrackInformation::crossedBoundary ( ) const
inline

◆ genParticleP()

double TrackInformation::genParticleP ( ) const
inline

Definition at line 75 of file TrackInformation.h.

References genParticleP_.

Referenced by CaloSD::getResponseWt().

75 { return genParticleP_; }

◆ genParticlePID()

int TrackInformation::genParticlePID ( ) const
inline

◆ getCastorHitPID()

int TrackInformation::getCastorHitPID ( ) const
inline

Definition at line 85 of file TrackInformation.h.

References castorHitPID_.

Referenced by CastorSD::getEnergyDeposit().

85 { return castorHitPID_; }

◆ getIDCaloVolume()

int TrackInformation::getIDCaloVolume ( ) const
inline

Definition at line 51 of file TrackInformation.h.

References idCaloVolume_.

Referenced by CaloTrkProcessing::update().

51 { return idCaloVolume_; }

◆ getIDLastVolume()

int TrackInformation::getIDLastVolume ( ) const
inline

Definition at line 52 of file TrackInformation.h.

References idLastVolume_.

Referenced by CaloTrkProcessing::update().

52 { return idLastVolume_; }

◆ getIDonCaloSurface()

int TrackInformation::getIDonCaloSurface ( ) const
inline

◆ getMomentumAtBoundary()

const math::XYZTLorentzVectorF& TrackInformation::getMomentumAtBoundary ( ) const
inline

Definition at line 64 of file TrackInformation.h.

References momentumAtBoundary_.

Referenced by TrackingAction::PostUserTrackingAction().

64 { return momentumAtBoundary_; }
math::XYZTLorentzVectorF momentumAtBoundary_

◆ getPositionAtBoundary()

const math::XYZTLorentzVectorF& TrackInformation::getPositionAtBoundary ( ) const
inline

Definition at line 63 of file TrackInformation.h.

References positionAtBoundary_.

Referenced by TrackingAction::PostUserTrackingAction().

63 { return positionAtBoundary_; }
math::XYZTLorentzVectorF positionAtBoundary_

◆ hasCastorHit()

bool TrackInformation::hasCastorHit ( ) const
inline

Definition at line 80 of file TrackInformation.h.

References hasCastorHit_.

Referenced by CastorSD::getEnergyDeposit(), and CastorSD::getFromLibrary().

80 { return hasCastorHit_; }

◆ hasHits()

bool TrackInformation::hasHits ( ) const
inline

Definition at line 27 of file TrackInformation.h.

References hasHits_.

27 { return hasHits_; }

◆ isAncestor()

bool TrackInformation::isAncestor ( ) const
inline

Definition at line 36 of file TrackInformation.h.

References flagAncestor_.

Referenced by TrackingAction::PostUserTrackingAction().

36 { return flagAncestor_; }

◆ isBTLlooper()

bool TrackInformation::isBTLlooper ( ) const
inline

Definition at line 94 of file TrackInformation.h.

References mtdStatus_.

Referenced by MtdSD::getTrackID(), Print(), and Phase2SteppingAction::UserSteppingAction().

94 { return (mtdStatus_ >> 2) & 1; }

◆ isExtSecondary()

bool TrackInformation::isExtSecondary ( ) const
inline

Definition at line 98 of file TrackInformation.h.

References mtdStatus_.

Referenced by MtdSD::getTrackID(), and Print().

98 { return (mtdStatus_ >> 4) & 1; }

◆ isFromBTLtoT()

bool TrackInformation::isFromBTLtoT ( ) const
inline

Definition at line 92 of file TrackInformation.h.

References mtdStatus_.

Referenced by Print(), and Phase2SteppingAction::UserSteppingAction().

92 { return (mtdStatus_ >> 1) & 1; }

◆ isFromTtoBTL()

bool TrackInformation::isFromTtoBTL ( ) const
inline

Definition at line 90 of file TrackInformation.h.

References mtdStatus_.

Referenced by Print(), and Phase2SteppingAction::UserSteppingAction().

90 { return (mtdStatus_ >> 0) & 1; }

◆ isGeneratedSecondary()

bool TrackInformation::isGeneratedSecondary ( ) const
inline

Definition at line 30 of file TrackInformation.h.

References isGeneratedSecondary_.

30 { return isGeneratedSecondary_; }

◆ isInHistory()

bool TrackInformation::isInHistory ( ) const
inline

Definition at line 33 of file TrackInformation.h.

References isInHistory_.

Referenced by TrackingAction::PostUserTrackingAction().

33 { return isInHistory_; }

◆ isInTrkFromBackscattering()

bool TrackInformation::isInTrkFromBackscattering ( ) const
inline

Definition at line 96 of file TrackInformation.h.

References mtdStatus_.

Referenced by MtdSD::getTrackID(), Print(), and Phase2SteppingAction::UserSteppingAction().

96 { return (mtdStatus_ >> 3) & 1; }

◆ isPrimary()

bool TrackInformation::isPrimary ( ) const
inline

◆ mcTruthID()

int TrackInformation::mcTruthID ( ) const
inline

Definition at line 39 of file TrackInformation.h.

References mcTruthID_.

Referenced by MtdSD::getTrackID(), and Phase2SteppingAction::UserSteppingAction().

39 { return mcTruthID_; }

◆ operator delete()

void TrackInformation::operator delete ( void *  TrackInformation)
inline

Definition at line 136 of file TrackInformation.h.

References fpTrackInformationAllocator.

136  {
137  fpTrackInformationAllocator->FreeSingle((TrackInformation *)trkInfo);
138 }
G4ThreadLocal G4Allocator< TrackInformation > * fpTrackInformationAllocator

◆ operator new()

void * TrackInformation::operator new ( size_t  )
inline

Definition at line 130 of file TrackInformation.h.

References fpTrackInformationAllocator.

130  {
132  fpTrackInformationAllocator = new G4Allocator<TrackInformation>;
133  return (void *)fpTrackInformationAllocator->MallocSingle();
134 }
G4ThreadLocal G4Allocator< TrackInformation > * fpTrackInformationAllocator

◆ Print()

void TrackInformation::Print ( void  ) const
override

Definition at line 24 of file TrackInformation.cc.

References caloIDChecked(), getIDonCaloSurface(), hasHits_, idCaloVolume_, idLastVolume_, isBTLlooper(), isExtSecondary(), isFromBTLtoT(), isFromTtoBTL(), isGeneratedSecondary_, isInHistory_, isInTrkFromBackscattering(), isPrimary_, LogDebug, mcTruthID_, and storeTrack_.

Referenced by MtdSD::getTrackID().

24  {
25  LogDebug("TrackInformation") << " TrackInformation : storeTrack = " << storeTrack_ << "\n"
26  << " hasHits = " << hasHits_ << "\n"
27  << " isPrimary = " << isPrimary_ << "\n"
28  << " isGeneratedSecondary = " << isGeneratedSecondary_ << "\n"
29  << " mcTruthID = " << mcTruthID_ << "\n"
30  << " isInHistory = " << isInHistory_ << "\n"
31  << " idOnCaloSurface = " << getIDonCaloSurface() << "\n"
32  << " caloIDChecked = " << caloIDChecked() << "\n"
33  << " idCaloVolume = " << idCaloVolume_ << "\n"
34  << " idLastVolume = " << idLastVolume_ << "\n"
35  << " isFromTtoBTL = " << isFromTtoBTL() << "\n"
36  << " isFromBTLtoT = " << isFromBTLtoT() << "\n"
37  << " isBTLlooper = " << isBTLlooper() << "\n"
38  << " isInTrkFromBackscattering = " << isInTrkFromBackscattering()
39  << "\n"
40  << " isExtSecondary = " << isExtSecondary();
41 }
bool caloIDChecked() const
bool isExtSecondary() const
bool isInTrkFromBackscattering() const
int getIDonCaloSurface() const
bool isFromBTLtoT() const
bool isBTLlooper() const
bool isFromTtoBTL() const
#define LogDebug(id)

◆ putInHistory()

void TrackInformation::putInHistory ( )
inline

Definition at line 34 of file TrackInformation.h.

References isInHistory_.

Referenced by TrackingAction::PreUserTrackingAction(), and CaloTrkProcessing::update().

34 { isInHistory_ = true; }

◆ setAncestor()

void TrackInformation::setAncestor ( )
inline

Definition at line 37 of file TrackInformation.h.

References flagAncestor_.

37 { flagAncestor_ = true; }

◆ setBTLlooper()

void TrackInformation::setBTLlooper ( )
inline

Definition at line 93 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

93 { mtdStatus_ |= 1 << 2; } // 3th bit

◆ setCaloIDChecked()

void TrackInformation::setCaloIDChecked ( bool  f)
inline

Definition at line 54 of file TrackInformation.h.

References caloIDChecked_, and f.

Referenced by CaloTrkProcessing::update().

54 { caloIDChecked_ = f; }
double f[11][100]

◆ setCaloSurfaceParticleP()

void TrackInformation::setCaloSurfaceParticleP ( double  p)
inline

◆ setCaloSurfaceParticlePID()

void TrackInformation::setCaloSurfaceParticlePID ( int  id)
inline

◆ setCastorHitPID()

void TrackInformation::setCastorHitPID ( const int  pid)
inline

Definition at line 81 of file TrackInformation.h.

References castorHitPID_, and hasCastorHit_.

Referenced by CastorSD::getEnergyDeposit(), and CastorSD::getFromLibrary().

81  {
82  hasCastorHit_ = true;
83  castorHitPID_ = pid;
84  }

◆ setCrossedBoundary()

void TrackInformation::setCrossedBoundary ( const G4Track *  track)

Definition at line 11 of file TrackInformation.cc.

References crossedBoundary_, invgev, momentumAtBoundary_, AlCaHLTBitMon_ParallelJobs::p, positionAtBoundary_, edm::second(), HLT_2024v13_cff::track, and findQualityFiles::v.

Referenced by CaloTrkProcessing::update(), SteppingAction::UserSteppingAction(), and Phase2SteppingAction::UserSteppingAction().

11  {
12  const double invcm = 1.0 / CLHEP::cm;
13  const double invgev = 1.0 / CLHEP::GeV;
14  const double invsec = 1.0 / CLHEP::second;
15  crossedBoundary_ = true;
16  const G4ThreeVector& v = track->GetPosition();
18  math::XYZTLorentzVectorF(v.x() * invcm, v.y() * invcm, v.z() * invcm, track->GetGlobalTime() * invsec);
19  const G4ThreeVector& p = track->GetMomentum();
21  math::XYZTLorentzVectorF(p.x() * invgev, p.y() * invgev, p.z() * invgev, track->GetTotalEnergy() * invgev);
22 }
math::XYZTLorentzVectorF momentumAtBoundary_
U second(std::pair< T, U > const &p)
static const float invgev
Definition: TimingSD.cc:32
math::XYZTLorentzVectorF positionAtBoundary_
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22

◆ setExtSecondary()

void TrackInformation::setExtSecondary ( )
inline

Definition at line 97 of file TrackInformation.h.

References mtdStatus_.

97 { mtdStatus_ |= 1 << 4; } //5th bit

◆ setFromBTLtoT()

void TrackInformation::setFromBTLtoT ( )
inline

Definition at line 91 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

91 { mtdStatus_ |= 1 << 1; } // 2nd bit

◆ setFromTtoBTL()

void TrackInformation::setFromTtoBTL ( )
inline

Definition at line 89 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

89 { mtdStatus_ |= 1 << 0; } // 1st bit

◆ setGeneratedSecondary()

void TrackInformation::setGeneratedSecondary ( bool  v)
inline

◆ setGenParticleP()

void TrackInformation::setGenParticleP ( double  p)
inline

◆ setGenParticlePID()

void TrackInformation::setGenParticlePID ( int  id)
inline

◆ setHasHits()

void TrackInformation::setHasHits ( bool  v)
inline

Definition at line 28 of file TrackInformation.h.

References hasHits_, and findQualityFiles::v.

◆ setIDonCaloSurface()

void TrackInformation::setIDonCaloSurface ( int  id,
int  ical,
int  last,
int  pdgID,
double  p 
)
inline

◆ setInTrkFromBackscattering()

void TrackInformation::setInTrkFromBackscattering ( )
inline

Definition at line 95 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

95 { mtdStatus_ |= 1 << 3; } // 4th bit

◆ setMCTruthID()

void TrackInformation::setMCTruthID ( int  id)
inline

Definition at line 40 of file TrackInformation.h.

References l1ctLayer2EG_cff::id, and mcTruthID_.

Referenced by MCTruthUtil::primary().

◆ setPrimary()

void TrackInformation::setPrimary ( bool  v)
inline

Definition at line 25 of file TrackInformation.h.

References isPrimary_, and findQualityFiles::v.

Referenced by MCTruthUtil::primary().

◆ setStartedInFineVolume()

void TrackInformation::setStartedInFineVolume ( bool  flag = true)
inline

◆ setStoreTrack()

void TrackInformation::setStoreTrack ( )
inline

can only be set to true, cannot be reset to false!

Definition at line 19 of file TrackInformation.h.

References isInHistory_, and storeTrack_.

Referenced by CaloSD::createNewHit(), CaloSD::findBoundaryCrossingParent(), MCTruthUtil::primary(), and DBremWatcher::update().

19  {
20  storeTrack_ = true;
21  isInHistory_ = true;
22  }

◆ startedInFineVolume()

bool TrackInformation::startedInFineVolume ( ) const
inline

Definition at line 65 of file TrackInformation.h.

References startedInFineVolume_.

Referenced by CaloTrkProcessing::update().

65 { return startedInFineVolume_; }

◆ startedInFineVolumeIsSet()

bool TrackInformation::startedInFineVolumeIsSet ( )
inline

Definition at line 70 of file TrackInformation.h.

References startedInFineVolumeIsSet_.

Referenced by CaloTrkProcessing::update().

70 { return startedInFineVolumeIsSet_; }

◆ storeTrack()

bool TrackInformation::storeTrack ( ) const
inline

Member Data Documentation

◆ caloIDChecked_

bool TrackInformation::caloIDChecked_ {false}
private

Definition at line 109 of file TrackInformation.h.

Referenced by caloIDChecked(), and setCaloIDChecked().

◆ caloSurfaceParticleP_

double TrackInformation::caloSurfaceParticleP_ {0.}
private

◆ caloSurfaceParticlePID_

int TrackInformation::caloSurfaceParticlePID_ {0}
private

◆ castorHitPID_

int TrackInformation::castorHitPID_ {0}
private

Definition at line 120 of file TrackInformation.h.

Referenced by getCastorHitPID(), and setCastorHitPID().

◆ crossedBoundary_

bool TrackInformation::crossedBoundary_ {false}
private

Definition at line 110 of file TrackInformation.h.

Referenced by crossedBoundary(), and setCrossedBoundary().

◆ flagAncestor_

bool TrackInformation::flagAncestor_ {false}
private

Definition at line 108 of file TrackInformation.h.

Referenced by isAncestor(), and setAncestor().

◆ genParticleP_

double TrackInformation::genParticleP_ {0.}
private

Definition at line 122 of file TrackInformation.h.

Referenced by genParticleP(), and setGenParticleP().

◆ genParticlePID_

int TrackInformation::genParticlePID_ {-1}
private

Definition at line 117 of file TrackInformation.h.

Referenced by genParticlePID(), and setGenParticlePID().

◆ hasCastorHit_

bool TrackInformation::hasCastorHit_ {false}
private

Definition at line 113 of file TrackInformation.h.

Referenced by hasCastorHit(), and setCastorHitPID().

◆ hasHits_

bool TrackInformation::hasHits_ {false}
private

Definition at line 105 of file TrackInformation.h.

Referenced by hasHits(), Print(), and setHasHits().

◆ idCaloVolume_

int TrackInformation::idCaloVolume_ {-1}
private

Definition at line 115 of file TrackInformation.h.

Referenced by getIDCaloVolume(), Print(), and setIDonCaloSurface().

◆ idLastVolume_

int TrackInformation::idLastVolume_ {-1}
private

Definition at line 116 of file TrackInformation.h.

Referenced by getIDLastVolume(), Print(), and setIDonCaloSurface().

◆ idOnCaloSurface_

int TrackInformation::idOnCaloSurface_ {0}
private

Definition at line 114 of file TrackInformation.h.

Referenced by getIDonCaloSurface(), and setIDonCaloSurface().

◆ isGeneratedSecondary_

bool TrackInformation::isGeneratedSecondary_ {false}
private

Definition at line 106 of file TrackInformation.h.

Referenced by isGeneratedSecondary(), Print(), and setGeneratedSecondary().

◆ isInHistory_

bool TrackInformation::isInHistory_ {false}
private

Definition at line 107 of file TrackInformation.h.

Referenced by isInHistory(), Print(), putInHistory(), and setStoreTrack().

◆ isPrimary_

bool TrackInformation::isPrimary_ {false}
private

Definition at line 104 of file TrackInformation.h.

Referenced by isPrimary(), Print(), and setPrimary().

◆ mcTruthID_

int TrackInformation::mcTruthID_ {-1}
private

Definition at line 118 of file TrackInformation.h.

Referenced by mcTruthID(), Print(), and setMCTruthID().

◆ momentumAtBoundary_

math::XYZTLorentzVectorF TrackInformation::momentumAtBoundary_
private

Definition at line 125 of file TrackInformation.h.

Referenced by getMomentumAtBoundary(), and setCrossedBoundary().

◆ mtdStatus_

uint8_t TrackInformation::mtdStatus_ {0}
private

◆ positionAtBoundary_

math::XYZTLorentzVectorF TrackInformation::positionAtBoundary_
private

Definition at line 124 of file TrackInformation.h.

Referenced by getPositionAtBoundary(), and setCrossedBoundary().

◆ startedInFineVolume_

bool TrackInformation::startedInFineVolume_ {false}
private

Definition at line 111 of file TrackInformation.h.

Referenced by setStartedInFineVolume(), and startedInFineVolume().

◆ startedInFineVolumeIsSet_

bool TrackInformation::startedInFineVolumeIsSet_ {false}
private

Definition at line 112 of file TrackInformation.h.

Referenced by setStartedInFineVolume(), and startedInFineVolumeIsSet().

◆ storeTrack_

bool TrackInformation::storeTrack_ {false}
private

Definition at line 103 of file TrackInformation.h.

Referenced by Print(), setStoreTrack(), and storeTrack().