1 \section{hlt::phos::Phos\-Fitter Class Reference}
2 \label{classhlt_1_1phos_1_1PhosFitter}\index{hlt::phos::PhosFitter@{hlt::phos::PhosFitter}}
3 {\tt \#include $<$Phos\-Fitter.h$>$}
5 \subsection*{Public Member Functions}
10 {\bf Phos\-Fitter} (int $\ast$data)
12 {\bf Phos\-Fitter} (float $\ast$data)
14 void {\bf Fit\-KLevel} (float k\-Level, int start, int lenght)
16 void {\bf Fit\-Peak\-Finder} (int start, int lenght)
18 void {\bf Fit\-Peak\-Finder} (int start, int lenght, float $\ast$t\-Vector, float $\ast$a\-Vector)
20 void {\bf Fit\-Chi\-Square} (int start, int lenght)
22 void {\bf Fit\-Chi\-Square} (int start, int lenght, float t\-Guess, float a\-Guess)
24 void {\bf Fit\-Least\-Mean\-Square} (int start, int lenght, const float $\ast$$\ast$m\-Covar, float $\ast$$\ast$p\-Covar)
26 void {\bf Fit\-Least\-Mean\-Square} (int start, int lenght, const float $\ast$$\ast$m\-Covar, float $\ast$$\ast$p\-Covar, float t\-Guess, float a\-Guess)
28 int {\bf Find\-Start\-Index} (float treshold)
30 void {\bf Get\-Timing} ()
32 void {\bf Get\-Eneergy} ()
34 void {\bf Set\-Data} (int $\ast$data)
36 void {\bf Set\-Data} (float $\ast$data)
38 \subsection*{Private Member Functions}
39 \begin{CompactItemize}
41 void {\bf Make\-Initial\-Guess} ()
43 void {\bf Make\-Initial\-Guess} (int treshold)
45 \subsection*{Private Attributes}
46 \begin{CompactItemize}
48 int $\ast$ {\bf d\-Data}
50 float $\ast$ {\bf f\-Data}
56 float {\bf d\-Tof\-Guess}
58 float {\bf d\-Ampl\-Guess}
62 \subsection{Detailed Description}
63 The {\bf Phos\-Fitter}{\rm (p.\,\pageref{classhlt_1_1phos_1_1PhosFitter})} class is the class for extracting the basic signal parameters \char`\"{}timing\char`\"{} and \char`\"{}energy\char`\"{} from the PHOS raw data. Physical data will for a given readout channel be a sequense of ADC digitized 10 bit values. For debugging, it is also usefull to have the possibulity to use arrays of floating poin values.
67 \subsection{Constructor \& Destructor Documentation}
68 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!PhosFitter@{PhosFitter}}
69 \index{PhosFitter@{PhosFitter}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
70 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}hlt::phos::Phos\-Fitter::Phos\-Fitter ()}\label{classhlt_1_1phos_1_1PhosFitter_a0}
73 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!PhosFitter@{PhosFitter}}
74 \index{PhosFitter@{PhosFitter}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
75 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}hlt::phos::Phos\-Fitter::Phos\-Fitter (int $\ast$ {\em data})}\label{classhlt_1_1phos_1_1PhosFitter_a1}
78 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!PhosFitter@{PhosFitter}}
79 \index{PhosFitter@{PhosFitter}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
80 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}hlt::phos::Phos\-Fitter::Phos\-Fitter (float $\ast$ {\em data})}\label{classhlt_1_1phos_1_1PhosFitter_a2}
85 \subsection{Member Function Documentation}
86 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FindStartIndex@{FindStartIndex}}
87 \index{FindStartIndex@{FindStartIndex}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
88 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int hlt::phos::Phos\-Fitter::Find\-Start\-Index (float {\em treshold})}\label{classhlt_1_1phos_1_1PhosFitter_a10}
91 This method finds the start index of the pulse (relative to the data array) by serching for three or more continious samples above trheshold. \begin{Desc}
94 \item[{\em treshold}]treshold to use when searchin for the start of the pulse \end{description}
96 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitChiSquare@{FitChiSquare}}
97 \index{FitChiSquare@{FitChiSquare}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
98 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-Chi\-Square (int {\em start}, int {\em lenght}, float {\em t\-Guess}, float {\em a\-Guess})}\label{classhlt_1_1phos_1_1PhosFitter_a7}
101 Extraction of timing and energy using a least square fit assuming uncorrelated measurement errors. This is also called a \char`\"{}Chi square fit\char`\"{}. The default method is the Levenberg Marquardt nonlinear fit. If the errors are correlated (which is typically the case) the timing and energy will not be mimimum variance lower bound. Correlated errors might also give a systematic error. The parameters \char`\"{}start\char`\"{} and \char`\"{}length\char`\"{} defines the subarray of the data array set in the constructor that will be used in the fit. \char`\"{}start + length\char`\"{} cannot exeed the length of the data array. The baseline must be subtracted before performing the fit othervise the result wil biased. A good initial guess greatly enchanes performance. A poor initial guess might give a solution that is a local minima instead of a global minima. If the startindex of the pulse is the first sample above a low (2-3 ADC levels) above the baseline, then the initial guess of t0 an be set to zero. A good initial guess for amplitude will for a gamma 2 function be for instance (Max sample valu - baseline)$\ast$exp(2). If a Gamma N function is used multiply with exp(N). \begin{Desc}
104 \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \item[{\em t\-Guess}]initial guess for timing (in entities of samples) \item[{\em a\-Guess}]initial guess for energy in entities of (ADC channels)$\ast$exp(2) (for a gamma 2 fuction) \end{description}
106 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitChiSquare@{FitChiSquare}}
107 \index{FitChiSquare@{FitChiSquare}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
108 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-Chi\-Square (int {\em start}, int {\em lenght})}\label{classhlt_1_1phos_1_1PhosFitter_a6}
111 Extraction of timing and energy using a least square fit assuming uncorrelated measurement errors. This is also called a \char`\"{}Chi square fit\char`\"{}. The default method is the Levenberg Marquardt nonlinear fit. If the errors are correlated (which is typically the case) the timing and energy will not be mimimum variance lower bound. Correlated errors might also give a systematic error. The parameters \char`\"{}start\char`\"{} and \char`\"{}length\char`\"{} defines the subarray of the data array set in the constructor that will be used in the fit. \char`\"{}start + length\char`\"{} cannot exeed the length of the data array. The baseline must be subtracted before performing the fit. the initial guess parameters is found by the method \char`\"{}Make\-Initial\-Guess\char`\"{}. \begin{Desc}
114 \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \end{description}
116 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitKLevel@{FitKLevel}}
117 \index{FitKLevel@{FitKLevel}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
118 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-KLevel (float {\em k\-Level}, int {\em start}, int {\em lenght})}\label{classhlt_1_1phos_1_1PhosFitter_a3}
121 Extraction of timing an energy using the K-level method. \begin{Desc}
124 \item[{\em k\-Level}]the K-level \char`\"{}start\char`\"{} and \char`\"{}length\char`\"{} defines the subarray of the data array (set in the constructor) \item[{\em start}]index of samples to use relative to the the data array \item[{\em length}]the number of samples to use (starting at \char`\"{}start\char`\"{}) \end{description}
126 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitLeastMeanSquare@{FitLeastMeanSquare}}
127 \index{FitLeastMeanSquare@{FitLeastMeanSquare}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
128 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-Least\-Mean\-Square (int {\em start}, int {\em lenght}, const float $\ast$$\ast$ {\em m\-Covar}, float $\ast$$\ast$ {\em p\-Covar}, float {\em t\-Guess}, float {\em a\-Guess})}\label{classhlt_1_1phos_1_1PhosFitter_a9}
131 The same as the previous exep that initial guess for timing and energy is supplied by the user. This will greatly enchance performance. \begin{Desc}
134 \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \item[{\em m\-Covar}]the measurement correlation matrix \item[{\em p\-Covar}]the correlation matrix of the estimated parameters \end{description}
136 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitLeastMeanSquare@{FitLeastMeanSquare}}
137 \index{FitLeastMeanSquare@{FitLeastMeanSquare}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
138 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-Least\-Mean\-Square (int {\em start}, int {\em lenght}, const float $\ast$$\ast$ {\em m\-Covar}, float $\ast$$\ast$ {\em p\-Covar})}\label{classhlt_1_1phos_1_1PhosFitter_a8}
141 Extraction of timing and energy using a least square fit assuming correlated errors. The user must supply the autocovariance matrix. For N number of samples this matrix will be a Nx\-N matrix. The default method is the Levenberg Marquardt nonlinear fit. If the errors are correlated (which is typically the case) the timing and energy will not be mimimum variance lower bound. Correlated errors might also give a systematic error. The parameters \char`\"{}start\char`\"{} and \char`\"{}length\char`\"{} defines the subarray of the data array set in the constructor that will be used in the fit. \char`\"{}start + length\char`\"{} cannot exeed the length of the data array. The baseline must be subtracted before performing the fit othervise the result wil biased. A good initial guess greatly enchanes performance. A poor initial guess might give a solution that is a local minima instead of a global minima. If the startindex of the pulse is the first sample above a low (2-3 ADC levels) above the baseline, then the initial guess of t0 an be set to zero. A good initial guess for amplitude will for a gamma 2 function be for instance (Max sample valu - baseline)$\ast$exp(2). If a Gamma N function is used multiply with exp(N). The correlation matrix for the parameters is written to the matrix pointe to by p\-Covar \begin{Desc}
144 \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \item[{\em m\-Covar}]the measurement correlation matrix \item[{\em p\-Covar}]the correlation matrix of the estimated parameters \end{description}
146 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitPeakFinder@{FitPeakFinder}}
147 \index{FitPeakFinder@{FitPeakFinder}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
148 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-Peak\-Finder (int {\em start}, int {\em lenght}, float $\ast$ {\em t\-Vector}, float $\ast$ {\em a\-Vector})}\label{classhlt_1_1phos_1_1PhosFitter_a5}
151 Extraction of timing and energy using the Peakfinde Algorithm. The. The parameters \char`\"{}start\char`\"{} and \char`\"{}length\char`\"{} defines a sub array of the data array that will be used for the the fit. If start+length must not exeed the total length of the Data array. \char`\"{}start\char`\"{} must be chosen as close as possible to t0. The baseline must also be subtracted. The length of \char`\"{}t\-Vector\char`\"{} and \char`\"{}a\-Vector\char`\"{} mus be equal to length. \char`\"{}index + length\char`\"{} must not exeed the length of the data array set in the constructor. \begin{Desc}
154 \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \item[{\em t\-Vector}]the peakfinder vector for timing \item[{\em a\-Vector}]the peakfinder vector for amplitude (energy) \end{description}
156 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!FitPeakFinder@{FitPeakFinder}}
157 \index{FitPeakFinder@{FitPeakFinder}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
158 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Fit\-Peak\-Finder (int {\em start}, int {\em lenght})}\label{classhlt_1_1phos_1_1PhosFitter_a4}
161 Extraction of timing and energy using the Peakfinde Algorithm. The. The parameters \char`\"{}start\char`\"{} and \char`\"{}length\char`\"{} defines a sub array of the data array that will be used for the the fit. If start+length must not exeed the total length of the Data array. \char`\"{}start\char`\"{} must be chosen as close as possible to t0. The peakfinder reguire timing and energy vector that is unique for a given number of samples and will have exactly \char`\"{}length\char`\"{} number of samples. The timing and energy vectors will be searched for in a file, and if matching vectors are not found, an error is issued. \begin{Desc}
164 \item[{\em start}]the start index of the subarray of the data array. \item[{\em length}]the number of samples to use starting from index \end{description}
166 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!GetEneergy@{GetEneergy}}
167 \index{GetEneergy@{GetEneergy}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
168 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Get\-Eneergy ()}\label{classhlt_1_1phos_1_1PhosFitter_a12}
171 Gives the time in entities of ADC channels (quantization levels). Absolute enrgy is found by multiplying with offline calibration constants. \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!GetTiming@{GetTiming}}
172 \index{GetTiming@{GetTiming}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
173 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Get\-Timing ()}\label{classhlt_1_1phos_1_1PhosFitter_a11}
176 Gives the timing in entities of sample indexes Physical time is found by multiplying with the sampling intervall (Ts). \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!MakeInitialGuess@{MakeInitialGuess}}
177 \index{MakeInitialGuess@{MakeInitialGuess}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
178 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Make\-Initial\-Guess (int {\em treshold})\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_d1}
181 This function applies only to the Chi and Least mean square fit. An initial guess is made based on the average of the first 5 samples and the first value exeeding threshold + this value. \begin{Desc}
184 \item[{\em treshold}]The index of the first value above treshold is ntaken to be the first value. \end{description}
186 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!MakeInitialGuess@{MakeInitialGuess}}
187 \index{MakeInitialGuess@{MakeInitialGuess}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
188 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Make\-Initial\-Guess ()\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_d0}
191 This function applies only to the Chi and Least mean square fit. An initial guess is made based on the average of the first 5 samples and the first value exeeding this value. \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!SetData@{SetData}}
192 \index{SetData@{SetData}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
193 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Set\-Data (float $\ast$ {\em data})}\label{classhlt_1_1phos_1_1PhosFitter_a14}
196 Set data array. Overrides data data array set in the constructor. \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!SetData@{SetData}}
197 \index{SetData@{SetData}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
198 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void hlt::phos::Phos\-Fitter::Set\-Data (int $\ast$ {\em data})}\label{classhlt_1_1phos_1_1PhosFitter_a13}
201 Set data array. Overrrides the data array set in the constructor.
203 \subsection{Member Data Documentation}
204 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!dAmpl@{dAmpl}}
205 \index{dAmpl@{dAmpl}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
206 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}float {\bf hlt::phos::Phos\-Fitter::d\-Ampl}\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_r3}
209 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!dAmplGuess@{dAmplGuess}}
210 \index{dAmplGuess@{dAmplGuess}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
211 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}float {\bf hlt::phos::Phos\-Fitter::d\-Ampl\-Guess}\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_r5}
214 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!dData@{dData}}
215 \index{dData@{dData}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
216 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ {\bf hlt::phos::Phos\-Fitter::d\-Data}\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_r0}
219 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!dTof@{dTof}}
220 \index{dTof@{dTof}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
221 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}float {\bf hlt::phos::Phos\-Fitter::d\-Tof}\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_r2}
224 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!dTofGuess@{dTofGuess}}
225 \index{dTofGuess@{dTofGuess}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
226 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}float {\bf hlt::phos::Phos\-Fitter::d\-Tof\-Guess}\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_r4}
229 \index{hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}!fData@{fData}}
230 \index{fData@{fData}!hlt::phos::PhosFitter@{hlt::phos::Phos\-Fitter}}
231 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ {\bf hlt::phos::Phos\-Fitter::f\-Data}\hspace{0.3cm}{\tt [private]}}\label{classhlt_1_1phos_1_1PhosFitter_r1}
236 The documentation for this class was generated from the following files:\begin{CompactItemize}
238 {\bf Phos\-Fitter.h}\item
239 {\bf Phos\-Fitter.cxx}\end{CompactItemize}