CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalVFELinearizationImpl Class Reference

#include <HGCalVFELinearizationImpl.h>

Public Member Functions

 HGCalVFELinearizationImpl (const edm::ParameterSet &conf)
 
void linearize (const std::vector< HGCDataFrame< DetId, HGCSample >> &, std::vector< std::pair< DetId, uint32_t >> &)
 
uint32_t linnBits () const
 

Private Attributes

double adcLSB_sc_
 
double adcLSB_si_
 
uint32_t adcnBits_sc_
 
uint32_t adcnBits_si_
 
double adcsaturation_sc_
 
double adcsaturation_si_
 
double linLSB_sc_
 
double linLSB_si_
 
uint32_t linMax_
 
uint32_t linnBits_
 
double tdcLSB_sc_
 
double tdcLSB_si_
 
uint32_t tdcnBits_sc_
 
uint32_t tdcnBits_si_
 
double tdcOnset_sc_
 
double tdcOnset_si_
 
double tdcsaturation_sc_
 
double tdcsaturation_si_
 

Detailed Description

Definition at line 12 of file HGCalVFELinearizationImpl.h.

Constructor & Destructor Documentation

HGCalVFELinearizationImpl::HGCalVFELinearizationImpl ( const edm::ParameterSet conf)

Definition at line 3 of file HGCalVFELinearizationImpl.cc.

References adcLSB_sc_, adcLSB_si_, adcnBits_sc_, adcnBits_si_, adcsaturation_sc_, adcsaturation_si_, linMax_, linnBits_, funct::pow(), tdcLSB_sc_, tdcLSB_si_, tdcnBits_sc_, tdcnBits_si_, tdcsaturation_sc_, and tdcsaturation_si_.

4  : linLSB_si_(conf.getParameter<double>("linLSB_si")),
5  adcsaturation_si_(conf.getParameter<double>("adcsaturation_si")),
6  tdcnBits_si_(conf.getParameter<uint32_t>("tdcnBits_si")),
7  tdcOnset_si_(conf.getParameter<double>("tdcOnset_si")),
8  adcnBits_si_(conf.getParameter<uint32_t>("adcnBits_si")),
9  tdcsaturation_si_(conf.getParameter<double>("tdcsaturation_si")),
10  linLSB_sc_(conf.getParameter<double>("linLSB_sc")),
11  adcsaturation_sc_(conf.getParameter<double>("adcsaturation_sc")),
12  tdcnBits_sc_(conf.getParameter<uint32_t>("tdcnBits_sc")),
13  tdcOnset_sc_(conf.getParameter<double>("tdcOnset_sc")),
14  adcnBits_sc_(conf.getParameter<uint32_t>("adcnBits_sc")),
15  tdcsaturation_sc_(conf.getParameter<double>("tdcsaturation_sc")),
16  linnBits_(conf.getParameter<uint32_t>("linnBits")) {
21  linMax_ = (0x1 << linnBits_) - 1;
22 }
T getParameter(std::string const &) const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30

Member Function Documentation

void HGCalVFELinearizationImpl::linearize ( const std::vector< HGCDataFrame< DetId, HGCSample >> &  dataframes,
std::vector< std::pair< DetId, uint32_t >> &  linearized_dataframes 
)

Definition at line 24 of file HGCalVFELinearizationImpl.cc.

References adcLSB_sc_, adcLSB_si_, CustomPhysics_cfi::amplitude, data, DetId::Forward, amptDefault_cfi::frame, DetId::Hcal, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, linLSB_sc_, linLSB_si_, linMax_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, tdcLSB_sc_, tdcLSB_si_, HGCalUncalibRecHit_cfi::tdcOnset, tdcOnset_sc_, and tdcOnset_si_.

25  {
26  double amplitude = 0.;
27  uint32_t amplitude_int = 0;
28  const int kIntimeSample = 2;
29 
30  for (const auto& frame : dataframes) { //loop on DIGI
31  unsigned det = frame.id().det();
32  double adcLSB = 0.;
33  double tdcLSB = 0.;
34  double tdcOnset = 0.;
35  double linLSB = 0.;
36  if (det == DetId::Forward || det == DetId::HGCalEE || det == DetId::HGCalHSi) {
37  adcLSB = adcLSB_si_;
38  tdcLSB = tdcLSB_si_;
39  tdcOnset = tdcOnset_si_;
40  linLSB = linLSB_si_;
41  } else if (det == DetId::Hcal || det == DetId::HGCalHSc) {
42  adcLSB = adcLSB_sc_;
43  tdcLSB = tdcLSB_sc_;
44  tdcOnset = tdcOnset_sc_;
45  linLSB = linLSB_sc_;
46  }
47  if (frame[kIntimeSample].mode()) { //TOT mode
48  amplitude = (floor(tdcOnset / adcLSB) + 1.0) * adcLSB + double(frame[kIntimeSample].data()) * tdcLSB;
49  } else { //ADC mode
50  amplitude = double(frame[kIntimeSample].data()) * adcLSB;
51  }
52 
53  amplitude_int = uint32_t(floor(amplitude / linLSB + 0.5));
54  if (amplitude_int > linMax_)
55  amplitude_int = linMax_;
56 
57  linearized_dataframes.push_back(std::make_pair(frame.id(), amplitude_int));
58  }
59 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint32_t HGCalVFELinearizationImpl::linnBits ( ) const
inline

Definition at line 19 of file HGCalVFELinearizationImpl.h.

References linnBits_.

Member Data Documentation

double HGCalVFELinearizationImpl::adcLSB_sc_
private

Definition at line 31 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

double HGCalVFELinearizationImpl::adcLSB_si_
private

Definition at line 22 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::adcnBits_sc_
private

Definition at line 36 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

uint32_t HGCalVFELinearizationImpl::adcnBits_si_
private

Definition at line 27 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::adcsaturation_sc_
private

Definition at line 33 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::adcsaturation_si_
private

Definition at line 24 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::linLSB_sc_
private

Definition at line 32 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

double HGCalVFELinearizationImpl::linLSB_si_
private

Definition at line 23 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

uint32_t HGCalVFELinearizationImpl::linMax_
private

Definition at line 40 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::linnBits_
private

Definition at line 41 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linnBits().

double HGCalVFELinearizationImpl::tdcLSB_sc_
private

Definition at line 38 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

double HGCalVFELinearizationImpl::tdcLSB_si_
private

Definition at line 29 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::tdcnBits_sc_
private

Definition at line 34 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

uint32_t HGCalVFELinearizationImpl::tdcnBits_si_
private

Definition at line 25 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::tdcOnset_sc_
private

Definition at line 35 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

double HGCalVFELinearizationImpl::tdcOnset_si_
private

Definition at line 26 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

double HGCalVFELinearizationImpl::tdcsaturation_sc_
private

Definition at line 37 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::tdcsaturation_si_
private

Definition at line 28 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().