File indexing completed on 2026-04-21 07:51:39
0001 #ifndef HGCROC_WAVEFORM_ANALYSIS_H
0002 #define HGCROC_WAVEFORM_ANALYSIS_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 HGCROC_Waveform_Analysis{
0020
0021 public:
0022 HGCROC_Waveform_Analysis(){
0023 eventptr=&event;
0024 rswptr=&rsw;
0025 calibptr=&calib;
0026 }
0027 ~HGCROC_Waveform_Analysis(){}
0028
0029
0030 inline TString GetRootCalibInputName() const {return RootCalibInputName;};
0031 inline TString GetRootCalibOutputName() const {return RootCalibOutputName;};
0032 inline TString GetRootInputName() const {return RootInputName;};
0033 inline TString GetRootOutputName() const {return RootOutputName;};
0034 inline TString GetPlotOutputDir() const {return OutputNameDirPlots;};
0035 inline TString GetExternalBadChannelMap() const {return ExternalBadChannelMap;};
0036 inline TString GetExternalCalibFile() const {return ExternalCalibFile;};
0037 inline TString GetExternalToACalibOffSetFile() const {return ExternalToACalibOffSetFile;};
0038
0039 inline TFile* GetRootCalibInput() {return RootCalibInput;}
0040 inline TFile* GetRootInput() {return RootInput;}
0041 inline TFile* GetRootOutput() {return RootOutput;}
0042
0043 inline bool CanOverWrite(void) const {return Overwrite;};
0044 inline bool IsToAnalysisWaveForm(void) const {return IsAnalyseWaveForm;};
0045 inline bool IsToExtractTimeWalk(void) const {return IsExtractTimeWalk;};
0046 inline bool IsToInvCrossTalk(void) const {return IsInvCrossTalk;};
0047 inline bool IsHGCROC(void) const {return HGCROC;};
0048
0049 inline short GetExtPlotting(void) const {return ExtPlot;};
0050 inline bool GetOverWriteCalib(void) const {return OverWriteCalib;};
0051 inline int GetMaxEvents(void) const {return maxEvents;};
0052 inline int GetFixedTOASample(void) const {return fixedTOASample;};
0053 inline int GetFixedROChannel(void) const {return fixedROCh;};
0054
0055
0056
0057 inline void CanOverWrite(bool b) {Overwrite=b;};
0058 inline void IsToAnalysisWaveForm(bool b) {IsAnalyseWaveForm=b;};
0059 inline void IsToExtractTimeWalk(bool b) {IsExtractTimeWalk=b;};
0060 inline void IsToInvCrossTalk(bool b) {IsInvCrossTalk=b;};
0061 inline void SetOverWriteCalib(bool b) {OverWriteCalib = b;};
0062 inline void SetExtPlotting(short b) {ExtPlot = b;};
0063 inline void EnableDebug(int i) {debug=i;};
0064
0065 inline void SetYear(int year) {yearData=year;};
0066 inline void SetRunListInput(TString name) {RunListInputName=name;};
0067 inline void SetRootCalibInput(TString name) {RootCalibInputName=name;};
0068 inline void SetRootCalibOutput(TString name) {RootCalibOutputName=name;};
0069 inline void SetRootInput(TString name) {RootInputName=name;};
0070 inline void SetRootOutput(TString name) {RootOutputName =name;};
0071 inline void SetRootOutputHists(TString name) {RootOutputNameHist =name;};
0072 inline void SetPlotOutputDir(TString name) {OutputNameDirPlots =name;};
0073 inline void SetPlotExtension(TString name) {plotSuffix = name;};
0074 inline void SetExternalBadChannelMap(TString name) {ExternalBadChannelMap =name;};
0075 inline void SetExternalCalibFile(TString name) {ExternalCalibFile =name;};
0076 inline void SetExternalToACalibOffSetFile(TString name) {ExternalToACalibOffSetFile =name;};
0077 inline void SetMaxEvents(int n) {maxEvents = n;};
0078 inline void SetFixedTOASample(int s) {fixedTOASample = s;};
0079 inline void SetFixedROChannel(int r) {fixedROCh = r;};
0080
0081
0082 bool CreateOutputRootFile(void);
0083 bool CreateOutputRootHistFile(void);
0084 bool CheckAndOpenIO(void);
0085 bool Process(void);
0086
0087
0088 TString RootOutputName;
0089 TString RootOutputNameHist;
0090 TString OutputNameDirPlots;
0091 TString RootInputName;
0092 TString RootCalibInputName;
0093 TString RootCalibOutputName;
0094 TString RunListInputName;
0095 TString ExternalBadChannelMap;
0096 TString ExternalCalibFile;
0097 TString ExternalToACalibOffSetFile ="";
0098 TString plotSuffix = "pdf";
0099 TFile* RootOutput =nullptr;
0100 TFile* RootOutputHist =nullptr;
0101 TFile* RootInput =nullptr;
0102 TFile* RootCalibInput =nullptr;
0103 TFile* RootCalibOutput =nullptr;
0104 bool HGCROC =false;
0105 bool IsAnalyseWaveForm =false;
0106 bool IsExtractTimeWalk =false;
0107 bool IsInvCrossTalk =false;
0108 bool OverWriteCalib =false;
0109 short ExtPlot =0;
0110 bool Overwrite =false;
0111 int debug =0;
0112 int yearData =-1;
0113 RootSetupWrapper rsw;
0114 RootSetupWrapper* rswptr;
0115 Setup* setup;
0116 Calib calib;
0117 Calib* calibptr;
0118 Event event;
0119 Event* eventptr;
0120 int maxEvents = -1;
0121 int fixedTOASample = -1;
0122 int fixedROCh = -1;
0123
0124 TTree* TsetupIn=nullptr;
0125 TTree* TsetupOut=nullptr;
0126 TTree* TdataIn=nullptr;
0127 TTree* TdataOut=nullptr;
0128 TTree* TcalibIn=nullptr;
0129 TTree* TcalibOut=nullptr;
0130
0131 protected:
0132
0133
0134 private:
0135 bool AnalyseWaveForm(void);
0136 bool ExtractTimeWalk(void);
0137 bool InvestigateCrossTalk(void);
0138 };
0139
0140
0141 #endif