CMS 3D CMS Logo

EcalRecHit.cc

Go to the documentation of this file.
00001 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00002 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00003 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00004 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00005 
00006 EcalRecHit::EcalRecHit() : CaloRecHit() {
00007 }
00008 
00009 EcalRecHit::EcalRecHit(const DetId& id, float energy, float time) :
00010   CaloRecHit(id,energy,time) {
00011 }
00012 
00013 bool EcalRecHit::isRecovered() const {
00014         return time() == kRECOVERED;
00015 }
00016 
00017 std::ostream& operator<<(std::ostream& s, const EcalRecHit& hit) {
00018   if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalBarrel) 
00019     return s << EBDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
00020   else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalEndcap) 
00021     return s << EEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
00022   else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalPreshower) 
00023     return s << ESDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
00024   else
00025     return s << "EcalRecHit undefined subdetector" ;
00026 }

Generated on Tue Jun 9 17:30:42 2009 for CMSSW by  doxygen 1.5.4