test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CaloHitID Class Reference

#include <CaloHitID.h>

Public Member Functions

 CaloHitID (uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0, float tSlice=1, bool ignoreTkID=false)
 
 CaloHitID (float tSlice=1, bool ignoreTkID=false)
 
 CaloHitID (const CaloHitID &)
 
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::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.

References setID().

10  :
11  timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) {
13 }
bool ignoreTrackID
Definition: CaloHitID.h:43
double timeSlice() const
Definition: CaloHitID.h:24
uint16_t depth() const
Definition: CaloHitID.h:26
int trackID() const
Definition: CaloHitID.h:25
float timeSliceUnit
Definition: CaloHitID.h:42
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
uint32_t unitID() const
Definition: CaloHitID.h:22
CaloHitID::CaloHitID ( float  tSlice = 1,
bool  ignoreTkID = false 
)

Definition at line 15 of file CaloHitID.cc.

References reset().

15  :
16  timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) {
17  reset();
18 }
bool ignoreTrackID
Definition: CaloHitID.h:43
void reset()
Definition: CaloHitID.cc:53
float timeSliceUnit
Definition: CaloHitID.h:42
CaloHitID::CaloHitID ( const CaloHitID id)

Definition at line 20 of file CaloHitID.cc.

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

20  {
21  theUnitID = id.theUnitID;
22  theTimeSlice = id.theTimeSlice;
23  theTrackID = id.theTrackID;
24  theTimeSliceID = id.theTimeSliceID;
25  theDepth = id.theDepth;
26  timeSliceUnit = id.timeSliceUnit;
27  ignoreTrackID = id.ignoreTrackID;
28 }
bool ignoreTrackID
Definition: CaloHitID.h:43
uint32_t theUnitID
Definition: CaloHitID.h:37
double theTimeSlice
Definition: CaloHitID.h:38
uint16_t theDepth
Definition: CaloHitID.h:41
float timeSliceUnit
Definition: CaloHitID.h:42
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
CaloHitID::~CaloHitID ( )
virtual

Definition at line 42 of file CaloHitID.cc.

42 {}

Member Function Documentation

uint16_t CaloHitID::depth ( void  ) const
inline

Definition at line 26 of file CaloHitID.h.

References theDepth.

Referenced by CaloSD::createNewHit(), CaloG4Hit::getDepth(), operator<(), operator==(), operator>(), and setID().

26 {return theDepth;}
uint16_t theDepth
Definition: CaloHitID.h:41
bool CaloHitID::operator< ( const CaloHitID id) const

Definition at line 68 of file CaloHitID.cc.

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

68  {
69  if (theTrackID != id.trackID()) {
70  return (theTrackID > id.trackID());
71  } else if (theUnitID != id.unitID()) {
72  return (theUnitID > id.unitID());
73  } else if (theDepth != id.depth()) {
74  return (theDepth > id.depth());
75  } else {
76  return (theTimeSliceID > id.timeSliceID());
77  }
78 }
uint32_t theUnitID
Definition: CaloHitID.h:37
uint16_t depth() const
Definition: CaloHitID.h:26
uint16_t theDepth
Definition: CaloHitID.h:41
int timeSliceID() const
Definition: CaloHitID.h:23
int trackID() const
Definition: CaloHitID.h:25
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
uint32_t unitID() const
Definition: CaloHitID.h:22
const CaloHitID & CaloHitID::operator= ( const CaloHitID id)

Definition at line 30 of file CaloHitID.cc.

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

30  {
31  theUnitID = id.theUnitID;
32  theTimeSlice = id.theTimeSlice;
33  theTrackID = id.theTrackID;
34  theTimeSliceID = id.theTimeSliceID;
35  theDepth = id.theDepth;
36  timeSliceUnit = id.timeSliceUnit;
37  ignoreTrackID = id.ignoreTrackID;
38 
39  return *this;
40 }
bool ignoreTrackID
Definition: CaloHitID.h:43
uint32_t theUnitID
Definition: CaloHitID.h:37
double theTimeSlice
Definition: CaloHitID.h:38
uint16_t theDepth
Definition: CaloHitID.h:41
float timeSliceUnit
Definition: CaloHitID.h:42
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
bool CaloHitID::operator== ( const CaloHitID id) const

