CMS 3D CMS Logo

Functions
CastorNominalCoderTemplate Namespace Reference

Functions

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

Function Documentation

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

Definition at line 12 of file CastorNominalCoder.cc.

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

Referenced by CastorNominalCoder::fC2adc().

12  {
13  df = Digi(clf.id());
14  df.setSize(clf.size());
15  df.setPresamples(clf.presamples());
16  for (int i = 0; i < clf.size(); i++) {
17  int capId = (fCapIdOffset + i) % 4;
18  for (int q = 1; q < 128; q++) {
19  df.setSample(i, HcalQIESample(q, capId, 0, 0));
20  if (df[i].nominal_fC() > clf[i]) {
21  df.setSample(i, HcalQIESample(q - 1, capId, 0, 0));
22  break;
23  }
24  }
25  }
26  }
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:40
int size() const
get the size
Definition: CaloSamples.h:24
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21