CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
dtCalibration::DTT0FillChamberFromDB Class Reference

#include <DTT0FillChamberFromDB.h>

Inheritance diagram for dtCalibration::DTT0FillChamberFromDB:
dtCalibration::DTT0BaseCorrection

Public Member Functions

DTT0Data correction (const DTWireId &) override
 
 DTT0FillChamberFromDB (const edm::ParameterSet &)
 
void setES (const edm::EventSetup &setup) override
 
 ~DTT0FillChamberFromDB () override
 
- Public Member Functions inherited from dtCalibration::DTT0BaseCorrection
 DTT0BaseCorrection ()
 
virtual ~DTT0BaseCorrection ()
 

Private Attributes

std::string chamberRef_
 
DTChamberId chosenChamberId_
 
std::string dbLabelRef_
 
const DTT0t0Map_
 
const DTT0t0MapRef_
 

Detailed Description

Definition at line 25 of file DTT0FillChamberFromDB.h.

Constructor & Destructor Documentation

◆ DTT0FillChamberFromDB()

DTT0FillChamberFromDB::DTT0FillChamberFromDB ( const edm::ParameterSet pset)

Definition at line 27 of file DTT0FillChamberFromDB.cc.

28  : dbLabelRef_(pset.getParameter<string>("dbLabelRef")), chamberRef_(pset.getParameter<string>("chamberId")) {
29  //DTChamberId chosenChamberId;
30  if (!chamberRef_.empty() && chamberRef_ != "None") {
31  stringstream linestr;
32  int selWheel, selStation, selSector;
33  linestr << chamberRef_;
34  linestr >> selWheel >> selStation >> selSector;
35  chosenChamberId_ = DTChamberId(selWheel, selStation, selSector);
36  LogVerbatim("Calibration") << "[DTT0FillChamberFromDB] Chosen chamber: " << chosenChamberId_ << endl;
37  }
38  //FIXME: Check if chosen chamber is valid.
39  }

References chamberRef_, and chosenChamberId_.

◆ ~DTT0FillChamberFromDB()

DTT0FillChamberFromDB::~DTT0FillChamberFromDB ( )
override

Definition at line 41 of file DTT0FillChamberFromDB.cc.

41 {}

Member Function Documentation

◆ correction()

DTT0Data DTT0FillChamberFromDB::correction ( const DTWireId wireId)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 57 of file DTT0FillChamberFromDB.cc.

57  {
58  // If wire belongs to chosen chamber, use t0 value from reference DB
59  // Otherwise use value from default DB
60 
61  DTChamberId chamberId = wireId.layerId().superlayerId().chamberId();
62 
63  if (!chamberRef_.empty() && chamberRef_ != "None" && chamberId == chosenChamberId_) {
64  // Access reference DB
65  float t0MeanRef, t0RMSRef;
66  int statusRef = t0MapRef_->get(wireId, t0MeanRef, t0RMSRef, DTTimeUnits::counts);
67  if (!statusRef) {
68  return DTT0Data(t0MeanRef, t0RMSRef);
69  } else {
70  //...
71  throw cms::Exception("[DTT0FillChamberFromDB]")
72  << "Could not find t0 entry in reference DB for" << wireId << endl;
73  }
74  } else {
75  // Access default DB
76  float t0Mean, t0RMS;
77  int status = t0Map_->get(wireId, t0Mean, t0RMS, DTTimeUnits::counts);
78  if (!status) {
79  return DTT0Data(t0Mean, t0RMS);
80  } else {
81  //...
82  throw cms::Exception("[DTT0FillChamberFromDB]") << "Could not find t0 entry in DB for" << wireId << endl;
83  }
84  }
85  }

References DTSuperLayerId::chamberId(), chamberRef_, chosenChamberId_, DTTimeUnits::counts, Exception, DTT0::get(), DTWireId::layerId(), mps_update::status, DTLayerId::superlayerId(), t0Map_, and t0MapRef_.

◆ setES()

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

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 43 of file DTT0FillChamberFromDB.cc.

43  {
44  // Get t0 record from DB
45  ESHandle<DTT0> t0H;
46  setup.get<DTT0Rcd>().get(t0H);
47  t0Map_ = &*t0H;
48  LogVerbatim("Calibration") << "[DTT0FillChamberFromDB] T0 version: " << t0H->version();
49 
50  // Get reference t0 DB
51  ESHandle<DTT0> t0RefH;
52  setup.get<DTT0Rcd>().get(dbLabelRef_, t0RefH);
53  t0MapRef_ = &*t0RefH;
54  LogVerbatim("Calibration") << "[DTT0FillChamberFromDB] Reference T0 version: " << t0RefH->version();
55  }

References dbLabelRef_, get, singleTopDQM_cfi::setup, t0Map_, t0MapRef_, and DTT0::version().

Member Data Documentation

◆ chamberRef_

std::string dtCalibration::DTT0FillChamberFromDB::chamberRef_
private

Definition at line 38 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and DTT0FillChamberFromDB().

◆ chosenChamberId_

DTChamberId dtCalibration::DTT0FillChamberFromDB::chosenChamberId_
private

Definition at line 40 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and DTT0FillChamberFromDB().

◆ dbLabelRef_

std::string dtCalibration::DTT0FillChamberFromDB::dbLabelRef_
private

Definition at line 37 of file DTT0FillChamberFromDB.h.

Referenced by setES().

◆ t0Map_

const DTT0* dtCalibration::DTT0FillChamberFromDB::t0Map_
private

Definition at line 43 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and setES().

◆ t0MapRef_

const DTT0* dtCalibration::DTT0FillChamberFromDB::t0MapRef_
private

Definition at line 42 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and setES().

mps_update.status
status
Definition: mps_update.py:69
dtCalibration::DTT0FillChamberFromDB::t0Map_
const DTT0 * t0Map_
Definition: DTT0FillChamberFromDB.h:43
DTT0::version
const std::string & version() const
access version
Definition: DTT0.cc:82
DTT0Rcd
Definition: DTT0Rcd.h:9
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
dtCalibration::DTT0FillChamberFromDB::chamberRef_
std::string chamberRef_
Definition: DTT0FillChamberFromDB.h:38
DTT0::get
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:48
DTT0Data
Definition: DTT0.h:36
edm::ESHandle< DTT0 >
dtCalibration::DTT0FillChamberFromDB::chosenChamberId_
DTChamberId chosenChamberId_
Definition: DTT0FillChamberFromDB.h:40
DTSuperLayerId::chamberId
DTChamberId chamberId() const
Return the corresponding ChamberId.
Definition: DTSuperLayerId.h:45
edm::LogVerbatim
Definition: MessageLogger.h:297
get
#define get
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
Exception
Definition: hltDiff.cc:246
DTLayerId::superlayerId
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
dtCalibration::DTT0FillChamberFromDB::dbLabelRef_
std::string dbLabelRef_
Definition: DTT0FillChamberFromDB.h:37
dtCalibration::DTT0FillChamberFromDB::t0MapRef_
const DTT0 * t0MapRef_
Definition: DTT0FillChamberFromDB.h:42
DTWireId::layerId
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:45
DTChamberId
Definition: DTChamberId.h:14
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27