38 #ifndef PNDHYPGESPECTRUMANALYSER_H 39 #define PNDHYPGESPECTRUMANALYSER_H 42 #include "TSpectrum.h" 45 #include "TGraphErrors.h" 64 void SetEnergySpectrum(TH1D *hEnergySpec_ext);
66 Int_t AnalyseSpectrum();
67 Int_t AnalyseSimulationSpectrum();
71 Int_t DrawCalibratedSpectrum();
72 Int_t DrawSimulationSpectrum();
73 Int_t DoEnergyCalibration();
74 Int_t CalculateFWHM();
75 Int_t CalculateFWTM();
76 Double_t CalculateEfficiency();
77 Double_t GetFWHM511();
78 Double_t GetFWTM511();
79 Double_t GetFWHMCo1();
80 Double_t GetFWTMCo1();
85 Double_t GetEfficiency();
86 Double_t GetEfficiencyError();
88 Double_t GetCountsCo();
90 Int_t CompareNuclei(TString NucleiName);
92 void SetTxtFileOutputName(TString TxtFilename_ext);
93 void SetRootFileOutputName(TString RootFilename_ext);
94 void SetOutputPath(TString OutputPath_ext);
96 Int_t ExportToTextFile(TString TxtFilename_ext =
"test.txt");
97 Int_t ExportToRootFile(TString RootFilename_ext =
"test.root");
99 void SetSearchRange(Double_t RangeMin, Double_t RangeMax);
101 void SetGaussianFitting();
102 Bool_t IsGaussianFitting();
104 void SetFreeSkewedFitting();
105 Bool_t IsFreeSkewedFitting();
107 void SetSecondGausianFitting();
108 Bool_t IsSecondGausianFitting();
110 void SetNewFunctionFitting();
111 Bool_t IsNewFunctionFitting();
112 void SetNoDrawingMode(Bool_t NoDrawingMode_ext =
true);
113 Bool_t IsNoDrawingMode();
115 void SetInputHistogramResolution(Double_t InputHistogramResolution_ext);
116 void SetNumberOfSimEvents(Int_t NumberOfSimEvents_ext, Bool_t OnlyTwoPiSimulated = 1);
119 Double_t FindUpperSigmaFitLimit(Double_t threshold, Float_t StartingPoint);
121 Double_t Calibrate(Double_t Channel);
123 Double_t CalculateLowerErrorLeft(Double_t threshold, TH1D *histo, Double_t StartingValue);
124 Double_t CalculateUpperErrorLeft(Double_t threshold, TH1D *histo, Double_t StartingValue);
125 Double_t CalculateLowerErrorRight(Double_t threshold, TH1D *histo, Double_t StartingValue);
126 Double_t CalculateUpperErrorRight(Double_t threshold, TH1D *histo, Double_t StartingValue);
129 TCanvas *fEnergySpecCanvas;
130 TH1D *fhEnergySpectrum;
132 TCanvas *fCalSpecCanvas;
133 TH1D *fhCalibratedSpectrum;
135 TCanvas *fSubstractCanvas;
136 TH1D *fhSubstractSpectrum;
137 TSpectrum *fSpectrum;
145 TF1 *FitFuncWithoutBg[50];
146 TF1 *CalibratedFunction[50];
148 TF1 *FuncSmoothedStep[50];
153 vector<double> PeakFitX;
154 vector<double> PeakFitXError;
155 vector<double> PeakCounts;
157 TGraphErrors *fgCalibration;
161 Double_t Amplitude[50];
162 Double_t FWHMHeight[50];
163 Double_t FWHMlow[50];
164 Double_t FWHMlowLeftBorder[50];
165 Double_t FWHMlowRightBorder[50];
166 Double_t FWHMlowLeftBorderEnergy[50];
167 Double_t FWHMlowRightBorderEnergy[50];
168 Double_t FWHMhigh[50];
169 Double_t FWHMhighLeftBorder[50];
170 Double_t FWHMhighRightBorder[50];
171 Double_t FWHMhighLeftBorderEnergy[50];
172 Double_t FWHMhighRightBorderEnergy[50];
173 Double_t FWHMlowEnergy[50];
174 Double_t FWHMhighEnergy[50];
176 Double_t FWTMHeight[50];
177 Double_t FWTMlow[50];
178 Double_t FWTMhigh[50];
179 Double_t FWTMlowEnergy[50];
180 Double_t FWTMhighEnergy[50];
182 TH1D *fhFitErrorhistogram[50];
184 map<double, double> FWHM_ch;
185 map<double, double> FWHM_en;
186 map<double, double> FWTM_ch;
187 map<double, double> FWTM_en;
189 vector<double> Energies;
190 vector<double> EnergyErrors;
198 TString RootFilename;
202 Int_t fFittingMethod;
204 Bool_t NoDrawingMode;
206 Double_t fFEPEfficiency;
207 Double_t fFEPEfficiencyError;
208 Double_t fInputHistogramResolution;
209 Int_t fNumberOfSimEvents;
210 Int_t fSolidAngleCorrectionFactor;
TH1D * GetEnergySpectrum()