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 &, edm::ConsumesCollector cc)
 
void setES (const edm::EventSetup &setup) override
 
 ~DTT0FillDefaultFromDB () override
 
- Public Member Functions inherited from dtCalibration::DTT0BaseCorrection
 DTT0BaseCorrection ()
 
virtual ~DTT0BaseCorrection ()
 

Private Attributes

const DTT0t0Map_
 
const DTT0t0MapRef_
 
edm::ESGetToken< DTT0, DTT0Rcdt0RefToken_
 
edm::ESGetToken< DTT0, DTT0Rcdt0Token_
 

Detailed Description

Definition at line 28 of file DTT0FillDefaultFromDB.h.

Constructor & Destructor Documentation

◆ DTT0FillDefaultFromDB()

DTT0FillDefaultFromDB::DTT0FillDefaultFromDB ( const edm::ParameterSet pset,
edm::ConsumesCollector  cc 
)

Definition at line 22 of file DTT0FillDefaultFromDB.cc.

References edm::BeginRun.

◆ ~DTT0FillDefaultFromDB()

DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB ( )
override

Definition at line 27 of file DTT0FillDefaultFromDB.cc.

27 {}

Member Function Documentation

◆ correction()

DTT0Data DTT0FillDefaultFromDB::correction ( const DTWireId wireId)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 41 of file DTT0FillDefaultFromDB.cc.

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

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  }
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
Definition: DTT0.h:36

◆ setES()

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

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 29 of file DTT0FillDefaultFromDB.cc.

References singleTopDQM_cfi::setup, t0Map_, t0MapRef_, t0RefToken_, t0Token_, and DTT0::version().

29  {
30  // Get t0 record from DB
31  ESHandle<DTT0> t0H = setup.getHandle(t0Token_);
32  t0Map_ = &*t0H;
33  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] T0 version: " << t0H->version();
34 
35  // Get reference t0 DB
36  ESHandle<DTT0> t0RefH = setup.getHandle(t0RefToken_);
37  t0MapRef_ = &*t0RefH;
38  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] Reference T0 version: " << t0RefH->version();
39  }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< DTT0, DTT0Rcd > t0RefToken_
const std::string & version() const
access version
Definition: DTT0.cc:82
edm::ESGetToken< DTT0, DTT0Rcd > t0Token_

Member Data Documentation

◆ t0Map_

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0Map_
private

Definition at line 41 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

◆ t0MapRef_

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
private

Definition at line 40 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

◆ t0RefToken_

edm::ESGetToken<DTT0, DTT0Rcd> dtCalibration::DTT0FillDefaultFromDB::t0RefToken_
private

Definition at line 44 of file DTT0FillDefaultFromDB.h.

Referenced by setES().

◆ t0Token_

edm::ESGetToken<DTT0, DTT0Rcd> dtCalibration::DTT0FillDefaultFromDB::t0Token_
private

Definition at line 43 of file DTT0FillDefaultFromDB.h.

Referenced by setES().