CMS 3D CMS Logo

Classes | Functions

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/DataFormats/EcalRecHit/interface/EcalRecHit.h File Reference

#include "DataFormats/CaloRecHit/interface/CaloRecHit.h"

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 144 of file EcalRecHit.cc.

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

                                                             {
  if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalBarrel) 
    return s << EBDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalEndcap) 
    return s << EEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalPreshower) 
    return s << ESDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
  else
    return s << "EcalRecHit undefined subdetector" ;
}