CMS 3D CMS Logo

Public Member Functions | Private Attributes

dtCalibration::DTTTrigMatchRPhi Class Reference

#include <DTTTrigMatchRPhi.h>

Inheritance diagram for dtCalibration::DTTTrigMatchRPhi:
dtCalibration::DTTTrigBaseCorrection

List of all members.

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 DTTtrigtTrigMap_

Detailed Description

Definition at line 24 of file DTTTrigMatchRPhi.h.


Constructor & Destructor Documentation

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.

{}

Member Function Documentation

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;
}

Member Data Documentation

Definition at line 38 of file DTTTrigMatchRPhi.h.

Definition at line 36 of file DTTTrigMatchRPhi.h.