CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
ESRecHitWorker Class Reference

#include <ESRecHitWorker.h>

Inheritance diagram for ESRecHitWorker:
ESRecHitWorkerBaseClass

Public Member Functions

 ESRecHitWorker (const edm::ParameterSet &ps, edm::ConsumesCollector cc)
 
bool run (const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result) override
 
void set (const edm::EventSetup &es) override
 
 ~ESRecHitWorker () override
 
- Public Member Functions inherited from ESRecHitWorkerBaseClass
 ESRecHitWorkerBaseClass (const edm::ParameterSet &)
 
virtual ~ESRecHitWorkerBaseClass ()
 

Private Attributes

ESRecHitAnalyticAlgoalgoA_
 
ESRecHitFitAlgoalgoF_
 
ESRecHitSimAlgoalgoW_
 
edm::ESHandle
< ESAngleCorrectionFactors
esAngleCorrFactors_
 
edm::ESGetToken
< ESAngleCorrectionFactors,
ESAngleCorrectionFactorsRcd
esAngleCorrFactorsToken_
 
edm::ESHandle< ESChannelStatusesChannelStatus_
 
edm::ESGetToken
< ESChannelStatus,
ESChannelStatusRcd
esChannelStatusToken_
 
edm::ESHandle< ESGainesgain_
 
edm::ESGetToken< ESGain,
ESGainRcd
esgainToken_
 
edm::ESHandle
< ESIntercalibConstants
esMIPs_
 
edm::ESGetToken
< ESIntercalibConstants,
ESIntercalibConstantsRcd
esMIPsToken_
 
edm::ESHandle< ESMIPToGeVConstantesMIPToGeV_
 
edm::ESGetToken
< ESMIPToGeVConstant,
ESMIPToGeVConstantRcd
esMIPToGeVToken_
 
edm::ESHandle< ESPedestalsesPedestals_
 
edm::ESGetToken< ESPedestals,
ESPedestalsRcd
esPedestalsToken_
 
edm::ESHandle< ESRecHitRatioCutsesRatioCuts_
 
edm::ESGetToken
< ESRecHitRatioCuts,
ESRecHitRatioCutsRcd
esRatioCutsToken_
 
edm::ESHandle
< ESTimeSampleWeights
esWeights_
 
edm::ESGetToken
< ESTimeSampleWeights,
ESTimeSampleWeightsRcd
esWeightsToken_
 
int recoAlgo_
 

Detailed Description

Definition at line 37 of file ESRecHitWorker.h.

Constructor & Destructor Documentation

ESRecHitWorker::ESRecHitWorker ( const edm::ParameterSet ps,
edm::ConsumesCollector  cc 
)

Definition at line 13 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, esAngleCorrFactorsToken_, esChannelStatusToken_, edm::ConsumesCollector::esConsumes(), esgainToken_, esMIPsToken_, esMIPToGeVToken_, esPedestalsToken_, esRatioCutsToken_, esWeightsToken_, edm::ParameterSet::getParameter(), and recoAlgo_.

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 }
Definition: ESGain.h:7
ESRecHitSimAlgo * algoW_
ESPedestalsMap ESPedestals
Definition: ESPedestals.h:29
ESRecHitWorkerBaseClass(const edm::ParameterSet &)
ESChannelStatusMap ESChannelStatus
edm::ESGetToken< ESAngleCorrectionFactors, ESAngleCorrectionFactorsRcd > esAngleCorrFactorsToken_
ESRecHitFitAlgo * algoF_
ESAngleCorrectionFactorMap ESAngleCorrectionFactors
edm::ESGetToken< ESPedestals, ESPedestalsRcd > esPedestalsToken_
edm::ESGetToken< ESRecHitRatioCuts, ESRecHitRatioCutsRcd > esRatioCutsToken_
edm::ESGetToken< ESTimeSampleWeights, ESTimeSampleWeightsRcd > esWeightsToken_
ESIntercalibConstantMap ESIntercalibConstants
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESRecHitAnalyticAlgo * algoA_
edm::ESGetToken< ESGain, ESGainRcd > esgainToken_
edm::ESGetToken< ESMIPToGeVConstant, ESMIPToGeVConstantRcd > esMIPToGeVToken_
edm::ESGetToken< ESChannelStatus, ESChannelStatusRcd > esChannelStatusToken_
edm::ESGetToken< ESIntercalibConstants, ESIntercalibConstantsRcd > esMIPsToken_
ESRecHitWorker::~ESRecHitWorker ( )
override

