CMS 3D CMS Logo

Functions
HcalNominalCoderTemplate Namespace Reference

Functions

template<class Digi >
void process (const CaloSamples &clf, Digi &df, int fCapIdOffset)
 

Function Documentation

template<class Digi >
void HcalNominalCoderTemplate::process ( const CaloSamples clf,
Digi &  df,
int  fCapIdOffset 
)

Definition at line 31 of file HcalNominalCoder.cc.

References i, CaloSamples::id(), CaloSamples::presamples(), lumiQueryAPI::q, and CaloSamples::size().

Referenced by HcalNominalCoder::fC2adc().

31  {
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  }
int i
Definition: DBlmapReader.cc:9
int presamples() const
access presample information
Definition: CaloSamples.h:36
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
Definition: GenericDigi.h:30
int size() const
get the size
Definition: CaloSamples.h:24
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21