Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTTimeBoxPlotter_H
0002 #define DTTimeBoxPlotter_H
0003 
0004 /** \class DTTimeBoxPlotter
0005  *  Utility class to plot TimeBoxes produced with DTTTrigCalibration.
0006  *  The time box rising edge can be fitted using exactly the same code that is
0007  *  used by the calibration application.
0008  *
0009  *  \author G. Cerminara - INFN Torino
0010  */
0011 
0012 #include "TString.h"
0013 
0014 class TFile;
0015 class TCanvas;
0016 class TH1F;
0017 class TH2F;
0018 class DTTimeBoxFitter;
0019 
0020 class DTTimeBoxPlotter {
0021 public:
0022   /// Constructor
0023   DTTimeBoxPlotter(TFile* file);
0024 
0025   /// Destructor
0026   virtual ~DTTimeBoxPlotter();
0027 
0028   // Operations
0029 
0030   /// Plot the time box of a given chamber.
0031   /// Options: "same" -> histo drawn in the active canvas, "fit" -> fit the rising edge of the time box
0032   TH1F* plotTimeBox(int wheel, int station, int sector, const TString& drawOptions = "");
0033   /// Plot the time box of a given superlayer.
0034   /// Options: "same" -> histo drawn in the active canvas, "fit" -> fit the rising edge of the time box
0035   TH1F* plotTimeBox(int wheel, int station, int sector, int sl, const TString& drawOptions = "");
0036   /// Plot the time box of a given layer.
0037   /// Options: "same" -> histo drawn in the active canvas, "fit" -> fit the rising edge of the time box
0038   TH1F* plotTimeBox(int wheel, int station, int sector, int sl, int layer, const TString& drawOptions = "");
0039   /// Plot the time box of a given wire.
0040   /// Options: "same" -> histo drawn in the active canvas, "fit" -> fit the rising edge of the time box
0041   TH1F* plotTimeBox(int wheel, int station, int sector, int sl, int layer, int wire, const TString& drawOptions = "");
0042 
0043   /// Print all canvases in a pdf file.
0044   void printPDF();
0045 
0046   /// Set the verbosity of the output: 0 = silent, 1 = info, 2 = debug
0047   void setVerbosity(unsigned int lvl);
0048   void setInteractiveFit(bool isInteractive);
0049   void setRebinning(int rebin);
0050 
0051 protected:
0052 private:
0053   TString getHistoNameSuffix(int wheel, int station, int sector);
0054   TString getHistoNameSuffix(int wheel, int station, int sector, int sl);
0055   TString getHistoNameSuffix(int wheel, int station, int sector, int sl, int layer);
0056   TString getHistoNameSuffix(int wheel, int station, int sector, int sl, int layer, int wire);
0057 
0058   TH1F* plotHisto(const TString& histoName, const TString& drawOptions = "");
0059   TH2F* plotHisto2D(const TString& histoName, const TString& drawOptions = "");
0060 
0061   TCanvas* newCanvas(TString name = "", TString title = "", int xdiv = 0, int ydiv = 0, int form = 1, int w = -1);
0062 
0063   TCanvas* newCanvas(TString name, int xdiv, int ydiv, int form, int w);
0064   TCanvas* newCanvas(int xdiv, int ydiv, int form = 1);
0065   TCanvas* newCanvas(int form = 1);
0066   TCanvas* newCanvas(TString name, int form, int w = -1);
0067 
0068   DTTimeBoxFitter* theFitter;
0069   TFile* theFile;
0070   unsigned int theVerbosityLevel;
0071 };
0072 #endif