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
DTVDriftMeanTimer Class Reference

#include <DTVDriftMeanTimer.h>

Inheritance diagram for DTVDriftMeanTimer:
DTVDriftBaseAlgo

Public Member Functions

virtual DTVDriftData compute (const DTSuperLayerId &)
 
 DTVDriftMeanTimer (edm::ParameterSet const &)
 
virtual void setES (const edm::EventSetup &setup)
 
virtual ~DTVDriftMeanTimer ()
 
- Public Member Functions inherited from DTVDriftBaseAlgo
 DTVDriftBaseAlgo ()
 
virtual ~DTVDriftBaseAlgo ()
 

Private Attributes

DTMeanTimerFitterfitter_
 
TFile * rootFile_
 

Detailed Description

Concrete implementation of a DTVDriftBaseAlgo. Computes vDrift using the Mean Timer algorithm.

Revision:
1.1
Author
A. Vilela Pereira

Definition at line 18 of file DTVDriftMeanTimer.h.

Constructor & Destructor Documentation

DTVDriftMeanTimer::DTVDriftMeanTimer ( edm::ParameterSet const &  pset)

Definition at line 32 of file DTVDriftMeanTimer.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and dtTPAnalyzer_cfg::rootFileName.

32  {
33  string rootFileName = pset.getParameter<string>("rootFileName");
34  rootFile_ = new TFile(rootFileName.c_str(), "READ");
35  fitter_ = new DTMeanTimerFitter(rootFile_);
36  bool debug = pset.getUntrackedParameter<bool>("debug", false);
37  if(debug) fitter_->setVerbosity(1);
38 }
DTMeanTimerFitter * fitter_
#define debug
Definition: MEtoEDMFormat.h:34
DTVDriftMeanTimer::~DTVDriftMeanTimer ( )
virtual

Definition at line 40 of file DTVDriftMeanTimer.cc.

40  {
41  rootFile_->Close();
42  delete fitter_;
43 }
DTMeanTimerFitter * fitter_

Member Function Documentation

DTVDriftData DTVDriftMeanTimer::compute ( const DTSuperLayerId slId)
virtual

Implements DTVDriftBaseAlgo.

Definition at line 47 of file DTVDriftMeanTimer.cc.

References N, DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), and DTChamberId::wheel().

47  {
48 
49  // Evaluate v_drift and sigma from the TMax histograms
50  DTWireId wireId(slId, 0, 0);
51  TString N = ( ( ( ( (TString)"TMax" + (long)wireId.wheel() )
52  + (long)wireId.station() )
53  + (long)wireId.sector() ) + (long)wireId.superLayer() );
54  vector<float> vDriftAndReso = fitter_->evaluateVDriftAndReso(N);
55 
56  // Don't write the constants for the SL if the vdrift was not computed
57  if(vDriftAndReso.front() == -1)
58  throw cms::Exception("DTCalibration") << "Could not compute valid vDrift value for SL " << slId << endl;
59 
60  return DTVDriftData(vDriftAndReso[0],vDriftAndReso[1]);
61 }
std::vector< float > evaluateVDriftAndReso(TString N)
Fit the TMax histos and evaluate VDrift and resolution.
#define N
Definition: blowfish.cc:9
DTMeanTimerFitter * fitter_
void DTVDriftMeanTimer::setES ( const edm::EventSetup setup)
virtual

Implements DTVDriftBaseAlgo.

Definition at line 45 of file DTVDriftMeanTimer.cc.

45 {}

Member Data Documentation

DTMeanTimerFitter* DTVDriftMeanTimer::fitter_
private

Definition at line 27 of file DTVDriftMeanTimer.h.

TFile* DTVDriftMeanTimer::rootFile_
private

Definition at line 26 of file DTVDriftMeanTimer.h.