CMS 3D CMS Logo

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

#include <CaloHitID.h>

Public Member Functions

 CaloHitID (const CaloHitID &)
 
 CaloHitID (float tSlice=1, bool ignoreTkID=false)
 
 CaloHitID (uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0, float tSlice=1, bool ignoreTkID=false)
 
uint16_t depth () const
 
int fineTrackID () const
 
bool hasFineTrackID () const
 
bool operator< (const CaloHitID &) const
 
const CaloHitIDoperator= (const CaloHitID &)
 
bool operator== (const CaloHitID &) const
 
bool operator> (const CaloHitID &) const
 
void reset ()
 
void setFineTrackID (int fineTrackID)
 
void setID (uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
 
void setTrackID (int trackID)
 
double timeSlice () const
 
int timeSliceID () const
 
int trackID () const
 
uint32_t unitID () const
 
virtual ~CaloHitID ()
 

Private Attributes

bool ignoreTrackID
 
uint16_t theDepth
 
int theFineTrackID
 
double theTimeSlice
 
int theTimeSliceID
 
int theTrackID
 
uint32_t theUnitID
 
float timeSliceUnit
 

Detailed Description

Definition at line 11 of file CaloHitID.h.

Constructor & Destructor Documentation

◆ CaloHitID() [1/3]

CaloHitID::CaloHitID ( uint32_t  unitID,
double  timeSlice,
int  trackID,
uint16_t  depth = 0,
float  tSlice = 1,
bool  ignoreTkID = false 
)

Definition at line 9 of file CaloHitID.cc.

10  : timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID), theFineTrackID(-1) {
12 }

References depth(), setID(), timeSlice(), trackID(), and unitID().

◆ CaloHitID() [2/3]

CaloHitID::CaloHitID ( float  tSlice = 1,
bool  ignoreTkID = false 
)

Definition at line 14 of file CaloHitID.cc.

14 : timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) { reset(); }

References reset().

◆ CaloHitID() [3/3]

CaloHitID::CaloHitID ( const CaloHitID id)

Definition at line 16 of file CaloHitID.cc.

16  {
17  theUnitID = id.theUnitID;
18  theTimeSlice = id.theTimeSlice;
19  theTrackID = id.theTrackID;
20  theTimeSliceID = id.theTimeSliceID;
21  theDepth = id.theDepth;
22  timeSliceUnit = id.timeSliceUnit;
23  ignoreTrackID = id.ignoreTrackID;
24  theFineTrackID = id.theFineTrackID;
25 }

References ignoreTrackID, theDepth, theFineTrackID, theTimeSlice, theTimeSliceID, theTrackID, theUnitID, and timeSliceUnit.

◆ ~CaloHitID()

CaloHitID::~CaloHitID ( )
virtual

Definition at line 39 of file CaloHitID.cc.

39 {}

Member Function Documentation

◆ depth()

uint16_t CaloHitID::depth ( void  ) const
inline

◆ fineTrackID()

int CaloHitID::fineTrackID ( ) const
inline

◆ hasFineTrackID()

bool CaloHitID::hasFineTrackID ( ) const
inline

Definition at line 29 of file CaloHitID.h.

29 { return theFineTrackID != -1; }

References theFineTrackID.

Referenced by fineTrackID(), and CaloSD::saveHit().

◆ operator<()

bool CaloHitID::operator< ( const CaloHitID id) const

Definition at line 65 of file CaloHitID.cc.

65  {
66  if (theTrackID != id.trackID()) {
67  return (theTrackID > id.trackID());
68  } else if (fineTrackID() != id.fineTrackID()) {
69  return (fineTrackID() > id.fineTrackID());
70  } else if (theUnitID != id.unitID()) {
71  return (theUnitID > id.unitID());
72  } else if (theDepth != id.depth()) {
73  return (theDepth > id.depth());
74  } else {
75  return (theTimeSliceID > id.timeSliceID());
76  }
77 }

References depth(), fineTrackID(), theDepth, theTimeSliceID, theTrackID, theUnitID, timeSliceID(), trackID(), and unitID().

◆ operator=()

const CaloHitID & CaloHitID::operator= ( const CaloHitID id)

Definition at line 27 of file CaloHitID.cc.

27  {
28  theUnitID = id.theUnitID;
29  theTimeSlice = id.theTimeSlice;
30  theTrackID = id.theTrackID;
31  theTimeSliceID = id.theTimeSliceID;
32  theDepth = id.theDepth;
33  timeSliceUnit = id.timeSliceUnit;
34  ignoreTrackID = id.ignoreTrackID;
35  theFineTrackID = id.theFineTrackID;
36  return *this;
37 }

References ignoreTrackID, theDepth, theFineTrackID, theTimeSlice, theTimeSliceID, theTrackID, theUnitID, and timeSliceUnit.

◆ operator==()

bool CaloHitID::operator== ( const CaloHitID id) const

Definition at line 58 of file CaloHitID.cc.

58  {
59  return ((theUnitID == id.unitID()) && (theTrackID == id.trackID() || ignoreTrackID) &&
60  (theTimeSliceID == id.timeSliceID()) && (theDepth == id.depth()) && (fineTrackID() == id.fineTrackID()))
61  ? true
62  : false;
63 }

References depth(), fineTrackID(), ignoreTrackID, theDepth, theTimeSliceID, theTrackID, theUnitID, timeSliceID(), trackID(), funct::true, and unitID().

◆ operator>()

bool CaloHitID::operator> ( const CaloHitID id) const

Definition at line 79 of file CaloHitID.cc.

