CMS 3D CMS Logo

Public Member Functions | Private Attributes

ESRecHitWorker Class Reference

#include <ESRecHitWorker.h>

Inheritance diagram for ESRecHitWorker:
ESRecHitWorkerBaseClass

List of all members.

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

ESRecHitAnalyticAlgoalgoA_
ESRecHitFitAlgoalgoF_
ESRecHitSimAlgoalgoW_
edm::ESHandle
< ESAngleCorrectionFactors
esAngleCorrFactors_
edm::ESHandle< ESChannelStatusesChannelStatus_
edm::ESHandle< ESGainesgain_
edm::ESHandle
< ESIntercalibConstants
esMIPs_
edm::ESHandle< ESMIPToGeVConstantesMIPToGeV_
edm::ESHandle< ESPedestalsesPedestals_
edm::ESHandle< ESRecHitRatioCutsesRatioCuts_
edm::ESHandle
< ESTimeSampleWeights
esWeights_
int recoAlgo_

Detailed Description

Definition at line 28 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_.

                                                        :
        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 ( )

Definition at line 35 of file ESRecHitWorker.cc.

References algoA_, algoF_, algoW_, and recoAlgo_.

                                {
  if (recoAlgo_ == 0)
    delete algoW_;
  else if (recoAlgo_ == 1)
    delete algoF_;
  else 
    delete algoA_;
}

Member Function Documentation

bool ESRecHitWorker::run ( const edm::Event evt,
const ESDigiCollection::const_iterator digi,
ESRecHitCollection result 
) [virtual]
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);
  }
}

Member Data Documentation

Definition at line 43 of file ESRecHitWorker.h.

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

Definition at line 42 of file ESRecHitWorker.h.

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

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().

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().

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().

Definition at line 40 of file ESRecHitWorker.h.

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