DTMeanTimerPlotter

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#ifndef DTMeanTimerPlotter_H
#define DTMeanTimerPlotter_H

/** \class DTMeanTimerPlotter
 *  Utility class to plot MeanTimer produced with DTVDriftCalibration.
 *  The tmax histograms can be fitted using exactly the same code that is
 *  used by the calibration application.
 *
 *  \author S. Bolognesi - INFN Torino
 */

#include "TString.h"
#include <vector>

class TFile;
class TCanvas;
class TH1D;
class TF1;

class DTMeanTimerPlotter {
public:
  /// Constructor
  DTMeanTimerPlotter(TFile* file);

  /// Destructor
  virtual ~DTMeanTimerPlotter();

  // Operations

  /// Plot the time box of a given superlayer.
  /// Options: <br>
  /// "same" -> histo drawn in the active canvas, <br>
  /// "SingleDeltaT0" or "SingleFormula" -> fit and draw each TMax histo separately (in the same canvas) <br>
  /// "fit" -> draw and fit the histos <br>
  void plotMeanTimer(int wheel, int station, int sector, int sl, const TString& drawOptions = "");

  /// Set the verbosity of the output: 0 = silent, 1 = info, 2 = debug
  void setVerbosity(unsigned int lvl);

  /// Set rebin number
  void setRebinning(unsigned int rebin);

  /// Reset the counter for histos color
  void resetColor();

protected:
private:
  //Plot the TMax histogram for each deltaT0: THESE ARE NOT USED TO COMPUTE VDRIFT
  std::vector<TH1D*> plotSingleTMaxDeltaT0(TString& name);
  //Plot the TMax histogram for each formula
  std::vector<TH1D*> plotSingleTMaxFormula(TString& name);
  //Plot the total TMax histograms: THIS IS NOT USED TO COMPUTE VDRIFT
  std::vector<TH1D*> plotTotalTMax(TString& name);

  void plotHistos(std::vector<TH1D*> hTMaxes, TString& name, const TString& drawOptions);
  TString getHistoNameSuffix(int wheel, int station, int sector, int sl);
  std::vector<TF1*> fitTMaxes(std::vector<TH1D*> histo);
  double getMaximum(std::vector<TH1D*> hTMaxes);

  TFile* theFile;
  unsigned int theVerbosityLevel;
  unsigned int theRebinning;
  unsigned int color;
};
#endif