CMS 3D CMS Logo

EcalRecHit.cc File Reference

#include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "DataFormats/EcalDetId/interface/ESDetId.h"

Go to the source code of this file.

Functions

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


Function Documentation

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

Definition at line 17 of file EcalRecHit.cc.

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

00017                                                              {
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:52:02 2009 for CMSSW by  doxygen 1.5.4