#include <DTTTrigMatchRPhi.h>
Public Member Functions | |
virtual DTTTrigData | correction (const DTSuperLayerId &) |
DTTTrigMatchRPhi (const edm::ParameterSet &) | |
virtual void | setES (const edm::EventSetup &setup) |
virtual | ~DTTTrigMatchRPhi () |
Private Attributes | |
std::string | dbLabel |
const DTTtrig * | tTrigMap_ |
Definition at line 24 of file DTTTrigMatchRPhi.h.
DTTTrigMatchRPhi::DTTTrigMatchRPhi | ( | const edm::ParameterSet & | pset | ) |
Definition at line 24 of file DTTTrigMatchRPhi.cc.
References dtTTrigAnalyzer_cfg::dbLabel, and edm::ParameterSet::getUntrackedParameter().
{ dbLabel = pset.getUntrackedParameter<string>("dbLabel", ""); }
DTTTrigMatchRPhi::~DTTTrigMatchRPhi | ( | ) | [virtual] |
Definition at line 28 of file DTTTrigMatchRPhi.cc.
{}
DTTTrigData DTTTrigMatchRPhi::correction | ( | const DTSuperLayerId & | slId | ) | [virtual] |
Implements dtCalibration::DTTTrigBaseCorrection.
Definition at line 37 of file DTTTrigMatchRPhi.cc.
References DTSuperLayerId::chamberId(), Exception, DTTimeUnits::ns, ntuplemaker::status, and DTSuperLayerId::superLayer().
{ float tTrigMean,tTrigSigma,kFactor; int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns); // RZ superlayers return the current value if(slId.superLayer() == 2){ if(status != 0) throw cms::Exception("[DTTTrigMatchRPhi]") << "Could not find tTrig entry in DB for" << slId << endl; return DTTTrigData(tTrigMean,tTrigSigma,kFactor); } else{ DTSuperLayerId partnerSLId(slId.chamberId(),(slId.superLayer() == 1)?3:1); float tTrigMeanNew,tTrigSigmaNew,kFactorNew; if(!status){ // Gets average of both SuperLayer's if(!tTrigMap_->get(partnerSLId,tTrigMeanNew,tTrigSigmaNew,kFactorNew,DTTimeUnits::ns)){ tTrigMeanNew = (tTrigMean + tTrigMeanNew)/2.; // tTrigSigmaNew = sqrt(tTrigSigmaNew*tTrigSigmaNew + tTrigSigma*tTrigSigma)/2.; tTrigSigmaNew = (tTrigSigmaNew + tTrigSigma)/2.; kFactorNew = kFactor; return DTTTrigData(tTrigMeanNew,tTrigSigmaNew,kFactorNew); } else return DTTTrigData(tTrigMean,tTrigSigma,kFactor); } else{ // If there is no entry tries to find partner SL and retrieves its value if(!tTrigMap_->get(partnerSLId,tTrigMeanNew,tTrigSigmaNew,kFactorNew,DTTimeUnits::ns)) return DTTTrigData(tTrigMeanNew,tTrigSigmaNew,kFactorNew); else { // Both RPhi SL's not present in DB throw cms::Exception("[DTTTrigMatchRPhi]") << "Could not find tTrig entry in DB for" << slId << "\n" << partnerSLId << endl; } } } }
void DTTTrigMatchRPhi::setES | ( | const edm::EventSetup & | setup | ) | [virtual] |
Implements dtCalibration::DTTTrigBaseCorrection.
Definition at line 30 of file DTTTrigMatchRPhi.cc.
References dtTTrigAnalyzer_cfg::dbLabel, and edm::EventSetup::get().
{ // Get tTrig record from DB ESHandle<DTTtrig> tTrig; setup.get<DTTtrigRcd>().get(dbLabel,tTrig); tTrigMap_ = &*tTrig; }
std::string dtCalibration::DTTTrigMatchRPhi::dbLabel [private] |
Definition at line 38 of file DTTTrigMatchRPhi.h.
const DTTtrig* dtCalibration::DTTTrigMatchRPhi::tTrigMap_ [private] |
Definition at line 36 of file DTTTrigMatchRPhi.h.