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::DTT0FillChamberFromDB Class Reference

#include <DTT0FillChamberFromDB.h>

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

Public Member Functions

virtual DTT0Data correction (const DTWireId &)
 
 DTT0FillChamberFromDB (const edm::ParameterSet &)
 
virtual void setES (const edm::EventSetup &setup)
 
virtual ~DTT0FillChamberFromDB ()
 
- 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 24 of file DTT0FillChamberFromDB.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file DTT0FillChamberFromDB.cc.

References chamberRef_, chosenChamberId_, and DTChamberId.

25  :
26  dbLabelRef_( pset.getParameter<string>("dbLabelRef") ),
27  chamberRef_( pset.getParameter<string>("chamberId") ) {
28 
29  //DTChamberId chosenChamberId;
30  if( chamberRef_ != "" && 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 
40 }
T getParameter(std::string const &) const
DTT0FillChamberFromDB::~DTT0FillChamberFromDB ( )
virtual

Definition at line 42 of file DTT0FillChamberFromDB.cc.

42  {
43 }

Member Function Documentation

DTT0Data DTT0FillChamberFromDB::correction ( const DTWireId wireId)
virtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 60 of file DTT0FillChamberFromDB.cc.

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

60  {
61  // If wire belongs to chosen chamber, use t0 value from reference DB
62  // Otherwise use value from default DB
63 
64  DTChamberId chamberId = wireId.layerId().superlayerId().chamberId();
65 
66  if( chamberRef_ != "" && chamberRef_ != "None" && chamberId == chosenChamberId_ ){
67  // Access reference DB
68  float t0MeanRef,t0RMSRef;
69  int statusRef = t0MapRef_->get(wireId,t0MeanRef,t0RMSRef,DTTimeUnits::counts);
70  if(!statusRef){
71  return DTT0Data(t0MeanRef,t0RMSRef);
72  } else{
73  //...
74  throw cms::Exception("[DTT0FillChamberFromDB]") << "Could not find t0 entry in reference DB for"
75  << wireId << endl;
76  }
77  } else{
78  // Access default DB
79  float t0Mean,t0RMS;
80  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
81  if(!status){
82  return DTT0Data(t0Mean,t0RMS);
83  } else{
84  //...
85  throw cms::Exception("[DTT0FillChamberFromDB]") << "Could not find t0 entry in DB for"
86  << wireId << endl;
87  }
88  }
89 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:59
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:69
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:62
tuple status
Definition: ntuplemaker.py:245
Definition: DTT0.h:38
void DTT0FillChamberFromDB::setES ( const edm::EventSetup setup)
virtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 45 of file DTT0FillChamberFromDB.cc.

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

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

Member Data Documentation

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

Definition at line 37 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and DTT0FillChamberFromDB().

DTChamberId dtCalibration::DTT0FillChamberFromDB::chosenChamberId_
private

Definition at line 39 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and DTT0FillChamberFromDB().

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

Definition at line 36 of file DTT0FillChamberFromDB.h.

Referenced by setES().

const DTT0* dtCalibration::DTT0FillChamberFromDB::t0Map_
private

Definition at line 42 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and setES().

const DTT0* dtCalibration::DTT0FillChamberFromDB::t0MapRef_
private

Definition at line 41 of file DTT0FillChamberFromDB.h.

Referenced by correction(), and setES().