CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DataFormats/EcalRecHit/src/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"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <cassert>
#include <math.h>
#include <iostream>

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 194 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" ;
}