test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalRecHit.cc
Go to the documentation of this file.
6 #include <cassert>
7 #include <math.h>
8 
9 
10 std::ostream& operator<<(std::ostream& s, const EcalRecHit& hit) {
11  if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalBarrel)
12  return s << EBDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
13  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalEndcap)
14  return s << EEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
15  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalPreshower)
16  return s << ESDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
17  else
18  return s << "EcalRecHit undefined subdetector" ;
19 }
20 
21 
const DetId & detid() const
Definition: EcalRecHit.h:71
float time() const
Definition: EcalRecHit.h:70
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
float energy() const
Definition: EcalRecHit.h:68
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35