CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends
PSimHit Class Reference

#include <PSimHit.h>

Inheritance diagram for PSimHit:
UpdatablePSimHit

Public Member Functions

unsigned int detUnitId () const
 
float energyLoss () const
 The energy deposit in the PSimHit, in ???. More...
 
Local3DPoint entryPoint () const
 Entry point in the local Det frame. More...
 
EncodedEventId eventId () const
 
Local3DPoint exitPoint () const
 Exit point in the local Det frame. More...
 
LocalVector localDirection () const
 Obsolete. Same as momentumAtEntry().unit(), for backward compatibility. More...
 
Local3DPoint localPosition () const
 
LocalVector momentumAtEntry () const
 The momentum of the track that produced the hit, at entry point. More...
 
unsigned int offsetTrackId () const
 
unsigned int originalTrackId () const
 
float pabs () const
 fast and more accurate access to momentumAtEntry().mag() More...
 
int particleType () const
 
Geom::Phi< float > phiAtEntry () const
 fast and more accurate access to momentumAtEntry().phi() More...
 
unsigned short processType () const
 
 PSimHit ()
 
 PSimHit (const Local3DPoint &entry, const Local3DPoint &exit, float pabs, float tof, float eloss, int particleType, unsigned int detId, unsigned int trackId, float theta, float phi, unsigned short processType=0)
 
void setEventId (EncodedEventId e)
 
void setTof (float tof)
 
Geom::Theta< float > thetaAtEntry () const
 fast and more accurate access to momentumAtEntry().theta() More...
 
float timeOfFlight () const
 
float tof () const
 deprecated name for timeOfFlight() More...
 
unsigned int trackId () const
 

Static Public Member Functions

static unsigned int addTrackIdOffset (unsigned int tId, unsigned int offset)
 

Static Public Attributes

static constexpr unsigned int k_tidOffset = 200000000
 

Protected Attributes

unsigned int theDetUnitId
 
float theEnergyLoss
 
Local3DPoint theEntryPoint
 
EncodedEventId theEventId
 
float thePabs
 
int theParticleType
 
float thePhiAtEntry
 
unsigned short theProcessType
 
Local3DVector theSegment
 
float theThetaAtEntry
 
float theTof
 
unsigned int theTrackId
 

Friends

class TrackingSlaveSD
 

Detailed Description

Persistent-capable SimHit. Suitable for tracking detectors.

Definition at line 15 of file PSimHit.h.

Constructor & Destructor Documentation

◆ PSimHit() [1/2]

PSimHit::PSimHit ( )
inline

Definition at line 19 of file PSimHit.h.

19 : theDetUnitId(0) {}
unsigned int theDetUnitId
Definition: PSimHit.h:150

◆ PSimHit() [2/2]

PSimHit::PSimHit ( const Local3DPoint entry,
const Local3DPoint exit,
float  pabs,
float  tof,
float  eloss,
int  particleType,
unsigned int  detId,
unsigned int  trackId,
float  theta,
float  phi,
unsigned short  processType = 0 
)
inline

Definition at line 21 of file PSimHit.h.

34  thePabs(pabs),
35  theEnergyLoss(eloss),
38  theTof(tof),
float thePabs
Definition: PSimHit.h:139
unsigned int theTrackId
Definition: PSimHit.h:151
Local3DPoint theEntryPoint
Definition: PSimHit.h:137
unsigned int theDetUnitId
Definition: PSimHit.h:150
float theTof
Definition: PSimHit.h:144
float thePhiAtEntry
Definition: PSimHit.h:142
unsigned short theProcessType
Definition: PSimHit.h:146
float theEnergyLoss
Definition: PSimHit.h:140
unsigned short processType() const
Definition: PSimHit.h:131
unsigned int trackId() const
Definition: PSimHit.h:108
Local3DVector theSegment
Definition: PSimHit.h:138
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:78
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
Definition: PSimHit.h:69
int theParticleType
Definition: PSimHit.h:145
float theThetaAtEntry
Definition: PSimHit.h:141
int particleType() const
Definition: PSimHit.h:91
Geom::Theta< T > theta() const
def exit(msg="")

Member Function Documentation

◆ addTrackIdOffset()

static unsigned int PSimHit::addTrackIdOffset ( unsigned int  tId,
unsigned int  offset 
)
inlinestatic

Definition at line 117 of file PSimHit.h.

References k_tidOffset, and hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by MtdSD::getTrackID().

117 { return offset * k_tidOffset + tId; }
static constexpr unsigned int k_tidOffset
Definition: PSimHit.h:17

◆ detUnitId()

unsigned int PSimHit::detUnitId ( ) const
inline

◆ energyLoss()

float PSimHit::energyLoss ( ) const
inline

◆ entryPoint()

Local3DPoint PSimHit::entryPoint ( ) const
inline

◆ eventId()

EncodedEventId PSimHit::eventId ( ) const
inline

Definition at line 119 of file PSimHit.h.

References theEventId.

Referenced by DTHitAssociator::associateDTHitId(), TrackerHitAssociator::associateHit(), and ntupleDataFormat.Event::eventIdStr().

