#include <EcalUncalibRecHitWorkerRatio.h>
Public Member Functions | |
EcalUncalibRecHitWorkerRatio (const edm::ParameterSet &) | |
bool | run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result) |
void | set (const edm::EventSetup &es) |
virtual | ~EcalUncalibRecHitWorkerRatio () |
Protected Attributes | |
std::vector< double > | EBamplitudeFitParameters_ |
double | EBtimeConstantTerm_ |
std::pair< double, double > | EBtimeFitLimits_ |
std::vector< double > | EBtimeFitParameters_ |
std::vector< double > | EEamplitudeFitParameters_ |
double | EEtimeConstantTerm_ |
std::pair< double, double > | EEtimeFitLimits_ |
std::vector< double > | EEtimeFitParameters_ |
double | gainRatios [3] |
edm::ESHandle< EcalGainRatios > | gains |
double | pedRMSVec [3] |
edm::ESHandle< EcalPedestals > | peds |
double | pedVec [3] |
EcalUncalibRecHitRatioMethodAlgo < EBDataFrame > | uncalibMaker_barrel_ |
EcalUncalibRecHitRatioMethodAlgo < EEDataFrame > | uncalibMaker_endcap_ |
Definition at line 26 of file EcalUncalibRecHitWorkerRatio.h.
EcalUncalibRecHitWorkerRatio::EcalUncalibRecHitWorkerRatio | ( | const edm::ParameterSet & | ps | ) |
Definition at line 11 of file EcalUncalibRecHitWorkerRatio.cc.
References EBamplitudeFitParameters_, EBtimeConstantTerm_, EBtimeFitLimits_, EBtimeFitParameters_, EEamplitudeFitParameters_, EEtimeConstantTerm_, EEtimeFitLimits_, EEtimeFitParameters_, and edm::ParameterSet::getParameter().
: EcalUncalibRecHitWorkerBaseClass(ps) { EBtimeFitParameters_ = ps.getParameter<std::vector<double> >("EBtimeFitParameters"); EEtimeFitParameters_ = ps.getParameter<std::vector<double> >("EEtimeFitParameters"); EBamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EBamplitudeFitParameters"); EEamplitudeFitParameters_ = ps.getParameter<std::vector<double> >("EEamplitudeFitParameters"); EBtimeFitLimits_.first = ps.getParameter<double>("EBtimeFitLimits_Lower"); EBtimeFitLimits_.second = ps.getParameter<double>("EBtimeFitLimits_Upper"); EEtimeFitLimits_.first = ps.getParameter<double>("EEtimeFitLimits_Lower"); EEtimeFitLimits_.second = ps.getParameter<double>("EEtimeFitLimits_Upper"); EBtimeConstantTerm_ = ps.getParameter<double>("EBtimeConstantTerm"); EEtimeConstantTerm_ = ps.getParameter<double>("EEtimeConstantTerm"); }
virtual EcalUncalibRecHitWorkerRatio::~EcalUncalibRecHitWorkerRatio | ( | ) | [inline, virtual] |
Definition at line 30 of file EcalUncalibRecHitWorkerRatio.h.
{};
bool EcalUncalibRecHitWorkerRatio::run | ( | const edm::Event & | evt, |
const EcalDigiCollection::const_iterator & | digi, | ||
EcalUncalibratedRecHitCollection & | result | ||
) | [virtual] |
Implements EcalUncalibRecHitWorkerBaseClass.
Definition at line 40 of file EcalUncalibRecHitWorkerRatio.cc.
References EcalUncalibRecHitRatioMethodAlgo< C >::computeAmplitude(), EcalUncalibRecHitRatioMethodAlgo< C >::computeTime(), cond::rpcobgas::detid, EBamplitudeFitParameters_, EBtimeConstantTerm_, EBtimeFitLimits_, EBtimeFitParameters_, EcalEndcap, EEamplitudeFitParameters_, EEtimeConstantTerm_, EEtimeFitLimits_, EEtimeFitParameters_, EcalUncalibRecHitRatioMethodAlgo< C >::fixMGPAslew(), EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), gainRatios, gains, EcalUncalibRecHitRatioMethodAlgo< C >::getCalculatedRecHit(), EEDetId::hashedIndex(), ecalpyutils::hashedIndex(), EBDetId::hashedIndex(), EcalUncalibRecHitRatioMethodAlgo< C >::init(), pedRMSVec, peds, pedVec, funct::pow(), edm::SortedCollection< T, SORT >::push_back(), EcalUncalibratedRecHit::setAmplitude(), EcalUncalibratedRecHit::setJitter(), EcalUncalibratedRecHit::setJitterError(), mathSSE::sqrt(), uncalibMaker_barrel_, and uncalibMaker_endcap_.
{ DetId detid(itdg->id()); const EcalPedestals::Item * aped = 0; const EcalMGPAGainRatio * aGain = 0; if (detid.subdetId()==EcalEndcap) { unsigned int hashedIndex = EEDetId(detid).hashedIndex(); aped = &peds->endcap(hashedIndex); aGain = &gains->endcap(hashedIndex); } else { unsigned int hashedIndex = EBDetId(detid).hashedIndex(); aped = &peds->barrel(hashedIndex); aGain = &gains->barrel(hashedIndex); } pedVec[0] = aped->mean_x12; pedVec[1] = aped->mean_x6; pedVec[2] = aped->mean_x1; pedRMSVec[0] = aped->rms_x12; pedRMSVec[1] = aped->rms_x6; pedRMSVec[2] = aped->rms_x1; gainRatios[0] = 1.; gainRatios[1] = aGain->gain12Over6(); gainRatios[2] = aGain->gain6Over1()*aGain->gain12Over6(); float clockToNsConstant = 25.; EcalUncalibratedRecHit uncalibRecHit; if (detid.subdetId()==EcalEndcap) { uncalibMaker_endcap_.init(*itdg, pedVec, pedRMSVec, gainRatios); uncalibMaker_endcap_.computeTime(EEtimeFitParameters_, EEtimeFitLimits_, EEamplitudeFitParameters_ ); uncalibMaker_endcap_.computeAmplitude(EEamplitudeFitParameters_); EcalUncalibRecHitRatioMethodAlgo<EEDataFrame>::CalculatedRecHit crh = uncalibMaker_endcap_.getCalculatedRecHit(); uncalibRecHit.setAmplitude( crh.amplitudeMax ); uncalibRecHit.setJitter( crh.timeMax - 5 ); uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) + std::pow(EEtimeConstantTerm_,2)/ std::pow(clockToNsConstant,2)) ); } else { uncalibMaker_barrel_.init(*itdg, pedVec, pedRMSVec, gainRatios); bool gainSwitch = uncalibMaker_barrel_.fixMGPAslew(*itdg); uncalibMaker_barrel_.computeTime(EBtimeFitParameters_, EBtimeFitLimits_, EBamplitudeFitParameters_ ); uncalibMaker_barrel_.computeAmplitude(EBamplitudeFitParameters_); EcalUncalibRecHitRatioMethodAlgo<EBDataFrame>::CalculatedRecHit crh = uncalibMaker_barrel_.getCalculatedRecHit(); uncalibRecHit.setAmplitude( crh.amplitudeMax ); if(gainSwitch){ // introduce additional 1ns shift uncalibRecHit.setJitter( crh.timeMax - 5 - 0.04 ); }else{ uncalibRecHit.setJitter( crh.timeMax - 5); } uncalibRecHit.setJitterError( std::sqrt(pow(crh.timeError,2) + std::pow(EBtimeConstantTerm_,2)/ std::pow(clockToNsConstant,2)) ); } result.push_back(uncalibRecHit); return true; }
void EcalUncalibRecHitWorkerRatio::set | ( | const edm::EventSetup & | es | ) | [virtual] |
Implements EcalUncalibRecHitWorkerBaseClass.
Definition at line 31 of file EcalUncalibRecHitWorkerRatio.cc.
References gains, edm::EventSetup::get(), and peds.
{ es.get<EcalGainRatiosRcd>().get(gains); es.get<EcalPedestalsRcd>().get(peds); }
std::vector<double> EcalUncalibRecHitWorkerRatio::EBamplitudeFitParameters_ [protected] |
Definition at line 47 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
double EcalUncalibRecHitWorkerRatio::EBtimeConstantTerm_ [protected] |
Definition at line 53 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
std::pair<double,double> EcalUncalibRecHitWorkerRatio::EBtimeFitLimits_ [protected] |
Definition at line 50 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
std::vector<double> EcalUncalibRecHitWorkerRatio::EBtimeFitParameters_ [protected] |
Definition at line 44 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
std::vector<double> EcalUncalibRecHitWorkerRatio::EEamplitudeFitParameters_ [protected] |
Definition at line 48 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
double EcalUncalibRecHitWorkerRatio::EEtimeConstantTerm_ [protected] |
Definition at line 54 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
std::pair<double,double> EcalUncalibRecHitWorkerRatio::EEtimeFitLimits_ [protected] |
Definition at line 51 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
std::vector<double> EcalUncalibRecHitWorkerRatio::EEtimeFitParameters_ [protected] |
Definition at line 45 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by EcalUncalibRecHitWorkerRatio(), and run().
double EcalUncalibRecHitWorkerRatio::gainRatios[3] [protected] |
Definition at line 42 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by run().
Definition at line 38 of file EcalUncalibRecHitWorkerRatio.h.
double EcalUncalibRecHitWorkerRatio::pedRMSVec[3] [protected] |
Definition at line 41 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by run().
edm::ESHandle<EcalPedestals> EcalUncalibRecHitWorkerRatio::peds [protected] |
Definition at line 37 of file EcalUncalibRecHitWorkerRatio.h.
double EcalUncalibRecHitWorkerRatio::pedVec[3] [protected] |
Definition at line 40 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by run().
EcalUncalibRecHitRatioMethodAlgo<EBDataFrame> EcalUncalibRecHitWorkerRatio::uncalibMaker_barrel_ [protected] |
Definition at line 56 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by run().
EcalUncalibRecHitRatioMethodAlgo<EEDataFrame> EcalUncalibRecHitWorkerRatio::uncalibMaker_endcap_ [protected] |
Definition at line 57 of file EcalUncalibRecHitWorkerRatio.h.
Referenced by run().