Back to home page

EIC code displayed by LXR

 
 

    


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

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   inline void SetMinTilesHit(int n)               {minTilesHit = n;};
0057   inline void PlotHGCROC_ADCData()                {plotHGCROC = true; dataTypeHGCROC = 0; }
0058   inline void PlotHGCROC_ADCwPedData()            {plotHGCROC = true; dataTypeHGCROC = 1; }
0059   inline void PlotHGCROC_TOTData()                {plotHGCROC = true; dataTypeHGCROC = 2; }
0060   
0061   //General methods
0062   bool CheckAndOpenIO(void);
0063   bool Process(void);
0064 
0065   //Variable members
0066   TString OutputNameDirPlots;             // directory name of output for plots
0067   TString RootInputName;                  // file name of input root file 
0068   TString RunListInputName;               // file name run list 
0069   TString plotSuffix          = "pdf";    // plot extension
0070   TFile* RootOutput           =nullptr;   // root file output tree
0071   TFile* RootOutputHist       =nullptr;   // root file output histos
0072   TFile* RootInput            =nullptr;   // root file input 
0073   bool RunQA                  = false;    // Flag to run QA routine
0074   bool SaveCalibToFile        =false;     // Flag to save calib objects to text file
0075   short ExtPlot               =0;         // Enable extended plotting
0076   bool Overwrite              =true;      // Flag to overwrite outputs
0077   int debug                   =0;         // debug level 
0078   int yearData                =-1;        // data taking year externally set
0079   RootSetupWrapper rsw;                   // Wrapper singleton class for setup
0080   RootSetupWrapper* rswptr;               // Pointer to wrapper for singleton class for setup
0081   Setup* setup;                           // geometry setup
0082   Calib calib;                            // calibration object
0083   Calib* calibptr;                        // pointer to calib object
0084   Event event;
0085   Event* eventptr;
0086   int plotEvt                 = 0;
0087   int nEvts                   = 1;
0088   bool plotMuonEvts           = false;
0089   int minTilesHit             = 0;
0090   bool plotHGCROC             = false;
0091   int dataTypeHGCROC          = 0; // 0 - ADC, 1 - ADC-pedestal, 2 - ToT
0092   
0093   TTree* TsetupIn=nullptr;
0094   TTree* TdataIn=nullptr;
0095   TTree* TcalibIn=nullptr;
0096 
0097  protected:
0098 
0099 
0100  private:
0101   bool Plot();
0102  };
0103 
0104 
0105 #endif