CMS 3D CMS Logo

Functions
HGCalUncalibRecHitWorkerWeights.cc File Reference
#include "RecoLocalCalo/HGCalRecProducers/plugins/HGCalUncalibRecHitWorkerWeights.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "RecoLocalCalo/HGCalRecProducers/interface/HGCalUncalibRecHitWorkerFactory.h"

Go to the source code of this file.

Functions

template<typename DET >
void configureIt (const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame< DET, HGCSample >> &maker)
 
static const HGCalUncalibRecHitWorkerFactory::PMaker< HGCalUncalibRecHitWorkerWeightss_maker__LINE__ ("HGCalUncalibRecHitWorkerWeights")
 

Function Documentation

template<typename DET >
void configureIt ( const edm::ParameterSet conf,
HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame< DET, HGCSample >> &  maker 
)

Definition at line 10 of file HGCalUncalibRecHitWorkerWeights.cc.

References HGCalUncalibRecHit_cfi::adcNbits, HGCalUncalibRecHit_cfi::adcSaturation, constexpr, edm::ParameterSet::exists(), HGCalUncalibRecHit_cfi::fCPerMIP, edm::ParameterSet::getParameter(), HGCalUncalibRecHit_cfi::isSiFE, funct::pow(), HGCalUncalibRecHit_cfi::tdcNbits, HGCalUncalibRecHit_cfi::tdcOnset, HGCalUncalibRecHit_cfi::tdcSaturation, and HGCalUncalibRecHit_cfi::toaLSB_ns.

Referenced by HGCalUncalibRecHitWorkerWeights::HGCalUncalibRecHitWorkerWeights().

11  {
12  constexpr char isSiFE[] = "isSiFE";
13  constexpr char adcNbits[] = "adcNbits";
14  constexpr char adcSaturation[] = "adcSaturation";
15  constexpr char tdcNbits[] = "tdcNbits";
16  constexpr char tdcSaturation[] = "tdcSaturation";
17  constexpr char tdcOnset[] = "tdcOnset";
18  constexpr char toaLSB_ns[] = "toaLSB_ns";
19  constexpr char fCPerMIP[] = "fCPerMIP";
20 
21  if( conf.exists(isSiFE) ) {
22  maker.set_isSiFESim(conf.getParameter<bool>(isSiFE));
23  } else {
24  maker.set_isSiFESim(false);
25  }
26 
27  if( conf.exists(adcNbits) ) {
28  uint32_t nBits = conf.getParameter<uint32_t>(adcNbits);
29  double saturation = conf.getParameter<double>(adcSaturation);
30  float adcLSB = saturation/pow(2.,nBits);
31  maker.set_ADCLSB(adcLSB);
32  } else {
33  maker.set_ADCLSB(-1.);
34  }
35 
36  if( conf.exists(tdcNbits) ) {
37  uint32_t nBits = conf.getParameter<uint32_t>(tdcNbits);
38  double saturation = conf.getParameter<double>(tdcSaturation);
39  double onset = conf.getParameter<double>(tdcOnset); // in fC
40  float tdcLSB = saturation/pow(2.,nBits);
41  maker.set_TDCLSB(tdcLSB);
42  maker.set_tdcOnsetfC(onset);
43  } else {
44  maker.set_TDCLSB(-1.);
45  maker.set_tdcOnsetfC(-1.);
46  }
47 
48  if( conf.exists(toaLSB_ns) ) {
49  maker.set_toaLSBToNS(conf.getParameter<double>(toaLSB_ns));
50  } else {
51  maker.set_toaLSBToNS(-1.);
52  }
53 
54  if( conf.exists(fCPerMIP) ) {
55  maker.set_fCPerMIP(conf.getParameter<std::vector<double> >(fCPerMIP));
56  } else {
57  maker.set_fCPerMIP(std::vector<double>({1.0}));
58  }
59 
60 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
#define constexpr
void set_fCPerMIP(const std::vector< double > &fCPerMIP)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
static const HGCalUncalibRecHitWorkerFactory ::PMaker< HGCalUncalibRecHitWorkerWeights > s_maker__LINE__ ( "HGCalUncalibRecHitWorkerWeights"  )
static