Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:06:16

0001 #ifndef COMPARISONCALIB_H
0002 #define COMPARISONCALIB_H
0003 
0004 #include <iostream>
0005 #include <fstream>
0006 #include "TString.h"
0007 #include "TFile.h"
0008 #include "TChain.h"
0009 #include "TObjString.h"
0010 
0011 #include "Setup.h"
0012 #include "RootSetupWrapper.h"
0013 #include "Calib.h"
0014 #include "Event.h"
0015 #include "Tile.h"
0016 #include "HGCROC.h"
0017 #include "Caen.h"
0018     
0019 class ComparisonCalib{
0020 
0021  public:
0022   ComparisonCalib(){
0023     TsetupIn = new TChain("Setup");
0024     TcalibIn = new TChain("Calib");
0025     TcalibRef = new TChain("Calib");
0026     rswptr      =&rsw;
0027     calibptr    =&calib;
0028     calibRefptr =&calibRef;
0029   }
0030   ~ComparisonCalib(){
0031     if(RootOutput) RootOutput->Close();
0032   }
0033 
0034   //Getter methods
0035   inline TString GetRootCalibInputName()    const {return TcalibIn->GetFile()->GetName();};
0036   inline TString GetInputListName()         const {return InputListName;};
0037   inline TString GetRootOutputName()        const {return RootOutputName;};
0038   inline TString GetPlotOutputDir()         const {return OutputNameDirPlots;};
0039   inline short GetExtPlotting(void)         const {return ExtPlot;};
0040   inline bool GetIsHGCROC(void)             const {return isHGCROC;};
0041   inline int GetExpandedList()              const {return expandedList;}
0042   inline bool CanOverWrite(void)            const {return Overwrite;};
0043   
0044   inline TFile* GetRootOutput()                   {return RootOutput;}
0045   
0046   //setter methods
0047   //Overload method for boolean...or is it too dangerous?
0048   inline void CanOverWrite(bool b)               {Overwrite=b;};
0049   inline void EnableDebug(int i)                 {debug=i;};
0050   inline void ExpandedList(int i)               {expandedList=i;};  
0051   
0052   inline void AddInputFile(TString name)         {RootInputNames.push_back(name);};
0053   inline void SetInputList(TString name)         {InputListName=name;};
0054   inline void SetRootOutput(TString name)        {RootOutputName =name;};
0055   inline void SetPlotOutputDir(TString name)     {OutputNameDirPlots =name;};
0056   inline void SetPlotExtension(TString name)     {plotSuffix = name;};
0057   inline void SetExtPlotting(short b)            {ExtPlot = b;};
0058   inline void SetTrendingAxis(int i)             {Xaxis=i;};
0059   inline void SetRunListInput(TString name)      {RunListInputName=name;};
0060   inline void SetMaxPlotLayer(int i)             {maxLayerPlot=i;};
0061   inline void SetIsHGCROC(bool b)                {isHGCROC=b;};
0062     inline void SetLegendLabelOpt(int i)                     {eoLabelOpt=i;};  
0063   inline void SetCellList(TString name)                  {cellList=name;};  
0064   //General methods
0065   bool CreateOutputRootFile(void);
0066   bool CheckAndOpenIO(void);
0067   bool ProcessCalib(void);
0068 
0069   //Variable members
0070   TString RootOutputName;                 // file name of root output with tree
0071   std::vector<TString> RootInputNames;    // file name of root output with tree
0072   //TString RootOutputNameHist;             // file name of root output with additional histograms & fits
0073   TString OutputNameDirPlots;             // directory name of output for plots
0074   TString plotSuffix          = "pdf";    // output file format for plots
0075   TString InputListName;                  // file name of input file list 
0076   TString RunListInputName;               // file name run list 
0077   TString cellList            = "";       // list of cells to be plotted separately
0078   TFile* RootOutput           =nullptr;   // root file output tree
0079   bool Overwrite              =false;     // Flag to overwrite outputs
0080   int expandedList            =0;         // Expanded input list option: 1 - ImprovedScaling histo output, 2 - GetScaling histo output
0081   int debug                   =0;         // debug level 
0082   short ExtPlot               =0;         // Enable extended plotting
0083   int yearData                =-1;        // data taking year externally set
0084   int Xaxis                   =0;         // Trending dependence 0: run nr, 1: Voltage
0085   int maxLayerPlot            =100;       // option restrict individual layer plotting
0086   bool isHGCROC               =false;     // option to switch to HGCROC comparison
0087   int eoLabelOpt              =1;         // 1: run number, 2: beam E (NOT IMPLEMENTED), 3: Vop
0088   RootSetupWrapper rsw;                   // Wrapper singleton class for setup
0089   RootSetupWrapper* rswptr;               // Pointer to wrapper for singleton class for setup
0090   Setup* setup;                           // geometry setup
0091   Calib calib;                            // calibration object
0092   Calib* calibptr;                        // pointer to calib object
0093   Calib calibRef;                         // reference calibration object
0094   Calib* calibRefptr;                     // pointer to reference calib object
0095   
0096   TChain* TsetupIn  =nullptr;
0097   TChain* TcalibIn  =nullptr;
0098   TChain* TcalibRef =nullptr;
0099 
0100  protected:
0101 
0102 
0103  private:
0104    
0105 };
0106 
0107 #endif