File indexing completed on 2025-07-11 07:53:48
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
0042
0043
0044 inline void CanOverWrite(bool b) {Overwrite=b;};
0045 inline void IsCalibSaveToFile(bool b) {SaveCalibToFile=b;};
0046 inline void SetExtPlotting(short b) {ExtPlot = b;};
0047 inline void EnableDebug(int i) {debug=i;};
0048 inline void IsToRunQA(bool b) {RunQA=b;};
0049 inline void IsToSimpleRunQA(bool b) {RunSimpleQA=b;};
0050
0051 inline void SetYear(int year) {yearData=year;};
0052 inline void SetRunListInput(TString name) {RunListInputName=name;};
0053 inline void SetRootInput(TString name) {RootInputName=name;};
0054 inline void SetRootOutput(TString name) {RootOutputName =name;};
0055 inline void SetRootOutputHists(TString name) {RootOutputNameHist =name;};
0056 inline void SetPlotOutputDir(TString name) {OutputNameDirPlots =name;};
0057 inline void SetPlotExtension(TString name) {plotSuffix = name;};
0058 inline void SetMaximumEvents(int numevents) {eventNumber = numevents;};
0059
0060
0061 bool CreateOutputRootFile(void);
0062 bool CreateOutputRootFileHist(void);
0063 bool CheckAndOpenIO(void);
0064 bool Process(void);
0065
0066
0067 TString RootOutputName;
0068 TString RootOutputNameHist;
0069 TString OutputNameDirPlots;
0070 TString RootInputName;
0071 TString RunListInputName;
0072 TString plotSuffix = "pdf";
0073 TFile* RootOutput =nullptr;
0074 TFile* RootOutputHist =nullptr;
0075 TFile* RootInput =nullptr;
0076 bool RunQA = false;
0077 bool RunSimpleQA = false;
0078 bool SaveCalibToFile =false;
0079 short ExtPlot =0;
0080 bool Overwrite =false;
0081 int debug =0;
0082 int yearData =-1;
0083 int eventNumber =-1;
0084 RootSetupWrapper rsw;
0085 RootSetupWrapper* rswptr;
0086 Setup* setup;
0087 Calib calib;
0088 Calib* calibptr;
0089 Event event;
0090 Event* eventptr;
0091
0092 TTree* TsetupIn=nullptr;
0093 TTree* TsetupOut=nullptr;
0094 TTree* TdataIn=nullptr;
0095 TTree* TdataOut=nullptr;
0096 TTree* TcalibIn=nullptr;
0097 TTree* TcalibOut=nullptr;
0098
0099 protected:
0100
0101
0102 private:
0103 bool QAData(void);
0104 bool SimpleQAData(void);
0105 };
0106
0107
0108 #endif