File indexing completed on 2025-11-05 08:58:06
0001 #ifndef DataAnalysis_H
0002 #define DataAnalysis_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 DataAnalysis{
0020
0021 public:
0022 DataAnalysis(){
0023 eventptr=&event;
0024 rswptr=&rsw;
0025 calibptr=&calib;
0026 }
0027 ~DataAnalysis(){}
0028
0029
0030 inline TString GetRootInputName() const {return RootInputName;};
0031 inline TString GetRootOutputName() const {return RootOutputName;};
0032 inline TString GetPlotOutputDir() const {return OutputNameDirPlots;};
0033
0034 inline TFile* GetRootInput() {return RootInput;}
0035 inline TFile* GetRootOutput() {return RootOutput;}
0036
0037 inline bool CanOverWrite(void) const {return Overwrite;};
0038 inline bool IsCalibSaveToFile(void) const {return SaveCalibToFile;};
0039 inline short GetExtPlotting(void) const {return ExtPlot;};
0040 inline bool IsToRunQA(void) const {return RunQA;};
0041 inline bool GetDeltaTimePlotting(void) const {return DeltaTimePlot;};
0042 inline double GetTimeMin(void) const {return timemin;};
0043 inline double GetTimeMax(void) const {return timemax;};
0044 inline double GetPercentMin(void) const {return percentmin;};
0045 inline double GetPercentMax(void) const {return percentmax;};
0046
0047
0048
0049 inline void CanOverWrite(bool b) {Overwrite=b;};
0050 inline void IsCalibSaveToFile(bool b) {SaveCalibToFile=b;};
0051 inline void SetExtPlotting(short b) {ExtPlot = b;};
0052 inline void SetDeltaTimePlotting(bool b) {DeltaTimePlot = b;};
0053 inline void SetTimeMin(double b) {timemin = b;};
0054 inline void SetTimeMax(double b) {timemax = b;};
0055 inline void SetPercentMin(double b) {percentmin = b;};
0056 inline void SetPercentMax(double b) {percentmax = b;};
0057 inline void EnableDebug(int i) {debug=i;};
0058 inline void IsToRunQA(bool b) {RunQA=b;};
0059 inline void IsToSimpleRunQA(bool b) {RunSimpleQA=b;};
0060
0061 inline void SetYear(int year) {yearData=year;};
0062 inline void SetRunListInput(TString name) {RunListInputName=name;};
0063 inline void SetRootInput(TString name) {RootInputName=name;};
0064 inline void SetRootOutput(TString name) {RootOutputName =name;};
0065 inline void SetRootOutputHists(TString name) {RootOutputNameHist =name;};
0066 inline void SetPlotOutputDir(TString name) {OutputNameDirPlots =name;};
0067 inline void SetPlotExtension(TString name) {plotSuffix = name;};
0068 inline void SetMaximumEvents(int numevents) {eventNumber = numevents;};
0069
0070
0071 bool CreateOutputRootFile(void);
0072 bool CreateOutputRootFileHist(void);
0073 bool CheckAndOpenIO(void);
0074 bool Process(void);
0075
0076
0077 TString RootOutputName;
0078 TString RootOutputNameHist;
0079 TString OutputNameDirPlots;
0080 TString RootInputName;
0081 TString RunListInputName;
0082 TString plotSuffix = "pdf";
0083 TFile* RootOutput =nullptr;
0084 TFile* RootOutputHist =nullptr;
0085 TFile* RootInput =nullptr;
0086 bool RunQA = false;
0087 bool RunSimpleQA = false;
0088 bool SaveCalibToFile =false;
0089 short ExtPlot =0;
0090 bool DeltaTimePlot =false;
0091 bool Overwrite =false;
0092 int debug =0;
0093 int yearData =-1;
0094 int eventNumber =-1;
0095 double timemin =0;
0096 double timemax =35000;
0097 double percentmax =100;
0098 double percentmin =0;
0099 RootSetupWrapper rsw;
0100 RootSetupWrapper* rswptr;
0101 Setup* setup;
0102 Calib calib;
0103 Calib* calibptr;
0104 Event event;
0105 Event* eventptr;
0106
0107 TTree* TsetupIn=nullptr;
0108 TTree* TsetupOut=nullptr;
0109 TTree* TdataIn=nullptr;
0110 TTree* TdataOut=nullptr;
0111 TTree* TcalibIn=nullptr;
0112 TTree* TcalibOut=nullptr;
0113
0114 protected:
0115
0116
0117 private:
0118 bool QAData(void);
0119 bool SimpleQAData(void);
0120 };
0121
0122
0123 #endif