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
 
int idAtBTLentrance () const
 
bool isAncestor () const
 
bool isBTLdaughter () const
 
bool isBTLlooper () const
 
bool isFromBTLtoT () const
 
bool isFromTtoBTL () const
 
bool isGeneratedSecondary () const
 
bool isInHistory () const
 
bool isPrimary () const
 
void operator delete (void *TrackInformation)
 
void * operator new (size_t)
 
void Print () const override
 
void putInHistory ()
 
void setAncestor ()
 
void setBTLdaughter ()
 
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 setFromBTLtoT ()
 
void setFromTtoBTL ()
 
void setGeneratedSecondary (bool v)
 
void setGenParticleP (double p)
 
void setGenParticlePID (int id)
 
void setHasHits (bool v)
 
void setIdAtBTLentrance (int id)
 
void setIDonCaloSurface (int id, int ical, int last, int pdgID, double p)
 
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 idAtBTLentrance_ {0}
 
int idCaloVolume_ {-1}
 
int idLastVolume_ {-1}
 
int idOnCaloSurface_ {0}
 
bool isGeneratedSecondary_ {false}
 
bool isInHistory_ {false}
 
bool isPrimary_ {false}
 
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 50 of file TrackInformation.h.

References caloIDChecked_.

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

50 { return caloIDChecked_; }

◆ caloSurfaceParticleP()

double TrackInformation::caloSurfaceParticleP ( ) const
inline

Definition at line 54 of file TrackInformation.h.

References caloSurfaceParticleP_.

54 { return caloSurfaceParticleP_; }

◆ caloSurfaceParticlePID()

int TrackInformation::caloSurfaceParticlePID ( ) const
inline

Definition at line 52 of file TrackInformation.h.

References caloSurfaceParticlePID_.

◆ crossedBoundary()

bool TrackInformation::crossedBoundary ( ) const
inline

◆ genParticleP()

double TrackInformation::genParticleP ( ) const
inline

Definition at line 72 of file TrackInformation.h.

References genParticleP_.

Referenced by CaloSD::getResponseWt().

72 { return genParticleP_; }

◆ genParticlePID()

int TrackInformation::genParticlePID ( ) const
inline

◆ getCastorHitPID()

int TrackInformation::getCastorHitPID ( ) const
inline

Definition at line 82 of file TrackInformation.h.

References castorHitPID_.

Referenced by CastorSD::getEnergyDeposit().

82 { return castorHitPID_; }

◆ getIDCaloVolume()

int TrackInformation::getIDCaloVolume ( ) const
inline

Definition at line 48 of file TrackInformation.h.

References idCaloVolume_.

Referenced by CaloTrkProcessing::update().

48 { return idCaloVolume_; }

◆ getIDLastVolume()

int TrackInformation::getIDLastVolume ( ) const
inline

Definition at line 49 of file TrackInformation.h.

References idLastVolume_.

Referenced by CaloTrkProcessing::update().

49 { return idLastVolume_; }

◆ getIDonCaloSurface()

int TrackInformation::getIDonCaloSurface ( ) const
inline

◆ getMomentumAtBoundary()

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

Definition at line 61 of file TrackInformation.h.

References momentumAtBoundary_.

Referenced by TrackingAction::PostUserTrackingAction().

61 { return momentumAtBoundary_; }
math::XYZTLorentzVectorF momentumAtBoundary_

◆ getPositionAtBoundary()

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

Definition at line 60 of file TrackInformation.h.

References positionAtBoundary_.

Referenced by TrackingAction::PostUserTrackingAction().

60 { return positionAtBoundary_; }
math::XYZTLorentzVectorF positionAtBoundary_

◆ hasCastorHit()

bool TrackInformation::hasCastorHit ( ) const
inline

Definition at line 77 of file TrackInformation.h.

References hasCastorHit_.

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

77 { return hasCastorHit_; }

◆ hasHits()

