1 #ifndef ALICALORAWANALYZERPEAKFINDER_H
2 #define ALICALORAWANALYZERPEAKFINDER_H
5 /**************************************************************************
6 * This file is property of and copyright by *
7 * the Relativistic Heavy Ion Group (RHIG), Yale University, US, 2009 *
9 * Primary Author: Per Thomas Hille <perthomas.hille@yale.edu> *
11 * Contributors are mentioned in the code where appropriate. *
12 * Please report bugs to perthomas.hille@yale.edu *
14 * Permission to use, copy, modify and distribute this software and its *
15 * documentation strictly for non-commercial purposes is hereby granted *
16 * without fee, provided that the above copyright notice appears in all *
17 * copies and that both the copyright notice and this permission notice *
18 * appear in the supporting documentation. The authors make no claims *
19 * about the suitability of this software for any purpose. It is *
20 * provided "as is" without express or implied warranty. *
21 **************************************************************************/
23 // The Peak-Finder algorithm
24 // The amplitude is extracted as a
25 // weighted sum of the samples using the
26 // best possible weights.
28 #include "AliCaloRawAnalyzer.h"
29 #include "AliCaloPeakFinderConstants.h"
31 using namespace PeakFinderConstants;
33 class AliCaloBunchInfo;
34 class AliCaloPeakFinderVectors;
37 class AliCaloRawAnalyzerPeakFinder : public AliCaloRawAnalyzer
40 AliCaloRawAnalyzerPeakFinder();
41 virtual ~AliCaloRawAnalyzerPeakFinder();
42 virtual AliCaloFitResults Evaluate( const std::vector<AliCaloBunchInfo> &bunchvector,
43 const UInt_t altrocfg1, const UInt_t altrocfg2 );
46 AliCaloRawAnalyzerPeakFinder( const AliCaloRawAnalyzerPeakFinder & );
47 AliCaloRawAnalyzerPeakFinder & operator = ( const AliCaloRawAnalyzerPeakFinder & );
48 void LoadVectorsASCII();
49 void LoadVectorsOCDB();
50 void CopyVectors(const AliCaloPeakFinderVectors *const pfvectors );
52 void InitOCDB(bool alien) const;
53 void WriteRootFile() const;
54 Double_t ScanCoarse(const Double_t *const array, const int length ) const ; // Find a rough estimate of peak position and t0
56 Double_t fPFAmpVectorsCoarse[MAXSTART][SAMPLERANGE][100]; // Vectors for Amplitude extraction, first iteration
57 Double_t fPFTofVectorsCoarse[MAXSTART][SAMPLERANGE][100]; // Vectors for TOF extraction, first iteration
58 Double_t fPFAmpVectors[MAXSTART][SAMPLERANGE][100]; // Vectors for Amplitude extraction, second iteration
59 Double_t fPFTofVectors[MAXSTART][SAMPLERANGE][100]; // Vectors for TOF extraction, second iteration
60 Double_t fAmp; // The amplitude in entities of ADC counts
61 AliCaloPeakFinderVectors *fPeakFinderVectors; // Collection of Peak-Fincer vectors
63 bool fRunOnAlien; // Wether or not we are running on the GRID
65 ClassDef( AliCaloRawAnalyzerPeakFinder, 1 )