CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
HcalTDCReco Class Reference

#include <HcalTDCReco.h>

Public Member Functions

 HcalTDCReco ()
 
void reconstruct (const HcalUpgradeDataFrame &digi, HBHERecHit &recHit) const
 

Detailed Description

Definition at line 7 of file HcalTDCReco.h.

Constructor & Destructor Documentation

HcalTDCReco::HcalTDCReco ( )

Definition at line 5 of file HcalTDCReco.cc.

6 {}

Member Function Documentation

void HcalTDCReco::reconstruct ( const HcalUpgradeDataFrame digi,
HBHERecHit recHit 
) const

Definition at line 8 of file HcalTDCReco.cc.

References CaloRecHit::energy(), i, HBHERecHit::id(), n, pileupCalc::nbins, HcalUpgradeDataFrame::size(), and HcalUpgradeDataFrame::tdc().

Referenced by HcalSimpleRecAlgo::reconstructHBHEUpgrade().

10 {
11  int n = digi.size();
12  double risingTime = -999.;
13  double fallingTime = -999.;
14  int signalBX = 5; // NB: HARDWIRED !!!
15  int nbins = 50; // as in HcalTDCParameters.h (SimCalorimetry/HcalSimAlgos)
16  // start at bunch crossing 3 by default
17  for(int i = 3; i < n; ++i)
18  {
19  unsigned tdc = digi.tdc(i);
20 
21  /*
22  unsigned rising = tdc & 0x7F;
23  unsigned falling = (tdc >> 7) & 0x7F;
24  */
25  // temporary "unpacking" instead, which directly corresponds to
26  // SimCalorimetry/HcalSimAlgos/src/HcalTDC.cc (nibs = 50...)
27  // packedTDC = TDC_RisingEdge + (tdcBins*2) * TDC_FallingEdge;
28  unsigned rising = tdc%100;
29  unsigned falling = tdc/100;
30 
31  // only set the first time, avoiding "special" codes
32  if(risingTime < -998. && rising != 62 && rising != 63) {
33  risingTime = rising*25./nbins + (i-signalBX)*25.;
34  }
35  if(fallingTime < -998. && falling != 62 && falling != 63) {
36  fallingTime = falling*25./nbins + (i-signalBX)*25.;
37  }
38 
39  /*
40  std::cout << " digi.tdc[" << i << "] = " << tdc
41  << " rising = " << rising << " falling = " << falling
42  << " Rt = " << risingTime
43  << " Ft = " << fallingTime
44  << std::endl;
45  */
46  }
47  recHit = HBHERecHit(recHit.id(), recHit.energy(), risingTime, fallingTime);
48 }
int i
Definition: DBlmapReader.cc:9
HcalDetId id() const
Definition: HBHERecHit.h:25
float energy() const
Definition: CaloRecHit.h:19
uint16_t tdc(int iSample=0) const