]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/html/AliHLTPHOSDDLDecoderComponent_8cxx-source.html
New component for writing calibration data to fxs (Oystein)
[u/mrichter/AliRoot.git] / HLT / PHOS / html / AliHLTPHOSDDLDecoderComponent_8cxx-source.html
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: AliHLTPHOSDDLDecoderComponent.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&nbsp;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&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <h1>AliHLTPHOSDDLDecoderComponent.cxx</h1><a href="AliHLTPHOSDDLDecoderComponent_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"> * 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 &lt;perthi@fys.uio.no&gt; 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>
25 00018 
26 00019 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSDDLDecoderComponent_8h.html">AliHLTPHOSDDLDecoderComponent.h</a>"</span>
27 00020 <span class="preprocessor">#include &lt;iostream&gt;</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 &lt;cstdlib&gt;</span>
32 00025 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRcuChannelDataStruct_8h.html">AliHLTPHOSRcuChannelDataStruct.h</a>"</span>
33 00026 
34 <a name="l00027"></a><a class="code" href="AliHLTPHOSDDLDecoderComponent_8cxx.html#a0">00027</a>  <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html">AliHLTPHOSDDLDecoderComponent</a>  gAliHLTPHOSDDLDecoderComponent;
35 00028 
36 <a name="l00029"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v1">00029</a> <span class="keyword">const</span> <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v1">AliHLTPHOSDDLDecoderComponent::fgkInputDataTypes</a>[]={kAliHLTVoidDataType,{0,<span class="stringliteral">""</span>,<span class="stringliteral">""</span>}}; <span class="comment">//'zero' terminated array</span>
37 <a name="l00030"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v0">00030</a> <span class="keywordtype">int</span>   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v0">AliHLTPHOSDDLDecoderComponent::fgEventCount</a> = 0; 
38 00031 
39 00032 
40 <a name="l00033"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a0">00033</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a0">AliHLTPHOSDDLDecoderComponent::AliHLTPHOSDDLDecoderComponent</a>():<a class="code" href="classAliHLTProcessor.html">AliHLTProcessor</a>(), fEquippmentID(0), fRcuX(0), 
41 00034 fRcuZ(0),fRcuZOffset(0), fRcuXOffset(0),  fModuleID(0), fSendChannelData(kFALSE), fPHOSRawStream(0), fRawMemoryReader(0), fOutPtr(0)
42 00035 {
43 00036 
44 00037 } 
45 00038 
46 <a name="l00039"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a1">00039</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a1">AliHLTPHOSDDLDecoderComponent::~AliHLTPHOSDDLDecoderComponent</a>()
47 00040 {
48 00041   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r11">fRawMemoryReader</a> != 0)
49 00042     {
50 00043       <span class="keyword">delete</span> fRawMemoryReader;
51 00044     }
52 00045     <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a> != 0)
53 00046     {
54 00047       <span class="keyword">delete</span> fPHOSRawStream;
55 00048     }
56 00049 }
57 00050 
58 00051 
59 <a name="l00052"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a2">00052</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a0">AliHLTPHOSDDLDecoderComponent::AliHLTPHOSDDLDecoderComponent</a>(<span class="keyword">const</span> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html">AliHLTPHOSDDLDecoderComponent</a> &amp; ) : <a class="code" href="classAliHLTProcessor.html">AliHLTProcessor</a>(), 
60 00053 fEquippmentID(0), fRcuX(0), fRcuZ(0),fRcuZOffset(0), fRcuXOffset(0),  fModuleID(0),  fSendChannelData(kFALSE), fPHOSRawStream(0), fRawMemoryReader(0), fOutPtr(0)
61 00054 {
62 00055 }
63 00056 
64 00057 
65 00058 <span class="keywordtype">int</span> 
66 <a name="l00059"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a5">00059</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a5">AliHLTPHOSDDLDecoderComponent::Deinit</a>()
67 00060 {
68 00061   cout &lt;&lt;  <span class="stringliteral">"Deinit"</span> &lt;&lt; endl;
69 00062   <span class="keywordflow">return</span> 0;
70 00063 }
71 00064 
72 00065 
73 00066 <span class="keywordtype">int</span> 
74 <a name="l00067"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a6">00067</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a6">AliHLTPHOSDDLDecoderComponent::DoDeinit</a>()
75 00068 {
76 00069   cout &lt;&lt; <span class="stringliteral">"DoDeinit"</span> &lt;&lt; endl;
77 00070   <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">",AliHLTPHOSRawAnalyzerComponen DoDeinit"</span>);
78 00071 
79 00072   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r11">fRawMemoryReader</a> !=0)
80 00073     {
81 00074       <span class="keyword">delete</span> fRawMemoryReader;
82 00075     }
83 00076     
84 00077   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a> != 0)
85 00078     {
86 00079       <span class="keyword">delete</span> fPHOSRawStream;
87 00080     }
88 00081   <span class="keywordflow">return</span> 0;
89 00082 
90 00083 }
91 00084 
92 00085 
93 00086 <span class="keyword">const</span> <span class="keywordtype">char</span>* 
94 <a name="l00087"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a10">00087</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a10">AliHLTPHOSDDLDecoderComponent::GetComponentID</a>()
95 00088 {
96 00089   <span class="keywordflow">return</span> <span class="stringliteral">"PhosDDLDecoder"</span>;
97 00090 }
98 00091 
99 00092 
100 00093 
101 00094 <span class="keywordtype">void</span>
102 <a name="l00095"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a11">00095</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a11">AliHLTPHOSDDLDecoderComponent::GetInputDataTypes</a>(vector&lt;AliHLTComponentDataType&gt;&amp; list)
103 00096 {
104 00097   <span class="keyword">const</span> <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a>* pType=fgkInputDataTypes;
105 00098   <span class="keywordflow">while</span> (pType-&gt;<a class="code" href="structAliHLTComponentDataType.html#o1">fID</a>!=0) {
106 00099     list.push_back(*pType);
107 00100     pType++;
108 00101   }
109 00102 }
110 00103 
111 00104 <a class="code" href="structAliHLTComponentDataType.html">AliHLTComponentDataType</a> 
112 <a name="l00105"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a12">00105</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a12">AliHLTPHOSDDLDecoderComponent::GetOutputDataType</a>()
113 00106 {
114 00107   <span class="keywordflow">return</span> AliHLTPHOSDefinitions::gkCellEnergyDataType;
115 00108 }
116 00109 
117 00110 <span class="keywordtype">void</span>
118 <a name="l00111"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a13">00111</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a13">AliHLTPHOSDDLDecoderComponent::GetOutputDataSize</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>&amp; constBase, <span class="keywordtype">double</span>&amp; inputMultiplier )
119 00112 
120 00113 {
121 00114   constBase = 30;
122 00115   inputMultiplier = 1;
123 00116 }
124 00117 
125 00118 
126 00119   
127 00120 <span class="keywordtype">int</span>
128 <a name="l00121"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a15">00121</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a15">AliHLTPHOSDDLDecoderComponent::DoEvent</a>( <span class="keyword">const</span> <a class="code" href="structAliHLTComponentEventData.html">AliHLTComponentEventData</a>&amp; evtData, <span class="keyword">const</span> <a class="code" href="structAliHLTComponentBlockData.html">AliHLTComponentBlockData</a>* blocks, 
129 00122                                               <a class="code" href="structAliHLTComponentTriggerData.html">AliHLTComponentTriggerData</a>&amp; trigData, AliHLTUInt8_t* outputPtr, 
130 00123                                               AliHLTUInt32_t&amp; size, vector&lt;AliHLTComponentBlockData&gt;&amp; outputBlocks )
131 00124 {
132 00125   <a class="code" href="AliHLTDataTypes_8h.html#a4">AliHLTUInt8_t</a> tmpMod    = 0;
133 00126   <a class="code" href="AliHLTDataTypes_8h.html#a4">AliHLTUInt8_t</a> tmpZ      = 0;
134 00127   <a class="code" href="AliHLTDataTypes_8h.html#a4">AliHLTUInt8_t</a> tmpX      = 0;
135 00128   <a class="code" href="AliHLTDataTypes_8h.html#a4">AliHLTUInt8_t</a> tmpGain   = 0;
136 00129   Int_t sampleCnt         = 0;
137 00130   Int_t processedChannels = 0;
138 00131   UInt_t offset           = 0; 
139 00132   UInt_t mysize           = 0;
140 00133   UInt_t tSize            = 0;
141 00134   Int_t tmpChannelCnt     = 0;
142 00135   Int_t tmpStartIndex     = 0;
143 00136   <a class="code" href="AliHLTDataTypes_8h.html#a4">AliHLTUInt8_t</a>* outBPtr;
144 00137   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> first;
145 00138   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> last;
146 00139   outBPtr = outputPtr;
147 00140   <span class="keyword">const</span> <a class="code" href="structAliHLTComponentBlockData.html">AliHLTComponentBlockData</a>* iter = NULL; 
148 00141   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ndx;
149 00142 
150 00143   <span class="keywordflow">for</span>( ndx = 0; ndx &lt; evtData.<a class="code" href="structAliHLTComponentEventData.html#o4">fBlockCnt</a>; ndx++ )
151 00144     {
152 00145       iter = blocks+ndx;
153 00146       mysize = 0;
154 00147       tmpChannelCnt = 0;
155 00148       offset = tSize;
156 00149 
157 00150       <span class="keywordflow">if</span> ( iter-&gt;<a class="code" href="structAliHLTComponentBlockData.html#o5">fDataType</a> != AliHLTPHOSDefinitions::gkDDLPackedRawDataType )
158 00151         {
159 00152           <span class="keywordflow">continue</span>;
160 00153         }
161 00154 
162 00155       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r11">fRawMemoryReader</a>-&gt;SetMemory( reinterpret_cast&lt;UChar_t*&gt;( iter-&gt;<a class="code" href="structAliHLTComponentBlockData.html#o3">fPtr</a> ), iter-&gt;<a class="code" href="structAliHLTComponentBlockData.html#o4">fSize</a> );
163 00156       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a> =  (<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html">AliHLTPHOSRcuChannelDataStruct</a>*)outBPtr;
164 00157       mysize += <span class="keyword">sizeof</span>(<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html">AliHLTPHOSRcuChannelDataStruct</a>);
165 00158 
166 00159       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o2">fRcuX</a> = fRcuX;
167 00160       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o3">fRcuZ</a> = fRcuZ;
168 00161       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o1">fModuleID</a> = fModuleID;
169 00162 
170 00163       <span class="keywordflow">while</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;Next())
171 00164         {
172 00165           
173 00166           <span class="keywordflow">if</span> (<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;IsNewHWAddress())
174 00167             {
175 00168               sampleCnt = 0;
176 00169               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidChannelDataStruct.html#o0">fZ</a> = (AliHLTUInt8_t)<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;GetColumn() - fRcuZOffset;
177 00170               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidChannelDataStruct.html#o1">fX</a> = (AliHLTUInt8_t)<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;GetRow() - fRcuXOffset;
178 00171               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidChannelDataStruct.html#o2">fGain</a> = <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;IsLowGain();
179 00172               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o4">fValidData</a>[tmpChannelCnt].<a class="code" href="structAliHLTPHOSValidChannelDataStruct.html#o3">fNSamples</a> = 0;
180 00173               tmpChannelCnt++;
181 00174             }
182 00175           <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o4">fValidData</a>[tmpChannelCnt-1].<a class="code" href="structAliHLTPHOSValidChannelDataStruct.html#o3">fNSamples</a> ++;
183 00176           <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o4">fValidData</a>[tmpChannelCnt-1].<a class="code" href="structAliHLTPHOSValidChannelDataStruct.html#o4">fChannelData</a>[sampleCnt] = <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;GetSignal();
184 00177           sampleCnt ++; 
185 00178         }
186 00179 
187 00180       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r12">fOutPtr</a>-&gt;<a class="code" href="structAliHLTPHOSRcuChannelDataStruct.html#o0">fNValidChannels</a> = tmpChannelCnt-1;;
188 00181  
189 00182       <span class="keywordtype">int</span> tmpSampleCnt=0;
190 00183       <a class="code" href="structAliHLTComponentBlockData.html">AliHLTComponentBlockData</a> bd;
191 00184       <a class="code" href="classAliHLTComponent.html#b0">FillBlockData</a>( bd );
192 00185       bd.<a class="code" href="structAliHLTComponentBlockData.html#o2">fOffset</a> = offset;
193 00186       bd.<a class="code" href="structAliHLTComponentBlockData.html#o4">fSize</a> = mysize;
194 00187       bd.<a class="code" href="structAliHLTComponentBlockData.html#o5">fDataType</a> = AliHLTPHOSDefinitions::gkCellChannelDataDataType;
195 00188       bd.<a class="code" href="structAliHLTComponentBlockData.html#o6">fSpecification</a> = 0xeFFFFFFF;
196 00189       outputBlocks.push_back( bd);
197 00190       tSize += mysize;
198 00191       outBPtr += mysize;
199 00192     }
200 00193 
201 00194   
202 00195   <span class="keywordflow">if</span>( tSize &gt; size )
203 00196     {
204 00197       cout &lt;&lt;<span class="stringliteral">"kHLTLogFatal, HLT::AliHLTPHOSDDLDecoderComponent::DoEvent Too much data Data written over allowed buffer. Amount written:"</span> &lt;&lt; tSize &lt;&lt; <span class="stringliteral">" allowed"</span> &lt;&lt; size &lt;&lt; endl;
205 00198       <a class="code" href="classAliHLTLogging.html#a7">Logging</a>( <a class="code" href="AliHLTDataTypes_8h.html#a29a24">kHLTLogFatal</a>, <span class="stringliteral">"HLT::AliHLTPHOSDDLDecoderComponent::DoEvent"</span>, <span class="stringliteral">"Too much data"</span>, <span class="stringliteral">"Data written over allowed buffer. Amount written: %lu, allowed amount: %lu."</span>,  tSize, size );
206 00199       <span class="keywordflow">return</span> EMSGSIZE;
207 00200     }
208 00201 
209 00202   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v0">fgEventCount</a>++; 
210 00203   
211 00204   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r7">fPrintInfo</a> == kTRUE)
212 00205     {
213 00206       <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v0">fgEventCount</a>%<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r9">fPrintInfoFrequncy</a> == 0)
214 00207         {
215 00208           cout &lt;&lt;<span class="stringliteral">"Analyzing event "</span> &lt;&lt;  <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#v0">fgEventCount</a>  &lt;&lt; <span class="stringliteral">"for Equippment "</span> &lt;&lt; <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a> &lt;&lt; endl; 
216 00209         }  
217 00210     }
218 00211   size = tSize;
219 00212   <span class="keywordflow">return</span> 0;
220 00213 }<span class="comment">//end DoEvent</span>
221 00214 
222 00215 
223 00216 <span class="keywordtype">int</span>
224 <a name="l00217"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a4">00217</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a4">AliHLTPHOSDDLDecoderComponent::DoInit</a>( <span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span>** argv )
225 00218 {
226 00219   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r6">fSendChannelData</a> = kFALSE;
227 00220   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r7">fPrintInfo</a> = kFALSE;
228 00221   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r11">fRawMemoryReader</a> = <span class="keyword">new</span> AliRawReaderMemory();
229 00222   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a> = <span class="keyword">new</span>  AliCaloRawStream(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r11">fRawMemoryReader</a>,<span class="stringliteral">"PHOS"</span>);
230 00223   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r10">fPHOSRawStream</a>-&gt;SetOldRCUFormat(kFALSE);
231 00224   <span class="keywordtype">int</span> iResult=0;
232 00225   TString argument=<span class="stringliteral">""</span>;
233 00226   Bool_t isSetEquippmentID = kFALSE;
234 00227 
235 00228   <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i&lt;argc &amp;&amp; iResult&gt;=0; i++) 
236 00229     {
237 00230       argument=argv[i];
238 00231       
239 00232       <span class="keywordflow">if</span> (argument.IsNull()) 
240 00233         {
241 00234           <span class="keywordflow">continue</span>;
242 00235         }
243 00236                          
244 00237     <span class="keywordflow">if</span> (argument.CompareTo(<span class="stringliteral">"-equipmentID"</span>) == 0) 
245 00238         {
246 00239           cout &lt;&lt; <span class="stringliteral">"AliHLTPHOSDDLDecoderComponent:DoInit  argument = -equipmentID   "</span>  &lt;&lt;endl;  
247 00240           <span class="keywordflow">if</span>(i+1 &lt;= argc)
248 00241             {
249 00242               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a> = atoi(argv[i+1]);
250 00243               cout &lt;&lt; <span class="stringliteral">"AliHLTPHOSDDLDecoderComponent:DoInit  setting equippment ID to  "</span> &lt;&lt; <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a> &lt;&lt;endl;
251 00244               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r11">fRawMemoryReader</a>-&gt;SetEquipmentID(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a>); 
252 00245               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a7">SetEquippmentID</a>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a>);
253 00246               <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a9">SetCoordinates</a>(<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a>);
254 00247               isSetEquippmentID = kTRUE;
255 00248             }
256 00249           <span class="keywordflow">else</span>
257 00250             {
258 00251                iResult= -1;
259 00252                <a class="code" href="classAliHLTLogging.html#a7">Logging</a>( <a class="code" href="AliHLTDataTypes_8h.html#a29a24">kHLTLogFatal</a>, <span class="stringliteral">"HLT::AliHLTPHOSRcuHistogramProducerComponent::DoInt( int argc, const char** argv )"</span>, <span class="stringliteral">"Missing argument"</span>,
260 00253                         <span class="stringliteral">"The argument -equippmentID expects a number"</span>);
261 00254                <span class="keywordflow">return</span>  iResult;   
262 00255             }
263 00256         }
264 00257       
265 00258     
266 00259     <span class="keywordflow">if</span> (argument.CompareTo(<span class="stringliteral">"-datatype"</span>) == 0) 
267 00260       {
268 00261         <span class="keywordflow">if</span>(i+1 &lt;= argc)
269 00262           {
270 00263             <span class="comment">//      i++;</span>
271 00264             argument=argv[i+1];
272 00265             <span class="keywordflow">if</span>(argument.CompareTo(<span class="stringliteral">"channeldata"</span>) == 0)
273 00266               {
274 00267                 cout &lt;&lt; <span class="stringliteral">"AliHLTPHOSDDLDecoderComponent::DoIni  setting sendChannelData = kTRUE "</span>&lt;&lt; endl; 
275 00268                 <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r6">fSendChannelData</a> = kTRUE;
276 00269               }
277 00270           }     
278 00271       }
279 00272     
280 00273 
281 00274     <span class="keywordflow">if</span> (argument.CompareTo(<span class="stringliteral">"-printinfo"</span>) == 0) 
282 00275       {
283 00276         <span class="keywordflow">if</span>(i+1 &lt;= argc)
284 00277           {
285 00278             argument=argv[i+1];
286 00279             <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r9">fPrintInfoFrequncy</a> = atoi(argv[i+1]);
287 00280             <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r7">fPrintInfo</a> = kTRUE;
288 00281             cout &lt;&lt; <span class="stringliteral">"AliHLTPHOSDDLDecoderComponent::DoIni  setting printinfo = kTRUE, with update frequency every  "</span>&lt;&lt; <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r9">fPrintInfoFrequncy</a> &lt;&lt; <span class="stringliteral">"th event"</span> &lt;&lt;endl; 
289 00282           }
290 00283         <span class="keywordflow">else</span>
291 00284           {
292 00285             cout &lt;&lt; <span class="stringliteral">"WARNING: asking for event info, but no update frequency is specified, otipn is ignored"</span> &lt;&lt; endl;
293 00286           }
294 00287         <span class="comment">//     }        </span>
295 00288       }
296 00289  
297 00290     }
298 00291 
299 00292 
300 00293   <span class="keywordflow">if</span>(isSetEquippmentID == kFALSE)
301 00294     {
302 00295       <a class="code" href="classAliHLTLogging.html#a7">Logging</a>( <a class="code" href="AliHLTDataTypes_8h.html#a29a24">kHLTLogFatal</a>, <span class="stringliteral">"HLT::AliHLTPHOSRcuHistogramProducerComponent::DoInt( int argc, const char** argv )"</span>, <span class="stringliteral">"Missing argument"</span>,
303 00296                <span class="stringliteral">"The argument equippmentID is not set: set it with a component argumet like this: -equippmentID  &lt;number&gt;"</span>);
304 00297       iResult = -2; 
305 00298     }
306 00299 
307 00300 
308 00301   <span class="keywordflow">return</span> 0;
309 00302 }
310 00303 
311 00304 
312 00305 
313 00306 <span class="keywordtype">void</span> 
314 <a name="l00307"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a7">00307</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a7">AliHLTPHOSDDLDecoderComponent::SetEquippmentID</a>(AliHLTUInt16_t <span class="keywordtype">id</span>)
315 00308 {
316 00309   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a> = id;
317 00310 }
318 00311 
319 00312 
320 00313 <a class="code" href="AliHLTDataTypes_8h.html#a5">AliHLTUInt16_t</a>
321 <a name="l00314"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a8">00314</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a8">AliHLTPHOSDDLDecoderComponent::GetEquippmentID</a>()
322 00315 {
323 00316   <span class="keywordflow">return</span>  fEquippmentID;
324 00317 }
325 00318 
326 00319 
327 00320 <span class="keywordtype">void</span> 
328 <a name="l00321"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a9">00321</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a9">AliHLTPHOSDDLDecoderComponent::SetCoordinates</a>(AliHLTUInt16_t equippmentID)
329 00322 {
330 00323   <span class="keywordtype">int</span> rcuIndex =  (<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a> - 1792)%N_RCUS_PER_MODULE;
331 00324   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r5">fModuleID</a> = (<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a>  -1792 -rcuIndex)/N_RCUS_PER_MODULE;
332 00325   
333 00326   <span class="keywordflow">if</span>(rcuIndex == 0)
334 00327     {
335 00328       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r1">fRcuX</a> = 0; 
336 00329       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r2">fRcuZ</a> = 0;
337 00330     }
338 00331 
339 00332   <span class="keywordflow">if</span>(rcuIndex == 1)
340 00333     {
341 00334       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r1">fRcuX</a> = 0; 
342 00335       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r2">fRcuZ</a> = 1;
343 00336     }
344 00337  
345 00338   <span class="keywordflow">if</span>(rcuIndex == 2)
346 00339     {
347 00340       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r1">fRcuX</a> = 1; 
348 00341       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r2">fRcuZ</a> = 0;
349 00342     }
350 00343 
351 00344   <span class="keywordflow">if</span>(rcuIndex == 3)
352 00345     {
353 00346       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r1">fRcuX</a> = 1; 
354 00347       <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r2">fRcuZ</a> = 1;
355 00348     }
356 00349 
357 00350 
358 00351 
359 00352   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r3">fRcuZOffset</a> =  <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a13">N_ZROWS_RCU</a>*fRcuZ;
360 00353   <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r4">fRcuXOffset</a> =  <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a14">N_XCOLUMNS_RCU</a>*fRcuX;
361 00354 
362 00355   cout &lt;&lt;<span class="stringliteral">"********InitInfo************"</span>&lt;&lt; endl;
363 00356   cout &lt;&lt;<span class="stringliteral">"AliHLTPHOSDDLDecoderComponent::SetCoordinate"</span>&lt;&lt; endl;
364 00357   cout &lt;&lt;<span class="stringliteral">"Equpippment ID =\t"</span>&lt;&lt; <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r0">fEquippmentID</a> &lt;&lt;endl;
365 00358   cout &lt;&lt;<span class="stringliteral">"Module ID =\t"</span>&lt;&lt;  (int)<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r5">fModuleID</a>&lt;&lt;endl;
366 00359   cout &lt;&lt;<span class="stringliteral">"RCUX =\t\t"</span> &lt;&lt; (int)fRcuX &lt;&lt; endl;
367 00360   cout &lt;&lt;<span class="stringliteral">"RCUZ =\t\t"</span> &lt;&lt; (int)fRcuZ &lt;&lt; endl;
368 00361   cout &lt;&lt;<span class="stringliteral">"RcuZOffset = \t"</span> &lt;&lt;  (int)<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r3">fRcuZOffset</a> &lt;&lt; endl;
369 00362   cout &lt;&lt;<span class="stringliteral">"RcuXOffset = \t"</span> &lt;&lt;  (int)<a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#r4">fRcuXOffset</a> &lt;&lt; endl &lt;&lt; endl;
370 00363 }
371 00364 
372 00365 <a class="code" href="classAliHLTComponent.html">AliHLTComponent</a>*
373 <a name="l00366"></a><a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a14">00366</a> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html#a14">AliHLTPHOSDDLDecoderComponent::Spawn</a>()
374 00367 {
375 00368   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classAliHLTPHOSDDLDecoderComponent.html">AliHLTPHOSDDLDecoderComponent</a>;
376 00369 }
377 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by&nbsp;
378 <a href="http://www.doxygen.org/index.html">
379 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
380 </body>
381 </html>