CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
dtCalibration::DTTTrigConstantShift Class Reference

#include <DTTTrigConstantShift.h>

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

Public Member Functions

virtual DTTTrigData correction (const DTSuperLayerId &)
 
 DTTTrigConstantShift (const edm::ParameterSet &)
 
virtual void setES (const edm::EventSetup &setup)
 
virtual ~DTTTrigConstantShift ()
 
- Public Member Functions inherited from dtCalibration::DTTTrigBaseCorrection
 DTTTrigBaseCorrection ()
 
virtual ~DTTTrigBaseCorrection ()
 

Private Attributes

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

Detailed Description

Definition at line 24 of file DTTTrigConstantShift.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file DTTTrigConstantShift.cc.

References calibChamber_, chosenChamberId_, DTChamberId, and value_.

24  :
25  dbLabel_( pset.getUntrackedParameter<string>("dbLabel", "") ),
26  calibChamber_( pset.getParameter<string>("calibChamber") ),
27  value_( pset.getParameter<double>("value") ) {
28 
29  LogVerbatim("Calibration") << "[DTTTrigConstantShift] Applying constant correction value: " << value_ << endl;
30 
31  if( calibChamber_ != "" && calibChamber_ != "None" && calibChamber_ != "All" ){
32  stringstream linestr;
33  int selWheel, selStation, selSector;
34  linestr << calibChamber_;
35  linestr >> selWheel >> selStation >> selSector;
36  chosenChamberId_ = DTChamberId(selWheel, selStation, selSector);
37  LogVerbatim("Calibration") << "[DTTTrigConstantShift] Chosen chamber: " << chosenChamberId_ << endl;
38  }
39  //FIXME: Check if chosen chamber is valid.
40 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTTTrigConstantShift::~DTTTrigConstantShift ( )
virtual

Definition at line 42 of file DTTTrigConstantShift.cc.

42 {}

Member Function Documentation

DTTTrigData DTTTrigConstantShift::correction ( const DTSuperLayerId slId)
virtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 51 of file DTTTrigConstantShift.cc.

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

51  {
52 
53  float tTrigMean,tTrigSigma,kFactor;
54  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
55  if(status != 0) throw cms::Exception("[DTTTrigConstantShift]") << "Could not find tTrig entry in DB for"
56  << slId << endl;
57 
58  float tTrigMeanNew = tTrigMean;
59  if( calibChamber_ != "" && calibChamber_ != "None"){
60  if( ( calibChamber_ == "All" ) ||
61  ( calibChamber_ != "All" && slId.chamberId() == chosenChamberId_ ) ) {
62  tTrigMeanNew = tTrigMean + value_;
63  }
64  }
65 
66  return DTTTrigData(tTrigMeanNew,tTrigSigma,kFactor);
67 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
Definition: DTTtrig.cc:85
tuple status
Definition: ntuplemaker.py:245
void DTTTrigConstantShift::setES ( const edm::EventSetup setup)
virtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 44 of file DTTTrigConstantShift.cc.

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

44  {
45  // Get tTrig record from DB
46  ESHandle<DTTtrig> tTrig;
47  setup.get<DTTtrigRcd>().get(dbLabel_,tTrig);
48  tTrigMap_ = &*tTrig;
49 }
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

std::string dtCalibration::DTTTrigConstantShift::calibChamber_
private

Definition at line 37 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

DTChamberId dtCalibration::DTTTrigConstantShift::chosenChamberId_
private

Definition at line 41 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

std::string dtCalibration::DTTTrigConstantShift::dbLabel_
private

Definition at line 36 of file DTTTrigConstantShift.h.

Referenced by setES().

const DTTtrig* dtCalibration::DTTTrigConstantShift::tTrigMap_
private

Definition at line 40 of file DTTTrigConstantShift.h.

Referenced by correction(), and setES().

double dtCalibration::DTTTrigConstantShift::value_
private

Definition at line 38 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().