CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTVDriftMeanTimer.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * $Date: 2010/11/18 20:58:24 $
6  * $Revision: 1.2 $
7  * \author A. Vilela Pereira
8  */
9 
10 #include "DTVDriftMeanTimer.h"
11 
16 
19 
22 
23 #include <string>
24 #include <vector>
25 
26 #include "TFile.h"
27 #include "TString.h"
28 
29 using namespace std;
30 using namespace edm;
31 
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 }
39 
41  rootFile_->Close();
42  delete fitter_;
43 }
44 
46 
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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual ~DTVDriftMeanTimer()
virtual void setES(const edm::EventSetup &setup)
DTVDriftMeanTimer(edm::ParameterSet const &)
int superLayer() const
Return the superlayer number.
#define N
Definition: blowfish.cc:9
virtual DTVDriftData compute(const DTSuperLayerId &)
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
#define debug
Definition: MEtoEDMFormat.h:34
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")