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

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

119  {
120  if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCEE)
121  return s << HGCalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
122  else if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCHEF)
123  return s << HGCalDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
124  else if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == HGCHEB)
125  return s << HGCHEDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
126  else
127  return s << "HGCRecHit undefined subdetector" ;
128 }
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