bool TrackInformation::hasHits ( ) const
inline

Definition at line 27 of file TrackInformation.h.

References hasHits_.

27 { return hasHits_; }

◆ idAtBTLentrance()

int TrackInformation::idAtBTLentrance ( ) const
inline

Definition at line 95 of file TrackInformation.h.

References idAtBTLentrance_.

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

95 { return idAtBTLentrance_; }

◆ isAncestor()

bool TrackInformation::isAncestor ( ) const
inline

Definition at line 36 of file TrackInformation.h.

References flagAncestor_.

Referenced by TrackingAction::PostUserTrackingAction().

36 { return flagAncestor_; }

◆ isBTLdaughter()

bool TrackInformation::isBTLdaughter ( ) const
inline

Definition at line 91 of file TrackInformation.h.

References mtdStatus_.

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

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

◆ isBTLlooper()

bool TrackInformation::isBTLlooper ( ) const
inline

Definition at line 93 of file TrackInformation.h.

References mtdStatus_.

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

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

◆ isFromBTLtoT()

bool TrackInformation::isFromBTLtoT ( ) const
inline

Definition at line 89 of file TrackInformation.h.

References mtdStatus_.

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

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

◆ isFromTtoBTL()

bool TrackInformation::isFromTtoBTL ( ) const
inline

Definition at line 87 of file TrackInformation.h.

References mtdStatus_.

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

87 { 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_; }

◆ isPrimary()

bool TrackInformation::isPrimary ( ) const
inline

◆ operator delete()

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

Definition at line 134 of file TrackInformation.h.

References fpTrackInformationAllocator.

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

◆ operator new()

void * TrackInformation::operator new ( size_t  )
inline

Definition at line 128 of file TrackInformation.h.

References fpTrackInformationAllocator.

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

◆ Print()

void TrackInformation::Print ( void  ) const
override

Definition at line 24 of file TrackInformation.cc.

References caloIDChecked(), getIDonCaloSurface(), hasHits_, idAtBTLentrance_, idCaloVolume_, idLastVolume_, isBTLdaughter(), isBTLlooper(), isFromBTLtoT(), isFromTtoBTL(), isGeneratedSecondary_, isInHistory_, isPrimary_, LogDebug, and storeTrack_.

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

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

◆ putInHistory()

void TrackInformation::putInHistory ( )
inline

◆ setAncestor()

void TrackInformation::setAncestor ( )
inline

Definition at line 37 of file TrackInformation.h.

References flagAncestor_.

37 { flagAncestor_ = true; }

◆ setBTLdaughter()

void TrackInformation::setBTLdaughter ( )
inline

Definition at line 90 of file TrackInformation.h.

References mtdStatus_.

90 { mtdStatus_ |= 1 << 2; } // 3rd bit

◆ setBTLlooper()

void TrackInformation::setBTLlooper ( )
inline

Definition at line 92 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

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

◆ setCaloIDChecked()

void TrackInformation::setCaloIDChecked ( bool  f)
inline

Definition at line 51 of file TrackInformation.h.

References caloIDChecked_, and f.

Referenced by CaloTrkProcessing::update().

