CMS 3D CMS Logo

PCaloHit.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_PCaloHit_H
2 #define SimDataFormats_PCaloHit_H
3 
5 
6 // Persistent Calorimeter hit
7 
8 class PCaloHit {
9 public:
10  PCaloHit(float e = 0., float t = 0., int i = 0, float emFraction = 1., uint16_t d = 0)
11  : myEnergy(e), myEMFraction(emFraction), myTime(t), myItra(i), myDepth(d) {}
12 
13  PCaloHit(unsigned int id, float e = 0., float t = 0., int i = 0, float emFraction = 1., uint16_t d = 0)
14  : myEnergy(e), myEMFraction(emFraction), myTime(t), myItra(i), detId(id), myDepth(d) {}
15  PCaloHit(float eEM, float eHad, float t, int i = 0, uint16_t d = 0);
16  PCaloHit(unsigned int id, float eEM, float eHad, float t, int i = 0, uint16_t d = 0);
17 
18  //Names
19  static const char *name() { return "Hit"; }
20 
21  const char *getName() const { return name(); }
22 
23  //Energy deposit of the Hit
24  double energy() const { return myEnergy; }
25  double energyEM() const { return myEMFraction * myEnergy; }
26  double energyHad() const { return (1. - myEMFraction) * myEnergy; }
27  void setEnergy(double e) { myEnergy = e; }
28 
29  //Time of the deposit
30  double time() const { return myTime; }
31 
32  //Geant track number
33  int geantTrackId() const { return myItra; }
34 
35  //DetId where the Hit is recorded
36  void setID(unsigned int id) { detId = id; }
37  unsigned int id() const { return detId; }
38 
39  //Encoded depth in the detector
40  //for ECAL: # radiation length, 30 == APD
41  //for HCAL:
42  void setDepth(uint16_t depth) { myDepth = depth; }
43  uint16_t depth() const { return myDepth; }
44 
45  //Event Id (for signal/pileup discrimination)
46 
48  EncodedEventId eventId() const { return theEventId; }
49 
50  // new method used by the new transient CF
51  void setTime(float t) { myTime = t; }
52 
53  //Comparisons
54 
55  bool operator<(const PCaloHit &d) const { return myEnergy < d.myEnergy; }
56 
57  //Same Hit (by value)
58  bool operator==(const PCaloHit &d) const { return (myEnergy == d.myEnergy && detId == d.detId); }
59 
60  static const int kEcalDepthIdMask = 0x3;
61  static const int kEcalDepthMask = 0x1FFF;
62  static const int kEcalDepthOffset = 3;
63  static const int kEcalDepthRefz = 0X4;
64 
65 protected:
66  float myEnergy;
67  float myEMFraction;
68  float myTime;
69  int myItra;
70  unsigned int detId;
71  uint16_t myDepth;
73 };
74 
75 #include <iosfwd>
76 std::ostream &operator<<(std::ostream &, const PCaloHit &);
77 
78 #endif // _SimDataFormats_SimCaloHit_PCaloHit_h_
PCaloHit::energy
double energy() const
Definition: PCaloHit.h:24
mps_fire.i
i
Definition: mps_fire.py:355
PCaloHit::setID
void setID(unsigned int id)
Definition: PCaloHit.h:36
PCaloHit::name
static const char * name()
Definition: PCaloHit.h:19
PCaloHit::kEcalDepthOffset
static const int kEcalDepthOffset
Definition: PCaloHit.h:62
PCaloHit::PCaloHit
PCaloHit(unsigned int id, float e=0., float t=0., int i=0, float emFraction=1., uint16_t d=0)
Definition: PCaloHit.h:13
PCaloHit::operator==
bool operator==(const PCaloHit &d) const
Definition: PCaloHit.h:58
PCaloHit::operator<
bool operator<(const PCaloHit &d) const
Definition: PCaloHit.h:55
PCaloHit::myItra
int myItra
Definition: PCaloHit.h:69
PCaloHit::id
unsigned int id() const
Definition: PCaloHit.h:37
PCaloHit::setEnergy
void setEnergy(double e)
Definition: PCaloHit.h:27
PCaloHit::myEMFraction
float myEMFraction
Definition: PCaloHit.h:67
EncodedEventId
Definition: EncodedEventId.h:11
PCaloHit::myDepth
uint16_t myDepth
Definition: PCaloHit.h:71
PCaloHit::setDepth
void setDepth(uint16_t depth)
Definition: PCaloHit.h:42
OrderedSet.t
t
Definition: OrderedSet.py:90
PCaloHit::theEventId
EncodedEventId theEventId
Definition: PCaloHit.h:72
PCaloHit::setEventId
void setEventId(EncodedEventId e)
Definition: PCaloHit.h:47
PCaloHit::myTime
float myTime
Definition: PCaloHit.h:68
operator<<
std::ostream & operator<<(std::ostream &, const PCaloHit &)
Definition: PCaloHit.cc:15
PCaloHit::energyEM
double energyEM() const
Definition: PCaloHit.h:25
PCaloHit::kEcalDepthMask
static const int kEcalDepthMask
Definition: PCaloHit.h:61
PCaloHit
Definition: PCaloHit.h:8
PCaloHit::time
double time() const
Definition: PCaloHit.h:30
PCaloHit::depth
uint16_t depth() const
Definition: PCaloHit.h:43
PCaloHit::energyHad
double energyHad() const
Definition: PCaloHit.h:26
PCaloHit::geantTrackId
int geantTrackId() const
Definition: PCaloHit.h:33
PCaloHit::myEnergy
float myEnergy
Definition: PCaloHit.h:66
ztail.d
d
Definition: ztail.py:151
PCaloHit::eventId
EncodedEventId eventId() const
Definition: PCaloHit.h:48
PCaloHit::PCaloHit
PCaloHit(float e=0., float t=0., int i=0, float emFraction=1., uint16_t d=0)
Definition: PCaloHit.h:10
PCaloHit::getName
const char * getName() const
Definition: PCaloHit.h:21
PCaloHit::detId
unsigned int detId
Definition: PCaloHit.h:70
PCaloHit::kEcalDepthRefz
static const int kEcalDepthRefz
Definition: PCaloHit.h:63
PCaloHit::kEcalDepthIdMask
static const int kEcalDepthIdMask
Definition: PCaloHit.h:60
PCaloHit::setTime
void setTime(float t)
Definition: PCaloHit.h:51
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
EncodedEventId.h