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_
 
uint32_t adcnBits_
 
double adcsaturation_
 
double linLSB_
 
uint32_t linMax_
 
uint32_t linnBits_
 
double tdcLSB_
 
uint32_t tdcnBits_
 
double tdcOnsetfC_
 
double tdcsaturation_
 

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_, adcnBits_, adcsaturation_, linMax_, linnBits_, funct::pow(), tdcLSB_, tdcnBits_, and tdcsaturation_.

4  : linLSB_(conf.getParameter<double>("linLSB")),
5  adcsaturation_(conf.getParameter<double>("adcsaturation")),
6  tdcnBits_(conf.getParameter<uint32_t>("tdcnBits")),
7  tdcOnsetfC_(conf.getParameter<double>("tdcOnsetfC")),
8  adcnBits_(conf.getParameter<uint32_t>("adcnBits")),
9  tdcsaturation_(conf.getParameter<double>("tdcsaturation")),
10  linnBits_(conf.getParameter<uint32_t>("linnBits")) {
13  linMax_ = (0x1 << linnBits_) - 1;
14 }
T getParameter(std::string const &) const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

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 16 of file HGCalVFELinearizationImpl.cc.

References adcLSB_, CustomPhysics_cfi::amplitude, data, DetId::Forward, DetId::Hcal, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, linLSB_, linMax_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, tdcLSB_, and tdcOnsetfC_.

17  {
18  double amplitude = 0.;
19  uint32_t amplitude_int = 0;
20  const int kIntimeSample = 2;
21 
22  for (const auto& frame : dataframes) { //loop on DIGI
23  unsigned det = frame.id().det();
24  if (det == DetId::Forward || det == DetId::HGCalEE || det == DetId::HGCalHSi) {
25  if (frame[kIntimeSample].mode()) { //TOT mode
26  amplitude = (floor(tdcOnsetfC_ / adcLSB_) + 1.0) * adcLSB_ + double(frame[kIntimeSample].data()) * tdcLSB_;
27  } else { //ADC mode
28  amplitude = double(frame[kIntimeSample].data()) * adcLSB_;
29  }
30 
31  amplitude_int = uint32_t(floor(amplitude / linLSB_ + 0.5));
32  } else if (det == DetId::Hcal || det == DetId::HGCalHSc) {
33  // no linearization here. Take the raw ADC data
34  amplitude_int = frame[kIntimeSample].data();
35  }
36  if (amplitude_int > linMax_)
37  amplitude_int = linMax_;
38 
39  linearized_dataframes.push_back(std::make_pair(frame.id(), amplitude_int));
40  }
41 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
uint32_t HGCalVFELinearizationImpl::linnBits ( ) const
inline

Definition at line 19 of file HGCalVFELinearizationImpl.h.

References linnBits_.

Member Data Documentation

double HGCalVFELinearizationImpl::adcLSB_
private

Definition at line 22 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::adcnBits_
private

Definition at line 27 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::adcsaturation_
private

Definition at line 24 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::linLSB_
private

Definition at line 23 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

uint32_t HGCalVFELinearizationImpl::linMax_
private

Definition at line 31 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::linnBits_
private

Definition at line 29 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linnBits().

double HGCalVFELinearizationImpl::tdcLSB_
private

Definition at line 30 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::tdcnBits_
private

Definition at line 25 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::tdcOnsetfC_
private

Definition at line 26 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

double HGCalVFELinearizationImpl::tdcsaturation_
private

Definition at line 28 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().