CMS 3D CMS Logo

HGCalUncalibRecHitWorkerWeights.cc
Go to the documentation of this file.
2 
7 
9 
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 }
61 
64  bool useTime)
65  : HGCalUncalibRecHitWorkerBaseClass(ps, iC, useTime) {
66  const edm::ParameterSet& ee_cfg = ps.getParameterSet("HGCEEConfig");
67  const edm::ParameterSet& hef_cfg = ps.getParameterSet("HGCHEFConfig");
68  const edm::ParameterSet& heb_cfg = ps.getParameterSet("HGCHEBConfig");
69  const edm::ParameterSet& hfnose_cfg = ps.getParameterSet("HGCHFNoseConfig");
73  configureIt(hfnose_cfg, uncalibMaker_hfnose_);
74  computeLocalTime_ = useTime;
75 }
76 
78  const HGCalDigiCollection& digis,
81  uncalibMaker.setGeometry(geom);
82  result.reserve(result.size() + digis.size());
83  for (const auto& digi : digis)
84  result.push_back(uncalibMaker.makeRecHit(digi, computeLocalTime_));
85  return true;
86 }
87 
89  const HGCalDigiCollection& digis,
91  return run(geom, digis, uncalibMaker_ee_, result);
92 }
93 
95  const HGCalDigiCollection& digis,
97  return run(geom, digis, uncalibMaker_hef_, result);
98 }
99 
101  const HGCalDigiCollection& digis,
103  return run(geom, digis, uncalibMaker_heb_, result);
104 }
105 
107  const HGCalDigiCollection& digis,
109  return run(geom, digis, uncalibMaker_hfnose_, result);
110 }
111 
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool runHGCHFNose(const edm::ESHandle< HGCalGeometry > &geom, const HGCalDigiCollection &digis, HGChfnoseUncalibratedRecHitCollection &result) override
bool setGeometry(const edm::ESHandle< HGCalGeometry > &geom)
size_type size() const
bool exists(std::string const &parameterName) const
checks if a parameter exists
ParameterSet const & getParameterSet(std::string const &) const
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_hef_
void configureIt(const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &maker)
HGCalUncalibRecHitWorkerWeights(const edm::ParameterSet &, edm::ConsumesCollector iC, bool useTime)
bool run(const edm::ESHandle< HGCalGeometry > &geom, const HGCalDigiCollection &digis, HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &uncalibMaker, edm::SortedCollection< HGCUncalibratedRecHit > &result)
bool runHGCEE(const edm::ESHandle< HGCalGeometry > &geom, const HGCalDigiCollection &digis, HGCeeUncalibratedRecHitCollection &result) override
virtual HGCUncalibratedRecHit makeRecHit(const C &dataFrame, const bool computeLocalTime)
Compute HGCUncalibratedRecHit from DataFrame.
bool runHGCHEscint(const edm::ESHandle< HGCalGeometry > &geom, const HGCalDigiCollection &digis, HGChebUncalibratedRecHitCollection &result) override
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_ee_
void set_fCPerMIP(const std::vector< double > &fCPerMIP)
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_heb_
#define DEFINE_EDM_PLUGIN(factory, type, name)
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_hfnose_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
bool runHGCHEsil(const edm::ESHandle< HGCalGeometry > &geom, const HGCalDigiCollection &digis, HGChefUncalibratedRecHitCollection &result) override