Definition at line 32 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, and recoAlgo_.

32  {
33  if (recoAlgo_ == 0)
34  delete algoW_;
35  else if (recoAlgo_ == 1)
36  delete algoF_;
37  else
38  delete algoA_;
39 }
ESRecHitSimAlgo * algoW_
ESRecHitFitAlgo * algoF_
ESRecHitAnalyticAlgo * algoA_

Member Function Documentation

bool ESRecHitWorker::run ( const ESDigiCollection::const_iterator digi,
ESRecHitCollection result 
)
overridevirtual

Implements ESRecHitWorkerBaseClass.

Definition at line 103 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, edm::SortedCollection< T, SORT >::push_back(), recoAlgo_, ESRecHitSimAlgo::reconstruct(), ESRecHitAnalyticAlgo::reconstruct(), and ESRecHitFitAlgo::reconstruct().

103  {
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 }
EcalRecHit reconstruct(const ESDataFrame &digi) const
void push_back(T const &t)
ESRecHitSimAlgo * algoW_
ESRecHitFitAlgo * algoF_
EcalRecHit reconstruct(const ESDataFrame &digi) const
EcalRecHit reconstruct(const ESDataFrame &digi) const
ESRecHitAnalyticAlgo * algoA_
void ESRecHitWorker::set ( const edm::EventSetup es)
overridevirtual

Implements ESRecHitWorkerBaseClass.

Definition at line 41 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, esAngleCorrFactors_, esAngleCorrFactorsToken_, esChannelStatus_, esChannelStatusToken_, esgain_, esgainToken_, esMIPs_, esMIPsToken_, esMIPToGeV_, esMIPToGeVToken_, esPedestals_, esPedestalsToken_, esRatioCuts_, esRatioCutsToken_, esWeights_, esWeightsToken_, ESGain::getESGain(), ESMIPToGeVConstant::getESValueHigh(), ESMIPToGeVConstant::getESValueLow(), edm::EventSetup::getHandle(), ESTimeSampleWeights::getWeightForTS0(), ESTimeSampleWeights::getWeightForTS1(), ESTimeSampleWeights::getWeightForTS2(), edm::ESHandle< class >::product(), recoAlgo_, ESRecHitSimAlgo::setAngleCorrectionFactors(), ESRecHitAnalyticAlgo::setAngleCorrectionFactors(), ESRecHitFitAlgo::setAngleCorrectionFactors(), ESRecHitSimAlgo::setChannelStatus(), ESRecHitAnalyticAlgo::setChannelStatus(), ESRecHitFitAlgo::setChannelStatus(), ESRecHitSimAlgo::setESGain(), ESRecHitAnalyticAlgo::setESGain(), ESRecHitFitAlgo::setESGain(), ESRecHitSimAlgo::setIntercalibConstants(), ESRecHitAnalyticAlgo::setIntercalibConstants(), ESRecHitFitAlgo::setIntercalibConstants(), ESRecHitSimAlgo::setMIPGeV(), ESRecHitAnalyticAlgo::setMIPGeV(), ESRecHitFitAlgo::setMIPGeV(), ESRecHitSimAlgo::setPedestals(), ESRecHitAnalyticAlgo::setPedestals(), ESRecHitFitAlgo::setPedestals(), ESRecHitSimAlgo::setRatioCuts(), ESRecHitAnalyticAlgo::setRatioCuts(), ESRecHitFitAlgo::setRatioCuts(), ESRecHitSimAlgo::setW0(), ESRecHitSimAlgo::setW1(), ESRecHitSimAlgo::setW2(), and w2.

