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::DTTTrigConstantShift ( const edm::ParameterSet pset)

Definition at line 23 of file DTTTrigConstantShift.cc.

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

References calibChamber_, chosenChamberId_, and value_.

◆ ~DTTTrigConstantShift()

DTTTrigConstantShift::~DTTTrigConstantShift ( )
override

Definition at line 40 of file DTTTrigConstantShift.cc.

40 {}

Member Function Documentation

◆ correction()

DTTTrigData DTTTrigConstantShift::correction ( const DTSuperLayerId slId)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 49 of file DTTTrigConstantShift.cc.

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

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

◆ setES()

void DTTTrigConstantShift::setES ( const edm::EventSetup setup)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 42 of file DTTTrigConstantShift.cc.

42  {
43  // Get tTrig record from DB
46  tTrigMap_ = &*tTrig;
47  }

References dbLabel_, get, singleTopDQM_cfi::setup, dttriganalyzer_cfi::tTrig, and tTrigMap_.

Member Data Documentation

◆ calibChamber_

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

Definition at line 38 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

◆ chosenChamberId_

DTChamberId dtCalibration::DTTTrigConstantShift::chosenChamberId_
private

Definition at line 42 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

◆ dbLabel_

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

Definition at line 37 of file DTTTrigConstantShift.h.

Referenced by setES().

◆ tTrigMap_

const DTTtrig* dtCalibration::DTTTrigConstantShift::tTrigMap_
private

Definition at line 41 of file DTTTrigConstantShift.h.

Referenced by correction(), and setES().

◆ value_

double dtCalibration::DTTTrigConstantShift::value_
private

Definition at line 39 of file DTTTrigConstantShift.h.

Referenced by correction(), and DTTTrigConstantShift().

dtCalibration::DTTTrigConstantShift::calibChamber_
std::string calibChamber_
Definition: DTTTrigConstantShift.h:38
mps_update.status
status
Definition: mps_update.py:68
DTTtrigRcd
Definition: DTTtrigRcd.h:5
dttriganalyzer_cfi.tTrig
tTrig
Definition: dttriganalyzer_cfi.py:11
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
dtCalibration::DTTTrigConstantShift::tTrigMap_
const DTTtrig * tTrigMap_
Definition: DTTTrigConstantShift.h:41
dtCalibration::DTTTrigConstantShift::value_
double value_
Definition: DTTTrigConstantShift.h:39
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
edm::ESHandle< DTTtrig >
dtCalibration::DTTTrigConstantShift::dbLabel_
std::string dbLabel_
Definition: DTTTrigConstantShift.h:37
DTTtrig::get
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:59
DTSuperLayerId::chamberId
DTChamberId chamberId() const
Return the corresponding ChamberId.
Definition: DTSuperLayerId.h:45
get
#define get
dttriganalyzer_cfi.kFactor
kFactor
Definition: dttriganalyzer_cfi.py:7
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dtCalibration::DTTTrigConstantShift::chosenChamberId_
DTChamberId chosenChamberId_
Definition: DTTTrigConstantShift.h:42
Exception
Definition: hltDiff.cc:245
DTChamberId
Definition: DTChamberId.h:14
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27