File indexing completed on 2025-01-18 09:15:44
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
0050 inline void SetYear(int year) {yearData=year;};
0051 inline void SetRunListInput(TString name) {RunListInputName=name;};
0052 inline void SetRootInput(TString name) {RootInputName=name;};
0053 inline void SetRootOutput(TString name) {RootOutputName =name;};
0054 inline void SetRootOutputHists(TString name) {RootOutputNameHist =name;};
0055 inline void SetPlotOutputDir(TString name) {OutputNameDirPlots =name;};
0056
0057
0058 bool CreateOutputRootFile(void);
0059 bool CreateOutputRootFileHist(void);
0060 bool CheckAndOpenIO(void);
0061 bool Process(void);
0062
0063
0064 TString RootOutputName;
0065 TString RootOutputNameHist;
0066 TString OutputNameDirPlots;
0067 TString RootInputName;
0068 TString RunListInputName;
0069 TFile* RootOutput =nullptr;
0070 TFile* RootOutputHist =nullptr;
0071 TFile* RootInput =nullptr;
0072 bool RunQA = false;
0073 bool SaveCalibToFile =false;
0074 short ExtPlot =0;
0075 bool Overwrite =false;
0076 int debug =0;
0077 int yearData =-1;
0078 RootSetupWrapper rsw;
0079 RootSetupWrapper* rswptr;
0080 Setup* setup;
0081 Calib calib;
0082 Calib* calibptr;
0083 Event event;
0084 Event* eventptr;
0085
0086 TTree* TsetupIn=nullptr;
0087 TTree* TsetupOut=nullptr;
0088 TTree* TdataIn=nullptr;
0089 TTree* TdataOut=nullptr;
0090 TTree* TcalibIn=nullptr;
0091 TTree* TcalibOut=nullptr;
0092
0093 protected:
0094
0095
0096 private:
0097 bool QAData(void);
0098 };
0099
0100
0101 #endif