CMS 3D CMS Logo

ESRecHitWorker.cc
Go to the documentation of this file.
2 
17 
18 #include <cmath>
19 #include <iomanip>
20 #include <iostream>
21 
23  recoAlgo_ = ps.getParameter<int>("ESRecoAlgo");
24 
25  if (recoAlgo_ == 0)
26  algoW_ = new ESRecHitSimAlgo();
27  else if (recoAlgo_ == 1)
28  algoF_ = new ESRecHitFitAlgo();
29  else
31 }
32 
34  if (recoAlgo_ == 0)
35  delete algoW_;
36  else if (recoAlgo_ == 1)
37  delete algoF_;
38  else
39  delete algoA_;
40 }
41 
43  es.get<ESGainRcd>().get(esgain_);
44  const ESGain *gain = esgain_.product();
45 
47  const ESMIPToGeVConstant *mipToGeV = esMIPToGeV_.product();
48 
49  double ESGain = gain->getESGain();
50  double ESMIPToGeV = (ESGain == 1) ? mipToGeV->getESValueLow() : mipToGeV->getESValueHigh();
51 
53  const ESTimeSampleWeights *wgts = esWeights_.product();
54 
55  float w0 = wgts->getWeightForTS0();
56  float w1 = wgts->getWeightForTS1();
57  float w2 = wgts->getWeightForTS2();
58 
60  const ESPedestals *peds = esPedestals_.product();
61 
63  const ESIntercalibConstants *mips = esMIPs_.product();
64 
66  const ESAngleCorrectionFactors *ang = esAngleCorrFactors_.product();
67 
69  const ESChannelStatus *channelStatus = esChannelStatus_.product();
70 
72  const ESRecHitRatioCuts *ratioCuts = esRatioCuts_.product();
73 
74  if (recoAlgo_ == 0) {
76  algoW_->setMIPGeV(ESMIPToGeV);
77  algoW_->setW0(w0);
78  algoW_->setW1(w1);
79  algoW_->setW2(w2);
80  algoW_->setPedestals(peds);
82  algoW_->setChannelStatus(channelStatus);
83  algoW_->setRatioCuts(ratioCuts);
85  } else if (recoAlgo_ == 1) {
87  algoF_->setMIPGeV(ESMIPToGeV);
88  algoF_->setPedestals(peds);
90  algoF_->setChannelStatus(channelStatus);
91  algoF_->setRatioCuts(ratioCuts);
93  } else {
95  algoA_->setMIPGeV(ESMIPToGeV);
96  algoA_->setPedestals(peds);
98  algoA_->setChannelStatus(channelStatus);
99  algoA_->setRatioCuts(ratioCuts);
101  }
102 }
103 
105  if (recoAlgo_ == 0)
106  result.push_back(algoW_->reconstruct(*itdg));
107  else if (recoAlgo_ == 1)
108  result.push_back(algoF_->reconstruct(*itdg));
109  else
110  result.push_back(algoA_->reconstruct(*itdg));
111  return true;
112 }
113 
ESRecHitAnalyticAlgo::setChannelStatus
void setChannelStatus(const ESChannelStatus *status)
Definition: ESRecHitAnalyticAlgo.h:21
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
ESPedestalsRcd
Definition: ESPedestalsRcd.h:5
ESGain
Definition: ESGain.h:7
Handle.h
w2
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
MessageLogger.h
ESRecHitAnalyticAlgo::reconstruct
EcalRecHit reconstruct(const ESDataFrame &digi) const
Definition: ESRecHitAnalyticAlgo.cc:79
ESRecHitSimAlgo::setW1
void setW1(float value)
Definition: ESRecHitSimAlgo.h:22
ESRecHitSimAlgo::setW0
void setW0(float value)
Definition: ESRecHitSimAlgo.h:21
ESRecHitWorker::esMIPs_
edm::ESHandle< ESIntercalibConstants > esMIPs_
Definition: ESRecHitWorker.h:45
ESRecHitFitAlgo::setIntercalibConstants
void setIntercalibConstants(const ESIntercalibConstants *mips)
Definition: ESRecHitFitAlgo.h:22
ESRecHitWorkerBaseClass
Definition: ESRecHitWorkerBaseClass.h:12
ESRecHitSimAlgo::setESGain
void setESGain(float value)
Definition: ESRecHitSimAlgo.h:14
ESGainRcd
Definition: ESGainRcd.h:5
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
ESRecHitWorker::algoF_
ESRecHitFitAlgo * algoF_
Definition: ESRecHitWorker.h:38
ESChannelStatusRcd
Definition: ESChannelStatusRcd.h:5
ESRecHitFitAlgo::setChannelStatus
void setChannelStatus(const ESChannelStatus *status)
Definition: ESRecHitFitAlgo.h:23
ESMIPToGeVConstantRcd
Definition: ESMIPToGeVConstantRcd.h:5
ESTimeSampleWeights::getWeightForTS2
float getWeightForTS2() const
Definition: ESTimeSampleWeights.h:18
edm::SortedCollection< EcalRecHit >
EcalUncalibratedRecHit.h
ESRecHitFitAlgo::setPedestals
void setPedestals(const ESPedestals *peds)
Definition: ESRecHitFitAlgo.h:21
ESMIPToGeVConstant::getESValueHigh
float getESValueHigh() const
Definition: ESMIPToGeVConstant.h:15
ESChannelStatusRcd.h
ESRecHitWorker::esMIPToGeV_
edm::ESHandle< ESMIPToGeVConstant > esMIPToGeV_
Definition: ESRecHitWorker.h:42
ESGainRcd.h
EcalRecHitCollections.h
ESRecHitRatioCutsRcd
Definition: ESRecHitRatioCutsRcd.h:5
ESRecHitWorker
Definition: ESRecHitWorker.h:27
ESRecHitSimAlgo::setChannelStatus
void setChannelStatus(const ESChannelStatus *status)
Definition: ESRecHitSimAlgo.h:18
MakerMacros.h
ESTimeSampleWeightsRcd.h
ESRecHitWorker.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ESRecHitWorker::esPedestals_
edm::ESHandle< ESPedestals > esPedestals_
Definition: ESRecHitWorker.h:44
ESRecHitRatioCutsRcd.h
ESRecHitWorker::algoW_
ESRecHitSimAlgo * algoW_
Definition: ESRecHitWorker.h:37
EcalDigiCollections.h
ESRecHitWorker::algoA_
ESRecHitAnalyticAlgo * algoA_
Definition: ESRecHitWorker.h:39
ESRecHitSimAlgo::setMIPGeV
void setMIPGeV(float value)
Definition: ESRecHitSimAlgo.h:15
ESRecHitWorker::esAngleCorrFactors_
edm::ESHandle< ESAngleCorrectionFactors > esAngleCorrFactors_
Definition: ESRecHitWorker.h:48
ESMIPToGeVConstantRcd.h
ESRecHitWorker::esWeights_
edm::ESHandle< ESTimeSampleWeights > esWeights_
Definition: ESRecHitWorker.h:43
ESRecHitSimAlgo::setAngleCorrectionFactors
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
Definition: ESRecHitSimAlgo.h:20
ESRecHitRatioCuts
Definition: ESRecHitRatioCuts.h:7
ESIntercalibConstantsRcd
Definition: ESIntercalibConstantsRcd.h:5
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
ESRecHitWorker::esRatioCuts_
edm::ESHandle< ESRecHitRatioCuts > esRatioCuts_
Definition: ESRecHitWorker.h:47
ESRecHitSimAlgo::setRatioCuts
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
Definition: ESRecHitSimAlgo.h:19
ESIntercalibConstantsRcd.h
edm::ParameterSet
Definition: ParameterSet.h:36
ESRecHitAnalyticAlgo::setAngleCorrectionFactors
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
Definition: ESRecHitAnalyticAlgo.h:23
ESRecHitAnalyticAlgo::setPedestals
void setPedestals(const ESPedestals *peds)
Definition: ESRecHitAnalyticAlgo.h:19
ESRecHitWorker::esChannelStatus_
edm::ESHandle< ESChannelStatus > esChannelStatus_
Definition: ESRecHitWorker.h:46
edmplugin::PluginFactory
Definition: PluginFactory.h:34
ESTimeSampleWeights
Definition: ESTimeSampleWeights.h:7
ESRecHitFitAlgo
Definition: ESRecHitFitAlgo.h:14
ESRecHitSimAlgo
Definition: ESRecHitSimAlgo.h:12
ESRecHitWorker::set
void set(const edm::EventSetup &es) override
Definition: ESRecHitWorker.cc:42
ESRecHitAnalyticAlgo::setMIPGeV
void setMIPGeV(const double &value)
Definition: ESRecHitAnalyticAlgo.h:18
ESRecHitFitAlgo::reconstruct
EcalRecHit reconstruct(const ESDataFrame &digi) const
Definition: ESRecHitFitAlgo.cc:87
ESRecHitWorker::run
bool run(const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result) override
Definition: ESRecHitWorker.cc:104
ESRecHitFitAlgo::setMIPGeV
void setMIPGeV(const double &value)
Definition: ESRecHitFitAlgo.h:20
ESTimeSampleWeights::getWeightForTS1
float getWeightForTS1() const
Definition: ESTimeSampleWeights.h:16
ESRecHitFitAlgo::setAngleCorrectionFactors
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
Definition: ESRecHitFitAlgo.h:25
ESRecHitSimAlgo::setIntercalibConstants
void setIntercalibConstants(const ESIntercalibConstants *mips)
Definition: ESRecHitSimAlgo.h:17
ESMIPToGeVConstant
Definition: ESMIPToGeVConstant.h:7
edm::EventSetup
Definition: EventSetup.h:57
ESRecHitWorker::ESRecHitWorker
ESRecHitWorker(const edm::ParameterSet &ps)
Definition: ESRecHitWorker.cc:22
ESRecHitFitAlgo::setRatioCuts
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
Definition: ESRecHitFitAlgo.h:24
get
#define get
ESCondObjectContainer< ESPedestal >
ESRecHitSimAlgo::setW2
void setW2(float value)
Definition: ESRecHitSimAlgo.h:23
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
ESRecHitAnalyticAlgo::setRatioCuts
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
Definition: ESRecHitAnalyticAlgo.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ESTimeSampleWeights::getWeightForTS0
float getWeightForTS0() const
Definition: ESTimeSampleWeights.h:14
ESRecHitWorker::esgain_
edm::ESHandle< ESGain > esgain_
Definition: ESRecHitWorker.h:41
ESMIPToGeVConstant::getESValueLow
float getESValueLow() const
Definition: ESMIPToGeVConstant.h:13
ESTimeSampleWeightsRcd
Definition: ESTimeSampleWeightsRcd.h:5
ESRecHitWorker::recoAlgo_
int recoAlgo_
Definition: ESRecHitWorker.h:36
mps_fire.result
result
Definition: mps_fire.py:303
ESRecHitSimAlgo::reconstruct
EcalRecHit reconstruct(const ESDataFrame &digi) const
Definition: ESRecHitSimAlgo.cc:82
ParameterSet.h
ESAngleCorrectionFactorsRcd.h
ESAngleCorrectionFactorsRcd
Definition: ESAngleCorrectionFactorsRcd.h:5
ESRecHitSimAlgo::setPedestals
void setPedestals(const ESPedestals *peds)
Definition: ESRecHitSimAlgo.h:16
ESRecHitAnalyticAlgo
Definition: ESRecHitAnalyticAlgo.h:12
ESRecHitAnalyticAlgo::setIntercalibConstants
void setIntercalibConstants(const ESIntercalibConstants *mips)
Definition: ESRecHitAnalyticAlgo.h:20
ESRecHitWorkerFactory.h
ESRecHitFitAlgo::setESGain
void setESGain(const double &value)
Definition: ESRecHitFitAlgo.h:19
ESRecHitAnalyticAlgo::setESGain
void setESGain(const double &value)
Definition: ESRecHitAnalyticAlgo.h:17
ESPedestalsRcd.h
ESRecHitWorker::~ESRecHitWorker
~ESRecHitWorker() override
Definition: ESRecHitWorker.cc:33