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"
19 AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer(): AliHLTPHOSBase(),
30 fIntDataPtr = new UInt_t[1008];
33 AliHLTPHOSRawAnalyzer::~AliHLTPHOSRawAnalyzer()
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): AliHLTPHOSBase(),
56 fSampleFrequency = fs;
61 * Attemps to level the basline to zero.
62 * The baseline will be calculated from the pretrigger samples and subtracted from the
64 * If pretrigger samples are not present then the basline correction will be incorrect.
65 * @param dataPtr array for wich to correct the basline
66 * @param N the number of pretrigger samples used to calculate the baseline.
69 AliHLTPHOSRawAnalyzer::BaselineCorrection(double * /*dataPtr*/, int /*N*/)
72 } //end BaselineCorrection
76 * Shifts the baseline with the amount given by baselineValue
77 * If pretrigger samples are not present then the basline correction will be incorrect.
78 * @param dataPtr array for wich to correct the basline
79 * @param baselineValue the basline value to subtract..
82 AliHLTPHOSRawAnalyzer::BaselineCorrection(double * /*dataPtr*/, double /*baselineValue*/)
85 } //end BaslineCorrection
89 * Gives the timing in entities of sample indexes
90 * Physical time is found by multiplying with the sampling intervall (Ts).
93 AliHLTPHOSRawAnalyzer::GetTiming() const
100 * Gives the time in entities of ADC channels (quantization levels).
101 * Absolute enrgy is found by multiplying with offline calibration constants.
104 AliHLTPHOSRawAnalyzer::GetEnergy() const
111 * Set data array. Overrides data data array set in the constructor.
114 AliHLTPHOSRawAnalyzer::SetData(const UInt_t *data)
120 * Set data array. Overrides data data array set in the constructor.
123 AliHLTPHOSRawAnalyzer::SetData(const double *data)
125 fFloatDataPtr = data;
131 AliHLTPHOSRawAnalyzer::SetSampleFreq(double freq)
133 fSampleFrequency = freq;
137 AliHLTPHOSRawAnalyzer::FindStartIndex(double /*treshold*/)
139 // cout << "Find Start index not yet implemented" << endl;
141 } //end FindStartIndex
145 * This function applies only to the Chi and Least mean square fit. An initial guess is made
146 * based on the average of the first 5 samples and the first value exeeding this value.
149 AliHLTPHOSRawAnalyzer::MakeInitialGuess()
151 // cout << "Make initial guess not yet implemeted" << endl;
156 * This function applies only to the Chi and Least mean square fit. An initial guess is made
157 * based on the average of the first 5 samples and the first value exeeding threshold + this value.
158 * @param treshold The index of the first value above treshold is ntaken to be the first value.
161 AliHLTPHOSRawAnalyzer::MakeInitialGuess(int /*treshold*/)
163 // cout << "Make initial guess not yet implemeted" << endl;
168 AliHLTPHOSRawAnalyzer::SetStartIndex(int index)
176 AliHLTPHOSRawAnalyzer::SetTVector(Double_t * /*tVector*/, Int_t /*size*/)
178 // 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;