CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
EcalRecHit.h File Reference
#include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
#include <vector>

Go to the source code of this file.

Classes

class  EcalRecHit
 

Functions

std::ostream & operator<< (std::ostream &s, const EcalRecHit &hit)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const EcalRecHit hit 
)

Definition at line 146 of file EcalRecHit.cc.

References DetId::det(), CaloRecHit::detid(), DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, CaloRecHit::energy(), DetId::subdetId(), and CaloRecHit::time().

146  {
147  if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalBarrel)
148  return s << EBDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
149  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalEndcap)
150  return s << EEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
151  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalPreshower)
152  return s << ESDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
153  else
154  return s << "EcalRecHit undefined subdetector" ;
155 }
const DetId & detid() const
Definition: CaloRecHit.h:20
float time() const
Definition: CaloRecHit.h:19
float energy() const
Definition: CaloRecHit.h:17
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