CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 isFinecaloTrackID () const
 
void markAsFinecaloTrackID (bool flag=true)
 
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)
 
void setTrackID (int trackID)
 
double timeSlice () const
 
int timeSliceID () const
 
int trackID () const
 
uint32_t unitID () const
 
virtual ~CaloHitID ()
 

Private Attributes

bool ignoreTrackID
 
bool isFinecaloTrackID_
 
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  : timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID), isFinecaloTrackID_(false) {
12 }
bool ignoreTrackID
Definition: CaloHitID.h:43
double timeSlice() const
Definition: CaloHitID.h:22
uint16_t depth() const
Definition: CaloHitID.h:24
int trackID() const
Definition: CaloHitID.h:23
float timeSliceUnit
Definition: CaloHitID.h:42
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:41
bool isFinecaloTrackID_
Definition: CaloHitID.h:44
uint32_t unitID() const
Definition: CaloHitID.h:20
CaloHitID::CaloHitID ( float  tSlice = 1,
bool  ignoreTkID = false 
)

Definition at line 14 of file CaloHitID.cc.

References reset().

14 : timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) { reset(); }
bool ignoreTrackID
Definition: CaloHitID.h:43
void reset()
Definition: CaloHitID.cc:49
float timeSliceUnit
Definition: CaloHitID.h:42
CaloHitID::CaloHitID ( const CaloHitID id)

Definition at line 16 of file CaloHitID.cc.

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

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  isFinecaloTrackID_ = id.isFinecaloTrackID_;
25 }
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
bool isFinecaloTrackID_
Definition: CaloHitID.h:44
int theTrackID
Definition: CaloHitID.h:39
CaloHitID::~CaloHitID ( )
virtual

Definition at line 39 of file CaloHitID.cc.

39 {}

Member Function Documentation

uint16_t CaloHitID::depth ( void  ) const
inline
bool CaloHitID::isFinecaloTrackID ( ) const
inline

Definition at line 30 of file CaloHitID.h.

References isFinecaloTrackID_.

Referenced by CaloG4Hit::isFinecaloTrackID(), and CaloSD::shortreprID().

30 { return isFinecaloTrackID_; }
bool isFinecaloTrackID_
Definition: CaloHitID.h:44
void CaloHitID::markAsFinecaloTrackID ( bool  flag = true)
inline

Definition at line 29 of file CaloHitID.h.

References isFinecaloTrackID_.

Referenced by CaloSD::ProcessHits().

29 { isFinecaloTrackID_ = flag; }
bool isFinecaloTrackID_
Definition: CaloHitID.h:44
bool CaloHitID::operator< ( const CaloHitID id) const

Definition at line 65 of file CaloHitID.cc.

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

65  {
66  if (theTrackID != id.trackID()) {
67  return (theTrackID > id.trackID());
68  } else if (theUnitID != id.unitID()) {
69  return (theUnitID > id.unitID());
70  } else if (theDepth != id.depth()) {
71  return (theDepth > id.depth());
72  } else {
73  return (theTimeSliceID > id.timeSliceID());
74  }
75 }
uint32_t theUnitID
Definition: CaloHitID.h:37
uint16_t depth() const
Definition: CaloHitID.h:24
uint16_t theDepth
Definition: CaloHitID.h:41
int timeSliceID() const
Definition: CaloHitID.h:21
int trackID() const
Definition: CaloHitID.h:23
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
uint32_t unitID() const
Definition: CaloHitID.h:20
const CaloHitID & CaloHitID::operator= ( const CaloHitID id)

Definition at line 27 of file CaloHitID.cc.

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

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  isFinecaloTrackID_ = id.isFinecaloTrackID_;
36  return *this;
37 }
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
bool isFinecaloTrackID_
Definition: CaloHitID.h:44
int theTrackID
Definition: CaloHitID.h:39
bool CaloHitID::operator== ( const CaloHitID id) const

Definition at line 58 of file CaloHitID.cc.

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

58  {
59  return ((theUnitID == id.unitID()) && (theTrackID == id.trackID() || ignoreTrackID) &&
60  (theTimeSliceID == id.timeSliceID()) && (theDepth == id.depth()))
61  ? true
62  : false;
63 }
bool ignoreTrackID
Definition: CaloHitID.h:43
uint32_t theUnitID
Definition: CaloHitID.h:37
uint16_t depth() const
Definition: CaloHitID.h:24
uint16_t theDepth
Definition: CaloHitID.h:41
int timeSliceID() const
Definition: CaloHitID.h:21
int trackID() const
Definition: CaloHitID.h:23
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
uint32_t unitID() const
Definition: CaloHitID.h:20
bool CaloHitID::operator> ( const CaloHitID id) const

Definition at line 77 of file CaloHitID.cc.

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

77  {
78  if (theTrackID != id.trackID()) {
79  return (theTrackID < id.trackID());
80  } else if (theUnitID != id.unitID()) {
81  return (theUnitID < id.unitID());
82  } else if (theDepth != id.depth()) {
83  return (theDepth < id.depth());
84  } else {
85  return (theTimeSliceID < id.timeSliceID());
86  }
87 }
uint32_t theUnitID
Definition: CaloHitID.h:37
uint16_t depth() const
Definition: CaloHitID.h:24
uint16_t theDepth
Definition: CaloHitID.h:41
int timeSliceID() const
Definition: CaloHitID.h:21
int trackID() const
Definition: CaloHitID.h:23
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
uint32_t unitID() const
Definition: CaloHitID.h:20
void CaloHitID::reset ( void  )

Definition at line 49 of file CaloHitID.cc.

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

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

49  {
50  theUnitID = 0;
52  theTrackID = -2;
54  theDepth = 0;
55  isFinecaloTrackID_ = false;
56 }
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
bool isFinecaloTrackID_
Definition: CaloHitID.h:44
int theTrackID
Definition: CaloHitID.h:39
void CaloHitID::setID ( uint32_t  unitID,
double  timeSlice,
int  trackID,
uint16_t  depth = 0 
)
void CaloHitID::setTrackID ( int  trackID)
inline

Definition at line 28 of file CaloHitID.h.

References theTrackID, and trackID().

28 { theTrackID = trackID; }
int trackID() const
Definition: CaloHitID.h:23
int theTrackID
Definition: CaloHitID.h:39
double CaloHitID::timeSlice ( ) const
inline

Definition at line 22 of file CaloHitID.h.

References theTimeSlice.

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

22 { return theTimeSlice; }
double theTimeSlice
Definition: CaloHitID.h:38
int CaloHitID::timeSliceID ( ) const
inline
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==().

bool CaloHitID::isFinecaloTrackID_
private

Definition at line 44 of file CaloHitID.h.

Referenced by CaloHitID(), isFinecaloTrackID(), markAsFinecaloTrackID(), operator=(), and reset().

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
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().