#include <EcalUncalibRecHitWorkerAnalFit.h>
Public Member Functions | |
EcalUncalibRecHitWorkerAnalFit (const edm::ParameterSet &ps) | |
bool | run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result) |
void | set (const edm::EventSetup &es) |
~EcalUncalibRecHitWorkerAnalFit () | |
Private Attributes | |
EcalUncalibRecHitRecAnalFitAlgo < EBDataFrame > | algoEB_ |
EcalUncalibRecHitRecAnalFitAlgo < EEDataFrame > | algoEE_ |
edm::ESHandle< EcalPedestals > | pedHandle |
edm::ESHandle< EcalGainRatios > | pRatio |
produce ECAL uncalibrated rechits from dataframes with the analytical fit method
Definition at line 26 of file EcalUncalibRecHitWorkerAnalFit.h.
EcalUncalibRecHitWorkerAnalFit::EcalUncalibRecHitWorkerAnalFit | ( | const edm::ParameterSet & | ps | ) |
Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.cc.
: EcalUncalibRecHitWorkerBaseClass( ps ) { }
EcalUncalibRecHitWorkerAnalFit::~EcalUncalibRecHitWorkerAnalFit | ( | ) | [inline] |
Definition at line 30 of file EcalUncalibRecHitWorkerAnalFit.h.
{};
bool EcalUncalibRecHitWorkerAnalFit::run | ( | const edm::Event & | evt, |
const EcalDigiCollection::const_iterator & | digi, | ||
EcalUncalibratedRecHitCollection & | result | ||
) | [virtual] |
Implements EcalUncalibRecHitWorkerBaseClass.
Definition at line 61 of file EcalUncalibRecHitWorkerAnalFit.cc.
References algoEB_, algoEE_, EcalUncalibratedRecHit::amplitude(), cond::rpcobgas::detid, EcalBarrel, LogDebug, EcalUncalibRecHitRecAnalFitAlgo< C >::makeRecHit(), pedHandle, pRatio, edm::ESHandle< T >::product(), and edm::SortedCollection< T, SORT >::push_back().
{ using namespace edm; const EcalGainRatioMap & gainMap = pRatio.product()->getMap(); // map of gain ratios const EcalPedestalsMap & pedMap = pedHandle.product()->getMap(); // map of pedestals EcalPedestalsMapIterator pedIter; // pedestal iterator EcalPedestals::Item aped; // pedestal object for a single xtal EcalGainRatioMap::const_iterator gainIter; // gain iterator EcalMGPAGainRatio aGain; // gain object for a single xtal DetId detid( itdg->id() ); // find pedestals for this channel //LogDebug("EcalUncalibRecHitDebug") << "looking up pedestal for crystal: " << itdg->id(); // FIXME pedIter = pedMap.find( detid ); if( pedIter != pedMap.end() ) { aped = (*pedIter); } else { edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "error!! could not find pedestals for channel: "; if ( detid.subdetId() == EcalBarrel ) { edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EBDetId( detid ); } else { edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EEDetId( detid ); } edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "\n no uncalib rechit will be made for this digi!"; return false; } double pedVec[3]; pedVec[0] = aped.mean_x12; pedVec[1] = aped.mean_x6; pedVec[2] = aped.mean_x1; // find gain ratios //LogDebug("EcalUncalibRecHitDebug") << "looking up gainRatios for crystal: " << itdg->id(); // FIXME gainIter = gainMap.find( detid ); if( gainIter != gainMap.end() ) { aGain = (*gainIter); } else { edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "error!! could not find gain ratios for channel: "; if ( detid.subdetId() == EcalBarrel ) { edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EBDetId( detid ); } else { edm::LogError("EcalUncalibRecHitWorkerAnalFit") << EEDetId( detid ); } edm::LogError("EcalUncalibRecHitWorkerAnalFit") << "\n no uncalib rechit will be made for this digi!"; return false; } double gainRatios[3]; gainRatios[0] = 1.; gainRatios[1] = aGain.gain12Over6(); gainRatios[2] = aGain.gain6Over1()*aGain.gain12Over6(); if ( detid.subdetId() == EcalBarrel ) { EcalUncalibratedRecHit aHit = algoEB_.makeRecHit(*itdg, pedVec, gainRatios, 0 ,0); result.push_back( aHit ); if(aHit.amplitude()>0.) { LogDebug("EcalUncalibRecHitInfo") << "EcalUncalibRecHitWorkerAnalFit: processed EBDataFrame with id: " << EBDetId( detid ) << "\n" << "uncalib rechit amplitude: " << aHit.amplitude(); } } else { EcalUncalibratedRecHit aHit = algoEE_.makeRecHit(*itdg, pedVec, gainRatios, 0, 0); result.push_back( aHit ); if(aHit.amplitude()>0.) { LogDebug("EcalUncalibRecHitInfo") << "EcalUncalibRecHitWorkerAnalFit: processed EEDataFrame with id: " << EEDetId( detid ) << "\n" << "uncalib rechit amplitude: " << aHit.amplitude(); } } return true; }
void EcalUncalibRecHitWorkerAnalFit::set | ( | const edm::EventSetup & | es | ) | [virtual] |
Implements EcalUncalibRecHitWorkerBaseClass.
Definition at line 47 of file EcalUncalibRecHitWorkerAnalFit.cc.
References edm::EventSetup::get(), LogDebug, pedHandle, and pRatio.
{ // Gain Ratios LogDebug("EcalUncalibRecHitDebug") << "fetching gainRatios...."; es.get<EcalGainRatiosRcd>().get(pRatio); LogDebug("EcalUncalibRecHitDebug") << "done." ; // fetch the pedestals from the cond DB via EventSetup LogDebug("EcalUncalibRecHitDebug") << "fetching pedestals...."; es.get<EcalPedestalsRcd>().get( pedHandle ); LogDebug("EcalUncalibRecHitDebug") << "done." ; }
Definition at line 36 of file EcalUncalibRecHitWorkerAnalFit.h.
Referenced by run().
Definition at line 37 of file EcalUncalibRecHitWorkerAnalFit.h.
Referenced by run().
Definition at line 41 of file EcalUncalibRecHitWorkerAnalFit.h.
Definition at line 40 of file EcalUncalibRecHitWorkerAnalFit.h.