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 }
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 }
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 }
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
int size() const
get the size
Definition: CaloSamples.h:24
void process(const CaloSamples &clf, Digi &df, int fCapIdOffset)
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
int presamples() const
access presample information
Definition: CaloSamples.h:36
void fC2adc(const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const override