CMS 3D CMS Logo

Public Member Functions | Private Attributes

dtCalibration::DTTTrigConstantShift Class Reference

#include <DTTTrigConstantShift.h>

Inheritance diagram for dtCalibration::DTTTrigConstantShift:
dtCalibration::DTTTrigBaseCorrection

List of all members.

Public Member Functions

virtual DTTTrigData correction (const DTSuperLayerId &)
 DTTTrigConstantShift (const edm::ParameterSet &)
virtual void setES (const edm::EventSetup &setup)
virtual ~DTTTrigConstantShift ()

Private Attributes

std::string calibChamber_
DTChamberId chosenChamberId_
std::string dbLabel_
const DTTtrigtTrigMap_
double value_

Detailed Description

Definition at line 25 of file DTTTrigConstantShift.h.


Constructor & Destructor Documentation

DTTTrigConstantShift::DTTTrigConstantShift ( const edm::ParameterSet pset)

Definition at line 26 of file DTTTrigConstantShift.cc.

References calibChamber_, chosenChamberId_, DTChamberId, and value_.

                                                                  :
  dbLabel_( pset.getUntrackedParameter<string>("dbLabel", "") ),
  calibChamber_( pset.getParameter<string>("calibChamber") ),
  value_( pset.getParameter<double>("value") ) {

  LogVerbatim("Calibration") << "[DTTTrigConstantShift] Applying constant correction value: " << value_ << endl;

  if( calibChamber_ != "" && calibChamber_ != "None" && calibChamber_ != "All" ){
    stringstream linestr;
    int selWheel, selStation, selSector;
    linestr << calibChamber_;
    linestr >> selWheel >> selStation >> selSector;
    chosenChamberId_ = DTChamberId(selWheel, selStation, selSector);
    LogVerbatim("Calibration") << "[DTTTrigConstantShift] Chosen chamber: " << chosenChamberId_ << endl;
  }
  //FIXME: Check if chosen chamber is valid.
}
DTTTrigConstantShift::~DTTTrigConstantShift ( ) [virtual]

Definition at line 44 of file DTTTrigConstantShift.cc.

{}

Member Function Documentation

DTTTrigData DTTTrigConstantShift::correction ( const DTSuperLayerId slId) [virtual]

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 53 of file DTTTrigConstantShift.cc.

References calibChamber_, DTSuperLayerId::chamberId(), chosenChamberId_, Exception, DTTtrig::get(), DTTimeUnits::ns, ntuplemaker::status, tTrigMap_, and value_.

                                                                       {
  
  float tTrigMean,tTrigSigma,kFactor;
  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
  if(status != 0) throw cms::Exception("[DTTTrigConstantShift]") << "Could not find tTrig entry in DB for"
                                                                 << slId << endl;

  float tTrigMeanNew = tTrigMean;
  if( calibChamber_ != "" && calibChamber_ != "None"){
     if( ( calibChamber_ == "All" ) ||
         ( calibChamber_ != "All" && slId.chamberId() == chosenChamberId_ ) ) {
        tTrigMeanNew = tTrigMean + value_; 
     }
  }

  return DTTTrigData(tTrigMeanNew,tTrigSigma,kFactor);
}
void DTTTrigConstantShift::setES ( const edm::EventSetup setup) [virtual]

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 46 of file DTTTrigConstantShift.cc.

References dbLabel_, edm::EventSetup::get(), and tTrigMap_.

                                                        {
  // 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 DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

Definition at line 42 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

Definition at line 37 of file DTTTrigConstantShift.h.

Referenced by setES().

Definition at line 41 of file DTTTrigConstantShift.h.

Referenced by correction(), and setES().

Definition at line 39 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().