CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCalUncalibRecHitWorkerWeights.cc
Go to the documentation of this file.
2 
6 
8 
9 template< typename DET >
10 void configureIt(const edm::ParameterSet& conf,
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 }
53 
56 {
57  const edm::ParameterSet& ee_cfg = ps.getParameterSet("HGCEEConfig");
58  const edm::ParameterSet& hef_cfg = ps.getParameterSet("HGCHEFConfig");
59  const edm::ParameterSet& heb_cfg = ps.getParameterSet("HGCHEBConfig");
63 }
64 
65 void
67 {
68 
69 }
70 
71 
72 bool
76 {
77  result.push_back(uncalibMaker_ee_.makeRecHit(*itdg));
78  return true;
79 }
80 
81 bool
85 {
86  result.push_back(uncalibMaker_hef_.makeRecHit(*itdg));
87  return true;
88 }
89 
90 bool
94 {
95  result.push_back(uncalibMaker_heb_.makeRecHit(*itdg));
96  return true;
97 }
98 
bool run3(const edm::Event &evt, const HGCHEDigiCollection::const_iterator &digi, HGChebUncalibratedRecHitCollection &result)
T getParameter(std::string const &) const
HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame< HGCHEDetId, HGCSample > > uncalibMaker_hef_
std::vector< HGCEEDataFrame >::const_iterator const_iterator
bool exists(std::string const &parameterName) const
checks if a parameter exists
void configureIt(const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame< DET, HGCSample >> &maker)
void push_back(T const &t)
#define constexpr
bool run1(const edm::Event &evt, const HGCEEDigiCollection::const_iterator &digi, HGCeeUncalibratedRecHitCollection &result)
tuple result
Definition: mps_fire.py:84
virtual HGCUncalibratedRecHit makeRecHit(const C &dataFrame)
Compute parameters.
HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame< HGCEEDetId, HGCSample > > uncalibMaker_ee_
bool run2(const edm::Event &evt, const HGCHEDigiCollection::const_iterator &digi, HGChefUncalibratedRecHitCollection &result)
ParameterSet const & getParameterSet(std::string const &) const
HGCalUncalibRecHitWorkerWeights(const edm::ParameterSet &)
HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame< HGCHEDetId, HGCSample > > uncalibMaker_heb_
Readout digi for HGC.
Definition: HGCDataFrame.h:14
#define DEFINE_EDM_PLUGIN(factory, type, name)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40