1 /**************************************************************************
2 * This file is property of and copyright by the Experimental Nuclear *
3 * Physics Group, Dep. of Physics *
4 * University of Oslo, Norway, 2007 *
6 * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
7 * Contributors are mentioned in the code where appropriate. *
8 * Please report bugs to perthi@fys.uio.no *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 #include "AliHLTPHOSRawAnalyzerPeakFinder.h"
27 ClassImp(AliHLTPHOSRawAnalyzerPeakFinder)
30 //AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder(const AliHLTPHOSRawAnalyzerPeakFinder&):AliHLTPHOSRawAnalyzer() , fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0)
38 * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
39 * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
40 * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
41 * calculation is of type double.
43 AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder():AliHLTPHOSRawAnalyzer(), fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0)
45 // cout <<"PeakFinder:You cannot invoke the Fitter without arguments"<<endl;;
49 //___________________________________________________________________
50 AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder()
53 } //end AliHLTPHOSRawAnalyzerPeakFinder
58 AliHLTPHOSRawAnalyzerPeakFinder::SetTVector(Double_t *tVec, Int_t size)
67 fTVectorPtr = new Double_t[size];
69 for(int i=0; i< size; i++)
71 fTVectorPtr[i] = tVec[i];
76 //___________________________________________________________________
78 AliHLTPHOSRawAnalyzerPeakFinder::SetAVector(Double_t *aVec, Int_t size)
88 fAVectorPtr = new Double_t[size];
90 for(int i=0; i< size; i++)
92 fAVectorPtr[i] = aVec[i];
98 //___________________________________________________________________
100 AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(Int_t /*start*/, Int_t length)
106 // cout << "AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(), dumping data" << endl;
108 // DumpData(fIntDataPtr, length, 16);
110 if(fTVectorPtr == 0 || fAVectorPtr == 0)
117 if(length < fTVectorSize)
123 tmpLength = fTVectorSize;
126 for(int i=0; i < tmpLength; i++)
128 // fDAmpl += fAVectorPtr[i]*fFloatDataPtr[i];
129 fDAmpl += fAVectorPtr[i]*fIntDataPtr[i];
133 for(int i=0; i < tmpLength; i++)
135 // fDTof += fTVectorPtr[i]*fFloatDataPtr[i];
136 fDTof += fTVectorPtr[i]*fIntDataPtr[i];
142 Double_t tmpMax = MaxValue(const_cast<unsigned int*>(fIntDataPtr), tmpLength);
151 fDTof = fDTof/fDAmpl;