CMS 3D CMS Logo

Functions
HcalNominalCoderTemplate Namespace Reference

Functions

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

Function Documentation

◆ process()

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

Definition at line 36 of file HcalNominalCoder.cc.

References hgcalPerformanceValidation::df, TrendClient_cfi::Digi, mps_fire::i, CaloSamples::id(), CaloSamples::presamples(), submitPVResolutionJobs::q, and CaloSamples::size().

Referenced by HcalNominalCoder::fC2adc().

36  {
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  }
int size() const
get the size
Definition: CaloSamples.h:24
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
int presamples() const
access presample information
Definition: CaloSamples.h:36