CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
dtCalibration::DTT0AbsoluteReferenceCorrection Class Reference

#include <DTT0AbsoluteReferenceCorrection.h>

Inheritance diagram for dtCalibration::DTT0AbsoluteReferenceCorrection:
dtCalibration::DTT0BaseCorrection

Public Member Functions

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

Private Member Functions

DTT0Data defaultT0 (const DTWireId &)
 

Private Attributes

std::string calibChamber_
 
DTChamberId chosenChamberId_
 
double reference_
 
const DTT0t0Map_
 

Detailed Description

Definition at line 25 of file DTT0AbsoluteReferenceCorrection.h.

Constructor & Destructor Documentation

DTT0AbsoluteReferenceCorrection::DTT0AbsoluteReferenceCorrection ( const edm::ParameterSet pset)

Definition at line 27 of file DTT0AbsoluteReferenceCorrection.cc.

References calibChamber_, and chosenChamberId_.

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

Definition at line 43 of file DTT0AbsoluteReferenceCorrection.cc.

43  {
44 }

Member Function Documentation

DTT0Data DTT0AbsoluteReferenceCorrection::correction ( const DTWireId wireId)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 54 of file DTT0AbsoluteReferenceCorrection.cc.

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

54  {
55  // Compute for selected chamber (or All) correction using as reference chamber mean
56 
57  DTChamberId chamberId = wireId.layerId().superlayerId().chamberId();
58 
59  if( calibChamber_ == "" || calibChamber_ == "None" ) return defaultT0(wireId);
60  if( calibChamber_ != "All" && chamberId != chosenChamberId_ ) return defaultT0(wireId);
61 
62  // Access DB
63  float t0Mean,t0RMS;
64  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
65  if(status != 0)
66  throw cms::Exception("[DTT0AbsoluteReferenceCorrection]") << "Could not find t0 entry in DB for"
67  << wireId << endl;
68 
69  float t0MeanNew = t0Mean - reference_;
70  float t0RMSNew = t0RMS;
71  return DTT0Data(t0MeanNew,t0RMSNew);
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
Definition: DTT0.h:37
DTT0Data DTT0AbsoluteReferenceCorrection::defaultT0 ( const DTWireId wireId)
private

Definition at line 74 of file DTT0AbsoluteReferenceCorrection.cc.

References DTTimeUnits::counts, Exception, DTT0::get(), mps_update::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("[DTT0AbsoluteReferenceCorrection]") << "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
Definition: DTT0.h:37
void DTT0AbsoluteReferenceCorrection::setES ( const edm::EventSetup setup)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 46 of file DTT0AbsoluteReferenceCorrection.cc.

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

46  {
47  // Get t0 record from DB
48  ESHandle<DTT0> t0H;
49  setup.get<DTT0Rcd>().get(t0H);
50  t0Map_ = &*t0H;
51  LogVerbatim("Calibration") << "[DTT0AbsoluteReferenceCorrection] T0 version: " << t0H->version();
52 }
Definition: DTT0Rcd.h:9
T get() const
Definition: EventSetup.h:71
const std::string & version() const
access version
Definition: DTT0.cc:118

Member Data Documentation

std::string dtCalibration::DTT0AbsoluteReferenceCorrection::calibChamber_
private
DTChamberId dtCalibration::DTT0AbsoluteReferenceCorrection::chosenChamberId_
private
double dtCalibration::DTT0AbsoluteReferenceCorrection::reference_
private

Definition at line 40 of file DTT0AbsoluteReferenceCorrection.h.

Referenced by correction().

const DTT0* dtCalibration::DTT0AbsoluteReferenceCorrection::t0Map_
private

Definition at line 43 of file DTT0AbsoluteReferenceCorrection.h.

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