Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 07:53:36

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