Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:31

0001 #ifndef DTMeanTimerPlotter_H
0002 #define DTMeanTimerPlotter_H
0003 
0004 /** \class DTMeanTimerPlotter
0005  *  Utility class to plot MeanTimer produced with DTVDriftCalibration.
0006  *  The tmax histograms can be fitted using exactly the same code that is
0007  *  used by the calibration application.
0008  *
0009  *  \author S. Bolognesi - INFN Torino
0010  */
0011 
0012 #include "TString.h"
0013 #include <vector>
0014 
0015 class TFile;
0016 class TCanvas;
0017 class TH1D;
0018 class TF1;
0019 
0020 class DTMeanTimerPlotter {
0021 public:
0022   /// Constructor
0023   DTMeanTimerPlotter(TFile* file);
0024 
0025   /// Destructor
0026   virtual ~DTMeanTimerPlotter();
0027 
0028   // Operations
0029 
0030   /// Plot the time box of a given superlayer.
0031   /// Options: <br>
0032   /// "same" -> histo drawn in the active canvas, <br>
0033   /// "SingleDeltaT0" or "SingleFormula" -> fit and draw each TMax histo separately (in the same canvas) <br>
0034   /// "fit" -> draw and fit the histos <br>
0035   void plotMeanTimer(int wheel, int station, int sector, int sl, const TString& drawOptions = "");
0036 
0037   /// Set the verbosity of the output: 0 = silent, 1 = info, 2 = debug
0038   void setVerbosity(unsigned int lvl);
0039 
0040   /// Set rebin number
0041   void setRebinning(unsigned int rebin);
0042 
0043   /// Reset the counter for histos color
0044   void resetColor();
0045 
0046 protected:
0047 private:
0048   //Plot the TMax histogram for each deltaT0: THESE ARE NOT USED TO COMPUTE VDRIFT
0049   std::vector<TH1D*> plotSingleTMaxDeltaT0(TString& name);
0050   //Plot the TMax histogram for each formula
0051   std::vector<TH1D*> plotSingleTMaxFormula(TString& name);
0052   //Plot the total TMax histograms: THIS IS NOT USED TO COMPUTE VDRIFT
0053   std::vector<TH1D*> plotTotalTMax(TString& name);
0054 
0055   void plotHistos(std::vector<TH1D*> hTMaxes, TString& name, const TString& drawOptions);
0056   TString getHistoNameSuffix(int wheel, int station, int sector, int sl);
0057   std::vector<TF1*> fitTMaxes(std::vector<TH1D*> histo);
0058   double getMaximum(std::vector<TH1D*> hTMaxes);
0059 
0060   TFile* theFile;
0061   unsigned int theVerbosityLevel;
0062   unsigned int theRebinning;
0063   unsigned int color;
0064 };
0065 #endif