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 **************************************************************************/
24 #include "AliHLTPHOSRawAnalyzerPeakFinder.h"
27 #include "AliHLTCaloUtilities.h"
32 ClassImp(AliHLTPHOSRawAnalyzerPeakFinder)
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(),
49 // fUtilitiesPtr = new AliHLTPHOSUtilities();
50 // cout <<"PeakFinder:You cannot invoke the Fitter without arguments"<<endl;;
54 //___________________________________________________________________
55 AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder()
58 } //end AliHLTPHOSRawAnalyzerPeakFinder
63 AliHLTPHOSRawAnalyzerPeakFinder::SetTVector(Double_t *tVec, Int_t size)
72 fTVectorPtr = new Double_t[size];
74 for(int i=0; i< size; i++)
76 fTVectorPtr[i] = tVec[i];
81 //___________________________________________________________________
83 AliHLTPHOSRawAnalyzerPeakFinder::SetAVector(Double_t *aVec, Int_t size)
93 fAVectorPtr = new Double_t[size];
95 for(int i=0; i< size; i++)
97 fAVectorPtr[i] = aVec[i];
103 //___________________________________________________________________
105 AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(Int_t /*start*/, Int_t length)
111 if(fTVectorPtr == 0 || fAVectorPtr == 0)
117 if(length < fTVectorSize)
123 tmpLength = fTVectorSize;
126 for(int i=0; i < tmpLength; i++)
128 //fDAmpl += fAVectorPtr[i]*fIntDataPtr[i]; removed 18 april 2008
129 fDAmpl += fAVectorPtr[i]*fDoubleDataPtr[i];
132 for(int i=0; i < tmpLength; i++)
134 // fDTof += fTVectorPtr[i]*fIntDataPtr[i]; removed 18 april 2008
135 fDTof += fTVectorPtr[i]*fDoubleDataPtr[i];
140 // Double_t tmpMax = MaxValue(const_cast<unsigned int*>(fIntDataPtr), tmpLength); removed 18 april 2008
141 double tmpMax = fUtilitiesPtr->MaxValue(fDoubleDataPtr, tmpLength);
149 fDTof = fDTof/fDAmpl;