Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:28:17

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   
0061   //General methods
0062   bool CreateOutputRootFile(void);
0063   bool CheckAndOpenIO(void);
0064   bool ProcessCalib(void);
0065 
0066   //Variable members
0067   TString RootOutputName;                 // file name of root output with tree
0068   std::vector<TString> RootInputNames;    // file name of root output with tree
0069   //TString RootOutputNameHist;             // file name of root output with additional histograms & fits
0070   TString OutputNameDirPlots;             // directory name of output for plots
0071   TString plotSuffix        = "pdf";      // output file format for plots
0072   TString InputListName;                  // file name of input file list 
0073   TString RunListInputName;               // file name run list 
0074   TFile* RootOutput         =nullptr;     // root file output tree
0075   bool Overwrite              =false;     // Flag to overwrite outputs
0076   int expandedList            =0;         // Expanded input list option: 1 - ImprovedScaling histo output, 2 - GetScaling histo output
0077   int debug                   =0;         // debug level 
0078   short ExtPlot               =0;         // Enable extended plotting
0079   int yearData                =-1;        // data taking year externally set
0080   int Xaxis                   =0;         // Trending dependence 0: run nr, 1: Voltage
0081   int maxLayerPlot            =100;       // option restrict individual layer plotting
0082   bool isHGCROC               =false;     // option to switch to HGCROC comparison
0083   RootSetupWrapper rsw;                   // Wrapper singleton class for setup
0084   RootSetupWrapper* rswptr;               // Pointer to wrapper for singleton class for setup
0085   Setup* setup;                           // geometry setup
0086   Calib calib;                            // calibration object
0087   Calib* calibptr;                        // pointer to calib object
0088   
0089   TChain* TsetupIn=nullptr;
0090   TChain* TcalibIn=nullptr;
0091 
0092  protected:
0093 
0094 
0095  private:
0096    
0097 };
0098 
0099 #endif