CMS 3D CMS Logo

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

#include <DTT0FillDefaultFromDB.h>

Inheritance diagram for dtCalibration::DTT0FillDefaultFromDB:
dtCalibration::DTT0BaseCorrection

Public Member Functions

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

Private Attributes

std::string dbLabelRef_
 
const DTT0t0Map_
 
const DTT0t0MapRef_
 

Detailed Description

Definition at line 24 of file DTT0FillDefaultFromDB.h.

Constructor & Destructor Documentation

◆ DTT0FillDefaultFromDB()

DTT0FillDefaultFromDB::DTT0FillDefaultFromDB ( const edm::ParameterSet pset)

Definition at line 22 of file DTT0FillDefaultFromDB.cc.

23  : dbLabelRef_(pset.getParameter<string>("dbLabelRef")) {}

◆ ~DTT0FillDefaultFromDB()

DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB ( )
override

Definition at line 25 of file DTT0FillDefaultFromDB.cc.

25 {}

Member Function Documentation

◆ correction()

DTT0Data DTT0FillDefaultFromDB::correction ( const DTWireId wireId)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 41 of file DTT0FillDefaultFromDB.cc.

41  {
42  // Try to access value in default DB
43  // If it does not exist return value from reference DB
44  // If it does not exist in reference DB, throw exception
45  // Could also set to default zero value
46  float t0Mean, t0RMS;
47  int status = t0Map_->get(wireId, t0Mean, t0RMS, DTTimeUnits::counts);
48  if (!status) {
49  return DTT0Data(t0Mean, t0RMS);
50  } else {
51  // Now access reference DB
52  float t0MeanRef, t0RMSRef;
53  int statusRef = t0MapRef_->get(wireId, t0MeanRef, t0RMSRef, DTTimeUnits::counts);
54  if (!statusRef) {
55  return DTT0Data(t0MeanRef, t0RMSRef);
56  } else {
57  //...
58  throw cms::Exception("[DTT0FillDefaultFromDB]")
59  << "Could not find t0 entry in reference DB for" << wireId << endl;
60  }
61  }
62  }

References DTTimeUnits::counts, Exception, DTT0::get(), mps_update::status, t0Map_, and t0MapRef_.

◆ setES()

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

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 27 of file DTT0FillDefaultFromDB.cc.

27  {
28  // Get t0 record from DB
29  ESHandle<DTT0> t0H;
30  setup.get<DTT0Rcd>().get(t0H);
31  t0Map_ = &*t0H;
32  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] T0 version: " << t0H->version();
33 
34  // Get reference t0 DB
35  ESHandle<DTT0> t0RefH;
36  setup.get<DTT0Rcd>().get(dbLabelRef_, t0RefH);
37  t0MapRef_ = &*t0RefH;
38  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] Reference T0 version: " << t0RefH->version();
39  }

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

Member Data Documentation

◆ dbLabelRef_

std::string dtCalibration::DTT0FillDefaultFromDB::dbLabelRef_
private

Definition at line 36 of file DTT0FillDefaultFromDB.h.

Referenced by setES().

◆ t0Map_

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0Map_
private

Definition at line 39 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

◆ t0MapRef_

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
private

Definition at line 38 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

dtCalibration::DTT0FillDefaultFromDB::dbLabelRef_
std::string dbLabelRef_
Definition: DTT0FillDefaultFromDB.h:36
mps_update.status
status
Definition: mps_update.py:69
dtCalibration::DTT0FillDefaultFromDB::t0Map_
const DTT0 * t0Map_
Definition: DTT0FillDefaultFromDB.h:39
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
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 >
get
#define get
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
const DTT0 * t0MapRef_
Definition: DTT0FillDefaultFromDB.h:38
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27