CMS 3D CMS Logo

HcalNominalCoder.cc
Go to the documentation of this file.
2 
4  lf = CaloSamples(df.id(), df.size());
5  for (int i = 0; i < df.size(); i++)
6  lf[i] = df[i].nominal_fC();
7  lf.setPresamples(df.presamples());
8 }
9 void HcalNominalCoder::adc2fC(const HODataFrame& df, CaloSamples& lf) const {
10  lf = CaloSamples(df.id(), df.size());
11  for (int i = 0; i < df.size(); i++)
12  lf[i] = df[i].nominal_fC();
13  lf.setPresamples(df.presamples());
14 }
15 void HcalNominalCoder::adc2fC(const HFDataFrame& df, CaloSamples& lf) const {
16  lf = CaloSamples(df.id(), df.size());
17  for (int i = 0; i < df.size(); i++)
18  lf[i] = df[i].nominal_fC();
19  lf.setPresamples(df.presamples());
20 }
22  lf = CaloSamples(df.id(), df.size());
23  for (int i = 0; i < df.size(); i++)
24  lf[i] = df[i].nominal_fC();
25  lf.setPresamples(df.presamples());
26 }
28  lf = CaloSamples(df.id(), df.size());
29  for (int i = 0; i < df.size(); i++)
30  lf[i] = df[i].nominal_fC();
31  lf.setPresamples(df.presamples());
32 }
33 
35  template <class Digi>
36  void process(const CaloSamples& clf, Digi& df, int fCapIdOffset) {
37  df = Digi(clf.id());
38  df.setSize(clf.size());
39  df.setPresamples(clf.presamples());
40  for (int i = 0; i < clf.size(); i++) {
41  int capId = (fCapIdOffset + i) % 4;
42  for (int q = 1; q < 128; q++) {
43  df.setSample(i, HcalQIESample(q, capId, 0, 0));
44  if (df[i].nominal_fC() > clf[i]) {
45  df.setSample(i, HcalQIESample(q - 1, capId, 0, 0));
46  break;
47  }
48  }
49  }
50  }
51 } // namespace HcalNominalCoderTemplate
52 
53 void HcalNominalCoder::fC2adc(const CaloSamples& clf, HBHEDataFrame& df, int fCapIdOffset) const {
54  HcalNominalCoderTemplate::process(clf, df, fCapIdOffset);
55 }
56 void HcalNominalCoder::fC2adc(const CaloSamples& clf, HFDataFrame& df, int fCapIdOffset) const {
57  HcalNominalCoderTemplate::process(clf, df, fCapIdOffset);
58 }
59 void HcalNominalCoder::fC2adc(const CaloSamples& clf, HODataFrame& df, int fCapIdOffset) const {
60  HcalNominalCoderTemplate::process(clf, df, fCapIdOffset);
61 }
62 void HcalNominalCoder::fC2adc(const CaloSamples& clf, ZDCDataFrame& df, int fCapIdOffset) const {
63  HcalNominalCoderTemplate::process(clf, df, fCapIdOffset);
64 }
65 void HcalNominalCoder::fC2adc(const CaloSamples& clf, HcalCalibDataFrame& df, int fCapIdOffset) const {
66  HcalNominalCoderTemplate::process(clf, df, fCapIdOffset);
67 }
mps_fire.i
i
Definition: mps_fire.py:355
HFDataFrame::id
constexpr HcalDetId const & id() const
Definition: HFDataFrame.h:23
CaloSamples::size
int size() const
get the size
Definition: CaloSamples.h:24
data-class-funcs.q
q
Definition: data-class-funcs.py:169
TrendClient_cfi.Digi
Digi
Definition: TrendClient_cfi.py:7
HcalQIESample
Definition: HcalQIESample.h:32
HFDataFrame::presamples
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware)
Definition: HFDataFrame.h:29
HcalNominalCoder.h
ZDCDataFrame::id
const HcalZDCDetId & id() const
Definition: ZDCDataFrame.h:22
ZDCDataFrame::size
int size() const
total number of samples in the digi
Definition: ZDCDataFrame.h:26
HcalNominalCoder::adc2fC
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
Definition: HcalNominalCoder.cc:3
ZDCDataFrame
Definition: ZDCDataFrame.h:15
HBHEDataFrame
Definition: HBHEDataFrame.h:14
HcalCalibDataFrame
Definition: HcalCalibDataFrame.h:15
CaloSamples::setPresamples
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
HFDataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HFDataFrame.h:27
HcalNominalCoder::fC2adc
void fC2adc(const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const override
Definition: HcalNominalCoder.cc:53
ZDCDataFrame::presamples
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware)
Definition: ZDCDataFrame.h:28
HcalCalibDataFrame::presamples
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware)
Definition: HcalCalibDataFrame.h:28
CaloSamples::id
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
HFDataFrame
Definition: HFDataFrame.h:14
HODataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
CaloSamples
Definition: CaloSamples.h:14
HBHEDataFrame::id
constexpr const HcalDetId & id() const
Definition: HBHEDataFrame.h:23
HODataFrame::presamples
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware)
Definition: HODataFrame.h:29
HBHEDataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:27
CaloSamples::presamples
int presamples() const
access presample information
Definition: CaloSamples.h:36
HODataFrame
Definition: HODataFrame.h:14
HcalNominalCoderTemplate
Definition: HcalNominalCoder.cc:34
HcalCalibDataFrame::size
int size() const
total number of samples in the digi
Definition: HcalCalibDataFrame.h:26
HODataFrame::id
constexpr HcalDetId const & id() const
Definition: HODataFrame.h:23
HcalNominalCoderTemplate::process
void process(const CaloSamples &clf, Digi &df, int fCapIdOffset)
Definition: HcalNominalCoder.cc:36
HcalCalibDataFrame::id
const HcalCalibDetId & id() const
Definition: HcalCalibDataFrame.h:22
HBHEDataFrame::presamples
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware)
Definition: HBHEDataFrame.h:29