CMS 3D CMS Logo

Functions
HGCRecHit.cc File Reference
#include "DataFormats/HGCRecHit/interface/HGCRecHit.h"
#include "DataFormats/ForwardDetId/interface/HGCEEDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCHEDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include <cassert>
#include <math.h>

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 108 of file HGCRecHit.cc.

References DetId::det(), CaloRecHit::detid(), CaloRecHit::energy(), DetId::Forward, HGCEE, HGCHEB, HGCHEF, DetId::subdetId(), and CaloRecHit::time().

108  {
109  if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCEE)
110  return s << HGCalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
111  else if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCHEF)
112  return s << HGCalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
113  else if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCHEB)
114  return s << HGCHEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
115  else
116  return s << "HGCRecHit undefined subdetector" ;
117 }
const DetId & detid() const
Definition: CaloRecHit.h:21
float time() const
Definition: CaloRecHit.h:19
float energy() const
Definition: CaloRecHit.h:17
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35