119 { return theEventId; }
EncodedEventId theEventId
Definition: PSimHit.h:152

◆ exitPoint()

Local3DPoint PSimHit::exitPoint ( ) const
inline

◆ localDirection()

LocalVector PSimHit::localDirection ( ) const
inline

Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.

Definition at line 60 of file PSimHit.h.

References f, phiAtEntry(), and thetaAtEntry().

Referenced by CkfDebugger::SimHit::localDirection().

60 { return LocalVector(thetaAtEntry(), phiAtEntry(), 1.f); }
Local3DVector LocalVector
Definition: LocalVector.h:12
double f[11][100]
Geom::Theta< float > thetaAtEntry() const
fast and more accurate access to momentumAtEntry().theta()
Definition: PSimHit.h:63
Geom::Phi< float > phiAtEntry() const
fast and more accurate access to momentumAtEntry().phi()
Definition: PSimHit.h:66

◆ localPosition()

Local3DPoint PSimHit::localPosition ( ) const
inline

◆ momentumAtEntry()

LocalVector PSimHit::momentumAtEntry ( ) const
inline

The momentum of the track that produced the hit, at entry point.

Definition at line 57 of file PSimHit.h.

References pabs(), phiAtEntry(), and thetaAtEntry().

Referenced by TestHits::analyze(), TestSmoothHits::analyze(), TestTrackHits::analyze(), FWTrackingParticleProxyBuilderFullFramework::build(), MuonTrackResidualAnalyzer::computeResolution(), and PixelTemplateSmearerBase::hitsMerge().

57 { return LocalVector(thetaAtEntry(), phiAtEntry(), pabs()); }
Local3DVector LocalVector
Definition: LocalVector.h:12
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
Definition: PSimHit.h:69
Geom::Theta< float > thetaAtEntry() const
fast and more accurate access to momentumAtEntry().theta()
Definition: PSimHit.h:63
Geom::Phi< float > phiAtEntry() const
fast and more accurate access to momentumAtEntry().phi()
Definition: PSimHit.h:66

◆ offsetTrackId()

unsigned int PSimHit::offsetTrackId ( ) const
inline

Definition at line 115 of file PSimHit.h.

References k_tidOffset, and theTrackId.

115 { return theTrackId / k_tidOffset; }
unsigned int theTrackId
Definition: PSimHit.h:151
static constexpr unsigned int k_tidOffset
Definition: PSimHit.h:17

◆ originalTrackId()

unsigned int PSimHit::originalTrackId ( ) const
inline

In case te SimTrack ID is incremented by the k_tidOffset for hit category definition, this methods returns the original theTrackId value directly.

Definition at line 113 of file PSimHit.h.

References k_tidOffset, and theTrackId.

113 { return theTrackId % k_tidOffset; }
unsigned int theTrackId
Definition: PSimHit.h:151
static constexpr unsigned int k_tidOffset
Definition: PSimHit.h:17

◆ pabs()

float PSimHit::pabs ( ) const
inline

◆ particleType()

int PSimHit::particleType ( ) const
inline

The particle type of the track that produced this hit, in standard PDG code. NB: This differs from ORCA5 and earlier, where the code was Geant3. The particle type of the hit may differ from the particle type of the SimTrack with id trackId(). This happends if the hit was created by a secondary track (e.g. a delta ray) originating from the trackId() and not existing as a separate SimTrack.

Definition at line 91 of file PSimHit.h.

References theParticleType.

Referenced by FWPSimHitProxyBuilder::buildViewType(), SubsystemNeutronReader::generateChamberNoise(), GEMBaseValidation::isMuonSimHit(), CkfDebugger::SimHit::particleType(), CSCGasCollisions::simulate(), and CSCGasCollisions::writeSummary().

91 { return theParticleType; }
int theParticleType
Definition: PSimHit.h:145

◆ phiAtEntry()

Geom::Phi<float> PSimHit::phiAtEntry ( ) const
inline

◆ processType()

unsigned short PSimHit::processType ( ) const
inline

The ID of the physics process that created the track that produced the hit. This is useful for identifying hits from secondary interactions, especially in the case when the track that produced the hit was not saved as a SimTrack. The meaning of the ID is defined outside of the PSimHit; The only value with special significance is zero (for "undefined"), so zero should not be the ID of any process.

Definition at line 131 of file PSimHit.h.

References theProcessType.

Referenced by CkfDebugger::analyseCompatibleMeasurements(), TestHits::analyze(), TestSmoothHits::analyze(), TestOutliers::analyze(), TestTrackHits::analyze(), TrackerHitAssociator::associateHit(), SubsystemNeutronReader::generateChamberNoise(), SiPixelDigitizerAlgorithm::make_digis(), and CkfDebugger::SimHit::processType().

131 { return theProcessType; }
unsigned short theProcessType
Definition: PSimHit.h:146

◆ setEventId()

void PSimHit::setEventId ( EncodedEventId  e)
inline

Definition at line 121 of file PSimHit.h.

