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: AliHLTPHOSModuleMergerComponent.cxx Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
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="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</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="dirs.html">Directories</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>AliHLTPHOSModuleMergerComponent.cxx</h1><a href="AliHLTPHOSModuleMergerComponent_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/**************************************************************************</span>
9 00002 <span class="comment"> * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *</span>
10 00003 <span class="comment"> * *</span>
11 00004 <span class="comment"> * Author: Per Thomas Hille for the ALICE HLT Project. *</span>
12 00005 <span class="comment"> * Contributors are mentioned in the code where appropriate. *</span>
13 00006 <span class="comment"> * *</span>
14 00007 <span class="comment"> * Permission to use, copy, modify and distribute this software and its *</span>
15 00008 <span class="comment"> * documentation strictly for non-commercial purposes is hereby granted *</span>
16 00009 <span class="comment"> * without fee, provided that the above copyright notice appears in all *</span>
17 00010 <span class="comment"> * copies and that both the copyright notice and this permission notice *</span>
18 00011 <span class="comment"> * appear in the supporting documentation. The authors make no claims *</span>
19 00012 <span class="comment"> * about the suitability of this software for any purpose. It is *</span>
20 00013 <span class="comment"> * provided "as is" without express or implied warranty. *</span>
21 00014 <span class="comment"> **************************************************************************/</span>
23 00016 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSModuleMergerComponent_8h.html">AliHLTPHOSModuleMergerComponent.h</a>"</span>
24 00017 <span class="comment">//#include <iostream></span>
25 00018 <span class="comment">//#include "stdio.h"</span>
26 00019 <span class="preprocessor">#include "AliRawReaderMemory.h"</span>
27 00020 <span class="preprocessor">#include "AliCaloRawStream.h"</span>
28 00021 <span class="comment">//#include <cstdlib></span>
29 00022 <span class="preprocessor">#include <cstdio></span>
30 00023 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRcuCellEnergyDataStruct_8h.html">AliHLTPHOSRcuCellEnergyDataStruct.h</a>"</span>
33 <a name="l00026"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#v0">00026</a> <span class="keyword">const</span> <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#v0">AliHLTPHOSModuleMergerComponent::fgkInputDataTypes</a>[]={kAliHLTVoidDataType,{0,<span class="stringliteral">""</span>,<span class="stringliteral">""</span>}}; <span class="comment">//'zero' terminated array</span>
34 <a name="l00027"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#v1">00027</a> <span class="keyword">const</span> <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#v1">AliHLTPHOSModuleMergerComponent::fgkOutputDataType</a>=kAliHLTVoidDataType;
37 <a name="l00030"></a><a class="code" href="AliHLTPHOSModuleMergerComponent_8cxx.html#a0">00030</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html">AliHLTPHOSModuleMergerComponent</a> gAliHLTPHOSModuleMergerComponent;
38 <a name="l00031"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a0">00031</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a0">AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent</a>():<a class="code" href="classAliHLTProcessor.html">AliHLTProcessor</a>(), fEventCount(0), fEquippmentID(0)
44 <a name="l00037"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a1">00037</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a1">AliHLTPHOSModuleMergerComponent::~ AliHLTPHOSModuleMergerComponent</a>()
50 <a name="l00043"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a2">00043</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a0">AliHLTPHOSModuleMergerComponent::AliHLTPHOSModuleMergerComponent</a>(<span class="keyword">const</span> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html">AliHLTPHOSModuleMergerComponent</a> & ) : <a class="code" href="classAliHLTProcessor.html">AliHLTProcessor</a>(), fEventCount(0), fEquippmentID(0)
56 00049 <span class="keywordtype">int</span>
57 <a name="l00050"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a5">00050</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a5">AliHLTPHOSModuleMergerComponent::Deinit</a>()
59 00052 <span class="keywordflow">return</span> 0;
63 00056 <span class="keywordtype">int</span>
64 <a name="l00057"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a6">00057</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a6">AliHLTPHOSModuleMergerComponent::DoDeinit</a>()
66 00059 <a class="code" href="classAliHLTLogging.html#a7">Logging</a>(<a class="code" href="AliHLTDataTypes_8h.html#a29a21">kHLTLogInfo</a>, <span class="stringliteral">"HLT"</span>, <span class="stringliteral">"PHOS"</span>, <span class="stringliteral">",AliHLTPHOSModuleMerger DoDeinit"</span>);
67 00060 <span class="keywordflow">return</span> 0;
72 00065 <span class="keyword">const</span> <span class="keywordtype">char</span>*
73 <a name="l00066"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a10">00066</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a10">AliHLTPHOSModuleMergerComponent::GetComponentID</a>()
75 00068 <span class="keywordflow">return</span> <span class="stringliteral">"ModuleMerger"</span>;
79 00072 <span class="keywordtype">void</span>
80 <a name="l00073"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a11">00073</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a11">AliHLTPHOSModuleMergerComponent::GetInputDataTypes</a>( vector<AliHLTComponentDataType>& list)
82 00076 <span class="keyword">const</span> <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a>* pType=fgkInputDataTypes;
83 00077 <span class="keywordflow">while</span> (pType-><a class="code" href="structAliHLTComponentDataType.html#o1">fID</a>!=0)
85 00079 list.push_back(*pType);
91 00085 <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a>
92 <a name="l00086"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a12">00086</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a12">AliHLTPHOSModuleMergerComponent::GetOutputDataType</a>()
94 00089 <span class="keywordflow">return</span> AliHLTPHOSDefinitions::gkCellEnergyDataType;
98 00093 <span class="keywordtype">void</span>
99 <a name="l00094"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a13">00094</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a13">AliHLTPHOSModuleMergerComponent::GetOutputDataSize</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>& constBase, <span class="keywordtype">double</span>& inputMultiplier )
101 00097 constBase = 30;
102 00098 inputMultiplier = 1;
106 <a name="l00102"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a7">00102</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a7">AliHLTPHOSModuleMergerComponent::DoEvent</a>( <span class="keyword">const</span> <a class="code" href="structAliHLTComponentEventData.html">AliHLTComponentEventData</a>& evtData, <span class="keyword">const</span> <a class="code" href="structAliHLTComponentBlockData.html">AliHLTComponentBlockData</a>* blocks,
107 00103 <a class="code" href="structAliHLTComponentTriggerData.html">AliHLTComponentTriggerData</a>& trigData, AliHLTUInt8_t* outputPtr,
108 00104 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
110 00106 <span class="comment">//Merging of data from 4 RCUS to one module</span>
112 00108 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ndx;
113 00109 <span class="keyword">const</span> <a class="code" href="structAliHLTComponentBlockData.html">AliHLTComponentBlockData</a>* iter = NULL;
114 00110 <a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html">AliHLTPHOSRcuCellEnergyDataStruct</a> *cellDataPtr;
116 00112 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#b0">Reset</a>();
118 00114 <span class="keywordflow">for</span>( ndx = 0; ndx < evtData.<a class="code" href="structAliHLTComponentEventData.html#o4">fBlockCnt</a>; ndx++ )
120 00116 <span class="keywordtype">int</span> tmpModuleID = 0;
121 00117 <span class="keywordtype">int</span> tmpRcuX = 0;
122 00118 <span class="keywordtype">int</span> tmpRcuZ = 0;
123 00119 <span class="keywordtype">int</span> tmpCnt = cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o3">fCnt</a>;
124 00120 iter = blocks+ndx;
125 00121 <a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html">AliHLTPHOSRcuCellEnergyDataStruct</a> *cellDataPtr = (<a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html">AliHLTPHOSRcuCellEnergyDataStruct</a>*)( iter-><a class="code" href="structAliHLTComponentBlockData.html#o3">fPtr</a>);
126 00122 tmpModuleID = cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o0">fModuleID</a>;
127 00123 tmpRcuX = cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o1">fRcuX</a> ;
128 00124 tmpRcuZ = cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o2">fRcuZ</a>;
130 00126 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i= 0; i< tmpCnt; tmpCnt ++)
132 00128 <span class="keywordflow">if</span>(cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o2">fGain</a> == HIGH_GAIN)
134 00130 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r3">fMaxValues</a>[tmpModuleID][ cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o0">fZ</a> + <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a13">N_ZROWS_RCU</a>*tmpRcuZ][ cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o1">fX</a> + <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a14">N_XCOLUMNS_RCU</a>*tmpRcuX][HIGH_GAIN] = cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o3">fEnergy</a>;
136 00132 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o2">fGain</a> == LOW_GAIN)
138 00134 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r3">fMaxValues</a>[tmpModuleID][ cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o0">fZ</a> + <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a11">N_ROWS_RCU</a>*tmpRcuZ][ cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o1">fX</a> +<a class="code" href="AliHLTPHOSCommonDefs_8h.html#a12">N_COLUMNS_RCU</a>*tmpRcuX][LOW_GAIN] = cellDataPtr-><a class="code" href="structAliHLTPHOSRcuCellEnergyDataStruct.html#o4">fValidData</a>[i].<a class="code" href="structAliHLTPHOSValidCellDataStruct.html#o3">fEnergy</a>;
144 00140 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a8">DumpData</a>(1);
145 00141 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r0">fEventCount</a>++;
146 00142 <span class="keywordflow">return</span> 0;
148 00144 }<span class="comment">//end DoEvent</span>
151 00147 <span class="keywordtype">int</span>
152 <a name="l00148"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a4">00148</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a4">AliHLTPHOSModuleMergerComponent::DoInit</a>( <span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span>** argv )
154 00150 <span class="comment">//See base classs for documenation</span>
155 00151 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#b0">Reset</a>();
157 00153 <span class="keywordflow">if</span> (argc==0 && argv==NULL) {
158 00154 <span class="comment">// this is currently just to get rid of the warning "unused parameter"</span>
160 00156 <span class="keywordflow">return</span> 0;
164 00160 <span class="keywordtype">void</span>
165 <a name="l00161"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a8">00161</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a8">AliHLTPHOSModuleMergerComponent::DumpData</a>(<span class="keywordtype">int</span> gain)
167 00163 <span class="keywordflow">if</span>(gain < 0 || gain > N_GAINS)
169 00165 cout <<<span class="stringliteral">"AliHLTPHOSModuleMergerComponent::DumpDat: Error, gain must be between "</span> << 0 << <span class="stringliteral">"and"</span> << <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a17">N_GAINS</a> << endl;
172 00168 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> mod = 0; mod < N_MODULES; mod ++)
174 00170 <span class="keywordflow">if</span>(gain == HIGH_GAIN)
176 00172 cout << endl <<<span class="stringliteral">" *********** MODULE"</span> << mod << <span class="stringliteral">"****HIGH_GAIN"</span> <<<span class="stringliteral">"************"</span> << endl;
178 00174 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(gain == LOW_GAIN)
180 00176 cout << endl <<<span class="stringliteral">" *********** MODULE"</span> << mod << <span class="stringliteral">"****LOW_GAIN"</span> <<<span class="stringliteral">"************"</span> << endl;
183 00179 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> row = 0; row < N_ROWS_MOD; row ++)
185 00181 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> col = 0; col < N_COLUMNS_MOD; col ++)
187 00183 <span class="keywordflow">if</span>( <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r3">fMaxValues</a>[mod][row][col][0] != 0)
189 00185 cout << <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r3">fMaxValues</a>[mod][row][col][0] << <span class="stringliteral">"\t"</span>;
198 00194 <span class="keywordtype">void</span>
199 <a name="l00195"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#b0">00195</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#b0">AliHLTPHOSModuleMergerComponent::Reset</a>()
201 00197 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> mod = 0; mod < N_MODULES; mod ++)
203 00199 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> row = 0; row < N_ROWS_MOD; row ++)
205 00201 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> col = 0; col < N_COLUMNS_MOD; col ++)
207 00203 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> gain = 0; gain < N_GAINS; gain ++ )
210 00206 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r3">fMaxValues</a>[mod][row][col][gain] = 0;
216 00212 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0 ; i< ALTRO_MAX_SAMPLES; i++)
218 00214 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r2">fTmpChannelData</a>[i] = 0;
220 00216 } <span class="comment">// end Reset</span>
222 00218 <span class="keywordtype">void</span>
223 <a name="l00219"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#b1">00219</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#b1">AliHLTPHOSModuleMergerComponent::ResetDataPtr</a>()
225 00221 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0 ; i< ALTRO_MAX_SAMPLES; i++)
227 00223 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r2">fTmpChannelData</a>[i] = 0;
232 00228 <span class="keywordtype">void</span>
233 <a name="l00229"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a14">00229</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a14">AliHLTPHOSModuleMergerComponent::SetEquippmentId</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
235 00231 <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#r1">fEquippmentID</a> = id;
238 00234 <span class="keywordtype">int</span>
239 <a name="l00235"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a9">00235</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a9">AliHLTPHOSModuleMergerComponent::GetEquippmentId</a>()
241 00237 <span class="keywordflow">return</span> fEquippmentID;
245 00241 <a class="code" href="classAliHLTComponent.html">AliHLTComponent</a>*
246 <a name="l00242"></a><a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a15">00242</a> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html#a15">AliHLTPHOSModuleMergerComponent::Spawn</a>()
248 00244 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classAliHLTPHOSModuleMergerComponent.html">AliHLTPHOSModuleMergerComponent</a>;
252 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by
253 <a href="http://www.doxygen.org/index.html">
254 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>