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.

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 }

References HLTEgPhaseIITestSequence_cff::adcNbits, HLTEgPhaseIITestSequence_cff::adcSaturation, edm::ParameterSet::exists(), HLTEgPhaseIITestSequence_cff::fCPerMIP, edm::ParameterSet::getParameter(), HLTEgPhaseIITestSequence_cff::isSiFE, funct::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(), HLTEgPhaseIITestSequence_cff::tdcNbits, hgcalVFEProducer_cfi::tdcOnset, HLTEgPhaseIITestSequence_cff::tdcSaturation, and HLTEgPhaseIITestSequence_cff::toaLSB_ns.

Referenced by HGCalUncalibRecHitWorkerWeights::HGCalUncalibRecHitWorkerWeights().

◆ s_maker__LINE__()

static const HGCalUncalibRecHitWorkerFactory ::PMaker< HGCalUncalibRecHitWorkerWeights > s_maker__LINE__ ( "HGCalUncalibRecHitWorkerWeights"  )
static
EcalSCDynamicDPhiParametersESProducer_cfi.saturation
saturation
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:14
HGCalUncalibRecHitRecWeightsAlgo::set_toaLSBToNS
void set_toaLSBToNS(const double lsb2ns)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:32
HLTEgPhaseIITestSequence_cff.tdcSaturation
tdcSaturation
Definition: HLTEgPhaseIITestSequence_cff.py:951
HGCalUncalibRecHitRecWeightsAlgo::set_ADCLSB
void set_ADCLSB(const double adclsb)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:29
HGCalUncalibRecHitRecWeightsAlgo::set_tdcOnsetfC
void set_tdcOnsetfC(const double tdcOnset)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:34
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
HLTEgPhaseIITestSequence_cff.toaLSB_ns
toaLSB_ns
Definition: HLTEgPhaseIITestSequence_cff.py:952
HLTEgPhaseIITestSequence_cff.fCPerMIP
fCPerMIP
Definition: HLTEgPhaseIITestSequence_cff.py:947
hgcalVFEProducer_cfi.tdcOnset
tdcOnset
Definition: hgcalVFEProducer_cfi.py:24
HGCalUncalibRecHitRecWeightsAlgo::set_TDCLSB
void set_TDCLSB(const double tdclsb)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:30
HLTEgPhaseIITestSequence_cff.adcNbits
adcNbits
Definition: HLTEgPhaseIITestSequence_cff.py:945
HGCalUncalibRecHitRecWeightsAlgo::set_isSiFESim
void set_isSiFESim(const bool isSiFE)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:26
HLTEgPhaseIITestSequence_cff.adcSaturation
adcSaturation
Definition: HLTEgPhaseIITestSequence_cff.py:946
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTEgPhaseIITestSequence_cff.tdcNbits
tdcNbits
Definition: HLTEgPhaseIITestSequence_cff.py:949
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
HLTEgPhaseIITestSequence_cff.isSiFE
isSiFE
Definition: HLTEgPhaseIITestSequence_cff.py:948
HGCalUncalibRecHitRecWeightsAlgo::set_fCPerMIP
void set_fCPerMIP(const std::vector< double > &fCPerMIP)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:36