CMS 3D CMS Logo

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  constexpr char fCPerMIP[] = "fCPerMIP";
20 
21  if( conf.exists(isSiFE) ) {
22  maker.set_isSiFESim(conf.getParameter<bool>(isSiFE));
23  } else {
24  maker.set_isSiFESim(false);
25  }
26 
27  if( conf.exists(adcNbits) ) {
28  uint32_t nBits = conf.getParameter<uint32_t>(adcNbits);
29  double saturation = conf.getParameter<double>(adcSaturation);
30  float adcLSB = saturation/pow(2.,nBits);
31  maker.set_ADCLSB(adcLSB);
32  } else {
33  maker.set_ADCLSB(-1.);
34  }
35 
36  if( conf.exists(tdcNbits) ) {
37  uint32_t nBits = conf.getParameter<uint32_t>(tdcNbits);
38  double saturation = conf.getParameter<double>(tdcSaturation);
39  double onset = conf.getParameter<double>(tdcOnset); // in fC
40  float tdcLSB = saturation/pow(2.,nBits);
41  maker.set_TDCLSB(tdcLSB);
42  maker.set_tdcOnsetfC(onset);
43  } else {
44  maker.set_TDCLSB(-1.);
45  maker.set_tdcOnsetfC(-1.);
46  }
47 
48  if( conf.exists(toaLSB_ns) ) {
49  maker.set_toaLSBToNS(conf.getParameter<double>(toaLSB_ns));
50  } else {
51  maker.set_toaLSBToNS(-1.);
52  }
53 
54  if( conf.exists(fCPerMIP) ) {
55  maker.set_fCPerMIP(conf.getParameter<std::vector<double> >(fCPerMIP));
56  } else {
57  maker.set_fCPerMIP(std::vector<double>({1.0}));
58  }
59 
60 }
61 
64 {
65  const edm::ParameterSet& ee_cfg = ps.getParameterSet("HGCEEConfig");
66  const edm::ParameterSet& hef_cfg = ps.getParameterSet("HGCHEFConfig");
67  const edm::ParameterSet& heb_cfg = ps.getParameterSet("HGCHEBConfig");
71 }
72 
73 void
75 {
76  if (uncalibMaker_ee_.isSiFESim()) {
77  edm::ESHandle<HGCalGeometry> hgceeGeoHandle;
78  es.get<IdealGeometryRecord>().get("HGCalEESensitive",hgceeGeoHandle) ;
79  uncalibMaker_ee_.setGeometry(hgceeGeoHandle.product());
80  }
81  if (uncalibMaker_hef_.isSiFESim()) {
82  edm::ESHandle<HGCalGeometry> hgchefGeoHandle;
83  es.get<IdealGeometryRecord>().get("HGCalHESiliconSensitive",hgchefGeoHandle) ;
84  uncalibMaker_hef_.setGeometry(hgchefGeoHandle.product());
85  }
86  uncalibMaker_heb_.setGeometry(nullptr);
87 }
88 
89 
90 bool
94 {
95  result.push_back(uncalibMaker_ee_.makeRecHit(*itdg));
96  return true;
97 }
98 
99 bool
103 {
104  result.push_back(uncalibMaker_hef_.makeRecHit(*itdg));
105  return true;
106 }
107 
108 bool
112 {
113  result.push_back(uncalibMaker_heb_.makeRecHit(*itdg));
114  return true;
115 }
116 
T getParameter(std::string const &) const
HGCalUncalibRecHitRecWeightsAlgo< HGCEEDataFrame > uncalibMaker_ee_
std::vector< HGCEEDataFrame >::const_iterator const_iterator
HGCalUncalibRecHitRecWeightsAlgo< HGCHEDataFrame > uncalibMaker_hef_
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
ParameterSet const & getParameterSet(std::string const &) const
HGCalUncalibRecHitRecWeightsAlgo< HGCBHDataFrame > uncalibMaker_heb_
bool run2(const edm::Event &evt, const HGCHEDigiCollection::const_iterator &digi, HGChefUncalibratedRecHitCollection &result) override
bool run3(const edm::Event &evt, const HGCBHDigiCollection::const_iterator &digi, HGChebUncalibratedRecHitCollection &result) override
HGCalUncalibRecHitWorkerWeights(const edm::ParameterSet &)
const T & get() const
Definition: EventSetup.h:58
Readout digi for HGC.
Definition: HGCDataFrame.h:14
void set(const edm::EventSetup &es) override
#define DEFINE_EDM_PLUGIN(factory, type, name)
bool run1(const edm::Event &evt, const HGCEEDigiCollection::const_iterator &digi, HGCeeUncalibratedRecHitCollection &result) override
T const * product() const
Definition: ESHandle.h:86
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40