CMS 3D CMS Logo

HGCalUncalibRecHitWorkerWeights.cc
Go to the documentation of this file.
2 
6 
8 
9 void configureIt(const edm::ParameterSet& conf,
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 }
60 
63 {
64  const edm::ParameterSet& ee_cfg = ps.getParameterSet("HGCEEConfig");
65  const edm::ParameterSet& hef_cfg = ps.getParameterSet("HGCHEFConfig");
66  const edm::ParameterSet& heb_cfg = ps.getParameterSet("HGCHEBConfig");
70 }
71 
72 void
74 {
75  if (uncalibMaker_ee_.isSiFESim()) {
76  edm::ESHandle<HGCalGeometry> hgceeGeoHandle;
77  es.get<IdealGeometryRecord>().get("HGCalEESensitive",hgceeGeoHandle) ;
78  uncalibMaker_ee_.setGeometry(hgceeGeoHandle.product());
79  }
80  if (uncalibMaker_hef_.isSiFESim()) {
81  edm::ESHandle<HGCalGeometry> hgchefGeoHandle;
82  es.get<IdealGeometryRecord>().get("HGCalHESiliconSensitive",hgchefGeoHandle) ;
83  uncalibMaker_hef_.setGeometry(hgchefGeoHandle.product());
84  }
85  uncalibMaker_heb_.setGeometry(nullptr);
86 }
87 
88 
89 bool
93 {
94  result.push_back(uncalibMaker_ee_.makeRecHit(*itdg));
95  return true;
96 }
97 
98 bool
102 {
103  result.push_back(uncalibMaker_hef_.makeRecHit(*itdg));
104  return true;
105 }
106 
107 bool
111 {
112  result.push_back(uncalibMaker_heb_.makeRecHit(*itdg));
113  return true;
114 }
115 
T getParameter(std::string const &) const
bool run3(const edm::Event &evt, const HGCalDigiCollection::const_iterator &digi, HGChebUncalibratedRecHitCollection &result) override
bool run2(const edm::Event &evt, const HGCalDigiCollection::const_iterator &digi, HGChefUncalibratedRecHitCollection &result) override
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)
#define constexpr
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_hef_
bool run1(const edm::Event &evt, const HGCalDigiCollection::const_iterator &digi, HGCeeUncalibratedRecHitCollection &result) override
void configureIt(const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &maker)
ParameterSet const & getParameterSet(std::string const &) const
HGCalUncalibRecHitWorkerWeights(const edm::ParameterSet &)
void set(const edm::EventSetup &es) override
T get() const
Definition: EventSetup.h:63
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_ee_
void set_fCPerMIP(const std::vector< double > &fCPerMIP)
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_heb_
#define DEFINE_EDM_PLUGIN(factory, type, name)
T const * product() const
Definition: ESHandle.h:86
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40