test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Private Attributes

std::string dbLabelRef_
 
const DTT0t0Map_
 
const DTT0t0MapRef_
 

Detailed Description

Definition at line 23 of file DTT0FillDefaultFromDB.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file DTT0FillDefaultFromDB.cc.

24  :
25  dbLabelRef_( pset.getParameter<string>("dbLabelRef") ) {
26 }
T getParameter(std::string const &) const
DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB ( )
virtual

Definition at line 28 of file DTT0FillDefaultFromDB.cc.

28  {
29 }

Member Function Documentation

DTT0Data DTT0FillDefaultFromDB::correction ( const DTWireId wireId)
virtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 46 of file DTT0FillDefaultFromDB.cc.

References DTTimeUnits::counts, edm::hlt::Exception, DTT0::get(), ntuplemaker::status, t0Map_, and t0MapRef_.

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

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 31 of file DTT0FillDefaultFromDB.cc.

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

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

Member Data Documentation

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

Definition at line 35 of file DTT0FillDefaultFromDB.h.

Referenced by setES().

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0Map_
private

Definition at line 38 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

const DTT0* dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
private

Definition at line 37 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().