CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
34 namespace HcalNominalCoderTemplate {
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
constexpr int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
int presamples() const
access presample information
Definition: CaloSamples.h:36
constexpr const HcalDetId & id() const
Definition: HBHEDataFrame.h:23
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
int size() const
total number of samples in the digi
void process(const CaloSamples &clf, Digi &df, int fCapIdOffset)
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
Definition: HBHEDataFrame.h:29
constexpr int size() const
total number of samples in the digi
Definition: HFDataFrame.h:27
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
Definition: ZDCDataFrame.h:28
const HcalCalibDetId & id() const
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
constexpr int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:27
const HcalZDCDetId & id() const
Definition: ZDCDataFrame.h:22
int size() const
get the size
Definition: CaloSamples.h:24
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
Definition: HFDataFrame.h:29
int size() const
total number of samples in the digi
Definition: ZDCDataFrame.h:26
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
Definition: HODataFrame.h:29
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
constexpr HcalDetId const & id() const
Definition: HODataFrame.h:23
void fC2adc(const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const override
constexpr HcalDetId const & id() const
Definition: HFDataFrame.h:23