41  {
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 }
void setIntercalibConstants(const ESIntercalibConstants *mips)
edm::ESHandle< ESGain > esgain_
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 setESGain(const double &value)
ESRecHitSimAlgo * algoW_
void setPedestals(const ESPedestals *peds)
void setMIPGeV(float value)
void setPedestals(const ESPedestals *peds)
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
edm::ESGetToken< ESPedestals, ESPedestalsRcd > esPedestalsToken_
edm::ESGetToken< ESRecHitRatioCuts, ESRecHitRatioCutsRcd > esRatioCutsToken_
void setMIPGeV(const double &value)
edm::ESHandle< ESPedestals > esPedestals_
void setMIPGeV(const double &value)
edm::ESHandle< ESChannelStatus > esChannelStatus_
void setRatioCuts(const ESRecHitRatioCuts *ratioCuts)
void setESGain(float value)
edm::ESHandle< ESTimeSampleWeights > esWeights_
edm::ESHandle< ESMIPToGeVConstant > esMIPToGeV_
edm::ESHandle< ESAngleCorrectionFactors > esAngleCorrFactors_
edm::ESGetToken< ESTimeSampleWeights, ESTimeSampleWeightsRcd > esWeightsToken_
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
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setW2(float value)
void setChannelStatus(const ESChannelStatus *status)
void setESGain(const double &value)
void setChannelStatus(const ESChannelStatus *status)
ESRecHitAnalyticAlgo * algoA_
edm::ESGetToken< ESGain, ESGainRcd > esgainToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
edm::ESHandle< ESIntercalibConstants > esMIPs_
float getESValueHigh() const
edm::ESGetToken< ESMIPToGeVConstant, ESMIPToGeVConstantRcd > esMIPToGeVToken_
edm::ESGetToken< ESChannelStatus, ESChannelStatusRcd > esChannelStatusToken_
edm::ESGetToken< ESIntercalibConstants, ESIntercalibConstantsRcd > esMIPsToken_

Member Data Documentation

ESRecHitAnalyticAlgo* ESRecHitWorker::algoA_
private

Definition at line 49 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().

ESRecHitFitAlgo* ESRecHitWorker::algoF_
private

Definition at line 48 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().

ESRecHitSimAlgo* ESRecHitWorker::algoW_
private

Definition at line 47 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().

edm::ESHandle<ESAngleCorrectionFactors> ESRecHitWorker::esAngleCorrFactors_
private

Definition at line 58 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESAngleCorrectionFactors, ESAngleCorrectionFactorsRcd> ESRecHitWorker::esAngleCorrFactorsToken_
private

Definition at line 66 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESChannelStatus> ESRecHitWorker::esChannelStatus_
private

Definition at line 56 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESChannelStatus, ESChannelStatusRcd> ESRecHitWorker::esChannelStatusToken_
private

Definition at line 64 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESGain> ESRecHitWorker::esgain_
private

Definition at line 51 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESGain, ESGainRcd> ESRecHitWorker::esgainToken_
private

Definition at line 59 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESIntercalibConstants> ESRecHitWorker::esMIPs_
private

Definition at line 55 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESIntercalibConstants, ESIntercalibConstantsRcd> ESRecHitWorker::esMIPsToken_
private

Definition at line 63 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESMIPToGeVConstant> ESRecHitWorker::esMIPToGeV_
private

Definition at line 52 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESMIPToGeVConstant, ESMIPToGeVConstantRcd> ESRecHitWorker::esMIPToGeVToken_
private

Definition at line 60 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESPedestals> ESRecHitWorker::esPedestals_
private

Definition at line 54 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESPedestals, ESPedestalsRcd> ESRecHitWorker::esPedestalsToken_
private

Definition at line 62 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESRecHitRatioCuts> ESRecHitWorker::esRatioCuts_
private

Definition at line 57 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESRecHitRatioCuts, ESRecHitRatioCutsRcd> ESRecHitWorker::esRatioCutsToken_
private

Definition at line 65 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

edm::ESHandle<ESTimeSampleWeights> ESRecHitWorker::esWeights_
private

Definition at line 53 of file ESRecHitWorker.h.

Referenced by set().

edm::ESGetToken<ESTimeSampleWeights, ESTimeSampleWeightsRcd> ESRecHitWorker::esWeightsToken_
private

Definition at line 61 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), and set().

int ESRecHitWorker::recoAlgo_
private

Definition at line 46 of file ESRecHitWorker.h.

Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().