]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSRawAnalyzer.cxx
Added source code to the hrml documentation
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSRawAnalyzer.cxx
1 #include "AliHLTPHOSRawAnalyzer.h"
2 #include <iostream>
3
4 using std::cout;
5 using std::endl;
6
7
8
9 AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer():fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), n(99999)
10 {
11 cout <<"AliHLTPHOSRawAnalyzer Base class::Creating a new AliHLTPHOSRawAnalyzer() object"<<endl;
12 }
13
14 AliHLTPHOSRawAnalyzer::~AliHLTPHOSRawAnalyzer()
15 {
16
17 }
18
19 AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(AliHLTPHOSRawAnalyzer const&):fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), n(99999)
20 {
21
22 }
23
24 /**
25 * Main constructor
26 * @param dataPtr Data array for wich a subarray will be taken to perform the fit
27 * @param fs the sampling frequency in entities of MHz. Needed in order to calculate physical time
28 **/
29 AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(double *dtaPtr, double fs):fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), n(99999)
30 {
31   fFloatDataPtr = dtaPtr;  
32   fSampleFrequency = fs;
33 } //end  
34
35
36 /**
37 * Attemps to level the basline to zero.
38 * The baseline will be calculated from the pretrigger samples and subtracted from the 
39 * data array. 
40 * If pretrigger samples are not present then the basline correction will be incorrect. 
41 * @param dataPtr array for wich to correct the basline 
42 * @param N the number of pretrigger samples used to calculate the baseline.
43 **/
44 void 
45 AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, int N)
46 {
47   fFloatDataPtr = dataPtr;  
48   n=N;
49   cout << "Baseline correction not yet implemeted" << endl;
50 } //end BaselineCorrection
51
52
53 /**
54 * Shifts the basline with the amount given by baselineValue
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 BaslineValue the basline value to subtract..
58 **/
59 void 
60 AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, double baselineValue)
61 {
62   fFloatDataPtr = dataPtr;   
63   printf("\nbaselineValue = %f\n", baselineValue);
64   cout << "Baseline correction not yet implemeted" << endl;
65 } //end BaslineCorrection
66
67
68 /**
69  * Gives the timing in entities of sample indexes
70  * Physical time is found by multiplying  with the sampling intervall (Ts).
71  **/
72 float
73 AliHLTPHOSRawAnalyzer::GetTiming()
74 {
75   return fDTof;
76 } //end GetTiming
77
78
79 /**
80  * Gives the time in entities of ADC channels (quantization levels).  
81  * Absolute enrgy is found by multiplying with offline calibration constants.
82  **/
83 float
84 AliHLTPHOSRawAnalyzer::GetEnergy()
85 {
86   return fDAmpl;
87 } //end GetEnergy
88
89
90 /**
91  * Set data array. Overrides data data array set in the constructor.
92  **/
93 void 
94 AliHLTPHOSRawAnalyzer::SetData(double *data)
95 {
96   //  double *dta;
97   //  dta = data;
98   fFloatDataPtr = data;
99   //  cout << "Set data not yet implemented" << endl;
100 }
101
102 void 
103 AliHLTPHOSRawAnalyzer::SetSampleFreq(double freq)
104 {
105
106 }
107
108 int 
109 AliHLTPHOSRawAnalyzer::FindStartIndex(double treshold)
110 {
111   printf("\ntreshold = %f \n", treshold);
112   cout << "Find Start index not yet implemented" << endl;
113   return 0;
114 } //end FindStartIndex
115
116
117 /**
118  * This function applies only to the Chi and Least mean square fit. An initial guess is made
119  * based on the average of the first 5 samples and the first value exeeding this value.
120  **/
121 void 
122 AliHLTPHOSRawAnalyzer::MakeInitialGuess()
123 {
124   cout << "Make initial guess not yet implemeted" << endl;
125 }
126
127
128 /**
129  * This function applies only to the Chi and Least mean square fit. An initial guess is made
130  * based on the average of the first 5 samples and the first value exeeding threshold + this value.
131  * @param treshold The index of the first value above treshold is ntaken to be the first value.
132  **/
133 void 
134 AliHLTPHOSRawAnalyzer::MakeInitialGuess(int treshold)
135 {
136   printf("\ntreshold = %d\n", treshold);
137   cout << "Make initial guess not yet implemeted" << endl;  
138 }