CMS 3D CMS Logo

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

DTTTrigData correction (const DTSuperLayerId &) override
 
 DTTTrigConstantShift (const edm::ParameterSet &)
 
void setES (const edm::EventSetup &setup) override
 
 ~DTTTrigConstantShift () override
 
- 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 23 of file DTTTrigConstantShift.cc.

References calibChamber_, chosenChamberId_, and value_.

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

Definition at line 41 of file DTTTrigConstantShift.cc.

41 {}

Member Function Documentation

DTTTrigData DTTTrigConstantShift::correction ( const DTSuperLayerId slId)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 50 of file DTTTrigConstantShift.cc.

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

50  {
51 
52  float tTrigMean,tTrigSigma,kFactor;
53  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
54  if(status != 0) throw cms::Exception("[DTTTrigConstantShift]") << "Could not find tTrig entry in DB for"
55  << slId << endl;
56 
57  float tTrigMeanNew = tTrigMean;
58  if( calibChamber_ != "" && calibChamber_ != "None"){
59  if( ( calibChamber_ == "All" ) ||
60  ( calibChamber_ != "All" && slId.chamberId() == chosenChamberId_ ) ) {
61  tTrigMeanNew = tTrigMean + value_;
62  }
63  }
64 
65  return DTTTrigData(tTrigMeanNew,tTrigSigma,kFactor);
66 }
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
void DTTTrigConstantShift::setES ( const edm::EventSetup setup)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 43 of file DTTTrigConstantShift.cc.

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

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

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().