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

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 9 of file HGCalUncalibRecHitWorkerWeights.cc.

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

References HLTEgPhaseIITestSequence_cff::adcNbits, HLTEgPhaseIITestSequence_cff::adcSaturation, edm::ParameterSet::exists(), HLTEgPhaseIITestSequence_cff::fCPerMIP, edm::ParameterSet::getParameter(), HLTEgPhaseIITestSequence_cff::isSiFE, funct::pow(), HLT_FULL_cff::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
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
HLT_FULL_cff.saturation
saturation
Definition: HLT_FULL_cff.py:6636
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