#include <ESRecHitWorker.h>
Public Member Functions | |
ESRecHitWorker (const edm::ParameterSet &ps) | |
bool | run (const edm::Event &evt, const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result) |
void | set (const edm::EventSetup &es) |
~ESRecHitWorker () | |
Private Attributes | |
ESRecHitAnalyticAlgo * | algoA_ |
ESRecHitFitAlgo * | algoF_ |
ESRecHitSimAlgo * | algoW_ |
edm::ESHandle < ESAngleCorrectionFactors > | esAngleCorrFactors_ |
edm::ESHandle< ESChannelStatus > | esChannelStatus_ |
edm::ESHandle< ESGain > | esgain_ |
edm::ESHandle < ESIntercalibConstants > | esMIPs_ |
edm::ESHandle< ESMIPToGeVConstant > | esMIPToGeV_ |
edm::ESHandle< ESPedestals > | esPedestals_ |
edm::ESHandle< ESRecHitRatioCuts > | esRatioCuts_ |
edm::ESHandle < ESTimeSampleWeights > | esWeights_ |
int | recoAlgo_ |
Definition at line 28 of file ESRecHitWorker.h.
ESRecHitWorker::ESRecHitWorker | ( | const edm::ParameterSet & | ps | ) |
Definition at line 22 of file ESRecHitWorker.cc.
References algoA_, algoF_, algoW_, edm::ParameterSet::getParameter(), and recoAlgo_.
: ESRecHitWorkerBaseClass( ps ) { recoAlgo_ = ps.getParameter<int>("ESRecoAlgo"); if (recoAlgo_ == 0) algoW_ = new ESRecHitSimAlgo(); else if (recoAlgo_ == 1) algoF_ = new ESRecHitFitAlgo(); else algoA_ = new ESRecHitAnalyticAlgo(); }
ESRecHitWorker::~ESRecHitWorker | ( | ) |
bool ESRecHitWorker::run | ( | const edm::Event & | evt, |
const ESDigiCollection::const_iterator & | digi, | ||
ESRecHitCollection & | result | ||
) | [virtual] |
Implements ESRecHitWorkerBaseClass.
Definition at line 108 of file ESRecHitWorker.cc.
References algoA_, algoF_, algoW_, edm::SortedCollection< T, SORT >::push_back(), recoAlgo_, ESRecHitSimAlgo::reconstruct(), ESRecHitAnalyticAlgo::reconstruct(), and ESRecHitFitAlgo::reconstruct().
{ if (recoAlgo_ == 0) result.push_back( algoW_->reconstruct(*itdg) ); else if (recoAlgo_ == 1) result.push_back( algoF_->reconstruct(*itdg) ); else result.push_back( algoA_->reconstruct(*itdg) ); return true; }
void ESRecHitWorker::set | ( | const edm::EventSetup & | es | ) | [virtual] |
Implements ESRecHitWorkerBaseClass.
Definition at line 44 of file ESRecHitWorker.cc.
References algoA_, algoF_, algoW_, esAngleCorrFactors_, esChannelStatus_, esgain_, esMIPs_, esMIPToGeV_, esPedestals_, esRatioCuts_, esWeights_, edm::EventSetup::get(), ESGain::getESGain(), ESMIPToGeVConstant::getESValueHigh(), ESMIPToGeVConstant::getESValueLow(), ESTimeSampleWeights::getWeightForTS0(), ESTimeSampleWeights::getWeightForTS1(), ESTimeSampleWeights::getWeightForTS2(), edm::ESHandle< T >::product(), recoAlgo_, ESRecHitFitAlgo::setAngleCorrectionFactors(), ESRecHitAnalyticAlgo::setAngleCorrectionFactors(), ESRecHitSimAlgo::setAngleCorrectionFactors(), ESRecHitFitAlgo::setChannelStatus(), ESRecHitSimAlgo::setChannelStatus(), ESRecHitAnalyticAlgo::setChannelStatus(), ESRecHitFitAlgo::setESGain(), ESRecHitAnalyticAlgo::setESGain(), ESRecHitSimAlgo::setESGain(), ESRecHitFitAlgo::setIntercalibConstants(), ESRecHitSimAlgo::setIntercalibConstants(), ESRecHitAnalyticAlgo::setIntercalibConstants(), ESRecHitSimAlgo::setMIPGeV(), ESRecHitAnalyticAlgo::setMIPGeV(), ESRecHitFitAlgo::setMIPGeV(), ESRecHitSimAlgo::setPedestals(), ESRecHitFitAlgo::setPedestals(), ESRecHitAnalyticAlgo::setPedestals(), ESRecHitSimAlgo::setRatioCuts(), ESRecHitAnalyticAlgo::setRatioCuts(), ESRecHitFitAlgo::setRatioCuts(), ESRecHitSimAlgo::setW0(), ESRecHitSimAlgo::setW1(), ESRecHitSimAlgo::setW2(), and w2.
{ es.get<ESGainRcd>().get(esgain_); const ESGain *gain = esgain_.product(); es.get<ESMIPToGeVConstantRcd>().get(esMIPToGeV_); const ESMIPToGeVConstant *mipToGeV = esMIPToGeV_.product(); double ESGain = gain->getESGain(); double ESMIPToGeV = (ESGain == 1) ? mipToGeV->getESValueLow() : mipToGeV->getESValueHigh(); es.get<ESTimeSampleWeightsRcd>().get(esWeights_); const ESTimeSampleWeights *wgts = esWeights_.product(); float w0 = wgts->getWeightForTS0(); float w1 = wgts->getWeightForTS1(); float w2 = wgts->getWeightForTS2(); es.get<ESPedestalsRcd>().get(esPedestals_); const ESPedestals *peds = esPedestals_.product(); es.get<ESIntercalibConstantsRcd>().get(esMIPs_); const ESIntercalibConstants *mips = esMIPs_.product(); es.get<ESAngleCorrectionFactorsRcd>().get(esAngleCorrFactors_); const ESAngleCorrectionFactors *ang = esAngleCorrFactors_.product(); es.get<ESChannelStatusRcd>().get(esChannelStatus_); const ESChannelStatus *channelStatus = esChannelStatus_.product(); es.get<ESRecHitRatioCutsRcd>().get(esRatioCuts_); const ESRecHitRatioCuts *ratioCuts = esRatioCuts_.product(); if (recoAlgo_ == 0) { algoW_->setESGain(ESGain); algoW_->setMIPGeV(ESMIPToGeV); algoW_->setW0(w0); algoW_->setW1(w1); algoW_->setW2(w2); algoW_->setPedestals(peds); algoW_->setIntercalibConstants(mips); algoW_->setChannelStatus(channelStatus); algoW_->setRatioCuts(ratioCuts); algoW_->setAngleCorrectionFactors(ang); } else if (recoAlgo_ == 1) { algoF_->setESGain(ESGain); algoF_->setMIPGeV(ESMIPToGeV); algoF_->setPedestals(peds); algoF_->setIntercalibConstants(mips); algoF_->setChannelStatus(channelStatus); algoF_->setRatioCuts(ratioCuts); algoF_->setAngleCorrectionFactors(ang); } else { algoA_->setESGain(ESGain); algoA_->setMIPGeV(ESMIPToGeV); algoA_->setPedestals(peds); algoA_->setIntercalibConstants(mips); algoA_->setChannelStatus(channelStatus); algoA_->setRatioCuts(ratioCuts); algoA_->setAngleCorrectionFactors(ang); } }
ESRecHitAnalyticAlgo* ESRecHitWorker::algoA_ [private] |
Definition at line 43 of file ESRecHitWorker.h.
Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().
ESRecHitFitAlgo* ESRecHitWorker::algoF_ [private] |
Definition at line 42 of file ESRecHitWorker.h.
Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().
ESRecHitSimAlgo* ESRecHitWorker::algoW_ [private] |
Definition at line 41 of file ESRecHitWorker.h.
Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().
Definition at line 52 of file ESRecHitWorker.h.
Referenced by set().
Definition at line 50 of file ESRecHitWorker.h.
Referenced by set().
edm::ESHandle<ESGain> ESRecHitWorker::esgain_ [private] |
Definition at line 45 of file ESRecHitWorker.h.
Referenced by set().
Definition at line 49 of file ESRecHitWorker.h.
Referenced by set().
Definition at line 46 of file ESRecHitWorker.h.
Referenced by set().
edm::ESHandle<ESPedestals> ESRecHitWorker::esPedestals_ [private] |
Definition at line 48 of file ESRecHitWorker.h.
Referenced by set().
Definition at line 51 of file ESRecHitWorker.h.
Referenced by set().
Definition at line 47 of file ESRecHitWorker.h.
Referenced by set().
int ESRecHitWorker::recoAlgo_ [private] |
Definition at line 40 of file ESRecHitWorker.h.
Referenced by ESRecHitWorker(), run(), set(), and ~ESRecHitWorker().