26 #ifndef PNDHYPGESPECTRUMANALYSER_H 27 #define PNDHYPGESPECTRUMANALYSER_H 30 #include "TSpectrum.h" 33 #include "TGraphErrors.h" 52 void SetEnergySpectrum(TH1D *hEnergySpec_ext);
54 Int_t AnalyseSpectrum();
55 Int_t AnalyseSimulationSpectrum();
59 Int_t DrawCalibratedSpectrum();
60 Int_t DrawSimulationSpectrum();
61 Int_t DoEnergyCalibration();
62 Int_t CalculateFWHM();
63 Int_t CalculateFWTM();
64 Double_t CalculateEfficiency();
65 Double_t GetFWHM511();
66 Double_t GetFWTM511();
67 Double_t GetFWHMCo1();
68 Double_t GetFWTMCo1();
73 Double_t GetEfficiency();
74 Double_t GetEfficiencyError();
76 Double_t GetCountsCo();
78 Int_t CompareNuclei(TString NucleiName);
80 void SetTxtFileOutputName(TString TxtFilename_ext);
81 void SetRootFileOutputName(TString RootFilename_ext);
82 void SetOutputPath(TString OutputPath_ext);
84 Int_t ExportToTextFile(TString TxtFilename_ext =
"test.txt");
85 Int_t ExportToRootFile(TString RootFilename_ext =
"test.root");
87 void SetSearchRange(Double_t RangeMin, Double_t RangeMax);
89 void SetGaussianFitting();
90 Bool_t IsGaussianFitting();
92 void SetFreeSkewedFitting();
93 Bool_t IsFreeSkewedFitting();
95 void SetSecondGausianFitting();
96 Bool_t IsSecondGausianFitting();
98 void SetNewFunctionFitting();
99 Bool_t IsNewFunctionFitting();
100 void SetNoDrawingMode(Bool_t NoDrawingMode_ext =
true);
101 Bool_t IsNoDrawingMode();
103 void SetInputHistogramResolution(Double_t InputHistogramResolution_ext);
104 void SetNumberOfSimEvents(Int_t NumberOfSimEvents_ext, Bool_t OnlyTwoPiSimulated = 1);
107 Double_t FindUpperSigmaFitLimit(Double_t threshold, Float_t StartingPoint);
109 Double_t Calibrate(Double_t Channel);
111 Double_t CalculateLowerErrorLeft(Double_t threshold, TH1D *histo, Double_t StartingValue);
112 Double_t CalculateUpperErrorLeft(Double_t threshold, TH1D *histo, Double_t StartingValue);
113 Double_t CalculateLowerErrorRight(Double_t threshold, TH1D *histo, Double_t StartingValue);
114 Double_t CalculateUpperErrorRight(Double_t threshold, TH1D *histo, Double_t StartingValue);
117 TCanvas *fEnergySpecCanvas;
118 TH1D *fhEnergySpectrum;
120 TCanvas *fCalSpecCanvas;
121 TH1D *fhCalibratedSpectrum;
123 TCanvas *fSubstractCanvas;
124 TH1D *fhSubstractSpectrum;
125 TSpectrum *fSpectrum;
133 TF1 *FitFuncWithoutBg[50];
134 TF1 *CalibratedFunction[50];
136 TF1 *FuncSmoothedStep[50];
141 vector<double> PeakFitX;
142 vector<double> PeakFitXError;
143 vector<double> PeakCounts;
145 TGraphErrors *fgCalibration;
149 Double_t Amplitude[50];
150 Double_t FWHMHeight[50];
151 Double_t FWHMlow[50];
152 Double_t FWHMlowLeftBorder[50];
153 Double_t FWHMlowRightBorder[50];
154 Double_t FWHMlowLeftBorderEnergy[50];
155 Double_t FWHMlowRightBorderEnergy[50];
156 Double_t FWHMhigh[50];
157 Double_t FWHMhighLeftBorder[50];
158 Double_t FWHMhighRightBorder[50];
159 Double_t FWHMhighLeftBorderEnergy[50];
160 Double_t FWHMhighRightBorderEnergy[50];
161 Double_t FWHMlowEnergy[50];
162 Double_t FWHMhighEnergy[50];
164 Double_t FWTMHeight[50];
165 Double_t FWTMlow[50];
166 Double_t FWTMhigh[50];
167 Double_t FWTMlowEnergy[50];
168 Double_t FWTMhighEnergy[50];
170 TH1D *fhFitErrorhistogram[50];
172 map<double, double> FWHM_ch;
173 map<double, double> FWHM_en;
174 map<double, double> FWTM_ch;
175 map<double, double> FWTM_en;
177 vector<double> Energies;
178 vector<double> EnergyErrors;
186 TString RootFilename;
190 Int_t fFittingMethod;
192 Bool_t NoDrawingMode;
194 Double_t fFEPEfficiency;
195 Double_t fFEPEfficiencyError;
196 Double_t fInputHistogramResolution;
197 Int_t fNumberOfSimEvents;
198 Int_t fSolidAngleCorrectionFactor;
TH1D * GetEnergySpectrum()