Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-21 09:30:13

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