Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-24 08:25:50

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