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

References adcLSB_, adcnBits_, adcsaturation_, linearize(), linMax_, linnBits_, funct::pow(), tdcLSB_, tdcnBits_, and tdcsaturation_.

4  :
5  linLSB_(conf.getParameter<double>("linLSB")),
6  adcsaturation_(conf.getParameter<double>("adcsaturation")),
7  tdcnBits_(conf.getParameter<uint32_t>("tdcnBits")),
8  tdcOnsetfC_(conf.getParameter<double>("tdcOnsetfC")),
9  adcnBits_(conf.getParameter<uint32_t>("adcnBits")),
10  tdcsaturation_(conf.getParameter<double>("tdcsaturation")),
11  linnBits_(conf.getParameter<uint32_t>("linnBits"))
12 {
15  linMax_ = (0x1<<linnBits_)-1;
16 }
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 20 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_.

Referenced by HGCalVFELinearizationImpl(), and HGCalVFEProcessorSums::run().

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

Definition at line 22 of file HGCalVFELinearizationImpl.h.

References linnBits_.

Member Data Documentation

double HGCalVFELinearizationImpl::adcLSB_
private

Definition at line 25 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::adcnBits_
private

Definition at line 30 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::adcsaturation_
private

Definition at line 27 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::linLSB_
private

Definition at line 26 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

uint32_t HGCalVFELinearizationImpl::linMax_
private

Definition at line 34 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::linnBits_
private

Definition at line 32 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linnBits().

double HGCalVFELinearizationImpl::tdcLSB_
private

Definition at line 33 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl(), and linearize().

uint32_t HGCalVFELinearizationImpl::tdcnBits_
private

Definition at line 28 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().

double HGCalVFELinearizationImpl::tdcOnsetfC_
private

Definition at line 29 of file HGCalVFELinearizationImpl.h.

Referenced by linearize().

double HGCalVFELinearizationImpl::tdcsaturation_
private

Definition at line 31 of file HGCalVFELinearizationImpl.h.

Referenced by HGCalVFELinearizationImpl().