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 Member Functions | Private Attributes
dtCalibration::DTT0ChamberReferenceCorrection Class Reference

#include <DTT0ChamberReferenceCorrection.h>

Inheritance diagram for dtCalibration::DTT0ChamberReferenceCorrection:
dtCalibration::DTT0BaseCorrection

Public Member Functions

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

Private Member Functions

DTT0Data defaultT0 (const DTWireId &)
 

Private Attributes

std::string calibChamber_
 
DTChamberId chosenChamberId_
 
const DTT0t0Map_
 

Detailed Description

Definition at line 24 of file DTT0ChamberReferenceCorrection.h.

Constructor & Destructor Documentation

DTT0ChamberReferenceCorrection::DTT0ChamberReferenceCorrection ( const edm::ParameterSet pset)

Definition at line 25 of file DTT0ChamberReferenceCorrection.cc.

References calibChamber_, chosenChamberId_, and DTChamberId.

25  :
26  calibChamber_( pset.getParameter<string>("calibChamber") ) {
27 
28  //DTChamberId chosenChamberId;
29  if( calibChamber_ != "" && calibChamber_ != "None" && calibChamber_ != "All" ){
30  stringstream linestr;
31  int selWheel, selStation, selSector;
32  linestr << calibChamber_;
33  linestr >> selWheel >> selStation >> selSector;
34  chosenChamberId_ = DTChamberId(selWheel, selStation, selSector);
35  LogVerbatim("Calibration") << "[DTT0ChamberReferenceCorrection] Chosen chamber: " << chosenChamberId_ << endl;
36  }
37  //FIXME: Check if chosen chamber is valid.
38 
39 }
T getParameter(std::string const &) const
DTT0ChamberReferenceCorrection::~DTT0ChamberReferenceCorrection ( )
virtual

Definition at line 41 of file DTT0ChamberReferenceCorrection.cc.

41  {
42 }

Member Function Documentation

DTT0Data DTT0ChamberReferenceCorrection::correction ( const DTWireId wireId)
virtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 52 of file DTT0ChamberReferenceCorrection.cc.

References calibChamber_, DTSuperLayerId::chamberId(), chosenChamberId_, DTTimeUnits::counts, defaultT0(), Exception, DTT0::get(), DTWireId::layerId(), ntuplemaker::status, DTLayerId::superlayerId(), and t0Map_.

52  {
53  // Compute for selected chamber (or All) correction using as reference chamber mean
54 
55  DTChamberId chamberId = wireId.layerId().superlayerId().chamberId();
56 
57  if( calibChamber_ == "" || calibChamber_ == "None" ) return defaultT0(wireId);
58  if( calibChamber_ != "All" && chamberId != chosenChamberId_ ) return defaultT0(wireId);
59 
60  // Access DB
61  float t0Mean,t0RMS;
62  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
63  if(status != 0)
64  throw cms::Exception("[DTT0ChamberReferenceCorrection]") << "Could not find t0 entry in DB for"
65  << wireId << endl;
66  /*
67  Leaving just the structure for future implementation
68  ...
69  ...
70  */
71  return DTT0Data(t0Mean,t0RMS);
72 }
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:67
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:62
tuple status
Definition: ntuplemaker.py:245
Definition: DTT0.h:37
DTT0Data DTT0ChamberReferenceCorrection::defaultT0 ( const DTWireId wireId)
private

Definition at line 74 of file DTT0ChamberReferenceCorrection.cc.

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

Referenced by correction().

74  {
75  // Access default DB
76  float t0Mean,t0RMS;
77  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
78  if(!status){
79  return DTT0Data(t0Mean,t0RMS);
80  } else{
81  //...
82  throw cms::Exception("[DTT0ChamberReferenceCorrection]") << "Could not find t0 entry in DB for"
83  << wireId << endl;
84  }
85 }
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 DTT0ChamberReferenceCorrection::setES ( const edm::EventSetup setup)
virtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 44 of file DTT0ChamberReferenceCorrection.cc.

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

44  {
45  // Get t0 record from DB
46  ESHandle<DTT0> t0H;
47  setup.get<DTT0Rcd>().get(t0H);
48  t0Map_ = &*t0H;
49  LogVerbatim("Calibration") << "[DTT0ChamberReferenceCorrection] T0 version: " << t0H->version();
50 }
const T & get() const
Definition: EventSetup.h:56
Definition: DTT0Rcd.h:9

Member Data Documentation

std::string dtCalibration::DTT0ChamberReferenceCorrection::calibChamber_
private

Definition at line 38 of file DTT0ChamberReferenceCorrection.h.

Referenced by correction(), and DTT0ChamberReferenceCorrection().

DTChamberId dtCalibration::DTT0ChamberReferenceCorrection::chosenChamberId_
private

Definition at line 40 of file DTT0ChamberReferenceCorrection.h.

Referenced by correction(), and DTT0ChamberReferenceCorrection().

const DTT0* dtCalibration::DTT0ChamberReferenceCorrection::t0Map_
private

Definition at line 41 of file DTT0ChamberReferenceCorrection.h.

Referenced by correction(), defaultT0(), and setES().