Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-21 07:51:39

0001 #ifndef MULTICANVAS_H
0002 #define MULTICANVAS_H
0003 
0004 #include "TLegend.h"
0005 #include "TAxis.h"
0006 #include "TColor.h"
0007 #include "TCanvas.h"
0008 #include "TLine.h"
0009 #include "TBox.h"
0010 #include "TPad.h"
0011 #include "TFrame.h"
0012 #include "TLatex.h"
0013 #include "TGraph.h"
0014 #include "TGraphErrors.h"
0015 #include "TGraphAsymmErrors.h"
0016 #include "TGaxis.h"
0017 #include "TSystem.h"
0018 #include "TStyle.h"
0019 #include <TH3.h>
0020 #include "Caen.h"
0021 #include "HGCROC.h"
0022 #include "Setup.h"
0023 #include "Calib.h"
0024 #include "TileSpectra.h"  
0025 #include "TileTrend.h"  
0026 #include "CalibSummary.h"  
0027 #include "AnaSummary.h"
0028 #include "CommonHelperFunctions.h"
0029 #include "PlotHelper.h"
0030 // #include "PlotHelper_general.h"
0031 // #include "PlotHelper_8MLayer.h"
0032 // #include "PlotHelper_2MLayer.h"
0033 // #include "PlotHelper_1MLayer.h"
0034 // #include "PlotHelper_2ModLayer.h"
0035 // #include "PlotHelper_AsicLFHCal.h"
0036 
0037 class MultiCanvas{
0038 
0039  public:
0040   MultiCanvas(){}
0041   MultiCanvas(DetConf::Type det, TString name){
0042     detType = det;
0043     addName = name;
0044   }
0045   ~MultiCanvas(){}
0046   
0047 
0048   bool    Initialize(int);
0049   
0050   TCanvas*  GetCanvas() {if (init) return canvasMulti; else return nullptr;}
0051   TPad**  GetPad() {if (init) return padMulti; else return nullptr;}
0052   Double_t* GetLegPlace1D(int opt){ if (init) {if (opt==0) return legPlace_X; else return legPlace_Y;} else return nullptr;}
0053   Double_t* GetRelTextSize1D(){ if (init) return relTextSize; else return nullptr;}
0054   
0055   
0056   void ReturnCorrectValuesForCanvasScaling(   Int_t sizeX, Int_t sizeY, Int_t nCols, Int_t nRows, Double_t  leftMargin, Double_t rightMargin, Double_t upperMargin, Double_t lowerMargin, Double_t* arrayBoundariesX, Double_t* arrayBoundariesY, Double_t* relativeMarginsX, Double_t* relativeMarginsY, int verbose = 1);
0057   
0058   void ReturnCorrectValuesTextSize(   TPad * pad, Double_t &textsizeLabels, Double_t &textsizeFac, Int_t textSizeLabelsPixel, Double_t dummyWUP);
0059   
0060   void CreateCanvasAndPadsFor8PannelTBPlot(Int_t textSizePixel = 30, Double_t marginLeft = 0.03, TString add = "", bool rightCorner = true, int debug = 0);
0061   
0062   void CreateCanvasAndPadsFor2PannelTBPlot(Int_t textSizePixel = 30, Double_t marginLeft = 0.03, TString add = "", bool rightCorner = true, int debug = 0);
0063   
0064   void CreateCanvasAndPadsForDualModTBPlot(Int_t textSizePixel = 30, Double_t marginLeft = 0.03, TString add = "", bool rightCorner = true, int debug = 0);
0065 
0066   void CreateCanvasAndPadsForAsicLFHCalTBPlot( Int_t textSizePixel = 30, Double_t marginLeft = 0.03, TString add = "", bool rightCorner = true, int debug = 0);
0067 
0068   void DefaultCanvasSettings( TCanvas* c1, Double_t leftMargin, Double_t rightMargin, Double_t topMargin, Double_t bottomMargin);
0069 
0070   void DefaultPadSettings( TPad* pad1, Double_t leftMargin, Double_t rightMargin, Double_t topMargin, Double_t bottomMargin);
0071 
0072   void PlotNoiseWithFits( std::map<int,TileSpectra> spectra, int option, 
0073                           Double_t xPMin, Double_t xPMax, Double_t scaleYMax, 
0074                           TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, int debug = 1 );
0075   void PlotNoiseAdvWithFits(  std::map<int,TileSpectra> spectra, std::map<int,TileSpectra> spectraNoise, int option, 
0076                               Double_t xPMin, Double_t xPMax, Double_t scaleYMax, 
0077                               TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, int debug = 1);
0078   
0079   void PlotCorr2DLayer(   std::map<int,TileSpectra> spectra, int option, 
0080                           Double_t xPMin, Double_t xPMax, Double_t minY, Double_t maxY, 
0081                           TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, 
0082                           int noCalib = 0, int triggerCha = -1, int debug = 1);
0083   void PlotCorrWithFits(   std::map<int,TileSpectra> spectra, int option, 
0084                             Double_t xPMin, Double_t xPMax, Double_t minY, Double_t maxY, 
0085                             TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, 
0086                             int debug = 1);
0087   
0088   void PlotSpectra(  std::map<int,TileSpectra> spectra, int option, 
0089                      Double_t xPMin, Double_t xPMax, Double_t scaleYMax, 
0090                      TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, 
0091                      int debug = 1);
0092   
0093   void PlotMipWithFits( std::map<int,TileSpectra> spectra, std::map<int,TileSpectra> spectraTrigg, 
0094                         int option, Double_t xPMin, Double_t xPMax, Double_t scaleYMax, 
0095                         TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, int debug= 1 );
0096 
0097   void PlotTriggerPrim(  std::map<int,TileSpectra> spectra, 
0098                          double avMip, double facLow, double facHigh,
0099                          Double_t xPMin, Double_t xPMax, Double_t scaleYMax, 
0100                          TString nameOutputBase, TString suffix,  RunInfo currRunInfo, Calib* calib, 
0101                          int debug = 1);
0102   
0103  private:
0104   TCanvas* canvasMulti;
0105   TPad* padMulti[64];
0106   Double_t legPlace_X[64];
0107   Double_t legPlace_Y[64];
0108   Double_t relTextSize[64];
0109   bool init                = false;
0110   DetConf::Type detType    = DetConf::Type::Undef; 
0111   int maxPads              = 0;
0112   int textSize             = 30;
0113   // int maxRow               = 0;
0114   // int maxColumn            = 0;
0115   TString addName          = "";
0116   
0117  protected:
0118 
0119 };
0120 
0121 
0122 #endif