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

Definition at line 22 of file DTT0FillDefaultFromDB.cc.

22  :
23  dbLabelRef_( pset.getParameter<string>("dbLabelRef") ) {
24 }
T getParameter(std::string const &) const
DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB ( )
override

Definition at line 26 of file DTT0FillDefaultFromDB.cc.

26  {
27 }

Member Function Documentation

DTT0Data DTT0FillDefaultFromDB::correction ( const DTWireId wireId)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 44 of file DTT0FillDefaultFromDB.cc.

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

44  {
45  // Try to access value in default DB
46  // If it does not exist return value from reference DB
47  // If it does not exist in reference DB, throw exception
48  // Could also set to default zero value
49  float t0Mean,t0RMS;
50  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
51  if(!status){
52  return DTT0Data(t0Mean,t0RMS);
53  } else{
54  // Now access reference DB
55  float t0MeanRef,t0RMSRef;
56  int statusRef = t0MapRef_->get(wireId,t0MeanRef,t0RMSRef,DTTimeUnits::counts);
57  if(!statusRef){
58  return DTT0Data(t0MeanRef,t0RMSRef);
59  } else{
60  //...
61  throw cms::Exception("[DTT0FillDefaultFromDB]") << "Could not find t0 entry in reference DB for"
62  << wireId << endl;
63  }
64  }
65 }
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:67
Definition: DTT0.h:37
void DTT0FillDefaultFromDB::setES ( const edm::EventSetup setup)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 29 of file DTT0FillDefaultFromDB.cc.

References dbLabelRef_, edm::EventSetup::get(), t0Map_, t0MapRef_, and DTT0::version().

29  {
30  // Get t0 record from DB
31  ESHandle<DTT0> t0H;
32  setup.get<DTT0Rcd>().get(t0H);
33  t0Map_ = &*t0H;
34  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] T0 version: " << t0H->version();
35 
36  // Get reference t0 DB
37  ESHandle<DTT0> t0RefH;
38  setup.get<DTT0Rcd>().get(dbLabelRef_,t0RefH);
39  t0MapRef_ = &*t0RefH;
40  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] Reference T0 version: " << t0RefH->version();
41 
42 }
Definition: DTT0Rcd.h:9
T get() const
Definition: EventSetup.h:68
const std::string & version() const
access version
Definition: DTT0.cc:118

Member Data Documentation

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

Definition at line 36 of file DTT0FillDefaultFromDB.h.

Referenced by setES().

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0Map_
private

Definition at line 39 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
private

Definition at line 38 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().