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 
62  ee_geometry_token_(iC.esConsumes(edm::ESInputTag("", "HGCalEESensitive"))),
63  hef_geometry_token_(iC.esConsumes(edm::ESInputTag("", "HGCalHESiliconSensitive"))),
64  hfnose_geometry_token_(iC.esConsumes(edm::ESInputTag("", "HGCalHFNoseSensitive"))) {
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");
68  const edm::ParameterSet& hfnose_cfg = ps.getParameterSet("HGCHFNoseConfig");
72  configureIt(hfnose_cfg, uncalibMaker_hfnose_);
73 }
74 
76  if (uncalibMaker_ee_.isSiFESim()) {
78  }
79  if (uncalibMaker_hef_.isSiFESim()) {
81  }
82  uncalibMaker_heb_.setGeometry(nullptr);
83  if (uncalibMaker_hfnose_.isSiFESim()) {
85  }
86 }
87 
90  result.push_back(uncalibMaker_ee_.makeRecHit(*itdg));
91  return true;
92 }
93 
96  result.push_back(uncalibMaker_hef_.makeRecHit(*itdg));
97  return true;
98 }
99 
102  result.push_back(uncalibMaker_heb_.makeRecHit(*itdg));
103  return true;
104 }
105 
108  result.push_back(uncalibMaker_hfnose_.makeRecHit(*itdg));
109  return true;
110 }
111 
HGCalUncalibRecHitWorkerWeights::hfnose_geometry_token_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > hfnose_geometry_token_
Definition: HGCalUncalibRecHitWorkerWeights.h:42
EcalSCDynamicDPhiParametersESProducer_cfi.saturation
saturation
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:14
HGCalUncalibRecHitRecWeightsAlgo::set_toaLSBToNS
void set_toaLSBToNS(const double lsb2ns)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:32
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
HGCalUncalibRecHitWorkerWeights::uncalibMaker_ee_
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_ee_
Definition: HGCalUncalibRecHitWorkerWeights.h:43
MessageLogger.h
ESInputTag
HLTEgPhaseIITestSequence_cff.tdcSaturation
tdcSaturation
Definition: HLTEgPhaseIITestSequence_cff.py:951
HGCalUncalibRecHitRecWeightsAlgo::set_ADCLSB
void set_ADCLSB(const double adclsb)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
HGCalUncalibRecHitWorkerWeights::uncalibMaker_hfnose_
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_hfnose_
Definition: HGCalUncalibRecHitWorkerWeights.h:46
HGCalUncalibRecHitWorkerBaseClass
Definition: HGCalUncalibRecHitWorkerBaseClass.h:16
ESProducer.h
edm::SortedCollection
Definition: SortedCollection.h:49
HGCalUncalibRecHitWorkerWeights::HGCalUncalibRecHitWorkerWeights
HGCalUncalibRecHitWorkerWeights(const edm::ParameterSet &, edm::ConsumesCollector iC)
Definition: HGCalUncalibRecHitWorkerWeights.cc:60
HGCalUncalibRecHitWorkerWeights::runHGCEE
bool runHGCEE(const HGCalDigiCollection::const_iterator &digi, HGCeeUncalibratedRecHitCollection &result) override
Definition: HGCalUncalibRecHitWorkerWeights.cc:88
HGCalUncalibRecHitWorkerWeights::uncalibMaker_hef_
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_hef_
Definition: HGCalUncalibRecHitWorkerWeights.h:44
configureIt
void configureIt(const edm::ParameterSet &conf, HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > &maker)
Definition: HGCalUncalibRecHitWorkerWeights.cc:10
HGCalUncalibRecHitWorkerWeights::runHGCHEscint
bool runHGCHEscint(const HGCalDigiCollection::const_iterator &digi, HGChebUncalibratedRecHitCollection &result) override
Definition: HGCalUncalibRecHitWorkerWeights.cc:100
MakerMacros.h
HGCalUncalibRecHitRecWeightsAlgo::set_tdcOnsetfC
void set_tdcOnsetfC(const double tdcOnset)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:34
HGCalUncalibRecHitWorkerWeights::hef_geometry_token_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > hef_geometry_token_
Definition: HGCalUncalibRecHitWorkerWeights.h:41
HGCalUncalibRecHitWorkerWeights::runHGCHEsil
bool runHGCHEsil(const HGCalDigiCollection::const_iterator &digi, HGChefUncalibratedRecHitCollection &result) override
Definition: HGCalUncalibRecHitWorkerWeights.cc:94
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::ParameterSet
Definition: ParameterSet.h:47
HLTEgPhaseIITestSequence_cff.toaLSB_ns
toaLSB_ns
Definition: HLTEgPhaseIITestSequence_cff.py:952
Event.h
HGCalUncalibRecHitWorkerWeights::ee_geometry_token_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > ee_geometry_token_
Definition: HGCalUncalibRecHitWorkerWeights.h:40
HGCalUncalibRecHitWorkerFactory.h
HLTEgPhaseIITestSequence_cff.fCPerMIP
fCPerMIP
Definition: HLTEgPhaseIITestSequence_cff.py:947
edmplugin::PluginFactory
Definition: PluginFactory.h:34
hgcalVFEProducer_cfi.tdcOnset
tdcOnset
Definition: hgcalVFEProducer_cfi.py:24
HGCalUncalibRecHitRecWeightsAlgo::set_TDCLSB
void set_TDCLSB(const double tdclsb)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:30
HLTEgPhaseIITestSequence_cff.adcNbits
adcNbits
Definition: HLTEgPhaseIITestSequence_cff.py:945
HGCalUncalibRecHitWorkerWeights.h
edm::EventSetup
Definition: EventSetup.h:58
HGCalUncalibRecHitRecWeightsAlgo
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:21
HGCalUncalibRecHitWorkerWeights
Definition: HGCalUncalibRecHitWorkerWeights.h:25
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
HGCalUncalibRecHitRecWeightsAlgo::set_isSiFESim
void set_isSiFESim(const bool isSiFE)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:26
HLTEgPhaseIITestSequence_cff.adcSaturation
adcSaturation
Definition: HLTEgPhaseIITestSequence_cff.py:946
HGCalUncalibRecHitWorkerWeights::runHGCHFNose
bool runHGCHFNose(const HGCalDigiCollection::const_iterator &digi, HGChfnoseUncalibratedRecHitCollection &result) override
Definition: HGCalUncalibRecHitWorkerWeights.cc:106
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTEgPhaseIITestSequence_cff.tdcNbits
tdcNbits
Definition: HLTEgPhaseIITestSequence_cff.py:949
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
mps_fire.result
result
Definition: mps_fire.py:311
HGCalUncalibRecHitWorkerWeights::uncalibMaker_heb_
HGCalUncalibRecHitRecWeightsAlgo< HGCalDataFrame > uncalibMaker_heb_
Definition: HGCalUncalibRecHitWorkerWeights.h:45
ParameterSet.h
HLTEgPhaseIITestSequence_cff.isSiFE
isSiFE
Definition: HLTEgPhaseIITestSequence_cff.py:948
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
HGCalUncalibRecHitWorkerWeights::set
void set(const edm::EventSetup &es) override
Definition: HGCalUncalibRecHitWorkerWeights.cc:75
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
HGCalUncalibRecHitRecWeightsAlgo::set_fCPerMIP
void set_fCPerMIP(const std::vector< double > &fCPerMIP)
Definition: HGCalUncalibRecHitRecWeightsAlgo.h:36