CMS 3D CMS Logo

PCaloHit.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 PCaloHit::PCaloHit(float eEM, float eHad, float t, int i, uint16_t d) : myTime(t), myItra(i), myDepth(d) {
5  myEnergy = eEM + eHad;
6  myEMFraction = (myEnergy <= 0.f ? 1.f : eEM / myEnergy);
7 }
8 
9 PCaloHit::PCaloHit(unsigned int id, float eEM, float eHad, float t, int i, uint16_t d)
10  : myTime(t), myItra(i), detId(id), myDepth(d) {
11  myEnergy = eEM + eHad;
12  myEMFraction = (myEnergy <= 0.f ? 1.f : eEM / myEnergy);
13 }
14 
15 std::ostream& operator<<(std::ostream& o, const PCaloHit& hit) {
16  o << "0x" << std::hex << hit.id() << std::dec << ": Energy (EM) " << hit.energyEM() << " GeV "
17  << ": Energy (Had) " << hit.energyHad() << " GeV "
18  << " Tof " << hit.time() << " ns "
19  << " Geant track #" << hit.geantTrackId() << " Encoded depth " << hit.depth();
20 
21  return o;
22 }
float myEMFraction
Definition: PCaloHit.h:67
d
Definition: ztail.py:151
unsigned int id
PCaloHit(float e=0., float t=0., int i=0, float emFraction=1., uint16_t d=0)
Definition: PCaloHit.h:10
float myEnergy
Definition: PCaloHit.h:66
std::ostream & operator<<(std::ostream &o, const PCaloHit &hit)
Definition: PCaloHit.cc:15