#include <EcalUncalibRecHitWorkerWeights.h>
Public Member Functions | |
EcalUncalibRecHitWorkerWeights (const edm::ParameterSet &) | |
bool | run (const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result) |
void | set (const edm::EventSetup &es) |
virtual | ~EcalUncalibRecHitWorkerWeights () |
Protected Attributes | |
const EcalWeightSet::EcalChi2WeightMatrix * | chi2mat [2] |
double | gainRatios [3] |
edm::ESHandle< EcalGainRatios > | gains |
edm::ESHandle < EcalWeightXtalGroups > | grps |
double | pedRMSVec [3] |
edm::ESHandle< EcalPedestals > | peds |
double | pedVec [3] |
const EBShape | testbeamEBShape |
const EEShape | testbeamEEShape |
EcalUncalibRecHitRecWeightsAlgo < EBDataFrame > | uncalibMaker_barrel_ |
EcalUncalibRecHitRecWeightsAlgo < EEDataFrame > | uncalibMaker_endcap_ |
const EcalWeightSet::EcalWeightMatrix * | weights [2] |
edm::ESHandle< EcalTBWeights > | wgts |
Definition at line 33 of file EcalUncalibRecHitWorkerWeights.h.
EcalUncalibRecHitWorkerWeights::EcalUncalibRecHitWorkerWeights | ( | const edm::ParameterSet & | ps | ) |
Definition at line 12 of file EcalUncalibRecHitWorkerWeights.cc.
: EcalUncalibRecHitWorkerBaseClass(ps) { }
virtual EcalUncalibRecHitWorkerWeights::~EcalUncalibRecHitWorkerWeights | ( | ) | [inline, virtual] |
Definition at line 37 of file EcalUncalibRecHitWorkerWeights.h.
{};
bool EcalUncalibRecHitWorkerWeights::run | ( | const edm::Event & | evt, |
const EcalDigiCollection::const_iterator & | digi, | ||
EcalUncalibratedRecHitCollection & | result | ||
) | [virtual] |
Implements EcalUncalibRecHitWorkerBaseClass.
Definition at line 28 of file EcalUncalibRecHitWorkerWeights.cc.
References cond::rpcobgas::detid, EcalEndcap, EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), gainRatios, gains, EcalWeightSet::getWeightsAfterGainSwitch(), EcalWeightSet::getWeightsBeforeGainSwitch(), grps, EEDetId::hashedIndex(), ecalpyutils::hashedIndex(), EBDetId::hashedIndex(), EcalXtalGroupId::id(), EcalUncalibRecHitRecWeightsAlgo< C >::makeRecHit(), pedRMSVec, peds, pedVec, edm::SortedCollection< T, SORT >::push_back(), testbeamEBShape, testbeamEEShape, uncalibMaker_barrel_, uncalibMaker_endcap_, weights, and wgts.
{ DetId detid(itdg->id()); const EcalPedestals::Item * aped = 0; const EcalMGPAGainRatio * aGain = 0; const EcalXtalGroupId * gid = 0; EcalTBWeights::EcalTDCId tdcid(1); if (detid.subdetId()==EcalEndcap) { unsigned int hashedIndex = EEDetId(detid).hashedIndex(); aped = &peds->endcap(hashedIndex); aGain = &gains->endcap(hashedIndex); gid = &grps->endcap(hashedIndex); } else { unsigned int hashedIndex = EBDetId(detid).hashedIndex(); aped = &peds->barrel(hashedIndex); aGain = &gains->barrel(hashedIndex); gid = &grps->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(); // now lookup the correct weights in the map EcalTBWeights::EcalTBWeightMap const & wgtsMap = wgts->getMap(); EcalTBWeights::EcalTBWeightMap::const_iterator wit; wit = wgtsMap.find( std::make_pair(*gid,tdcid) ); if( wit == wgtsMap.end() ) { edm::LogError("EcalUncalibRecHitError") << "No weights found for EcalGroupId: " << gid->id() << " and EcalTDCId: " << tdcid << "\n skipping digi with id: " << detid.rawId(); return false; } const EcalWeightSet& wset = wit->second; // this is the EcalWeightSet const EcalWeightSet::EcalWeightMatrix& mat1 = wset.getWeightsBeforeGainSwitch(); const EcalWeightSet::EcalWeightMatrix& mat2 = wset.getWeightsAfterGainSwitch(); // const EcalWeightSet::EcalChi2WeightMatrix& mat3 = wset.getChi2WeightsBeforeGainSwitch(); // const EcalWeightSet::EcalChi2WeightMatrix& mat4 = wset.getChi2WeightsAfterGainSwitch(); weights[0] = &mat1; weights[1] = &mat2; // chi2mat[0] = &mat3; // chi2mat[1] = &mat4; /* if (detid.subdetId()==EcalEndcap) { result.push_back(uncalibMaker_endcap_.makeRecHit(*itdg, pedVec, gainRatios, weights, chi2mat)); } else { result.push_back(uncalibMaker_barrel_.makeRecHit(*itdg, pedVec, gainRatios, weights, chi2mat)); } */ if (detid.subdetId()==EcalEndcap) { result.push_back(uncalibMaker_endcap_.makeRecHit(*itdg, pedVec, pedRMSVec, gainRatios, weights, testbeamEEShape)); } else { result.push_back(uncalibMaker_barrel_.makeRecHit(*itdg, pedVec, pedRMSVec, gainRatios, weights, testbeamEBShape)); } return true; }
void EcalUncalibRecHitWorkerWeights::set | ( | const edm::EventSetup & | es | ) | [virtual] |
Implements EcalUncalibRecHitWorkerBaseClass.
Definition at line 18 of file EcalUncalibRecHitWorkerWeights.cc.
References gains, edm::EventSetup::get(), grps, peds, and wgts.
{ es.get<EcalGainRatiosRcd>().get(gains); es.get<EcalPedestalsRcd>().get(peds); es.get<EcalWeightXtalGroupsRcd>().get(grps); es.get<EcalTBWeightsRcd>().get(wgts); }
const EcalWeightSet::EcalChi2WeightMatrix* EcalUncalibRecHitWorkerWeights::chi2mat[2] [protected] |
Definition at line 54 of file EcalUncalibRecHitWorkerWeights.h.
double EcalUncalibRecHitWorkerWeights::gainRatios[3] [protected] |
Definition at line 51 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
Definition at line 45 of file EcalUncalibRecHitWorkerWeights.h.
Definition at line 46 of file EcalUncalibRecHitWorkerWeights.h.
double EcalUncalibRecHitWorkerWeights::pedRMSVec[3] [protected] |
Definition at line 50 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
Definition at line 44 of file EcalUncalibRecHitWorkerWeights.h.
double EcalUncalibRecHitWorkerWeights::pedVec[3] [protected] |
Definition at line 49 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
const EBShape EcalUncalibRecHitWorkerWeights::testbeamEBShape [protected] |
Definition at line 60 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
const EEShape EcalUncalibRecHitWorkerWeights::testbeamEEShape [protected] |
Definition at line 59 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
EcalUncalibRecHitRecWeightsAlgo<EBDataFrame> EcalUncalibRecHitWorkerWeights::uncalibMaker_barrel_ [protected] |
Definition at line 56 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
EcalUncalibRecHitRecWeightsAlgo<EEDataFrame> EcalUncalibRecHitWorkerWeights::uncalibMaker_endcap_ [protected] |
Definition at line 57 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
const EcalWeightSet::EcalWeightMatrix* EcalUncalibRecHitWorkerWeights::weights[2] [protected] |
Definition at line 53 of file EcalUncalibRecHitWorkerWeights.h.
Referenced by run().
Definition at line 47 of file EcalUncalibRecHitWorkerWeights.h.