CMS 3D CMS Logo

HGCalUncalibRecHitWorkerWeights.cc
Go to the documentation of this file.
2 
6 
8 
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 }
58 
61  const edm::ParameterSet& ee_cfg = ps.getParameterSet("HGCEEConfig");
62  const edm::ParameterSet& hef_cfg = ps.getParameterSet("HGCHEFConfig");
63  const edm::ParameterSet& heb_cfg = ps.getParameterSet("HGCHEBConfig");
64  const edm::ParameterSet& hfnose_cfg = ps.getParameterSet("HGCHFNoseConfig");
68  configureIt(hfnose_cfg, uncalibMaker_hfnose_);
69 }
70 
72  if (uncalibMaker_ee_.isSiFESim()) {
73  edm::ESHandle<HGCalGeometry> hgceeGeoHandle;
74  es.get<IdealGeometryRecord>().get("HGCalEESensitive", hgceeGeoHandle);
75  uncalibMaker_ee_.setGeometry(hgceeGeoHandle.product());
76  }
77  if (uncalibMaker_hef_.isSiFESim()) {
78  edm::ESHandle<HGCalGeometry> hgchefGeoHandle;
79  es.get<IdealGeometryRecord>().get("HGCalHESiliconSensitive", hgchefGeoHandle);
80  uncalibMaker_hef_.setGeometry(hgchefGeoHandle.product());
81  }
82  uncalibMaker_heb_.setGeometry(nullptr);
83  if (uncalibMaker_hfnose_.isSiFESim()) {
84  edm::ESHandle<HGCalGeometry> hgchfnoseGeoHandle;
85  es.get<IdealGeometryRecord>().get("HGCalHFNoseSensitive", hgchfnoseGeoHandle);
86  uncalibMaker_hfnose_.setGeometry(hgchfnoseGeoHandle.product());
87  }
88 }
89 
92  result.push_back(uncalibMaker_ee_.makeRecHit(*itdg));
93  return true;
94 }
95 
98  result.push_back(uncalibMaker_hef_.makeRecHit(*itdg));
99  return true;
100 }
101 
104  result.push_back(uncalibMaker_heb_.makeRecHit(*itdg));
105  return true;
106 }
107 
110  result.push_back(uncalibMaker_hfnose_.makeRecHit(*itdg));
111  return true;
112 }
113 
T getParameter(std::string const &) const
std::vector< T >::const_iterator const_iterator
bool exists(std::string const &parameterName) const
checks if a parameter exists
void push_back(T const &t)
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_hef_
bool runHGCHFNose(const HGCalDigiCollection::const_iterator &digi, HGChfnoseUncalibratedRecHitCollection &result) override
bool runHGCHEscint(const HGCalDigiCollection::const_iterator &digi, HGChebUncalibratedRecHitCollection &result) override
void configureIt(const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &maker)
bool runHGCEE(const HGCalDigiCollection::const_iterator &digi, HGCeeUncalibratedRecHitCollection &result) override
ParameterSet const & getParameterSet(std::string const &) const
HGCalUncalibRecHitWorkerWeights(const edm::ParameterSet &)
void set(const edm::EventSetup &es) override
T get() const
Definition: EventSetup.h:73
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_
T const * product() const
Definition: ESHandle.h:86
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
#define constexpr
bool runHGCHEsil(const HGCalDigiCollection::const_iterator &digi, HGChefUncalibratedRecHitCollection &result) override