CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFPreRecAlgo Class Reference

#include <HFPreRecAlgo.h>

Public Member Functions

 HFPreRecAlgo (const bool sumAllTS)
 
HFQIE10Info reconstruct (const QIE10DataFrame &digi, int tsToUse, const HcalCoder &coder, const HcalChannelProperties &prop) const
 
 ~HFPreRecAlgo ()
 

Private Attributes

bool sumAllTS_
 

Detailed Description

Definition at line 10 of file HFPreRecAlgo.h.

Constructor & Destructor Documentation

◆ HFPreRecAlgo()

HFPreRecAlgo::HFPreRecAlgo ( const bool  sumAllTS)
inlineexplicit

Definition at line 12 of file HFPreRecAlgo.h.

12 : sumAllTS_(sumAllTS) {}

◆ ~HFPreRecAlgo()

HFPreRecAlgo::~HFPreRecAlgo ( )
inline

Definition at line 14 of file HFPreRecAlgo.h.

14 {}

Member Function Documentation

◆ reconstruct()

HFQIE10Info HFPreRecAlgo::reconstruct ( const QIE10DataFrame digi,
int  tsToUse,
const HcalCoder coder,
const HcalChannelProperties prop 
) const

Definition at line 12 of file HFPreRecAlgo.cc.

15  {
16  // Scrap the trailing edge time for now -- until the front-end
17  // FPGA firmware is finalized and the description of the FPGA
18  // output becomes available
19  static const float timeFalling = HcalSpecialTimes::UNKNOWN_T_NOTDC;
20 
22 
24  coder.adc2fC(digi, cs);
25  const int nRead = cs.size();
26 
27  // Number of raw samples to store in HFQIE10Info
28  const int nStore = std::min(nRead, static_cast<int>(HFQIE10Info::N_RAW_MAX));
29 
30  if (sumAllTS_) {
31  // This branch is intended for use with cosmic runs
32  double charge = 0.0, energy = 0.0;
34 
35  for (int ts = 0; ts < nRead; ++ts) {
36  const QIE10DataFrame::Sample s(digi[ts]);
37  const int capid = s.capid();
38  const HcalPipelinePedestalAndGain& pAndGain(properties.pedsAndGains.at(capid));
39  const float q = cs[ts] - pAndGain.pedestal(false);
40  charge += q;
41  energy += q * pAndGain.gain();
42  if (ts < nStore)
43  raw[ts] = s.wideRaw();
44  }
45 
46  // Timing measurement does not appear to be useful here
47  const float timeRising = HcalSpecialTimes::UNKNOWN_T_NOTDC;
48 
49  // The following HFQIE10Info arguments correspond to SOI
50  // not stored in the raw data. Essentially, only charge
51  // and energy are meaningful.
52  result = HFQIE10Info(digi.id(), charge, energy, timeRising, timeFalling, raw, nStore, nStore);
53  } else if (0 <= tsToUse && tsToUse < nRead) {
54  const QIE10DataFrame::Sample s(digi[tsToUse]);
55  const int capid = s.capid();
56  const HcalPipelinePedestalAndGain& pAndGain(properties.pedsAndGains.at(capid));
57  const float charge = cs[tsToUse] - pAndGain.pedestal(false);
58  const float energy = charge * pAndGain.gain();
59  const float timeRising = HcalSpecialTimes::getTDCTime(s.le_tdc());
60 
61  // Figure out the window in the raw data
62  // that we want to store. This window will
63  // have the width given by "nStore" and
64  // will start at "shift".
65  int shift = 0;
66  if (nRead > static_cast<int>(HFQIE10Info::N_RAW_MAX)) {
67  // Try to center the window on "tsToUse"
68  const int winCenter = nStore / 2;
69  if (tsToUse > winCenter)
70  shift = tsToUse - winCenter;
71  if (shift + nStore > nRead)
72  shift = nRead - nStore;
73  }
74 
75  // Fill an array of raw values
77  for (int i = 0; i < nStore; ++i)
78  raw[i] = digi[i + shift].wideRaw();
79 
80  result = HFQIE10Info(digi.id(), charge, energy, timeRising, timeFalling, raw, nStore, tsToUse - shift);
81  }
82  return result;
83 }

References HcalCoder::adc2fC(), ALCARECOTkAlJpsiMuMu_cff::charge, fwrapper::cs, HCALHighEnergyHPDFilter_cfi::energy, HcalSpecialTimes::getTDCTime(), mps_fire::i, QIE10DataFrame::id(), min(), HFQIE10Info::N_RAW_MAX, HcalChannelProperties::pedsAndGains, submitPVResolutionJobs::q, mps_fire::result, alignCSCRings::s, edm::shift, sumAllTS_, and HcalSpecialTimes::UNKNOWN_T_NOTDC.

Referenced by HFPreReconstructor::fillInfos().

Member Data Documentation

◆ sumAllTS_

bool HFPreRecAlgo::sumAllTS_
private

Definition at line 22 of file HFPreRecAlgo.h.

Referenced by reconstruct().

mps_fire.i
i
Definition: mps_fire.py:428
HcalCoder::adc2fC
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const =0
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
HFQIE10Info
Definition: HFQIE10Info.h:15
min
T min(T a, T b)
Definition: MathUtil.h:58
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HcalSpecialTimes::getTDCTime
constexpr float getTDCTime(const int tdc)
Definition: HcalSpecialTimes.h:55
HcalSpecialTimes::UNKNOWN_T_NOTDC
constexpr float UNKNOWN_T_NOTDC
Definition: HcalSpecialTimes.h:42
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CaloSamples
Definition: CaloSamples.h:14
HFQIE10Info::N_RAW_MAX
static const unsigned N_RAW_MAX
Definition: HFQIE10Info.h:20
HFQIE10Info::raw_type
QIE10DataFrame::Sample::wide_type raw_type
Definition: HFQIE10Info.h:18
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
QIE10DataFrame::Sample
Definition: QIE10DataFrame.h:20
HFPreRecAlgo::sumAllTS_
bool sumAllTS_
Definition: HFPreRecAlgo.h:22
HcalPipelinePedestalAndGain
Definition: HcalPipelinePedestalAndGain.h:5
mps_fire.result
result
Definition: mps_fire.py:311
QIE10DataFrame::id
constexpr edm::DataFrame::id_type id() const
Definition: QIE10DataFrame.h:77