Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:31:13

0001 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
0002 #include <iostream>
0003 
0004 PCaloHit::PCaloHit(float eEM, float eHad, float t, int i, uint16_t d) : myTime(t), myItra(i), myDepth(d) {
0005   myEnergy = eEM + eHad;
0006   myEMFraction = (myEnergy <= 0.f ? 1.f : eEM / myEnergy);
0007 }
0008 
0009 PCaloHit::PCaloHit(unsigned int id, float eEM, float eHad, float t, int i, uint16_t d)
0010     : myTime(t), myItra(i), detId(id), myDepth(d) {
0011   myEnergy = eEM + eHad;
0012   myEMFraction = (myEnergy <= 0.f ? 1.f : eEM / myEnergy);
0013 }
0014 
0015 std::ostream& operator<<(std::ostream& o, const PCaloHit& hit) {
0016   o << "0x" << std::hex << hit.id() << std::dec << ": Energy (EM) " << hit.energyEM() << " GeV "
0017     << ": Energy (Had) " << hit.energyHad() << " GeV "
0018     << " Tof " << hit.time() << " ns "
0019     << " Geant track #" << hit.geantTrackId() << " Encoded depth " << hit.depth();
0020 
0021   return o;
0022 }