]>
Commit | Line | Data |
---|---|---|
1b41ab20 | 1 | // $Id$ |
2 | ||
cbab66dd | 3 | /************************************************************************** |
4 | * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. * | |
5 | * * | |
6 | * Author: Per Thomas Hille for the ALICE HLT Project. * | |
7 | * Contributors are mentioned in the code where appropriate. * | |
8 | * * | |
9 | * Permission to use, copy, modify and distribute this software and its * | |
10 | * documentation strictly for non-commercial purposes is hereby granted * | |
11 | * without fee, provided that the above copyright notice appears in all * | |
12 | * copies and that both the copyright notice and this permission notice * | |
13 | * appear in the supporting documentation. The authors make no claims * | |
14 | * about the suitability of this software for any purpose. It is * | |
15 | * provided "as is" without express or implied warranty. * | |
16 | **************************************************************************/ | |
17 | ||
18 | #include "AliHLTPHOSRawAnalyzerCrude.h" | |
cbab66dd | 19 | |
9c9d15d6 | 20 | //ClassImp(AliHLTPHOSRawAnalyzerCrude) |
cbab66dd | 21 | |
cbab66dd | 22 | |
cbab66dd | 23 | /** |
24 | * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters | |
25 | * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be | |
26 | * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in | |
27 | * calculation is of type double. | |
28 | **/ | |
d504c864 | 29 | //____________________________________________________________________________ |
cbab66dd | 30 | AliHLTPHOSRawAnalyzerCrude::AliHLTPHOSRawAnalyzerCrude():AliHLTPHOSRawAnalyzer() |
31 | { | |
05be0766 | 32 | |
cbab66dd | 33 | } |
34 | ||
35 | ||
d504c864 | 36 | //____________________________________________________________________________ |
cbab66dd | 37 | AliHLTPHOSRawAnalyzerCrude::~AliHLTPHOSRawAnalyzerCrude() |
38 | { | |
39 | ||
40 | } //end AliHLTPHOSRawAnalyzerCrude | |
41 | ||
42 | ||
cbab66dd | 43 | /** |
ee7849e6 | 44 | * Extraction of timing and energy using Crude estimate. |
cbab66dd | 45 | * The. The parameters "start" and "length" defines a sub array of the data array |
46 | * that will be used for the the fit. If start+length must not exeed the total length | |
47 | * of the Data array. "start" must be chosen as close as possible to t0. | |
04751caa | 48 | * The baseline must also be subtracted. . |
cbab66dd | 49 | * "index + length" must not exeed the length of the data array set in the constructor. |
50 | * @param start the start index of the subarray of the data array. | |
51 | * @param length the number of samples to use starting from index | |
cbab66dd | 52 | **/ |
04751caa | 53 | // //____________________________________________________________________________ |
54 | // void | |
55 | // AliHLTPHOSRawAnalyzerCrude::Evaluate(int start, int length) | |
56 | // { | |
57 | // double tmpAmplitudeMax =0; | |
58 | // double tmpTime = 0; | |
59 | ||
60 | // for(int i=start; i<length; i++) | |
61 | // { | |
62 | // if(fIntDataPtr[i] > tmpAmplitudeMax && i > 5) | |
63 | // { | |
64 | // tmpAmplitudeMax = fIntDataPtr[i]; | |
65 | // tmpTime = i; | |
66 | // } | |
67 | // } | |
68 | ||
69 | // fDAmpl = tmpAmplitudeMax; | |
70 | // fDTof = tmpTime; | |
71 | ||
72 | // //thats all | |
73 | // } //end Crude | |
74 | ||
75 | ||
cbab66dd | 76 | void |
77 | AliHLTPHOSRawAnalyzerCrude::Evaluate(int start, int length) | |
78 | { | |
04751caa | 79 | // cout << "AliHLTPHOSRawAnalyzerCrude::Evaluate TP0" << endl; |
80 | ||
81 | //DumpData(T | |
82 | ||
83 | // DumpData(fDoubleDataPtr,50, 25); | |
84 | ||
87434909 | 85 | if(fUseShortValues == true) |
86 | { | |
87 | EvaluateShort(start, length); | |
88 | } | |
89 | else | |
90 | { | |
91 | ||
92 | double tmpAmplitudeMax =0; | |
93 | double tmpTime = 0; | |
94 | ||
95 | for(int i=start; i<length; i++) | |
96 | { | |
97 | // if(fDoubleDataPtr[i] > tmpAmplitudeMax && i > 5) | |
b6f9f0f8 | 98 | // if(fIntDataPtr[i] > tmpAmplitudeMax && i > 5) |
99 | if(fIntDataPtr[i] > tmpAmplitudeMax ) | |
87434909 | 100 | { |
101 | // tmpAmplitudeMax = fDoubleDataPtr[i]; | |
102 | tmpAmplitudeMax = fIntDataPtr[i]; | |
103 | tmpTime = i; | |
104 | } | |
105 | } | |
106 | ||
107 | fDAmpl = tmpAmplitudeMax; | |
108 | fDTof = tmpTime; | |
109 | } | |
110 | ||
111 | //thats all | |
112 | } //end Crude | |
113 | ||
114 | void | |
115 | AliHLTPHOSRawAnalyzerCrude::EvaluateShort(int start, int length) | |
116 | { | |
117 | // cout << "AliHLTPHOSRawAnalyzerCrude::Evaluate TP0" << endl; | |
118 | ||
119 | //DumpData(T | |
120 | ||
121 | // DumpData(fDoubleDataPtr,50, 25); | |
122 | ||
cbab66dd | 123 | double tmpAmplitudeMax =0; |
124 | double tmpTime = 0; | |
125 | ||
126 | for(int i=start; i<length; i++) | |
127 | { | |
37ff2dd6 | 128 | // cout << "sample index: " << i << endl; |
04751caa | 129 | // if(fDoubleDataPtr[i] > tmpAmplitudeMax && i > 5) |
b6f9f0f8 | 130 | // if(fShortDataPtr[i] > tmpAmplitudeMax && i > 5) |
131 | if(fShortDataPtr[i] > tmpAmplitudeMax ) | |
cbab66dd | 132 | { |
04751caa | 133 | // tmpAmplitudeMax = fDoubleDataPtr[i]; |
87434909 | 134 | tmpAmplitudeMax = fShortDataPtr[i]; |
cbab66dd | 135 | tmpTime = i; |
136 | } | |
137 | } | |
04751caa | 138 | |
139 | ||
cbab66dd | 140 | fDAmpl = tmpAmplitudeMax; |
141 | fDTof = tmpTime; | |
92e78811 | 142 | |
cbab66dd | 143 | //thats all |
144 | } //end Crude |