CMS 3D CMS Logo

CaloGVHit.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_CaloGVHit_h
2 #define SimG4CMS_CaloGVHit_h 1
3 // File: CaloGVHit.h
5 // Date: 10.02 Taken from CMSCaloHit
6 //
7 // Hit class for Calorimeters (Ecal, Hcal, ...)
8 //
9 // One Hit object should be created
10 // -for each new particle entering the calorimeter
11 // -for each detector unit (= crystal or fibre or scintillator layer)
12 // -for each nanosecond of the shower development
13 //
14 // This implies that all hit objects created for a given shower
15 // have the same value for
16 // - Entry (= local coordinates of the entrance point of the particle
17 // in the unit where the shower starts)
18 // - the TrackID (= Identification number of the incident particle)
19 // - the IncidentEnergy (= energy of that particle)
20 //
21 // Modified:
22 //
24 
28 #include <iostream>
29 
30 class CaloGVHit {
31 public:
32  CaloGVHit();
33  ~CaloGVHit();
34  CaloGVHit(const CaloGVHit& right);
35  const CaloGVHit& operator=(const CaloGVHit& right);
36  bool operator==(const CaloGVHit&) { return false; }
37 
38 public:
39  inline double getEM() const { return elem_; }
40  inline void setEM(double e) { elem_ = e; }
41 
42  inline double getHadr() const { return hadr_; }
43  inline void setHadr(double e) { hadr_ = e; }
44 
45  inline int getEventID() const { return eventID_; }
46  inline void setEventID(int id) { eventID_ = id; }
47 
48  inline int getTrackID() const { return hitID_.trackID(); }
49  inline uint32_t getUnitID() const { return hitID_.unitID(); }
50  inline double getTimeSlice() const { return hitID_.timeSlice(); }
51  inline int getTimeSliceID() const { return hitID_.timeSliceID(); }
52  inline uint16_t getDepth() const { return hitID_.depth(); }
53 
54  inline CaloHitID getID() const { return hitID_; }
55  inline void setID(uint32_t i, double d, int j, uint16_t k = 0) { hitID_.setID(i, d, j, k); }
56  inline void setID(const CaloHitID& id) { hitID_ = id; }
57 
58  void addEnergyDeposit(double em, double hd);
59  void addEnergyDeposit(const CaloGVHit& aHit);
60 
61  inline double getEnergyDeposit() const { return (elem_ + hadr_); }
62 
63 private:
64  int eventID_; //Event ID
65  double elem_; //EnergyDeposit of EM particles
66  double hadr_; //EnergyDeposit of HD particles
67  CaloHitID hitID_; //Identification number of the hit given
68  //by primary particle, Cell ID, Time of
69  //the hit
70 };
71 
73 public:
74  inline bool operator()(const CaloGVHit* a, const CaloGVHit* b) {
75  if (a->getEventID() != b->getEventID()) {
76  return (a->getEventID() < b->getEventID());
77  } else if (a->getTrackID() != b->getTrackID()) {
78  return (a->getTrackID() < b->getTrackID());
79  } else if (a->getUnitID() != b->getUnitID()) {
80  return (a->getUnitID() < b->getUnitID());
81  } else if (a->getDepth() != b->getDepth()) {
82  return (a->getDepth() < b->getDepth());
83  } else {
84  return (a->getTimeSliceID() < b->getTimeSliceID());
85  }
86  }
87 };
88 
90 public:
91  inline bool operator()(const CaloGVHit* a, const CaloGVHit* b) {
92  return (a->getEventID() == b->getEventID() && a->getTrackID() == b->getTrackID() &&
93  a->getUnitID() == b->getUnitID() && a->getDepth() == b->getDepth() &&
94  a->getTimeSliceID() == b->getTimeSliceID());
95  }
96 };
97 
98 std::ostream& operator<<(std::ostream&, const CaloGVHit&);
99 
100 #endif
CaloGVHit::getID
CaloHitID getID() const
Definition: CaloGVHit.h:54
mps_fire.i
i
Definition: mps_fire.py:428
CaloGVHit::operator==
bool operator==(const CaloGVHit &)
Definition: CaloGVHit.h:36
MessageLogger.h
CaloHitID::depth
uint16_t depth() const
Definition: CaloHitID.h:24
CaloGVHit::setEventID
void setEventID(int id)
Definition: CaloGVHit.h:46
CaloGVHit
Definition: CaloGVHit.h:30
CaloHitID::trackID
int trackID() const
Definition: CaloHitID.h:23
CaloGVHit::getDepth
uint16_t getDepth() const
Definition: CaloGVHit.h:52
CaloGVHit::setID
void setID(const CaloHitID &id)
Definition: CaloGVHit.h:56
CaloGVHit::getTrackID
int getTrackID() const
Definition: CaloGVHit.h:48
CaloHitID.h
operator<<
std::ostream & operator<<(std::ostream &, const CaloGVHit &)
Definition: CaloGVHit.cc:36
CaloHitID::unitID
uint32_t unitID() const
Definition: CaloHitID.h:20
CaloGVHit::setID
void setID(uint32_t i, double d, int j, uint16_t k=0)
Definition: CaloGVHit.h:55
CaloGVHit::~CaloGVHit
~CaloGVHit()
Definition: CaloGVHit.cc:12
CaloHitID::setID
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:40
CaloGVHitEqual
Definition: CaloGVHit.h:89
CaloGVHitEqual::operator()
bool operator()(const CaloGVHit *a, const CaloGVHit *b)
Definition: CaloGVHit.h:91
CaloHitID::timeSlice
double timeSlice() const
Definition: CaloHitID.h:22
CaloGVHit::CaloGVHit
CaloGVHit()
Definition: CaloGVHit.cc:6
CaloGVHit::hadr_
double hadr_
Definition: CaloGVHit.h:66
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CaloGVHit::getTimeSlice
double getTimeSlice() const
Definition: CaloGVHit.h:50
b
double b
Definition: hdecay.h:118
CaloGVHitLess::operator()
bool operator()(const CaloGVHit *a, const CaloGVHit *b)
Definition: CaloGVHit.h:74
CaloGVHit::setHadr
void setHadr(double e)
Definition: CaloGVHit.h:43
a
double a
Definition: hdecay.h:119
CaloGVHit::getTimeSliceID
int getTimeSliceID() const
Definition: CaloGVHit.h:51
CaloGVHitLess
Definition: CaloGVHit.h:72
CaloGVHit::eventID_
int eventID_
Definition: CaloGVHit.h:64
CaloHitID::timeSliceID
int timeSliceID() const
Definition: CaloHitID.h:21
CaloGVHit::getUnitID
uint32_t getUnitID() const
Definition: CaloGVHit.h:49
CaloGVHit::addEnergyDeposit
void addEnergyDeposit(double em, double hd)
Definition: CaloGVHit.cc:29
CaloGVHit::getHadr
double getHadr() const
Definition: CaloGVHit.h:42
CaloGVHit::setEM
void setEM(double e)
Definition: CaloGVHit.h:40
CaloGVHit::getEventID
int getEventID() const
Definition: CaloGVHit.h:45
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CaloGVHit::getEM
double getEM() const
Definition: CaloGVHit.h:39
CaloHitID
Definition: CaloHitID.h:11
Point3D.h
CaloGVHit::getEnergyDeposit
double getEnergyDeposit() const
Definition: CaloGVHit.h:61
CaloGVHit::elem_
double elem_
Definition: CaloGVHit.h:65
CaloGVHit::hitID_
CaloHitID hitID_
Definition: CaloGVHit.h:67
ztail.d
d
Definition: ztail.py:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CaloGVHit::operator=
const CaloGVHit & operator=(const CaloGVHit &right)
Definition: CaloGVHit.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37