3 /**************************************************************************
4 * This file is property of and copyright by the Experimental Nuclear *
5 * Physics Group, Dep. of Physics *
6 * University of Oslo, Norway, 2007 *
8 * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
9 * Contributors are mentioned in the code where appropriate. *
10 * Please report bugs to perthi@fys.uio.no *
12 * Permission to use, copy, modify and distribute this software and its *
13 * documentation strictly for non-commercial purposes is hereby granted *
14 * without fee, provided that the above copyright notice appears in all *
15 * copies and that both the copyright notice and this permission notice *
16 * appear in the supporting documentation. The authors make no claims *
17 * about the suitability of this software for any purpose. It is *
18 * provided "as is" without express or implied warranty. *
19 **************************************************************************/
21 #include "AliHLTPHOSRawAnalyzerPeakFinder.h"
23 #include "AliHLTCaloUtilities.h"
28 ClassImp(AliHLTPHOSRawAnalyzerPeakFinder)
32 * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
33 * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
34 * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
35 * calculation is of type double.
37 AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder():AliHLTPHOSRawAnalyzer(),
47 //___________________________________________________________________
48 AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder()
51 } //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];
74 AliHLTPHOSRawAnalyzerPeakFinder::SetAVector(Double_t *aVec, Int_t size)
84 fAVectorPtr = new Double_t[size];
86 for(int i=0; i< size; i++)
88 fAVectorPtr[i] = aVec[i];
93 AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(Int_t /*start*/, Int_t length)
100 if(fTVectorPtr == 0 || fAVectorPtr == 0)
106 if(length < fTVectorSize)
112 tmpLength = fTVectorSize;
115 for(int i=0; i < tmpLength; i++)
117 fDAmpl += fAVectorPtr[i]*fDoubleDataPtr[i];
120 for(int i=0; i < tmpLength; i++)
122 fDTof += fTVectorPtr[i]*fDoubleDataPtr[i];
127 double tmpMax = AliHLTCaloUtilities::MaxValue(fDoubleDataPtr, tmpLength);
134 fDTof = fDTof/fDAmpl;