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/ESProducer.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

void configureIt (const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &maker)
 
static const HGCalUncalibRecHitWorkerFactory ::PMaker< HGCalUncalibRecHitWorkerWeightss_maker__LINE__ ("HGCalUncalibRecHitWorkerWeights")
 

Function Documentation

◆ configureIt()

void configureIt ( const edm::ParameterSet conf,
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &  maker 
)

Definition at line 10 of file HGCalUncalibRecHitWorkerWeights.cc.

References HGCalUncalibRecHit_cfi::adcNbits, HGCalUncalibRecHit_cfi::adcSaturation, edm::ParameterSet::exists(), HGCalUncalibRecHit_cfi::fCPerMIP, edm::ParameterSet::getParameter(), HGCalUncalibRecHit_cfi::isSiFE, conifer::pow(), EcalSCDynamicDPhiParametersESProducer_cfi::saturation, HGCalUncalibRecHitRecWeightsAlgo< C >::set_ADCLSB(), HGCalUncalibRecHitRecWeightsAlgo< C >::set_fCPerMIP(), HGCalUncalibRecHitRecWeightsAlgo< C >::set_isSiFESim(), HGCalUncalibRecHitRecWeightsAlgo< C >::set_TDCLSB(), HGCalUncalibRecHitRecWeightsAlgo< C >::set_tdcOnsetfC(), HGCalUncalibRecHitRecWeightsAlgo< C >::set_toaLSBToNS(), HGCalUncalibRecHitRecWeightsAlgo< C >::set_tofDelay(), HGCalUncalibRecHit_cfi::tdcNbits, HGCalUncalibRecHit_cfi::tdcOnset, HGCalUncalibRecHit_cfi::tdcSaturation, and HGCalUncalibRecHit_cfi::toaLSB_ns.

Referenced by HGCalUncalibRecHitWorkerWeights::HGCalUncalibRecHitWorkerWeights().

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

◆ s_maker__LINE__()

static const HGCalUncalibRecHitWorkerFactory ::PMaker< HGCalUncalibRecHitWorkerWeights > s_maker__LINE__ ( "HGCalUncalibRecHitWorkerWeights"  )
static