CMS 3D CMS Logo

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

#include <DTT0WireInChamberReferenceCorrection.h>

Inheritance diagram for dtCalibration::DTT0WireInChamberReferenceCorrection:
dtCalibration::DTT0BaseCorrection

Public Member Functions

DTT0Data correction (const DTWireId &) override
 
 DTT0WireInChamberReferenceCorrection (const edm::ParameterSet &)
 
void setES (const edm::EventSetup &setup) override
 
 ~DTT0WireInChamberReferenceCorrection () 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_
 
edm::ESHandle< DTGeometrydtGeom_
 
const DTT0t0Map_
 

Detailed Description

Definition at line 27 of file DTT0WireInChamberReferenceCorrection.h.

Constructor & Destructor Documentation

DTT0WireInChamberReferenceCorrection::DTT0WireInChamberReferenceCorrection ( const edm::ParameterSet pset)

Definition at line 28 of file DTT0WireInChamberReferenceCorrection.cc.

References calibChamber_, and chosenChamberId_.

28  :
29  calibChamber_( pset.getParameter<string>("calibChamber") ) {
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") << "[DTT0WireInChamberReferenceCorrection] Chosen chamber: " << chosenChamberId_ << endl;
39  }
40  //FIXME: Check if chosen chamber is valid.
41 }
T getParameter(std::string const &) const
DTT0WireInChamberReferenceCorrection::~DTT0WireInChamberReferenceCorrection ( )
override

Definition at line 43 of file DTT0WireInChamberReferenceCorrection.cc.

43  {
44 }

Member Function Documentation

DTT0Data DTT0WireInChamberReferenceCorrection::correction ( const DTWireId wireId)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 57 of file DTT0WireInChamberReferenceCorrection.cc.

References calibChamber_, DTSuperLayerId::chamberId(), chosenChamberId_, DTTimeUnits::counts, defaultT0(), dtGeom_, Exception, DTTopology::firstChannel(), DTT0::get(), DTGeometry::layer(), DTWireId::layerId(), DTLayer::specificTopology(), mps_update::status, DTLayerId::superlayerId(), and t0Map_.

57  {
58  // Compute for selected chamber (or All) correction using as reference chamber mean
59 
60  DTChamberId chamberId = wireId.layerId().superlayerId().chamberId();
61 
62  if( calibChamber_ == "" || calibChamber_ == "None" ) return defaultT0(wireId);
63  if( calibChamber_ != "All" && chamberId != chosenChamberId_ ) return defaultT0(wireId);
64 
65  // Access DB
66  float t0Mean,t0RMS;
67  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
68  if(status != 0)
69  throw cms::Exception("[DTT0WireInChamberReferenceCorrection]") << "Could not find t0 entry in DB for"
70  << wireId << endl;
71 
72  // Try to find t0 for reference wire in layer
73  DTSuperLayerId slId = wireId.layerId().superlayerId();
74  // Layers 1 and 2
75  DTLayerId layerRef1( slId,1 );
76  //DTLayerId layerRef2( slId,2 );
77 
78  const DTTopology& dtTopoLayerRef1 = dtGeom_->layer( layerRef1 )->specificTopology();
79  const int firstWireLayerRef1 = dtTopoLayerRef1.firstChannel();
80  const int refWireLayerRef1 = firstWireLayerRef1;
81  DTWireId wireIdRefLayerRef1( layerRef1,refWireLayerRef1 );
82 
83  float t0MeanRef1,t0RMSRef1;
84  int statusRef1 = t0Map_->get(wireIdRefLayerRef1,t0MeanRef1,t0RMSRef1,DTTimeUnits::counts);
85 
86  // Correct channels in a superlayer wrt t0 from first wire in first layer
87  if(!statusRef1){
88  float t0MeanNew = t0Mean - t0MeanRef1;
89  float t0RMSNew = t0RMS;
90  return DTT0Data(t0MeanNew,t0RMSNew);
91  } else{
92  // If reference wire not active could choose adjacent wire instead
93  //...
94  throw cms::Exception("[DTT0WireInChamberReferenceCorrection]") << "Could not find t0 entry in DB for"
95  << wireIdRefLayerRef1 << endl;
96  }
97 }
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
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:62
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
Definition: DTT0.h:37
DTT0Data DTT0WireInChamberReferenceCorrection::defaultT0 ( const DTWireId wireId)
private

Definition at line 99 of file DTT0WireInChamberReferenceCorrection.cc.

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

Referenced by correction().

99  {
100  // Access default DB
101  float t0Mean,t0RMS;
102  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
103  if(!status){
104  return DTT0Data(t0Mean,t0RMS);
105  } else{
106  //...
107  throw cms::Exception("[DTT0WireInChamberReferenceCorrection]") << "Could not find t0 entry in DB for"
108  << wireId << endl;
109  }
110 }
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 DTT0WireInChamberReferenceCorrection::setES ( const edm::EventSetup setup)
overridevirtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 46 of file DTT0WireInChamberReferenceCorrection.cc.

References dtGeom_, 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") << "[DTT0WireInChamberReferenceCorrection] T0 version: " << t0H->version();
52 
53  // Get geometry from Event Setup
54  setup.get<MuonGeometryRecord>().get(dtGeom_);
55 }
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::DTT0WireInChamberReferenceCorrection::calibChamber_
private
DTChamberId dtCalibration::DTT0WireInChamberReferenceCorrection::chosenChamberId_
private
edm::ESHandle<DTGeometry> dtCalibration::DTT0WireInChamberReferenceCorrection::dtGeom_
private

Definition at line 45 of file DTT0WireInChamberReferenceCorrection.h.

Referenced by correction(), and setES().

const DTT0* dtCalibration::DTT0WireInChamberReferenceCorrection::t0Map_
private

Definition at line 44 of file DTT0WireInChamberReferenceCorrection.h.

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