#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_ |
Concrete implementation of a DTTTrigBaseCorrection. Matches tTrig values for RPhi SL's
Definition at line 22 of file DTTTrigMatchRPhi.h.
DTTTrigMatchRPhi::DTTTrigMatchRPhi | ( | const edm::ParameterSet & | pset | ) |
Definition at line 22 of file DTTTrigMatchRPhi.cc.
References edm::ParameterSet::getUntrackedParameter().
{ dbLabel = pset.getUntrackedParameter<string>("dbLabel", ""); }
DTTTrigMatchRPhi::~DTTTrigMatchRPhi | ( | ) | [virtual] |
Definition at line 26 of file DTTTrigMatchRPhi.cc.
{}
DTTTrigData DTTTrigMatchRPhi::correction | ( | const DTSuperLayerId & | slId | ) | [virtual] |
Implements DTTTrigBaseCorrection.
Definition at line 35 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 DTTTrigBaseCorrection.
Definition at line 28 of file DTTTrigMatchRPhi.cc.
References edm::EventSetup::get().
{ // Get tTrig record from DB ESHandle<DTTtrig> tTrig; setup.get<DTTtrigRcd>().get(dbLabel,tTrig); tTrigMap_ = &*tTrig; }
std::string DTTTrigMatchRPhi::dbLabel [private] |
Definition at line 36 of file DTTTrigMatchRPhi.h.
const DTTtrig* DTTTrigMatchRPhi::tTrigMap_ [private] |
Definition at line 34 of file DTTTrigMatchRPhi.h.