test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< HGCalUncalibRecHitWorkerWeights
s_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 constexpr, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and funct::pow().

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 
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 }
T getParameter(std::string const &) const
virtual void set_tdcOnsetfC(const double tdcOnset)
bool exists(std::string const &parameterName) const
checks if a parameter exists
virtual void set_ADCLSB(const double adclsb)
#define constexpr
virtual void set_toaLSBToNS(const double lsb2ns)
virtual void set_TDCLSB(const double tdclsb)
virtual void set_isSiFESim(const bool isSiFE)
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