CMS 3D CMS Logo

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

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

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

◆ CaloHitID() [2/3]

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() [3/3]

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::~CaloHitID ( )
virtual

Definition at line 39 of file CaloHitID.cc.

39 {}

Member Function Documentation

◆ depth()

uint16_t CaloHitID::depth ( void  ) const
inline

Definition at line 24 of file CaloHitID.h.

References theDepth.

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

24 { return theDepth; }
uint16_t theDepth
Definition: CaloHitID.h:41

◆ isFinecaloTrackID()

bool CaloHitID::isFinecaloTrackID ( ) const
inline

Definition at line 30 of file CaloHitID.h.

References isFinecaloTrackID_.

Referenced by CaloG4Hit::isFinecaloTrackID().

30 { return isFinecaloTrackID_; }
bool isFinecaloTrackID_
Definition: CaloHitID.h:44

◆ markAsFinecaloTrackID()

void CaloHitID::markAsFinecaloTrackID ( bool  flag = true)
inline

Definition at line 29 of file CaloHitID.h.

References RemoveAddSevLevel::flag, and isFinecaloTrackID_.

Referenced by CaloSD::ProcessHits().

◆ operator<()

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
int timeSliceID() const
Definition: CaloHitID.h:21
uint16_t theDepth
Definition: CaloHitID.h:41
uint32_t unitID() const
Definition: CaloHitID.h:20
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
int trackID() const
Definition: CaloHitID.h:23
uint16_t depth() const
Definition: CaloHitID.h:24

◆ operator=()

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

◆ operator==()

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

Definition at line 58 of file CaloHitID.cc.

References depth(), ignoreTrackID, theDepth, theTimeSliceID, theTrackID, theUnitID, timeSliceID(), trackID(), funct::true, 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
int timeSliceID() const
Definition: CaloHitID.h:21
uint16_t theDepth
Definition: CaloHitID.h:41
uint32_t unitID() const
Definition: CaloHitID.h:20
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
int trackID() const
Definition: CaloHitID.h:23
uint16_t depth() const
Definition: CaloHitID.h:24

◆ operator>()

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
int timeSliceID() const
Definition: CaloHitID.h:21
uint16_t theDepth
Definition: CaloHitID.h:41
uint32_t unitID() const
Definition: CaloHitID.h:20
int theTimeSliceID
Definition: CaloHitID.h:40
int theTrackID
Definition: CaloHitID.h:39
int trackID() const
Definition: CaloHitID.h:23
uint16_t depth() const
Definition: CaloHitID.h:24

◆ reset()

void CaloHitID::reset ( void  )

Definition at line 49 of file CaloHitID.cc.

References createfilelist::int, 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

◆ 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.

References theTrackID, and trackID().

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

◆ timeSlice()

double CaloHitID::timeSlice ( ) const
inline

Definition at line 22 of file CaloHitID.h.

References theTimeSlice.

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

22 { return theTimeSlice; }
double theTimeSlice
Definition: CaloHitID.h:38

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

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

◆ isFinecaloTrackID_

bool CaloHitID::isFinecaloTrackID_
private

Definition at line 44 of file CaloHitID.h.

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

◆ theDepth

uint16_t CaloHitID::theDepth
private

Definition at line 41 of file CaloHitID.h.

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

◆ theTimeSlice

double CaloHitID::theTimeSlice
private

Definition at line 38 of file CaloHitID.h.

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

◆ theTimeSliceID

int CaloHitID::theTimeSliceID
private

Definition at line 40 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 37 of file CaloHitID.h.

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

◆ timeSliceUnit

float CaloHitID::timeSliceUnit
private

Definition at line 42 of file CaloHitID.h.

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