Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:39:22

0001 #ifndef EventDisplay_H
0002 #define EventDisplay_H
0003 
0004 #include <iostream>
0005 #include <fstream>
0006 #include "TString.h"
0007 #include "TFile.h"
0008 #include "TTree.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 EventDisplay{
0020 
0021  public:
0022   EventDisplay(){
0023     eventptr=&event;
0024     rswptr=&rsw;
0025     calibptr=&calib;
0026   }
0027   ~EventDisplay(){}
0028 
0029   //Getter methods
0030   inline TString GetRootInputName()         const {return RootInputName;};
0031   inline TString GetPlotOutputDir()         const {return OutputNameDirPlots;};
0032   
0033   inline TFile* GetRootInput()         {return RootInput;}
0034   inline TFile* GetRootOutput()        {return RootOutput;}
0035 
0036   inline bool CanOverWrite(void)                const {return Overwrite;};
0037   inline bool IsCalibSaveToFile(void)           const {return SaveCalibToFile;};
0038   inline short GetExtPlotting(void)             const {return ExtPlot;};
0039   inline bool IsToRunQA(void)                   const {return RunQA;};
0040   
0041   //setter methods
0042   //Overload method for boolean...or is it too dangerous?
0043   inline void CanOverWrite(bool b)                {Overwrite=b;};
0044   inline void IsCalibSaveToFile(bool b)           {SaveCalibToFile=b;};
0045   inline void SetExtPlotting(short b)             {ExtPlot = b;};
0046   inline void EnableDebug(int i)                  {debug=i;};
0047 
0048   inline void SetYear(int year)                   {yearData=year;};
0049   inline void SetRunListInput(TString name)       {RunListInputName=name;};
0050   inline void SetRootInput(TString name)          {RootInputName=name;};
0051   inline void SetPlotOutputDir(TString name)      {OutputNameDirPlots =name;};
0052   inline void SetPlotExtension(TString name)      {plotSuffix = name;};
0053   inline void SetEventToPlot(int e)               {plotEvt = e;};
0054   inline void SetNumberOfEventsToPlot(int n)      {nEvts = n;};
0055   inline void PlotMuonTriggeredEvents(bool y)     {plotMuonEvts=y;};
0056   
0057   //General methods
0058   bool CheckAndOpenIO(void);
0059   bool Process(void);
0060 
0061   //Variable members
0062   TString OutputNameDirPlots;             // directory name of output for plots
0063   TString RootInputName;                  // file name of input root file 
0064   TString RunListInputName;               // file name run list 
0065   TString plotSuffix          = "pdf";    // plot extension
0066   TFile* RootOutput           =nullptr;   // root file output tree
0067   TFile* RootOutputHist       =nullptr;   // root file output histos
0068   TFile* RootInput            =nullptr;   // root file input 
0069   bool RunQA                  = false;    // Flag to run QA routine
0070   bool SaveCalibToFile        =false;     // Flag to save calib objects to text file
0071   short ExtPlot               =0;         // Enable extended plotting
0072   bool Overwrite              =true;      // Flag to overwrite outputs
0073   int debug                   =0;         // debug level 
0074   int yearData                =-1;        // data taking year externally set
0075   RootSetupWrapper rsw;                   // Wrapper singleton class for setup
0076   RootSetupWrapper* rswptr;               // Pointer to wrapper for singleton class for setup
0077   Setup* setup;                           // geometry setup
0078   Calib calib;                            // calibration object
0079   Calib* calibptr;                        // pointer to calib object
0080   Event event;
0081   Event* eventptr;
0082   int plotEvt                 = 0;
0083   int nEvts                   = 1;
0084   bool plotMuonEvts           = false;
0085   
0086   TTree* TsetupIn=nullptr;
0087   TTree* TdataIn=nullptr;
0088   TTree* TcalibIn=nullptr;
0089 
0090  protected:
0091 
0092 
0093  private:
0094   bool Plot();
0095  };
0096 
0097 
0098 #endif