CMS 3D CMS Logo

Public Member Functions | Private Attributes

CaloHitID Class Reference

#include <CaloHitID.h>

List of all members.

Public Member Functions

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

Definition at line 9 of file CaloHitID.cc.

References setID().

                                                                  :
  timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) {
  setID(unitID, timeSlice, trackID, depth);
}
CaloHitID::CaloHitID ( int  tSlice = 1,
bool  ignoreTkID = false 
)

Definition at line 15 of file CaloHitID.cc.

References reset().

                                                :
  timeSliceUnit(tSlice), ignoreTrackID(ignoreTkID) {
  reset();
}
CaloHitID::CaloHitID ( const CaloHitID id)

Definition at line 20 of file CaloHitID.cc.

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

                                         {
  theUnitID      = id.theUnitID;
  theTimeSlice   = id.theTimeSlice;
  theTrackID     = id.theTrackID;
  theTimeSliceID = id.theTimeSliceID;
  theDepth       = id.theDepth;
  timeSliceUnit  = id.timeSliceUnit;
  ignoreTrackID  = id.ignoreTrackID;
}
CaloHitID::~CaloHitID ( ) [virtual]

Definition at line 42 of file CaloHitID.cc.

{}

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

{return theDepth;}
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().

                                                   {
  if (theTrackID != id.trackID()) {
    return (theTrackID > id.trackID());
  } else if  (theUnitID != id.unitID()) {
    return (theUnitID > id.unitID());
  } else if  (theDepth != id.depth()) {
    return (theDepth > id.depth());
  } else {
    return (theTimeSliceID > id.timeSliceID());
  }
}
const CaloHitID & CaloHitID::operator= ( const CaloHitID id)

Definition at line 30 of file CaloHitID.cc.

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

                                                          {
  theUnitID      = id.theUnitID;
  theTimeSlice   = id.theTimeSlice;
  theTrackID     = id.theTrackID;
  theTimeSliceID = id.theTimeSliceID;
  theDepth       = id.theDepth;
  timeSliceUnit  = id.timeSliceUnit;
  ignoreTrackID  = id.ignoreTrackID;

  return *this;
}
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().

                                                    {
  return ((theUnitID == id.unitID()) && 
          (theTrackID == id.trackID() || ignoreTrackID) &&
          (theTimeSliceID == id.timeSliceID()) && 
          (theDepth == id.depth())) ? true : false;
}
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().

                                                   {
  if (theTrackID != id.trackID()) {
    return (theTrackID < id.trackID());
  } else if  (theUnitID != id.unitID()) {
    return (theUnitID < id.unitID());
  } else if  (theDepth != id.depth()) {
    return (theDepth < id.depth());
  } else {
    return (theTimeSliceID < id.timeSliceID());
  }
}
void CaloHitID::reset ( void  )
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().

{return theTimeSlice;}
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>().

{return theTimeSliceID;}
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().

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

int CaloHitID::timeSliceUnit [private]

Definition at line 42 of file CaloHitID.h.

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