CMS 3D CMS Logo

HBHERecHit.cc
Go to the documentation of this file.
4 
6  : CaloRecHit(),
7  chiSquared_(-1),
8  rawEnergy_(-1.0e21),
9  auxEnergy_(-1.0e21),
10  auxHBHE_(0),
11  auxPhase1_(0)
12 {
13 }
14 
15 HBHERecHit::HBHERecHit(const HcalDetId& id, float energy, float timeRising, float timeFalling)
16  : CaloRecHit(id,energy,timeRising),
17  timeFalling_(timeFalling),
18  chiSquared_(-1),
19  rawEnergy_(-1.0e21),
20  auxEnergy_(-1.0e21),
21  auxHBHE_(0),
22  auxPhase1_(0)
23 {
24 }
25 
26 std::ostream& operator<<(std::ostream& s, const HBHERecHit& hit) {
27  s << hit.id() << ": " << hit.energy() << " GeV";
28  if (hit.eraw() > -0.9e21) {
29  s << ", eraw=" << hit.eraw() << " GeV";
30  }
31  if (hit.eaux() > -0.9e21) {
32  s << ", eaux=" << hit.eaux() << " GeV";
33  }
34  if(hit.time() > -998) {
35  s << ", t= " << hit.time() << " to " << hit.timeFalling() << " ns";
36  }
37  return s;
38 }
39 
41 {
43 }
44 
45 void HBHERecHit::getMergedIds(std::vector<HcalDetId>* ids) const
46 {
47  if (ids)
48  {
49  ids->clear();
51  {
52  const unsigned nMerged = CaloRecHitAuxSetter::getField(
55  ids->reserve(nMerged);
56  const HcalDetId myId(id());
57  for (unsigned i=0; i<nMerged; ++i)
58  {
59  const unsigned depth = CaloRecHitAuxSetter::getField(auxHBHE_, 0xf, i*4);
60  ids->emplace_back(myId.subdet(), myId.ieta(), myId.iphi(), depth);
61  }
62  }
63  }
64 }
65 
66 
69  const HcalDetId myId(id());
70  return HcalDetId(myId.subdet(), myId.ieta(), myId.iphi(), auxHBHE_ & 0xf);
71  } else {
72  return id();
73  }
74 }
static const unsigned MASK_NSAMPLES
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
float auxEnergy_
Definition: HBHERecHit.h:56
HcalDetId id() const
get the id
Definition: HBHERecHit.h:25
float chiSquared_
Definition: HBHERecHit.h:54
uint32_t auxPhase1_
Definition: HBHERecHit.h:58
HcalDetId idFront() const
Definition: HBHERecHit.cc:67
float time() const
Definition: CaloRecHit.h:19
static const unsigned OFF_NSAMPLES
float energy() const
Definition: CaloRecHit.h:17
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
bool isMerged() const
Definition: HBHERecHit.cc:40
float timeFalling_
Definition: HBHERecHit.h:53
float timeFalling() const
get the hit falling time
Definition: HBHERecHit.h:23
uint32_t auxHBHE_
Definition: HBHERecHit.h:57
std::ostream & operator<<(std::ostream &s, const HBHERecHit &hit)
Definition: HBHERecHit.cc:26
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
void getMergedIds(std::vector< HcalDetId > *ids) const
Definition: HBHERecHit.cc:45
static const unsigned OFF_COMBINED
float eraw() const
Definition: HBHERecHit.h:31
float eaux() const
Definition: HBHERecHit.h:34
float rawEnergy_
Definition: HBHERecHit.h:55