CMS 3D CMS Logo

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)
 
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< ESAngleCorrectionFactorsesAngleCorrFactors_
 
edm::ESHandle< ESChannelStatusesChannelStatus_
 
edm::ESHandle< ESGainesgain_
 
edm::ESHandle< ESIntercalibConstantsesMIPs_
 
edm::ESHandle< ESMIPToGeVConstantesMIPToGeV_
 
edm::ESHandle< ESPedestalsesPedestals_
 
edm::ESHandle< ESRecHitRatioCutsesRatioCuts_
 
edm::ESHandle< ESTimeSampleWeightsesWeights_
 
int recoAlgo_
 

Detailed Description

Definition at line 27 of file ESRecHitWorker.h.

Constructor & Destructor Documentation

ESRecHitWorker::ESRecHitWorker ( const edm::ParameterSet ps)

Definition at line 22 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, edm::ParameterSet::getParameter(), and recoAlgo_.

22  :
24 {
25  recoAlgo_ = ps.getParameter<int>("ESRecoAlgo");
26 
27  if (recoAlgo_ == 0)
28  algoW_ = new ESRecHitSimAlgo();
29  else if (recoAlgo_ == 1)
30  algoF_ = new ESRecHitFitAlgo();
31  else
33 }
T getParameter(std::string const &) const
ESRecHitSimAlgo * algoW_
ESRecHitWorkerBaseClass(const edm::ParameterSet &)
ESRecHitFitAlgo * algoF_
ESRecHitAnalyticAlgo * algoA_
ESRecHitWorker::~ESRecHitWorker ( )
override

Definition at line 35 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, and recoAlgo_.

35  {
36  if (recoAlgo_ == 0)
37  delete algoW_;
38  else if (recoAlgo_ == 1)
39  delete algoF_;
40  else
41  delete algoA_;
42 }
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 108 of file ESRecHitWorker.cc.

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

110 {
111  if (recoAlgo_ == 0)
112  result.push_back( algoW_->reconstruct(*itdg) );
113  else if (recoAlgo_ == 1)
114  result.push_back( algoF_->reconstruct(*itdg) );
115  else
116  result.push_back( algoA_->reconstruct(*itdg) );
117  return true;
118 }
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 44 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, esAngleCorrFactors_, esChannelStatus_, esgain_, esMIPs_, esMIPToGeV_, esPedestals_, esRatioCuts_, esWeights_, muonCSCDigis_cfi::gain, edm::EventSetup::get(), ESGain::getESGain(), ESMIPToGeVConstant::getESValueHigh(), ESMIPToGeVConstant::getESValueLow(), ESTimeSampleWeights::getWeightForTS0(), ESTimeSampleWeights::getWeightForTS1(), ESTimeSampleWeights::getWeightForTS2(), edm::ESHandle< T >::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.

44  {
45 
46  es.get<ESGainRcd>().get(esgain_);
47  const ESGain *gain = esgain_.product();
48 
50  const ESMIPToGeVConstant *mipToGeV = esMIPToGeV_.product();
51 
52  double ESGain = gain->getESGain();
53  double ESMIPToGeV = (ESGain == 1) ? mipToGeV->getESValueLow() : mipToGeV->getESValueHigh();
54 
56  const ESTimeSampleWeights *wgts = esWeights_.product();
57 
58  float w0 = wgts->getWeightForTS0();
59  float w1 = wgts->getWeightForTS1();
60  float w2 = wgts->getWeightForTS2();
61 
62  es.get<ESPedestalsRcd>().get(esPedestals_);
63  const ESPedestals *peds = esPedestals_.product();
64 
66  const ESIntercalibConstants *mips = esMIPs_.product();
67 
69  const ESAngleCorrectionFactors *ang = esAngleCorrFactors_.product();
70 
72  const ESChannelStatus *channelStatus = esChannelStatus_.product();
73 
75  const ESRecHitRatioCuts *ratioCuts = esRatioCuts_.product();
76 
77  if (recoAlgo_ == 0) {
78  algoW_->setESGain(ESGain);
79  algoW_->setMIPGeV(ESMIPToGeV);
80  algoW_->setW0(w0);
81  algoW_->setW1(w1);
82  algoW_->setW2(w2);
83  algoW_->setPedestals(peds);
85  algoW_->setChannelStatus(channelStatus);
86  algoW_->setRatioCuts(ratioCuts);
88  } else if (recoAlgo_ == 1) {
89  algoF_->setESGain(ESGain);
90  algoF_->setMIPGeV(ESMIPToGeV);
91  algoF_->setPedestals(peds);
93  algoF_->setChannelStatus(channelStatus);
94  algoF_->setRatioCuts(ratioCuts);
96  } else {
97  algoA_->setESGain(ESGain);
98  algoA_->setMIPGeV(ESMIPToGeV);
99  algoA_->setPedestals(peds);
101  algoA_->setChannelStatus(channelStatus);
102  algoA_->setRatioCuts(ratioCuts);
104  }
105 }
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::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
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_
float getESGain() const
Definition: ESGain.h:13
void setIntercalibConstants(const ESIntercalibConstants *mips)
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setChannelStatus(const ESChannelStatus *status)
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setAngleCorrectionFactors(const ESAngleCorrectionFactors *ang)
void setW2(float value)
T get() const
Definition: EventSetup.h:63
void setChannelStatus(const ESChannelStatus *status)
void setESGain(const double &value)
void setChannelStatus(const ESChannelStatus *status)
ESRecHitAnalyticAlgo * algoA_
edm::ESHandle< ESIntercalibConstants > esMIPs_
float getESValueHigh() const
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

ESRecHitAnalyticAlgo* ESRecHitWorker::algoA_
private

Definition at line 42 of file ESRecHitWorker.h.

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

ESRecHitFitAlgo* ESRecHitWorker::algoF_
private

Definition at line 41 of file ESRecHitWorker.h.

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

ESRecHitSimAlgo* ESRecHitWorker::algoW_
private

Definition at line 40 of file ESRecHitWorker.h.

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

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

Definition at line 51 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 49 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 44 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 48 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 45 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 47 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 50 of file ESRecHitWorker.h.

Referenced by set().

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

Definition at line 46 of file ESRecHitWorker.h.

Referenced by set().

int ESRecHitWorker::recoAlgo_
private

Definition at line 39 of file ESRecHitWorker.h.

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