]>
Commit | Line | Data |
---|---|---|
9cf4e02f | 1 | #ifndef ALIHLTPHOSBASE_H |
2 | #define ALIHLTPHOSBASE_H | |
3 | ||
4 | /************************************************************************** | |
5 | * This file is property of and copyright by the Experimental Nuclear * | |
6 | * Physics Group, Dep. of Physics * | |
7 | * University of Oslo, Norway, 2007 * | |
8 | * * | |
9 | * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.* | |
10 | * Contributors are mentioned in the code where appropriate. * | |
11 | * Please report bugs to perthi@fys.uio.no * | |
12 | * * | |
13 | * Permission to use, copy, modify and distribute this software and its * | |
14 | * documentation strictly for non-commercial purposes is hereby granted * | |
15 | * without fee, provided that the above copyright notice appears in all * | |
16 | * copies and that both the copyright notice and this permission notice * | |
17 | * appear in the supporting documentation. The authors make no claims * | |
18 | * about the suitability of this software for any purpose. It is * | |
19 | * provided "as is" without express or implied warranty. * | |
20 | **************************************************************************/ | |
21 | ||
22 | #include <iostream> | |
23 | #include <Rtypes.h> | |
24 | #include "TString.h" | |
25 | #include "AliHLTDataTypes.h" | |
9c9d15d6 | 26 | //#include "AliHLTPHOSDefinitions.h" |
27 | //#include "AliHLTPHOSCommonDefs.h" | |
9cf4e02f | 28 | #include "AliHLTPHOSConstants.h" |
9cf4e02f | 29 | |
30 | using namespace PhosHLTConst; | |
9c9d15d6 | 31 | |
32 | ||
33 | ||
9cf4e02f | 34 | using namespace std; |
35 | ||
9c9d15d6 | 36 | |
9cf4e02f | 37 | class AliHLTPHOSBase |
38 | { | |
39 | public: | |
40 | AliHLTPHOSBase(); | |
41 | virtual ~AliHLTPHOSBase(); | |
42 | ||
9c9d15d6 | 43 | |
9cf4e02f | 44 | template<typename T> |
45 | void DumpData(T *array, int N, int nPerLine) | |
46 | { | |
47 | cout << "DumpData N= " << N <<endl; | |
48 | for(int i= 0; i< N; i++) | |
49 | { | |
50 | if((i%nPerLine == 0) && (i != 0)) | |
51 | { | |
52 | printf("\n"); | |
53 | } | |
54 | ||
55 | cout << array[i]<< "\t"; | |
56 | ||
57 | } | |
58 | } | |
59 | ||
60 | template<typename T> | |
61 | void Reset(T *array, int N) | |
62 | { | |
63 | for(int i= 0; i< N; i++) | |
64 | { | |
65 | array[i] = 0; | |
66 | } | |
67 | } | |
68 | ||
43dd7c5e | 69 | template<typename T> |
70 | T MaxValue(T *array, int N) | |
71 | { | |
9c9d15d6 | 72 | // Double_t tmpMax = 0; |
73 | ||
74 | T tmpMax = 0; | |
43dd7c5e | 75 | |
76 | for(int i = 0; i < N; i++) | |
77 | { | |
78 | if(array[i] > tmpMax) | |
79 | { | |
80 | tmpMax = array[i]; | |
81 | } | |
82 | } | |
83 | ||
84 | return tmpMax; | |
85 | } | |
86 | ||
87 | ||
9cf4e02f | 88 | private: |
9c9d15d6 | 89 | // AliHLTPHOSBase(const AliHLTPHOSBase & ); |
90 | // AliHLTPHOSBase & operator = (const AliHLTPHOSBase &); | |
91 | ||
9cf4e02f | 92 | |
43dd7c5e | 93 | |
94 | /// const struct THIS IS STRANGE; | |
95 | ||
96 | ||
9cf4e02f | 97 | }; |
98 | ||
99 | #endif |