Definition at line 61 of file CaloHitID.cc.

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

61  {
62  return ((theUnitID == id.unitID()) &&
63  (theTrackID == id.trackID() || ignoreTrackID) &&
64  (theTimeSliceID == id.timeSliceID()) &&
65  (theDepth == id.depth())) ? true : false;
66 }
bool ignoreTrackID
Definition: CaloHitID.h:43
uint32_t theUnitID
Definition: CaloHitID.h:37
uint16_t depth() const
Definition: CaloHitID.h:26
uint16_t theDepth
Definition: CaloHitID.h:41
int timeSliceID() const
Definition: CaloHitID.h:23
int trackID() const
Definition: CaloHitID.h:25
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
uint32_t unitID() const
Definition: CaloHitID.h:22
bool CaloHitID::operator> ( const CaloHitID id) const

Definition at line 80 of file CaloHitID.cc.

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

80  {
81  if (theTrackID != id.trackID()) {
82  return (theTrackID < id.trackID());
83  } else if (theUnitID != id.unitID()) {
84  return (theUnitID < id.unitID());
85  } else if (theDepth != id.depth()) {
86  return (theDepth < id.depth());
87  } else {
88  return (theTimeSliceID < id.timeSliceID());
89  }
90 }
uint32_t theUnitID
Definition: CaloHitID.h:37
uint16_t depth() const
Definition: CaloHitID.h:26
uint16_t theDepth
Definition: CaloHitID.h:41
int timeSliceID() const
Definition: CaloHitID.h:23
int trackID() const
Definition: CaloHitID.h:25
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
uint32_t unitID() const
Definition: CaloHitID.h:22
void CaloHitID::reset ( void  )

Definition at line 53 of file CaloHitID.cc.

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

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

53  {
54  theUnitID = 0;
56  theTrackID =-2;
58  theDepth = 0;
59 }
uint32_t theUnitID
Definition: CaloHitID.h:37
double theTimeSlice
Definition: CaloHitID.h:38
uint16_t theDepth
Definition: CaloHitID.h:41
float timeSliceUnit
Definition: CaloHitID.h:42
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
void CaloHitID::setID ( uint32_t  unitID,
double  timeSlice,
int  trackID,
uint16_t  depth = 0 
)
double CaloHitID::timeSlice ( ) const
inline

Definition at line 24 of file CaloHitID.h.

References theTimeSlice.

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

24 {return theTimeSlice;}
double theTimeSlice
Definition: CaloHitID.h:38
int CaloHitID::timeSliceID ( ) const
inline

Definition at line 23 of file CaloHitID.h.

References theTimeSliceID.

Referenced by CaloSD::createNewHit(), CaloG4Hit::getTimeSliceID(), operator<(), operator==(), and operator>().

23 {return theTimeSliceID;}
int theTimeSliceID
Definition: CaloHitID.h:40
int CaloHitID::trackID ( ) const
inline
uint32_t CaloHitID::unitID ( ) const
inline

Member Data Documentation

bool CaloHitID::ignoreTrackID
private

Definition at line 43 of file CaloHitID.h.

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

uint16_t CaloHitID::theDepth
private

Definition at line 41 of file CaloHitID.h.

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

double CaloHitID::theTimeSlice
private

Definition at line 38 of file CaloHitID.h.

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

int CaloHitID::theTimeSliceID
private

Definition at line 40 of file CaloHitID.h.

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

int CaloHitID::theTrackID
private

Definition at line 39 of file CaloHitID.h.

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

uint32_t CaloHitID::theUnitID
private

Definition at line 37 of file CaloHitID.h.

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

float CaloHitID::timeSliceUnit
private

Definition at line 42 of file CaloHitID.h.

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