]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/CALO/AliHLTCaloFourier.h
Added the most important Calo files, changed dependent files. Compiles. Calo library...
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloFourier.h
CommitLineData
3800a654 1//-*- Mode: C++ -*-
2// $Id: AliHLTPHOSFourier.h 34951 2009-09-23 14:35:38Z phille $
3
4#ifndef ALIHLTCALOFOURIER_H
5#define ALIHLTCALOFOURIER_H
6
7/**************************************************************************
8 * This file is property of and copyright by the Experimental Nuclear *
9 * Physics Group, Dep. of Physics *
10 * University of Oslo, Norway, 2007 *
11 * *
12 * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
13 * Contributors are mentioned in the code where appropriate. *
14 * Please report bugs to perthi@fys.uio.no *
15 * *
16 * Permission to use, copy, modify and distribute this software and its *
17 * documentation strictly for non-commercial purposes is hereby granted *
18 * without fee, provided that the above copyright notice appears in all *
19 * copies and that both the copyright notice and this permission notice *
20 * appear in the supporting documentation. The authors make no claims *
21 * about the suitability of this software for any purpose. It is *
22 * provided "as is" without express or implied warranty. *
23 **************************************************************************/
24
25#include "Rtypes.h"
26#include "TVirtualFFT.h"
27#include "TMath.h"
28#include "AliHLTCaloConstants.h"
29#include <iostream>
30
31#include "AliHLTCaloRcuFFTDataStruct.h"
32
33//using namespace PhosHLTConst;
77f350f7 34//using namespace CaloHLTConst;
3800a654 35
36using namespace std;
37
38#define SAMPLING_FREQUENCY 10
39
40class AliHLTCaloFourier
41{
42 public:
43 AliHLTCaloFourier();
44 virtual ~AliHLTCaloFourier();
45 AliHLTCaloRcuFFTDataStruct GetPSD();
46 void ProcessFourier(const Int_t *data, const int length, const int z, const int x, const int gain, const int event =-1);
47
48 int GetDataSize() {return fFixedDataSize;};
49private:
50 void Init();
51 void Int2Double(const Int_t *inputarray, double *outputarray, const int size);
52 bool CheckSignal(const Int_t *data, const int length);
53
54 double EvaluateMagnitude(const double re, const double im);
55
56 // double *fAccumulateFFTsAll[N_GAINS];
57 // int fNFFTsAll[N_GAINS];
58 // double *fAccumulateFFTs [N_ZROWS_MOD][N_XCOLUMNS_MOD][N_GAINS];
59 // int fNFFTs[N_ZROWS_MOD][N_XCOLUMNS_MOD][N_GAINS];
60
61 void ResetEventPSD(const int gain);
62 TVirtualFFT *fFFT_own;
63
64 double *fFFTInputArray;
65 double *fFFTOutputArray;
66 bool fIsFirstChannel;
67 int fFixedDataSize;
68
69 // AliHLTCaloRcuFFTDataStruct fFFTOupuStruct[N_GAINS];
70 AliHLTCaloRcuFFTDataStruct fFFTOupuStruct;
71
72 int fCurrentEvent;
73
74 template<typename T>
75 T Max(T *array, int N) const
76 {
77 T tmpMax = 0;
78
79 for(int i = 0; i < N; i++)
80 {
81 if(array[i] > tmpMax)
82 {
83 tmpMax = array[i];
84 }
85 }
86
87 return tmpMax;
88 }
89
90
91 template<typename T>
92 T Min(T *array, int N) const
93 {
94
95 T tmpMin = Max(array , N);
96
97 // T tmpMin = 100;
98
99 for(int i = 0; i < N; i++)
100 {
101 if(array[i] < tmpMin)
102 {
103 tmpMin = array[i];
104 }
105 }
106
107 return tmpMin;
108 }
109
110
111 AliHLTCaloFourier(const AliHLTCaloFourier&);
112 AliHLTCaloFourier & operator=(const AliHLTCaloFourier&){return *this;};
113
114};
115
116#endif
117
118// AliHLTCaloRcuAltroPatternTestComponent(const AliHLTCaloRcuAltroPatternTestComponent &);
119// AliHLTCaloRcuAltroPatternTestComponent & operator = (const AliHLTCaloRcuAltroPatternTestComponent &);