]>
Commit | Line | Data |
---|---|---|
8562a9e6 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> | |
3 | <title>AliHLTPHOS: AliHLTPHOSRawAnalyzerComponent.cxx Source File</title> | |
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> | |
5 | </head><body> | |
6 | <!-- Generated by Doxygen 1.3.9.1 --> | |
7 | <div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> | |
8 | <h1>AliHLTPHOSRawAnalyzerComponent.cxx</h1><a href="AliHLTPHOSRawAnalyzerComponent_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/**************************************************************************</span> | |
eace7fcd | 9 | 00002 <span class="comment"> * This file is property of and copyright by the Experimental Nuclear *</span> |
10 | 00003 <span class="comment"> * Physics Group, Dep. of Physics *</span> | |
11 | 00004 <span class="comment"> * University of Oslo, Norway, 2007 *</span> | |
12 | 00005 <span class="comment"> * * </span> | |
13 | 00006 <span class="comment"> * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*</span> | |
14 | 00007 <span class="comment"> * Contributors are mentioned in the code where appropriate. *</span> | |
15 | 00008 <span class="comment"> * Please report bugs to perthi@fys.uio.no * </span> | |
16 | 00009 <span class="comment"> * *</span> | |
17 | 00010 <span class="comment"> * Permission to use, copy, modify and distribute this software and its *</span> | |
18 | 00011 <span class="comment"> * documentation strictly for non-commercial purposes is hereby granted *</span> | |
19 | 00012 <span class="comment"> * without fee, provided that the above copyright notice appears in all *</span> | |
20 | 00013 <span class="comment"> * copies and that both the copyright notice and this permission notice *</span> | |
21 | 00014 <span class="comment"> * appear in the supporting documentation. The authors make no claims *</span> | |
22 | 00015 <span class="comment"> * about the suitability of this software for any purpose. It is *</span> | |
23 | 00016 <span class="comment"> * provided "as is" without express or implied warranty. *</span> | |
24 | 00017 <span class="comment"> **************************************************************************/</span> | |
8562a9e6 | 25 | 00018 |
eace7fcd | 26 | 00019 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRawAnalyzerComponent_8h.html">AliHLTPHOSRawAnalyzerComponent.h</a>"</span> |
27 | 00020 <span class="preprocessor">#include <iostream></span> | |
28 | 00021 <span class="preprocessor">#include "stdio.h"</span> | |
29 | 00022 <span class="preprocessor">#include "AliRawReaderMemory.h"</span> | |
30 | 00023 <span class="preprocessor">#include "AliCaloRawStream.h"</span> | |
31 | 00024 <span class="preprocessor">#include <cstdlib></span> | |
32 | 00025 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRcuCellEnergyDataStruct_8h.html">AliHLTPHOSRcuCellEnergyDataStruct.h</a>"</span> | |
33 | 00026 | |
34 | <a name="l00027"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentv1">00027</a> <span class="keyword">const</span> AliHLTComponentDataType <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentv1">AliHLTPHOSRawAnalyzerComponent::inputDataTypes</a>[]={kAliHLTVoidDataType,{0,<span class="stringliteral">""</span>,<span class="stringliteral">""</span>}}; <span class="comment">//'zero' terminated array</span> | |
35 | <a name="l00028"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentv0">00028</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentv0">AliHLTPHOSRawAnalyzerComponent::fEventCount</a> = 0; | |
8562a9e6 | 36 | 00029 |
eace7fcd | 37 | 00030 |
38 | <a name="l00044"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta0">00044</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta0">AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent</a>():AliHLTProcessor(),fEquippmentID(0), fRcuX(0), | |
39 | 00045 fRcuZ(0),fRcuRowOffeset(0), fRcuColOffeset(0), fModuleID(0), fPHOSRawStream(0), fRawMemoryReader(0), fOutPtr(0) | |
40 | 00046 { | |
41 | 00047 | |
42 | 00048 } | |
43 | 00049 | |
44 | <a name="l00050"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta1">00050</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta1">AliHLTPHOSRawAnalyzerComponent::~AliHLTPHOSRawAnalyzerComponent</a>() | |
45 | 00051 { | |
46 | 00052 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a> != 0) | |
47 | 00053 { | |
48 | 00054 <span class="keyword">delete</span> fRawMemoryReader; | |
49 | 00055 } | |
50 | 00056 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a> != 0) | |
51 | 00057 { | |
52 | 00058 <span class="keyword">delete</span> fPHOSRawStream; | |
53 | 00059 } | |
8562a9e6 | 54 | 00060 |
eace7fcd | 55 | 00061 } |
56 | 00062 | |
57 | 00063 | |
58 | 00064 | |
59 | <a name="l00065"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta2">00065</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta0">AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent</a>(<span class="keyword">const</span> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html">AliHLTPHOSRawAnalyzerComponent</a> & ) : AliHLTProcessor(), | |
60 | 00066 fEquippmentID(0), fRcuX(0), fRcuZ(0),fRcuRowOffeset(0), fRcuColOffeset(0), fModuleID(0), fPHOSRawStream(0), fRawMemoryReader(0), fOutPtr(0) | |
61 | 00067 { | |
62 | 00068 } | |
63 | 00069 | |
8562a9e6 | 64 | 00070 |
eace7fcd | 65 | 00071 <span class="comment">/*</span> |
66 | 00072 <span class="comment"> *Deinit function called by the HLT framwork at end of run</span> | |
67 | 00073 <span class="comment"> *@return 0 if the denitialzation was sucessfull.</span> | |
68 | 00074 <span class="comment"> */</span> | |
69 | 00075 <span class="keywordtype">int</span> | |
70 | <a name="l00076"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta5">00076</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta5">AliHLTPHOSRawAnalyzerComponent::Deinit</a>() | |
71 | 00077 { | |
72 | 00078 <span class="keywordflow">return</span> 0; | |
73 | 00079 } | |
74 | 00080 | |
75 | 00081 | |
76 | 00082 <span class="comment">/*</span> | |
77 | 00083 <span class="comment"> *Deinit function called by the HLT framwork at end of run</span> | |
78 | 00084 <span class="comment"> *@return 0 if the denitialzation was sucessfull.</span> | |
79 | 00085 <span class="comment"> */</span> | |
80 | 00086 <span class="keywordtype">int</span> | |
81 | <a name="l00087"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta6">00087</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta6">AliHLTPHOSRawAnalyzerComponent::DoDeinit</a>() | |
82 | 00088 { | |
83 | 00089 Logging(kHLTLogInfo, <span class="stringliteral">"HLT"</span>, <span class="stringliteral">"PHOS"</span>, <span class="stringliteral">",AliHLTPHOSRawAnalyzerComponen DoDeinit"</span>); | |
84 | 00090 | |
85 | 00091 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a> !=0) | |
86 | 00092 { | |
87 | 00093 <span class="keyword">delete</span> fRawMemoryReader; | |
88 | 00094 } | |
89 | 00095 | |
90 | 00096 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a> != 0) | |
91 | 00097 { | |
92 | 00098 <span class="keyword">delete</span> fPHOSRawStream; | |
93 | 00099 } | |
94 | 00100 <span class="keywordflow">return</span> 0; | |
95 | 00101 | |
8562a9e6 | 96 | 00102 } |
eace7fcd | 97 | 00103 |
98 | 00104 <span class="comment">/*</span> | |
99 | 00105 <span class="comment"> *Function called by the HLT framework during initialization</span> | |
100 | 00106 <span class="comment"> *@return the ID of the component</span> | |
101 | 00107 <span class="comment"> */</span> | |
102 | 00108 <span class="keyword">const</span> <span class="keywordtype">char</span>* | |
103 | <a name="l00109"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta13">00109</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponenta13">AliHLTPHOSRawAnalyzerComponent::GetComponentID</a>() | |
104 | 00110 { | |
105 | 00111 <span class="keywordflow">return</span> <span class="stringliteral">"AliPhosTestRaw"</span>; | |
106 | 00112 } | |
107 | 00113 | |
108 | 00114 | |
109 | 00115 <span class="keywordtype">void</span> | |
110 | 00116 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta13">AliHLTPHOSRawAnalyzerComponent::GetInputDataTypes</a>( vector<AliHLTComponentDataType>& list) | |
111 | 00117 { | |
112 | 00118 <span class="keyword">const</span> AliHLTComponentDataType* pType=inputDataTypes; | |
113 | 00119 <span class="keywordflow">while</span> (pType->fID!=0) { | |
114 | 00120 list.push_back(*pType); | |
115 | 00121 pType++; | |
116 | 00122 } | |
117 | 00123 } | |
118 | 00124 | |
119 | 00125 AliHLTComponentDataType | |
120 | <a name="l00126"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta14">00126</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta14">AliHLTPHOSRawAnalyzerComponent::GetOutputDataType</a>() | |
121 | 00127 { | |
122 | 00128 <span class="keywordflow">return</span> AliHLTPHOSDefinitions::gkCellEnergyDataType; | |
123 | 00129 } | |
124 | 00130 | |
125 | 00131 <span class="keywordtype">void</span> | |
126 | <a name="l00132"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta15">00132</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta15">AliHLTPHOSRawAnalyzerComponent::GetOutputDataSize</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>& constBase, <span class="keywordtype">double</span>& inputMultiplier ) | |
127 | 00133 | |
128 | 00134 { | |
129 | 00135 constBase = 30; | |
130 | 00136 inputMultiplier = 0.1; | |
131 | 00137 } | |
132 | 00138 | |
133 | 00139 | |
134 | 00140 <span class="keywordtype">int</span> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta16">AliHLTPHOSRawAnalyzerComponent::DoEvent</a>( <span class="keyword">const</span> AliHLTComponentEventData& evtData, <span class="keyword">const</span> AliHLTComponentBlockData* blocks, | |
135 | 00141 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, | |
136 | 00142 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks ) | |
137 | 00143 { | |
138 | 00144 Int_t tmpMod = 0; | |
139 | 00145 Int_t tmpRow = 0; | |
140 | 00146 Int_t tmpCol = 0; | |
141 | 00147 Int_t tmpGain = 0; | |
142 | 00148 Int_t sampleCnt = 0; | |
143 | 00149 Int_t processedChannels = 0; | |
144 | 00150 UInt_t offset = 0; | |
145 | 00151 UInt_t mysize = 0; | |
146 | 00152 UInt_t tSize = 0; | |
147 | 00153 Int_t tmpChannelCnt = 0; | |
148 | 00154 Int_t tmpStartIndex = 0; | |
149 | 00155 AliHLTUInt8_t* outBPtr; | |
150 | 00156 outBPtr = outputPtr; | |
151 | 00157 <span class="keyword">const</span> AliHLTComponentBlockData* iter = NULL; | |
152 | 00158 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ndx; | |
153 | 00159 | |
154 | 00160 <span class="keywordflow">if</span>((fEventCount % 100) == 0) | |
155 | 00161 { | |
156 | 00162 <span class="comment">// cout << "analyzing event: " << fEventCount << endl;</span> | |
157 | 00163 } | |
158 | 00164 | |
159 | 00165 <span class="keywordflow">for</span>( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) | |
160 | 00166 { | |
161 | 00167 iter = blocks+ndx; | |
162 | 00168 mysize = 0; | |
163 | 00169 offset = tSize; | |
164 | 00170 | |
165 | 00171 <span class="keywordflow">if</span> ( iter->fDataType != AliHLTPHOSDefinitions::gkDDLPackedRawDataType ) | |
166 | 00172 { | |
167 | 00173 <span class="comment">// cout << "Warning: data type = is nOT gkDDLPackedRawDataType " << endl;</span> | |
168 | 00174 <span class="keywordflow">continue</span>; | |
169 | 00175 } | |
170 | 00176 | |
171 | 00177 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a>->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize ); | |
172 | 00178 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponentp0">analyzerPtr</a>-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFindera12">SetData</a>(fTmpChannelData); | |
173 | 00179 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a> = (<a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html">AliHLTPHOSRcuCellEnergyDataStruct</a>*)outBPtr; | |
174 | 00180 mysize += <span class="keyword">sizeof</span>(<a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html">AliHLTPHOSRcuCellEnergyDataStruct</a>); | |
175 | 00181 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo1">fRcuX</a> = fRcuX; | |
176 | 00182 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo2">fRcuZ</a> = fRcuZ; | |
177 | 00183 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo0">fModuleID</a> = fModuleID; | |
178 | 00184 tmpChannelCnt = 0; | |
179 | 00185 | |
180 | 00186 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentv0">fEventCount</a>%100 ==0) | |
181 | 00187 { | |
182 | 00188 <span class="comment">// cout <<"Analyzing event: " << fEventCount << endl; </span> | |
183 | 00189 } | |
184 | 00190 | |
185 | 00191 <span class="keywordflow">while</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->Next()) | |
186 | 00192 { | |
187 | 00193 <span class="keywordflow">if</span> (<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->IsNewHWAddress()) | |
188 | 00194 { | |
189 | 00195 <span class="keywordflow">if</span>(processedChannels > 0) | |
190 | 00196 { | |
191 | 00197 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponentp0">analyzerPtr</a>-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFindera12">SetData</a>(fTmpChannelData); | |
192 | 00198 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponentp0">analyzerPtr</a>-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFindera17">Evaluate</a>(0, sampleCnt); | |
193 | 00199 sampleCnt = 0; | |
194 | 00200 | |
195 | 00201 <span class="comment">// cout << "tmGain = " << tmpGain <<" tmpRow = " << tmpRow << " tmpCol = " << tmpCol <<endl;</span> | |
196 | 00202 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#AliHLTPHOSValidCellDataStructo2">fGain</a> = tmpGain; | |
197 | 00203 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#AliHLTPHOSValidCellDataStructo0">fRow</a> = tmpRow; | |
198 | 00204 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#AliHLTPHOSValidCellDataStructo1">fCol</a> = tmpCol; | |
199 | 00205 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#AliHLTPHOSValidCellDataStructo3">fEnergy</a> = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponentp0">analyzerPtr</a>-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFindera11">GetEnergy</a>(); | |
200 | 00206 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#AliHLTPHOSValidCellDataStructo4">fTime</a> = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponentp0">analyzerPtr</a>-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFindera10">GetTiming</a>(); | |
201 | 00207 tmpChannelCnt ++; | |
202 | 00208 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd1">ResetDataPtr</a>(tmpStartIndex, sampleCnt); | |
203 | 00209 sampleCnt = 0; | |
204 | 00210 } | |
205 | 00211 | |
206 | 00212 tmpMod = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetModule() ; | |
207 | 00213 tmpRow = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetRow() - fRcuRowOffeset; | |
208 | 00214 tmpCol = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetColumn() - fRcuColOffeset; | |
209 | 00215 tmpGain = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->IsLowGain(); | |
210 | 00216 processedChannels ++; | |
211 | 00217 <span class="comment">// cout << endl;</span> | |
212 | 00218 cout << <span class="stringliteral">"EquitppmentId = "</span> << <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a>->GetEquipmentId() <<<span class="stringliteral">"\t"</span> << <span class="stringliteral">"fPHOSRawStream->GetColumn()=\t"</span> <<<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetColumn() <<<span class="stringliteral">"\t("</span> << tmpCol <<<span class="stringliteral">")\t"</span><<\ | |
213 | 00219 <span class="stringliteral">"fPHOSRawStream->GetRow()=\t"</span> <<<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetRow()<<<span class="stringliteral">"\t("</span> << tmpRow <<<span class="stringliteral">")"</span> <<endl; | |
214 | 00220 <span class="comment">// cout << "fPHOSRawStream->GetColumn()=\t" <<fPHOSRawStream->GetColumn() <<"\t(" << tmpCol <<")"<<endl;</span> | |
215 | 00221 <span class="comment">// cout << "fPHOSRawStream->GetRow()=\t" <<fPHOSRawStream->GetRow() <<"\t(" << tmpRow <<")" <<endl;</span> | |
216 | 00222 <span class="comment">// cout << "tmGain = " << tmpGain <<" tmpRow = " << tmpRow << " tmpCol = " << tmpCol <<endl << endl;</span> | |
217 | 00223 } | |
218 | 00224 | |
219 | 00225 <span class="keywordflow">if</span>(sampleCnt == 0) | |
220 | 00226 { | |
221 | 00227 tmpStartIndex = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetTime(); | |
222 | 00228 } | |
223 | 00229 | |
224 | 00230 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr6">fTmpChannelData</a>[<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetTime()] = <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->GetSignal(); | |
225 | 00231 sampleCnt ++; | |
226 | 00232 | |
227 | 00233 } | |
228 | 00234 | |
229 | 00235 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr10">fOutPtr</a>-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#AliHLTPHOSRcuCellEnergyDataStructo3">fCnt</a> = tmpChannelCnt; | |
230 | 00236 AliHLTComponentBlockData bd; | |
231 | 00237 FillBlockData( bd ); | |
232 | 00238 bd.fOffset = offset; | |
233 | 00239 bd.fSize = mysize; | |
234 | 00240 bd.fDataType = AliHLTPHOSDefinitions::gkCellEnergyDataType; | |
235 | 00241 bd.fSpecification = 0xFFFFFFFF; | |
236 | 00242 outputBlocks.push_back( bd ); | |
237 | 00243 tSize += mysize; | |
238 | 00244 outBPtr += mysize; | |
239 | 00245 | |
240 | 00246 <span class="keywordflow">if</span>( tSize > size ) | |
241 | 00247 { | |
242 | 00248 Logging( kHLTLogFatal, <span class="stringliteral">"HLT::AliHLTPHOSRawAnalyzerComponent::DoEvent"</span>, <span class="stringliteral">"Too much data"</span>, | |
243 | 00249 <span class="stringliteral">"Data written over allowed buffer. Amount written: %lu, allowed amount: %lu."</span> | |
244 | 00250 , tSize, size ); | |
245 | 00251 <span class="keywordflow">return</span> EMSGSIZE; | |
246 | 00252 } | |
247 | 00253 } | |
248 | 00254 | |
249 | 00255 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentv0">fEventCount</a>++; | |
250 | 00256 size = tSize; | |
251 | 00257 <span class="keywordflow">return</span> 0; | |
252 | 00258 }<span class="comment">//end DoEvent</span> | |
253 | 00259 | |
254 | 00260 | |
255 | 00261 | |
256 | 00262 <span class="keywordtype">int</span> | |
257 | <a name="l00263"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta4">00263</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta4">AliHLTPHOSRawAnalyzerComponent::DoInit</a>( <span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span>** argv ) | |
258 | 00264 { | |
259 | 00265 <span class="keywordtype">int</span> equippmentID = atoi(argv[6]); | |
260 | 00266 cout << <span class="stringliteral">"AliHLTPHOSRawAnalyzerComponent::DoIni Setting EquipmentID to"</span> << equippmentID << endl; | |
261 | 00267 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd0">Reset</a>(); | |
262 | 00268 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a> = <span class="keyword">new</span> AliRawReaderMemory(); | |
263 | 00269 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a> = <span class="keyword">new</span> AliCaloRawStream(<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a>,<span class="stringliteral">"PHOS"</span>); | |
264 | 00270 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr8">fPHOSRawStream</a>->SetOldRCUFormat(kFALSE); | |
265 | 00271 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr9">fRawMemoryReader</a>->SetEquipmentID(equippmentID); | |
266 | 00272 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta10">SetEquippmentID</a>(equippmentID); | |
267 | 00273 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta12">SetCoordinates</a>(equippmentID); | |
268 | 00274 <span class="keywordflow">if</span> (argc==0 && argv==NULL) { | |
269 | 00275 <span class="comment">// this is currently just to get rid of the warning "unused parameter"</span> | |
270 | 00276 } | |
271 | 00277 <span class="keywordflow">return</span> 0; | |
272 | 00278 } | |
273 | 00279 | |
274 | 00280 <span class="keywordtype">void</span> | |
275 | <a name="l00281"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta7">00281</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta8">AliHLTPHOSRawAnalyzerComponent::DumpData</a>(<span class="keywordtype">int</span> gain) | |
276 | 00282 { | |
277 | 00283 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> mod = 0; mod < N_MODULES; mod ++) | |
278 | 00284 { | |
279 | 00285 printf(<span class="stringliteral">"\n *********** MODULE %d ************\n"</span>, mod); | |
280 | 00286 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> row = 0; row < N_ROWS_MOD; row ++) | |
281 | 00287 { | |
282 | 00288 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> col = 0; col < N_COLUMNS_MOD; col ++) | |
283 | 00289 { | |
284 | 00290 <span class="keywordflow">if</span>( <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr7">fMaxValues</a>[mod][row][col][0] != 0) | |
285 | 00291 { | |
286 | 00292 cout << <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr7">fMaxValues</a>[mod][row][col][gain] << <span class="stringliteral">"\t"</span>; | |
287 | 00293 } | |
288 | 00294 } | |
289 | 00295 } | |
290 | 00296 } | |
291 | 00297 } | |
292 | 00298 | |
293 | 00299 | |
294 | 00300 <span class="keywordtype">void</span> | |
295 | <a name="l00301"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta8">00301</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta8">AliHLTPHOSRawAnalyzerComponent::DumpData</a>() | |
296 | 00302 { | |
297 | 00303 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta8">DumpData</a>(0); | |
298 | 00304 } | |
299 | 00305 | |
300 | 00306 <span class="keywordtype">void</span> | |
301 | <a name="l00307"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta9">00307</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta9">AliHLTPHOSRawAnalyzerComponent::DumpChannelData</a>(Double_t *data) | |
302 | 00308 { | |
303 | 00309 cout << endl; | |
304 | 00310 | |
305 | 00311 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i< ALTRO_MAX_SAMPLES; i++) | |
306 | 00312 { | |
307 | 00313 <span class="keywordflow">if</span> (data[i] != 0) | |
308 | 00314 { | |
309 | 00315 cout <<i <<<span class="stringliteral">"\t"</span>; | |
310 | 00316 } | |
311 | 00317 } | |
312 | 00318 cout << endl; | |
313 | 00319 | |
314 | 00320 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i< ALTRO_MAX_SAMPLES; i++) | |
315 | 00321 { | |
316 | 00322 <span class="keywordflow">if</span> (data[i] != 0) | |
317 | 00323 { | |
318 | 00324 cout <<data[i] <<<span class="stringliteral">"\t"</span>; | |
319 | 00325 } | |
320 | 00326 } | |
321 | 00327 | |
322 | 00328 cout << endl; | |
323 | 00329 } | |
324 | 00330 | |
325 | 00331 | |
326 | 00332 | |
327 | 00333 <span class="keywordtype">void</span> | |
328 | <a name="l00334"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd0">00334</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd0">AliHLTPHOSRawAnalyzerComponent::Reset</a>() | |
329 | 00335 { | |
330 | 00336 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> mod = 0; mod < N_MODULES; mod ++) | |
331 | 00337 { | |
332 | 00338 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> row = 0; row < N_ROWS_MOD; row ++) | |
333 | 00339 { | |
334 | 00340 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> col = 0; col < N_COLUMNS_MOD; col ++) | |
335 | 00341 { | |
336 | 00342 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> gain = 0; gain < N_GAINS; gain ++ ) | |
337 | 00343 { | |
338 | 00344 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr7">fMaxValues</a>[mod][row][col][gain] = 0; | |
339 | 00345 } | |
340 | 00346 } | |
341 | 00347 } | |
342 | 00348 } | |
343 | 00349 | |
344 | 00350 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd1">ResetDataPtr</a>(); | |
345 | 00351 | |
346 | 00352 } <span class="comment">// end Reset</span> | |
347 | 00353 | |
348 | 00354 | |
349 | 00355 | |
350 | 00356 <span class="keywordtype">void</span> | |
351 | <a name="l00357"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd1">00357</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd1">AliHLTPHOSRawAnalyzerComponent::ResetDataPtr</a>() | |
352 | 00358 { | |
353 | 00359 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0 ; i< ALTRO_MAX_SAMPLES; i++) | |
354 | 00360 { | |
355 | 00361 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr6">fTmpChannelData</a>[i] = 0; | |
356 | 00362 } | |
357 | 00363 } | |
358 | 00364 | |
359 | 00365 <span class="keywordtype">void</span> | |
360 | <a name="l00366"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd2">00366</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd1">AliHLTPHOSRawAnalyzerComponent::ResetDataPtr</a>(<span class="keywordtype">int</span> sampleCnt) | |
361 | 00367 { | |
362 | 00368 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0 ; i< sampleCnt; i++) | |
363 | 00369 { | |
364 | 00370 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr6">fTmpChannelData</a>[i] = 0; | |
365 | 00371 } | |
366 | 00372 } | |
367 | 00373 | |
368 | 00374 <span class="keywordtype">void</span> | |
369 | <a name="l00375"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd3">00375</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentd1">AliHLTPHOSRawAnalyzerComponent::ResetDataPtr</a>(<span class="keywordtype">int</span> startindex, <span class="keywordtype">int</span> sampleCnt) | |
370 | 00376 { | |
371 | 00377 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = startindex ; i< sampleCnt; i++) | |
372 | 00378 { | |
373 | 00379 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr6">fTmpChannelData</a>[i] = 0; | |
374 | 00380 } | |
375 | 00381 } | |
376 | 00382 | |
377 | 00383 | |
378 | 00384 <span class="keywordtype">void</span> | |
379 | <a name="l00385"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta10">00385</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta10">AliHLTPHOSRawAnalyzerComponent::SetEquippmentID</a>(AliHLTUInt32_t <span class="keywordtype">id</span>) | |
380 | 00386 { | |
381 | 00387 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr0">fEquippmentID</a> = id; | |
382 | 00388 } | |
383 | 00389 | |
384 | 00390 <span class="keywordtype">int</span> | |
385 | <a name="l00391"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta11">00391</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta11">AliHLTPHOSRawAnalyzerComponent::GetEquippmentID</a>() | |
386 | 00392 { | |
387 | 00393 <span class="keywordflow">return</span> fEquippmentID; | |
388 | 00394 } | |
389 | 00395 | |
390 | 00396 <span class="keywordtype">void</span> | |
391 | <a name="l00397"></a><a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta12">00397</a> <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerPeakFinderComponenta12">AliHLTPHOSRawAnalyzerComponent::SetCoordinates</a>(AliHLTUInt32_t equippmentID) | |
392 | 00398 { | |
393 | 00399 <span class="keywordtype">int</span> rcuIndex = (<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr0">fEquippmentID</a> - 1792)%4; | |
394 | 00400 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr5">fModuleID</a> = (<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr0">fEquippmentID</a> -1792 -rcuIndex)/5; | |
395 | 00401 | |
396 | 00402 <span class="keywordflow">if</span>(rcuIndex == 0) | |
397 | 00403 { | |
398 | 00404 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr1">fRcuX</a> = 0; | |
399 | 00405 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr2">fRcuZ</a> = 0; | |
400 | 00406 } | |
401 | 00407 | |
402 | 00408 <span class="keywordflow">if</span>(rcuIndex == 1) | |
403 | 00409 { | |
404 | 00410 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr1">fRcuX</a> = 0; | |
405 | 00411 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr2">fRcuZ</a> = 1; | |
406 | 00412 } | |
407 | 00413 | |
408 | 00414 <span class="keywordflow">if</span>(rcuIndex == 2) | |
409 | 00415 { | |
410 | 00416 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr1">fRcuX</a> = 1; | |
411 | 00417 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr2">fRcuZ</a> = 0; | |
412 | 00418 } | |
413 | 00419 | |
414 | 00420 | |
415 | 00421 <span class="keywordflow">if</span>(rcuIndex == 3) | |
416 | 00422 { | |
417 | 00423 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr1">fRcuX</a> = 1; | |
418 | 00424 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr2">fRcuZ</a> = 1; | |
419 | 00425 } | |
420 | 00426 | |
421 | 00427 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr3">fRcuRowOffeset</a> = 32*fRcuX; | |
422 | 00428 <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html#AliHLTPHOSRawAnalyzerComponentr4">fRcuColOffeset</a> = 28*fRcuZ; | |
423 | 00429 | |
424 | 00430 } | |
425 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Feb 18 22:17:03 2007 for AliHLTPHOS by | |
8562a9e6 | 426 | <a href="http://www.doxygen.org/index.html"> |
427 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> | |
428 | </body> | |
429 | </html> |