References MillePedeFileConverter_cfg::e, and theEventId.

◆ setTof()

void PSimHit::setTof ( float  tof)
inline

Definition at line 133 of file PSimHit.h.

References theTof, and tof().

133 { theTof = tof; }
float theTof
Definition: PSimHit.h:144
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:78

◆ thetaAtEntry()

Geom::Theta<float> PSimHit::thetaAtEntry ( ) const
inline

fast and more accurate access to momentumAtEntry().theta()

Definition at line 63 of file PSimHit.h.

References theThetaAtEntry.

Referenced by SubsystemNeutronReader::generateChamberNoise(), localDirection(), momentumAtEntry(), and CkfDebugger::SimHit::thetaAtEntry().

float theThetaAtEntry
Definition: PSimHit.h:141

◆ timeOfFlight()

float PSimHit::timeOfFlight ( ) const
inline

Time of flight in nanoseconds from the primary interaction to the entry point. Always positive in a PSimHit, but may become negative in a SimHit due to bunch assignment.

Definition at line 75 of file PSimHit.h.

References tof().

Referenced by CkfDebugger::associated(), ME0SimpleModel::getSimHitBx(), GEMSignalModel::getSimHitBx(), RPCSynchronizer::getSimHitBx(), RPCSynchronizer::getSimHitBxAndTimingForIRPC(), CkfDebugger::nextCorrectHits(), TkAccumulatingSensitiveDetector::sendHit(), and CkfDebugger::SimHit::timeOfFlight().

75 { return tof(); }
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:78

◆ tof()

float PSimHit::tof ( ) const
inline

deprecated name for timeOfFlight()

Definition at line 78 of file PSimHit.h.

References theTof.

Referenced by SubsystemNeutronReader::generateChamberNoise(), SortByTime::operator()(), setTof(), and timeOfFlight().

78 { return theTof; }
float theTof
Definition: PSimHit.h:144

◆ trackId()

unsigned int PSimHit::trackId ( ) const
inline

The SimTrack ID of the "mother" track. This may be the actual charged track that produced the hit, or a "mother" of this track, in case the track that produced the hit was not saved as a SimTrack. This ID must be interpreted in the context of the SimEvent to which the PSimHit belongs.

Definition at line 108 of file PSimHit.h.

References theTrackId.

Referenced by CkfDebugger::analyseRecHitExistance(), DTHitAssociator::associateDTHitId(), TrackerHitAssociator::associateHit(), CkfDebugger::correctMeas(), TkAccumulatingSensitiveDetector::createHit(), Phase2OTValidateRecHitBase::fillOTRecHitHistos(), Phase2ITValidateRecHitBase::fillRechitHistos(), SubsystemNeutronReader::generateChamberNoise(), SiPixelDigitizerAlgorithm::make_digis(), FastTrackerRecHitMatcher::produce(), TkAccumulatingSensitiveDetector::sendHit(), CkfDebugger::SimHit::trackId(), and TkAccumulatingSensitiveDetector::updateHit().

108 { return theTrackId; }
unsigned int theTrackId
Definition: PSimHit.h:151

Friends And Related Function Documentation

◆ TrackingSlaveSD

friend class TrackingSlaveSD
friend

Definition at line 154 of file PSimHit.h.

Member Data Documentation

◆ k_tidOffset

constexpr unsigned int PSimHit::k_tidOffset = 200000000
static

◆ theDetUnitId

unsigned int PSimHit::theDetUnitId
protected

Definition at line 150 of file PSimHit.h.

Referenced by detUnitId().

◆ theEnergyLoss

float PSimHit::theEnergyLoss
protected

◆ theEntryPoint

Local3DPoint PSimHit::theEntryPoint
protected

◆ theEventId

EncodedEventId PSimHit::theEventId
protected

Definition at line 152 of file PSimHit.h.

Referenced by eventId(), and setEventId().

◆ thePabs

float PSimHit::thePabs
protected

Definition at line 139 of file PSimHit.h.

Referenced by pabs().

◆ theParticleType

int PSimHit::theParticleType
protected

Definition at line 145 of file PSimHit.h.

Referenced by particleType().

◆ thePhiAtEntry

float PSimHit::thePhiAtEntry
protected

Definition at line 142 of file PSimHit.h.

Referenced by phiAtEntry().

◆ theProcessType

unsigned short PSimHit::theProcessType
protected

Definition at line 146 of file PSimHit.h.

Referenced by processType().

◆ theSegment

Local3DVector PSimHit::theSegment
protected

◆ theThetaAtEntry

float PSimHit::theThetaAtEntry
protected

Definition at line 141 of file PSimHit.h.

Referenced by thetaAtEntry().

◆ theTof

float PSimHit::theTof
protected

Definition at line 144 of file PSimHit.h.

Referenced by setTof(), and tof().

◆ theTrackId

unsigned int PSimHit::theTrackId
protected

Definition at line 151 of file PSimHit.h.

Referenced by offsetTrackId(), originalTrackId(), UpdatablePSimHit::setTrackId(), and trackId().