1 /**************************************************************************
2 * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Per Thomas Hille for the ALICE HLT Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "AliHLTPHOSRawAnalyzer.h"
22 //AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer():fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999)
23 AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer():fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999)
25 // fFloatDataPtr = new double[1008];
26 fIntDataPtr = new UInt_t[1008];
29 AliHLTPHOSRawAnalyzer::~AliHLTPHOSRawAnalyzer()
34 //AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(AliHLTPHOSRawAnalyzer const&):fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
35 AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(AliHLTPHOSRawAnalyzer const&):fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
42 * @param dtaPtr Data array for wich a subarray will be taken to perform the fit
43 * @param fs the sampling frequency in entities of MHz. Needed in order to calculate physical time
45 //AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(double *dtaPtr, double fs):fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
46 AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(double *dtaPtr, double fs):fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
48 // fIntDataPtr = dtaPtr;
49 fSampleFrequency = fs;
54 * Attemps to level the basline to zero.
55 * The baseline will be calculated from the pretrigger samples and subtracted from the
57 * If pretrigger samples are not present then the basline correction will be incorrect.
58 * @param dataPtr array for wich to correct the basline
59 * @param N the number of pretrigger samples used to calculate the baseline.
62 AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, int N)
64 // fFloatDataPtr = dataPtr;
66 cout << "Baseline correction not yet implemeted" << endl;
67 } //end BaselineCorrection
71 * Shifts the baseline with the amount given by baselineValue
72 * If pretrigger samples are not present then the basline correction will be incorrect.
73 * @param dataPtr array for wich to correct the basline
74 * @param baselineValue the basline value to subtract..
77 AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, double baselineValue)
79 // fFloatDataPtr = dataPtr;
80 printf("\nbaselineValue = %f\n", baselineValue);
81 cout << "Baseline correction not yet implemeted" << endl;
82 } //end BaslineCorrection
86 * Gives the timing in entities of sample indexes
87 * Physical time is found by multiplying with the sampling intervall (Ts).
90 AliHLTPHOSRawAnalyzer::GetTiming() const
97 * Gives the time in entities of ADC channels (quantization levels).
98 * Absolute enrgy is found by multiplying with offline calibration constants.
101 AliHLTPHOSRawAnalyzer::GetEnergy() const
108 * Set data array. Overrides data data array set in the constructor.
111 //AliHLTPHOSRawAnalyzer::SetData(double *data)
113 // fFloatDataPtr = data;
116 AliHLTPHOSRawAnalyzer::SetData(UInt_t *data)
118 // fFloatDataPtr = data;
123 * Set data array. Overrides data data array set in the constructor.
126 AliHLTPHOSRawAnalyzer::SetData(double *data)
128 fFloatDataPtr = data;
134 AliHLTPHOSRawAnalyzer::SetSampleFreq(double freq)
136 fSampleFrequency = freq;
140 AliHLTPHOSRawAnalyzer::FindStartIndex(double treshold)
142 cout << "Find Start index not yet implemented" << endl;
144 } //end FindStartIndex
148 * This function applies only to the Chi and Least mean square fit. An initial guess is made
149 * based on the average of the first 5 samples and the first value exeeding this value.
152 AliHLTPHOSRawAnalyzer::MakeInitialGuess()
154 cout << "Make initial guess not yet implemeted" << endl;
159 * This function applies only to the Chi and Least mean square fit. An initial guess is made
160 * based on the average of the first 5 samples and the first value exeeding threshold + this value.
161 * @param treshold The index of the first value above treshold is ntaken to be the first value.
164 AliHLTPHOSRawAnalyzer::MakeInitialGuess(int treshold)
166 cout << "Make initial guess not yet implemeted" << endl;
170 AliHLTPHOSRawAnalyzer::SetStartIndex(int index)
177 AliHLTPHOSRawAnalyzer::SetTVector(Double_t *tVector, Int_t size)
179 cout <<"ERROR: AliHLTPHOSRawAnalyzer::SetTVector: You cannot set the peakfindervector here, must be set in derived class peakfinder"<<endl;
184 AliHLTPHOSRawAnalyzer::SetAVector(Double_t *aVector, Int_t size)
186 cout <<"ERROR: AliHLTPHOSRawAnalyzer::SetAVector: You cannot set the peakfindervector here, must be set in derived class peakfinder"<<endl;
191 AliHLTPHOSRawAnalyzer::GetMaxValue(UInt_t *dta, Int_t size) const
196 for(int i = 0; i < size; i++)
211 AliHLTPHOSRawAnalyzer::GetMaxValue(Double_t *dta, Int_t size) const
216 for(int i = 0; i < size; i++)