51 { 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 78 of file TrackInformation.h.

References castorHitPID_, and hasCastorHit_.

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

78  {
79  hasCastorHit_ = true;
80  castorHitPID_ = pid;
81  }

◆ 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_2023v12_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

◆ setFromBTLtoT()

void TrackInformation::setFromBTLtoT ( )
inline

Definition at line 88 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

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

◆ setFromTtoBTL()

void TrackInformation::setFromTtoBTL ( )
inline

Definition at line 86 of file TrackInformation.h.

References mtdStatus_.

Referenced by Phase2SteppingAction::UserSteppingAction().

86 { 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.

◆ setIdAtBTLentrance()

void TrackInformation::setIdAtBTLentrance ( int  id)
inline

◆ setIDonCaloSurface()

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

◆ 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 62 of file TrackInformation.h.

References startedInFineVolume_.

Referenced by CaloTrkProcessing::update().

62 { return startedInFineVolume_; }

◆ startedInFineVolumeIsSet()

bool TrackInformation::startedInFineVolumeIsSet ( )
inline

Definition at line 67 of file TrackInformation.h.

References startedInFineVolumeIsSet_.

Referenced by CaloTrkProcessing::update().

67 { return startedInFineVolumeIsSet_; }

◆ storeTrack()

bool TrackInformation::storeTrack ( ) const
inline

Member Data Documentation

◆ caloIDChecked_

bool TrackInformation::caloIDChecked_ {false}
private

Definition at line 107 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 117 of file TrackInformation.h.

Referenced by getCastorHitPID(), and setCastorHitPID().

◆ crossedBoundary_

bool TrackInformation::crossedBoundary_ {false}
private

Definition at line 108 of file TrackInformation.h.

Referenced by crossedBoundary(), and setCrossedBoundary().

◆ flagAncestor_

bool TrackInformation::flagAncestor_ {false}
private

Definition at line 106 of file TrackInformation.h.

Referenced by isAncestor(), and setAncestor().

◆ genParticleP_

double TrackInformation::genParticleP_ {0.}
private

Definition at line 120 of file TrackInformation.h.

Referenced by genParticleP(), and setGenParticleP().

◆ genParticlePID_

int TrackInformation::genParticlePID_ {-1}
private

Definition at line 115 of file TrackInformation.h.

Referenced by genParticlePID(), and setGenParticlePID().

◆ hasCastorHit_

bool TrackInformation::hasCastorHit_ {false}
private

Definition at line 111 of file TrackInformation.h.

Referenced by hasCastorHit(), and setCastorHitPID().

◆ hasHits_

bool TrackInformation::hasHits_ {false}
private

Definition at line 103 of file TrackInformation.h.

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

◆ idAtBTLentrance_

int TrackInformation::idAtBTLentrance_ {0}
private

Definition at line 118 of file TrackInformation.h.

Referenced by idAtBTLentrance(), Print(), and setIdAtBTLentrance().

◆ idCaloVolume_

int TrackInformation::idCaloVolume_ {-1}
private

Definition at line 113 of file TrackInformation.h.

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

◆ idLastVolume_

int TrackInformation::idLastVolume_ {-1}
private

Definition at line 114 of file TrackInformation.h.

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

◆ idOnCaloSurface_

int TrackInformation::idOnCaloSurface_ {0}
private

Definition at line 112 of file TrackInformation.h.

Referenced by getIDonCaloSurface(), and setIDonCaloSurface().

◆ isGeneratedSecondary_

bool TrackInformation::isGeneratedSecondary_ {false}
private

Definition at line 104 of file TrackInformation.h.

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

◆ isInHistory_

bool TrackInformation::isInHistory_ {false}
private

Definition at line 105 of file TrackInformation.h.

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

◆ isPrimary_

bool TrackInformation::isPrimary_ {false}
private

Definition at line 102 of file TrackInformation.h.

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

◆ momentumAtBoundary_

math::XYZTLorentzVectorF TrackInformation::momentumAtBoundary_
private

Definition at line 123 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 122 of file TrackInformation.h.

Referenced by getPositionAtBoundary(), and setCrossedBoundary().

◆ startedInFineVolume_

bool TrackInformation::startedInFineVolume_ {false}
private

Definition at line 109 of file TrackInformation.h.

Referenced by setStartedInFineVolume(), and startedInFineVolume().

◆ startedInFineVolumeIsSet_

bool TrackInformation::startedInFineVolumeIsSet_ {false}
private

Definition at line 110 of file TrackInformation.h.

Referenced by setStartedInFineVolume(), and startedInFineVolumeIsSet().

◆ storeTrack_

bool TrackInformation::storeTrack_ {false}
private

Definition at line 101 of file TrackInformation.h.

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