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