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

#include <DTT0WireInChamberReferenceCorrection.h>

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

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 29 of file DTT0WireInChamberReferenceCorrection.cc.

References calibChamber_, chosenChamberId_, and DTChamberId.

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

Definition at line 44 of file DTT0WireInChamberReferenceCorrection.cc.

44  {
45 }

Member Function Documentation

DTT0Data DTT0WireInChamberReferenceCorrection::correction ( const DTWireId wireId)
virtual

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 58 of file DTT0WireInChamberReferenceCorrection.cc.

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

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

Definition at line 100 of file DTT0WireInChamberReferenceCorrection.cc.

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

Referenced by correction().

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

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 47 of file DTT0WireInChamberReferenceCorrection.cc.

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

47  {
48  // Get t0 record from DB
49  ESHandle<DTT0> t0H;
50  setup.get<DTT0Rcd>().get(t0H);
51  t0Map_ = &*t0H;
52  LogVerbatim("Calibration") << "[DTT0WireInChamberReferenceCorrection] T0 version: " << t0H->version();
53 
54  // Get geometry from Event Setup
55  setup.get<MuonGeometryRecord>().get(dtGeom_);
56 }
const T & get() const
Definition: EventSetup.h:56
Definition: DTT0Rcd.h:9

Member Data Documentation

std::string dtCalibration::DTT0WireInChamberReferenceCorrection::calibChamber_
private
DTChamberId dtCalibration::DTT0WireInChamberReferenceCorrection::chosenChamberId_
private
edm::ESHandle<DTGeometry> dtCalibration::DTT0WireInChamberReferenceCorrection::dtGeom_
private

Definition at line 44 of file DTT0WireInChamberReferenceCorrection.h.

Referenced by correction(), and setES().

const DTT0* dtCalibration::DTT0WireInChamberReferenceCorrection::t0Map_
private

Definition at line 43 of file DTT0WireInChamberReferenceCorrection.h.

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