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
 
bool operator< (const CaloHitID &) const
 
const CaloHitIDoperator= (const CaloHitID &)
 
bool operator== (const CaloHitID &) const
 
bool operator> (const CaloHitID &) const
 
void reset ()
 
void setID (uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
 
double timeSlice () const
 
int timeSliceID () const
 
int trackID () const
 
uint32_t unitID () const
 
virtual ~CaloHitID ()
 

Private Attributes

bool ignoreTrackID
 
uint16_t theDepth
 
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) {
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 }

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

◆ ~CaloHitID()

CaloHitID::~CaloHitID ( )
virtual

Definition at line 38 of file CaloHitID.cc.

38 {}

Member Function Documentation

◆ depth()

uint16_t CaloHitID::depth ( void  ) const
inline

◆ operator<()

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

Definition at line 63 of file CaloHitID.cc.

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

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

◆ operator=()

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

Definition at line 26 of file CaloHitID.cc.

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

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

◆ operator==()

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

Definition at line 56 of file CaloHitID.cc.

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

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

◆ operator>()

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

Definition at line 75 of file CaloHitID.cc.

75  {
76  if (theTrackID != id.trackID()) {
77  return (theTrackID < id.trackID());
78  } else if (theUnitID != id.unitID()) {
79  return (theUnitID < id.unitID());
80  } else if (theDepth != id.depth()) {
81  return (theDepth < id.depth());
82  } else {
83  return (theTimeSliceID < id.timeSliceID());
84  }
85 }

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

◆ reset()

void CaloHitID::reset ( void  )

Definition at line 48 of file CaloHitID.cc.

48  {
49  theUnitID = 0;
51  theTrackID = -2;
53  theDepth = 0;
54 }

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

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

◆ setID()

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

◆ 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 39 of file CaloHitID.h.

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

◆ theDepth

uint16_t CaloHitID::theDepth
private

Definition at line 37 of file CaloHitID.h.

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

◆ theTimeSlice

double CaloHitID::theTimeSlice
private

Definition at line 34 of file CaloHitID.h.

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

◆ theTimeSliceID

int CaloHitID::theTimeSliceID
private

Definition at line 36 of file CaloHitID.h.

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

◆ theTrackID

int CaloHitID::theTrackID
private

Definition at line 35 of file CaloHitID.h.

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

◆ theUnitID

uint32_t CaloHitID::theUnitID
private

Definition at line 33 of file CaloHitID.h.

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

◆ timeSliceUnit

float CaloHitID::timeSliceUnit
private

Definition at line 38 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:37
CaloHitID::trackID
int trackID() const
Definition: CaloHitID.h:23
CaloHitID::unitID
uint32_t unitID() const
Definition: CaloHitID.h:20
CaloHitID::timeSliceUnit
float timeSliceUnit
Definition: CaloHitID.h:38
CaloHitID::setID
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:40
CaloHitID::timeSlice
double timeSlice() const
Definition: CaloHitID.h:22
funct::true
true
Definition: Factorize.h:173
CaloHitID::theTimeSlice
double theTimeSlice
Definition: CaloHitID.h:34
CaloHitID::theTrackID
int theTrackID
Definition: CaloHitID.h:35
CaloHitID::theTimeSliceID
int theTimeSliceID
Definition: CaloHitID.h:36
createfilelist.int
int
Definition: createfilelist.py:10
CaloHitID::ignoreTrackID
bool ignoreTrackID
Definition: CaloHitID.h:39
CaloHitID::timeSliceID
int timeSliceID() const
Definition: CaloHitID.h:21
CaloHitID::reset
void reset()
Definition: CaloHitID.cc:48
CaloHitID::theUnitID
uint32_t theUnitID
Definition: CaloHitID.h:33