Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:47

0001 #ifndef SimG4CMS_CaloHitID_H
0002 #define SimG4CMS_CaloHitID_H
0003 ///////////////////////////////////////////////////////////////////////////////
0004 // File: CaloHitID.h
0005 // HitID class for storing unique identifier of a Calorimetric Hit
0006 ///////////////////////////////////////////////////////////////////////////////
0007 
0008 #include <cstdint>
0009 #include <iostream>
0010 
0011 class CaloHitID {
0012 public:
0013   CaloHitID(
0014       uint32_t unitID, double timeSlice, int trackID, uint16_t depth = 0, float tSlice = 1, bool ignoreTkID = false);
0015   CaloHitID(float tSlice = 1, bool ignoreTkID = false);
0016   CaloHitID(const CaloHitID&);
0017   const CaloHitID& operator=(const CaloHitID&);
0018   virtual ~CaloHitID();
0019 
0020   uint32_t unitID() const { return theUnitID; }
0021   int timeSliceID() const { return theTimeSliceID; }
0022   double timeSlice() const { return theTimeSlice; }
0023   int trackID() const { return theTrackID; }
0024   uint16_t depth() const { return theDepth; }
0025   void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth = 0);
0026   void reset();
0027 
0028   void setTrackID(int trackID) { theTrackID = trackID; }
0029   void markAsFinecaloTrackID(bool flag = true) { isFinecaloTrackID_ = flag; }
0030   bool isFinecaloTrackID() const { return isFinecaloTrackID_; }
0031 
0032   bool operator==(const CaloHitID&) const;
0033   bool operator<(const CaloHitID&) const;
0034   bool operator>(const CaloHitID&) const;
0035 
0036 private:
0037   uint32_t theUnitID;
0038   double theTimeSlice;
0039   int theTrackID;
0040   int theTimeSliceID;
0041   uint16_t theDepth;
0042   float timeSliceUnit;
0043   bool ignoreTrackID;
0044   bool isFinecaloTrackID_;
0045 };
0046 
0047 std::ostream& operator<<(std::ostream&, const CaloHitID&);
0048 #endif