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"
26 ClassImp(AliHLTPHOSRawAnalyzerPeakFinder)
29 AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder(const AliHLTPHOSRawAnalyzerPeakFinder&):AliHLTPHOSRawAnalyzer() , fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0)
37 * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
38 * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
39 * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
40 * calculation is of type double.
42 AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder():AliHLTPHOSRawAnalyzer(), fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0)
44 // cout <<"PeakFinder:You cannot invoke the Fitter without arguments"<<endl;;
48 //___________________________________________________________________
49 AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder()
52 } //end AliHLTPHOSRawAnalyzerPeakFinder
55 AliHLTPHOSRawAnalyzerPeakFinder::SetTVector(Double_t *tVec, Int_t size)
64 fTVectorPtr = new Double_t[size];
66 for(int i=0; i< size; i++)
68 fTVectorPtr[i] = tVec[i];
73 //___________________________________________________________________
75 AliHLTPHOSRawAnalyzerPeakFinder::SetAVector(Double_t *aVec, Int_t size)
85 fAVectorPtr = new Double_t[size];
87 for(int i=0; i< size; i++)
89 fAVectorPtr[i] = aVec[i];
94 //___________________________________________________________________
96 AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(Int_t start, Int_t length)
102 if(fTVectorPtr == 0 || fAVectorPtr == 0)
109 if(length < fTVectorSize)
115 tmpLength = fTVectorSize;
118 for(int i=0; i < tmpLength; i++)
120 // fDAmpl += fAVectorPtr[i]*fFloatDataPtr[i];
121 fDAmpl += fAVectorPtr[i]*fIntDataPtr[i];
124 for(int i=0; i < tmpLength; i++)
126 // fDTof += fTVectorPtr[i]*fFloatDataPtr[i];
127 fDTof += fTVectorPtr[i]*fIntDataPtr[i];
132 // Double_t tmpMax = GetMaxValue(fFloatDataPtr, tmpLength);
133 Double_t tmpMax = GetMaxValue(fIntDataPtr, tmpLength);
141 fDTof = fDTof/fDAmpl;