CMS 3D CMS Logo

Functions
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 <cmath>

Go to the source code of this file.

Functions

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

Function Documentation

◆ operator<<()

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

Definition at line 9 of file EcalRecHit.cc.

References DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, and alignCSCRings::s.

9  {
10  if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalBarrel)
11  return s << EBDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
12  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalEndcap)
13  return s << EEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
14  else if (hit.detid().det() == DetId::Ecal && hit.detid().subdetId() == EcalPreshower)
15  return s << ESDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
16  else
17  return s << "EcalRecHit undefined subdetector";
18 }