79  {
80  if (theTrackID != id.trackID()) {
81  return (theTrackID < id.trackID());
82  } else if (fineTrackID() != id.fineTrackID()) {
83  return (fineTrackID() < id.fineTrackID());
84  } else if (theUnitID != id.unitID()) {
85  return (theUnitID < id.unitID());
86  } else if (theDepth != id.depth()) {
87  return (theDepth < id.depth());
88  } else {
89  return (theTimeSliceID < id.timeSliceID());
90  }
91 }

References depth(), fineTrackID(), theDepth, theTimeSliceID, theTrackID, theUnitID, timeSliceID(), trackID(), and unitID().

◆ reset()

void CaloHitID::reset ( void  )

Definition at line 49 of file CaloHitID.cc.

49  {
50  theUnitID = 0;
52  theTrackID = -2;
54  theDepth = 0;
55  theFineTrackID = -1;
56 }

References createfilelist::int, theDepth, theFineTrackID, theTimeSlice, theTimeSliceID, theTrackID, theUnitID, and timeSliceUnit.

Referenced by CaloHitID(), and CaloSD::clearHits().

◆ setFineTrackID()

void CaloHitID::setFineTrackID ( int  fineTrackID)
inline

Definition at line 30 of file CaloHitID.h.

References fineTrackID(), and theFineTrackID.

Referenced by CaloSD::hitBookkeepingFineCalo().

◆ setID()

void CaloHitID::setID ( uint32_t  unitID,
double  timeSlice,
int  trackID,
uint16_t  depth = 0 
)

◆ setTrackID()

void CaloHitID::setTrackID ( int  trackID)
inline

Definition at line 28 of file CaloHitID.h.

28 { theTrackID = trackID; }

References theTrackID, and trackID().

Referenced by CaloSD::hitBookkeepingFineCalo().

◆ timeSlice()

double CaloHitID::timeSlice ( ) const
inline

Definition at line 22 of file CaloHitID.h.

22 { return theTimeSlice; }

References theTimeSlice.

Referenced by CaloHitID(), CaloGVHit::getTimeSlice(), CaloG4Hit::getTimeSlice(), and setID().

◆ timeSliceID()

int CaloHitID::timeSliceID ( ) const
inline

◆ trackID()

int CaloHitID::trackID ( ) const
inline

◆ unitID()

uint32_t CaloHitID::unitID ( ) const
inline

Member Data Documentation

◆ ignoreTrackID

bool CaloHitID::ignoreTrackID
private

Definition at line 44 of file CaloHitID.h.

Referenced by CaloHitID(), operator=(), and operator==().

◆ theDepth

uint16_t CaloHitID::theDepth
private

Definition at line 42 of file CaloHitID.h.

Referenced by CaloHitID(), depth(), operator<(), operator=(), operator==(), operator>(), reset(), and setID().

◆ theFineTrackID

int CaloHitID::theFineTrackID
private

Definition at line 45 of file CaloHitID.h.

Referenced by CaloHitID(), fineTrackID(), hasFineTrackID(), operator=(), reset(), and setFineTrackID().

◆ theTimeSlice

double CaloHitID::theTimeSlice
private

Definition at line 39 of file CaloHitID.h.

Referenced by CaloHitID(), operator=(), reset(), setID(), and timeSlice().

◆ theTimeSliceID

int CaloHitID::theTimeSliceID
private

Definition at line 41 of file CaloHitID.h.

Referenced by CaloHitID(), operator<(), operator=(), operator==(), operator>(), reset(), setID(), and timeSliceID().

◆ theTrackID

int CaloHitID::theTrackID
private

◆ theUnitID

uint32_t CaloHitID::theUnitID
private

Definition at line 38 of file CaloHitID.h.

Referenced by CaloHitID(), operator<(), operator=(), operator==(), operator>(), reset(), setID(), and unitID().

◆ timeSliceUnit

float CaloHitID::timeSliceUnit
private

Definition at line 43 of file CaloHitID.h.

Referenced by CaloHitID(), operator=(), reset(), and setID().

CaloHitID::depth
uint16_t depth() const
Definition: CaloHitID.h:24
CaloHitID::theDepth
uint16_t theDepth
Definition: CaloHitID.h:42
CaloHitID::trackID
int trackID() const
Definition: CaloHitID.h:23
CaloHitID::unitID
uint32_t unitID() const
Definition: CaloHitID.h:20
CaloHitID::theFineTrackID
int theFineTrackID
Definition: CaloHitID.h:45
CaloHitID::timeSliceUnit
float timeSliceUnit
Definition: CaloHitID.h:43
CaloHitID::setID
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:41
CaloHitID::timeSlice
double timeSlice() const
Definition: CaloHitID.h:22
funct::true
true
Definition: Factorize.h:173
CaloHitID::theTimeSlice
double theTimeSlice
Definition: CaloHitID.h:39
CaloHitID::theTrackID
int theTrackID
Definition: CaloHitID.h:40
CaloHitID::theTimeSliceID
int theTimeSliceID
Definition: CaloHitID.h:41
createfilelist.int
int
Definition: createfilelist.py:10
CaloHitID::ignoreTrackID
bool ignoreTrackID
Definition: CaloHitID.h:44
CaloHitID::timeSliceID
int timeSliceID() const
Definition: CaloHitID.h:21
CaloHitID::reset
void reset()
Definition: CaloHitID.cc:49
CaloHitID::fineTrackID
int fineTrackID() const
Definition: CaloHitID.h:31
CaloHitID::hasFineTrackID
bool hasFineTrackID() const
Definition: CaloHitID.h:29
CaloHitID::theUnitID
uint32_t theUnitID
Definition: CaloHitID.h:38