]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSRawAnalyzer.cxx
Removing this file that was added to CVS by accident
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSRawAnalyzer.cxx
1 /**************************************************************************
2  * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved.      *
3  *                                                                        *
4  * Author: Per Thomas Hille for the ALICE HLT Project.                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 #include "AliHLTPHOSRawAnalyzer.h"
17 //#include <iostream>
18
19 //using std::cout;
20 //using std::endl;
21
22 AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer(): AliHLTPHOSBase(), fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999)
23 {
24  fIntDataPtr = new UInt_t[1008];
25 }
26
27 AliHLTPHOSRawAnalyzer::~AliHLTPHOSRawAnalyzer()
28 {
29
30 }
31
32 /*
33 AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(AliHLTPHOSRawAnalyzer const&):fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
34 {
35
36 }
37 */
38
39
40 /**
41 * Main constructor
42 * @param dtaPtr Data array for wich a subarray will be taken to perform the fit
43 * @param fs the sampling frequency in entities of MHz. Needed in order to calculate physical time
44 **/
45 AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(double *dtaPtr, double fs): AliHLTPHOSBase(), fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
46 {
47   fSampleFrequency = fs;
48 } //end  
49
50
51 /**
52 * Attemps to level the basline to zero.
53 * The baseline will be calculated from the pretrigger samples and subtracted from the 
54 * data array. 
55 * If pretrigger samples are not present then the basline correction will be incorrect. 
56 * @param dataPtr array for wich to correct the basline 
57 * @param N the number of pretrigger samples used to calculate the baseline.
58 **/
59 void 
60 AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, int N)
61 {
62   cout << "Baseline correction not yet implemeted" << endl;
63 } //end BaselineCorrection
64
65
66 /**
67 * Shifts the baseline with the amount given by baselineValue
68 * If pretrigger samples are not present then the basline correction will be incorrect. 
69 * @param dataPtr array for wich to correct the basline 
70 * @param baselineValue the basline value to subtract..
71 **/
72 void 
73 AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, double baselineValue)
74 {
75   printf("\nbaselineValue = %f\n", baselineValue);
76   cout << "Baseline correction not yet implemeted" << endl;
77 } //end BaslineCorrection
78
79
80 /**
81  * Gives the timing in entities of sample indexes
82  * Physical time is found by multiplying  with the sampling intervall (Ts).
83  **/
84 float
85 AliHLTPHOSRawAnalyzer::GetTiming() const 
86 {
87   return fDTof;
88 } //end GetTiming
89
90
91 /**
92  * Gives the time in entities of ADC channels (quantization levels).  
93  * Absolute enrgy is found by multiplying with offline calibration constants.
94  **/
95 float
96 AliHLTPHOSRawAnalyzer::GetEnergy() const
97 {
98   return fDAmpl;
99 } //end GetEnergy
100
101
102 /**
103  * Set data array. Overrides data data array set in the constructor.
104  **/
105 void 
106 AliHLTPHOSRawAnalyzer::SetData(UInt_t *data)
107 {
108   fIntDataPtr = data;
109 }
110
111 /**
112  * Set data array. Overrides data data array set in the constructor.
113  **/
114 void 
115 AliHLTPHOSRawAnalyzer::SetData(double *data)
116 {
117   fFloatDataPtr = data;
118 }
119
120
121
122 void 
123 AliHLTPHOSRawAnalyzer::SetSampleFreq(double freq)
124 {
125   fSampleFrequency = freq;
126 }
127
128 int 
129 AliHLTPHOSRawAnalyzer::FindStartIndex(double treshold)
130 {
131   cout << "Find Start index not yet implemented" << endl;
132   return 0;
133 } //end FindStartIndex
134
135
136 /**
137  * This function applies only to the Chi and Least mean square fit. An initial guess is made
138  * based on the average of the first 5 samples and the first value exeeding this value.
139  **/
140 void 
141 AliHLTPHOSRawAnalyzer::MakeInitialGuess()
142 {
143   cout << "Make initial guess not yet implemeted" << endl;
144 }
145
146
147 /**
148  * This function applies only to the Chi and Least mean square fit. An initial guess is made
149  * based on the average of the first 5 samples and the first value exeeding threshold + this value.
150  * @param treshold The index of the first value above treshold is ntaken to be the first value.
151  **/
152 void 
153 AliHLTPHOSRawAnalyzer::MakeInitialGuess(int treshold)
154 {
155   cout << "Make initial guess not yet implemeted" << endl;  
156 }
157
158 void
159 AliHLTPHOSRawAnalyzer::SetStartIndex(int index)
160 {
161   fStartIndex = index;
162 }
163
164
165
166 void 
167 AliHLTPHOSRawAnalyzer::SetTVector(Double_t *tVector, Int_t size)
168 {
169   cout <<"ERROR: AliHLTPHOSRawAnalyzer::SetTVector:  You cannot set the peakfindervector here, must be set in derived class peakfinder"<<endl;
170 }
171
172
173
174 void
175 AliHLTPHOSRawAnalyzer::SetAVector(Double_t *aVector, Int_t size)
176 {
177  cout <<"ERROR: AliHLTPHOSRawAnalyzer::SetAVector:  You cannot set the peakfindervector here, must be set in derived class peakfinder"<<endl;
178 }
179
180
181
182 /*
183 UInt_t
184 AliHLTPHOSRawAnalyzer::GetMaxValue(UInt_t *dta, Int_t size) const
185 {
186
187   Double_t tmpMax = 0;
188
189   for(int i = 0; i < size; i++)
190     {
191       if(dta[i] > tmpMax)
192         {
193           tmpMax = dta[i];
194         }
195     }
196   
197   return tmpMax;
198
199 }
200 */