CMS 3D CMS Logo

Functions
HGCRecHit.cc File Reference
#include "DataFormats/HGCRecHit/interface/HGCRecHit.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include <cassert>
#include <cmath>

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 120 of file HGCRecHit.cc.

References DetId::det(), CaloRecHit::detid(), CaloRecHit::energy(), DetId::Forward, DetId::Hcal, HcalEndcap, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEF, DetId::subdetId(), and CaloRecHit::time().

120  {
121  if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCEE)
122  return s << HGCalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
123  else if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCHEF)
124  return s << HGCalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
125  else if (hit.detid().det() == DetId::Hcal && hit.detid().subdetId() == HcalEndcap)
126  return s << HcalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
127  else if (hit.detid().det() == DetId::HGCalEE || hit.detid().det() == DetId::HGCalHSi)
128  return s << HGCSiliconDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
129  else if (hit.detid().det() == DetId::HGCalHSc)
130  return s << HGCScintillatorDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
131  else
132  return s << "HGCRecHit undefined subdetector" ;
133 }
constexpr float energy() const
Definition: CaloRecHit.h:31
constexpr const DetId & detid() const
Definition: CaloRecHit.h:35
constexpr float time() const
Definition: CaloRecHit.h:33
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39