CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ESRecHitWorker.cc
Go to the documentation of this file.
2 
9 #include <cmath>
10 #include <iomanip>
11 #include <iostream>
12 
14  recoAlgo_ = ps.getParameter<int>("ESRecoAlgo");
23 
24  if (recoAlgo_ == 0)
25  algoW_ = new ESRecHitSimAlgo();
26  else if (recoAlgo_ == 1)
27  algoF_ = new ESRecHitFitAlgo();
28  else
30 }
31 
33  if (recoAlgo_ == 0)
34  delete algoW_;
35  else if (recoAlgo_ == 1)
36  delete algoF_;
37  else
38  delete algoA_;
39 }
40 
43  const ESGain *gain = esgain_.product();
44 
46  const ESMIPToGeVConstant *mipToGeV = esMIPToGeV_.product();
47 
48  double ESGain = gain->getESGain();
49  double ESMIPToGeV = (ESGain == 1) ? mipToGeV->getESValueLow() : mipToGeV->getESValueHigh();
50 
52  const ESTimeSampleWeights *wgts = esWeights_.product();
53 
54  float w0 = wgts->getWeightForTS0();
55  float w1 = wgts->getWeightForTS1();
56  float w2 = wgts->getWeightForTS2();
57 
59  const ESPedestals *peds = esPedestals_.product();
60 
62  const ESIntercalibConstants *mips = esMIPs_.product();
63 
65  const ESAngleCorrectionFactors *ang = esAngleCorrFactors_.product();
66 
68  const ESChannelStatus *channelStatus = esChannelStatus_.product();
69 
71  const ESRecHitRatioCuts *ratioCuts = esRatioCuts_.product();
72 
73  if (recoAlgo_ == 0) {
74  algoW_->setESGain(ESGain);
75  algoW_->setMIPGeV(ESMIPToGeV);
76  algoW_->setW0(w0);
77  algoW_->setW1(w1);
78  algoW_->setW2(w2);
79  algoW_->setPedestals(peds);
81  algoW_->setChannelStatus(channelStatus);
82  algoW_->setRatioCuts(ratioCuts);
84  } else if (recoAlgo_ == 1) {
85  algoF_->setESGain(ESGain);
86  algoF_->setMIPGeV(ESMIPToGeV);
87  algoF_->setPedestals(peds);
89  algoF_->setChannelStatus(channelStatus);
90  algoF_->setRatioCuts(ratioCuts);
92  } else {
93  algoA_->setESGain(ESGain);
94  algoA_->setMIPGeV(ESMIPToGeV);
95  algoA_->setPedestals(peds);
97  algoA_->setChannelStatus(channelStatus);
98  algoA_->setRatioCuts(ratioCuts);
100  }
101 }
102 
104  if (recoAlgo_ == 0)
105  result.push_back(algoW_->reconstruct(*itdg));
106  else if (recoAlgo_ == 1)
107  result.push_back(algoF_->reconstruct(*itdg));
108  else
109  result.push_back(algoA_->reconstruct(*itdg));
110  return true;
111 }
112 
void setIntercalibConstants(const ESIntercalibConstants *mips)
edm::ESHandle< ESGain > esgain_
EcalRecHit reconstruct(const ESDataFrame &digi) const
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
Definition: ESGain.h:7
void setPedestals(const ESPedestals *peds)
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
float getWeightForTS1() const
float getESValueLow() const
void setW0(float value)
void push_back(T const &t)
void setESGain(const double &value)
ESRecHitSimAlgo * algoW_
void setPedestals(const ESPedestals *peds)
ESPedestalsMap ESPedestals
Definition: ESPedestals.h:29
void setMIPGeV(float value)
void setPedestals(const ESPedestals *peds)
tuple result
Definition: mps_fire.py:311
ESChannelStatusMap ESChannelStatus
edm::ESGetToken< ESAngleCorrectionFactors, ESAngleCorrectionFactorsRcd > esAngleCorrFactorsToken_
edm::ESHandle< ESRecHitRatioCuts > esRatioCuts_
void setW1(float value)
void setIntercalibConstants(const ESIntercalibConstants *mips)
float getWeightForTS2() const
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
ESRecHitFitAlgo * algoF_
float getWeightForTS0() const
ESAngleCorrectionFactorMap ESAngleCorrectionFactors
edm::ESGetToken< ESPedestals, ESPedestalsRcd > esPedestalsToken_
edm::ESGetToken< ESRecHitRatioCuts, ESRecHitRatioCutsRcd > esRatioCutsToken_
EcalRecHit reconstruct(const ESDataFrame &digi) const
void setMIPGeV(const double &value)
edm::ESHandle< ESPedestals > esPedestals_
void setMIPGeV(const double &value)
edm::ESHandle< ESChannelStatus > esChannelStatus_
bool run(const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result) override
ESRecHitWorker(const edm::ParameterSet &ps, edm::ConsumesCollector cc)
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
void setESGain(float value)
edm::ESHandle< ESTimeSampleWeights > esWeights_
edm::ESHandle< ESMIPToGeVConstant > esMIPToGeV_
edm::ESHandle< ESAngleCorrectionFactors > esAngleCorrFactors_
EcalRecHit reconstruct(const ESDataFrame &digi) const
edm::ESGetToken< ESTimeSampleWeights, ESTimeSampleWeightsRcd > esWeightsToken_
ESIntercalibConstantMap ESIntercalibConstants
float getESGain() const
Definition: ESGain.h:13
void setIntercalibConstants(const ESIntercalibConstants *mips)
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setChannelStatus(const ESChannelStatus *status)
T const * product() const
Definition: ESHandle.h:86
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
void setW2(float value)
void setChannelStatus(const ESChannelStatus *status)
void setESGain(const double &value)
void setChannelStatus(const ESChannelStatus *status)
void set(const edm::EventSetup &es) override
#define DEFINE_EDM_PLUGIN(factory, type, name)
ESRecHitAnalyticAlgo * algoA_
edm::ESGetToken< ESGain, ESGainRcd > esgainToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
edm::ESHandle< ESIntercalibConstants > esMIPs_
float getESValueHigh() const
~ESRecHitWorker() override
edm::ESGetToken< ESMIPToGeVConstant, ESMIPToGeVConstantRcd > esMIPToGeVToken_
edm::ESGetToken< ESChannelStatus, ESChannelStatusRcd > esChannelStatusToken_
edm::ESGetToken< ESIntercalibConstants, ESIntercalibConstantsRcd > esMIPsToken_