Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:17

0001 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0002 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0003 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0004 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 #include <cassert>
0007 #include <cmath>
0008 
0009 std::ostream& operator<<(std::ostream& s, const EcalRecHit& hit) {
0010   if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalBarrel)
0011     return s << EBDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
0012   else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalEndcap)
0013     return s << EEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
0014   else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalPreshower)
0015     return s << ESDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
0016   else
0017     return s << "EcalRecHit undefined subdetector";
0018 }