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 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_.

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

Definition at line 44 of file DTTTrigConstantShift.cc.

44 {}

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_, edm::hlt::Exception, DTTtrig::get(), DTTimeUnits::ns, ntuplemaker::status, tTrigMap_, and value_.

53  {
54 
55  float tTrigMean,tTrigSigma,kFactor;
56  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
57  if(status != 0) throw cms::Exception("[DTTTrigConstantShift]") << "Could not find tTrig entry in DB for"
58  << slId << endl;
59 
60  float tTrigMeanNew = tTrigMean;
61  if( calibChamber_ != "" && calibChamber_ != "None"){
62  if( ( calibChamber_ == "All" ) ||
63  ( calibChamber_ != "All" && slId.chamberId() == chosenChamberId_ ) ) {
64  tTrigMeanNew = tTrigMean + value_;
65  }
66  }
67 
68  return DTTTrigData(tTrigMeanNew,tTrigSigma,kFactor);
69 }
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:87
tuple status
Definition: ntuplemaker.py:245
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_.

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

Member Data Documentation

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

Definition at line 38 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

DTChamberId dtCalibration::DTTTrigConstantShift::chosenChamberId_
private

Definition at line 42 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

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

Definition at line 37 of file DTTTrigConstantShift.h.

Referenced by setES().

const DTTtrig* dtCalibration::DTTTrigConstantShift::tTrigMap_
private

Definition at line 41 of file DTTTrigConstantShift.h.

Referenced by correction(), and setES().

double dtCalibration::DTTTrigConstantShift::value_
private

Definition at line 39 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().