]>
Commit | Line | Data |
---|---|---|
a9d14303 | 1 | // $Id$ |
6af4f584 | 2 | |
3 | //************************************************************************** | |
4 | //* This file is property of and copyright by the ALICE HLT Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* * | |
7 | //* Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> * | |
8 | //* for The ALICE HLT Project. * | |
9 | //* * | |
10 | //* Permission to use, copy, modify and distribute this software and its * | |
11 | //* documentation strictly for non-commercial purposes is hereby granted * | |
12 | //* without fee, provided that the above copyright notice appears in all * | |
13 | //* copies and that both the copyright notice and this permission notice * | |
14 | //* appear in the supporting documentation. The authors make no claims * | |
15 | //* about the suitability of this software for any purpose. It is * | |
16 | //* provided "as is" without express or implied warranty. * | |
17 | //************************************************************************** | |
18 | ||
19 | /** @file AliHLTTPCHWClusterTransformComponent.cxx | |
20 | @author Kalliopi Kanaki | |
21 | @date | |
22 | @brief | |
23 | */ | |
24 | ||
6af4f584 | 25 | #include "AliHLTTPCHWClusterTransformComponent.h" |
26 | #include "AliHLTTPCDefinitions.h" | |
27 | #include "AliHLTTPCTransform.h" | |
28 | #include "AliHLTTPCSpacePointData.h" | |
29 | #include "AliHLTTPCClusterDataFormat.h" | |
16e6f752 | 30 | #include "AliHLTCDHWrapper.h" |
e9530747 | 31 | #include "AliHLTTPCRawCluster.h" |
32 | #include "AliHLTTPCHWCFEmulator.h" | |
fd086f6c | 33 | #include "AliHLTTPCHWCFData.h" |
34 | #include "AliHLTErrorGuard.h" | |
96122515 | 35 | #include "AliTPCTransform.h" |
6af4f584 | 36 | |
491d6af5 | 37 | #include "AliCDBManager.h" |
38 | #include "AliCDBEntry.h" | |
dccee396 | 39 | #include "AliTPCcalibDB.h" |
491d6af5 | 40 | |
2b727eff | 41 | #include "TMath.h" |
7361746a | 42 | #include "TObjString.h" |
6af4f584 | 43 | #include <cstdlib> |
44 | #include <cerrno> | |
45 | #include <sys/time.h> | |
46 | ||
d5cf9283 | 47 | using namespace std; |
48 | ||
6af4f584 | 49 | ClassImp(AliHLTTPCHWClusterTransformComponent) //ROOT macro for the implementation of ROOT specific class methods |
50 | ||
84e36c27 | 51 | const char* AliHLTTPCHWClusterTransformComponent::fgkOCDBEntryHWTransform="HLT/ConfigTPC/TPCHWClusterTransform"; |
52 | ||
96122515 | 53 | AliHLTTPCClusterTransformation AliHLTTPCHWClusterTransformComponent::fgTransform; |
54 | Bool_t AliHLTTPCHWClusterTransformComponent::fgTimeInitialisedFromEvent = 0; | |
55 | ||
6af4f584 | 56 | AliHLTTPCHWClusterTransformComponent::AliHLTTPCHWClusterTransformComponent() |
a9d14303 | 57 | : |
84e36c27 | 58 | fDataId(kFALSE), |
e9530747 | 59 | fPublishRawClusters(kFALSE), |
fd086f6c | 60 | fpDecoder(NULL), |
a5dc9013 | 61 | fBenchmark("HWClusterTransform") |
6af4f584 | 62 | { |
63 | // see header file for class documentation | |
64 | // or | |
65 | // refer to README to build package | |
66 | // or | |
a9d14303 | 67 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt |
a5dc9013 | 68 | |
69 | fBenchmark.Reset(); | |
70 | fBenchmark.SetTimer(0,"total"); | |
6af4f584 | 71 | } |
72 | ||
fd086f6c | 73 | AliHLTTPCHWClusterTransformComponent::~AliHLTTPCHWClusterTransformComponent() |
74 | { | |
75 | // destructor | |
76 | if (!fpDecoder) delete fpDecoder; | |
77 | fpDecoder=NULL; | |
6af4f584 | 78 | } |
79 | ||
80 | const char* AliHLTTPCHWClusterTransformComponent::GetComponentID() { | |
81 | // see header file for class documentation | |
82 | ||
83 | return "TPCHWClusterTransform"; | |
84 | } | |
85 | ||
86 | void AliHLTTPCHWClusterTransformComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) { | |
87 | // see header file for class documentation | |
88 | ||
89 | list.clear(); | |
90 | list.push_back( AliHLTTPCDefinitions::fgkHWClustersDataType ); | |
91 | } | |
92 | ||
93 | AliHLTComponentDataType AliHLTTPCHWClusterTransformComponent::GetOutputDataType() { | |
94 | // see header file for class documentation | |
95 | ||
96 | return AliHLTTPCDefinitions::fgkClustersDataType; | |
97 | } | |
98 | ||
99 | int AliHLTTPCHWClusterTransformComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) { | |
100 | // see header file for class documentation | |
101 | ||
102 | tgtList.clear(); | |
7b86c66e | 103 | tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType| kAliHLTDataOriginTPC); |
104 | tgtList.push_back(AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo | kAliHLTDataOriginTPC ); | |
e9530747 | 105 | tgtList.push_back(AliHLTTPCDefinitions::fgkRawClustersDataType | kAliHLTDataOriginTPC ); |
6af4f584 | 106 | return tgtList.size(); |
107 | } | |
108 | ||
109 | void AliHLTTPCHWClusterTransformComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) { | |
110 | // see header file for class documentation | |
6af4f584 | 111 | constBase = 0; |
641530bb | 112 | inputMultiplier = 3.0; |
6af4f584 | 113 | } |
114 | ||
115 | AliHLTComponent* AliHLTTPCHWClusterTransformComponent::Spawn() { | |
116 | // see header file for class documentation | |
117 | ||
118 | return new AliHLTTPCHWClusterTransformComponent(); | |
119 | } | |
120 | ||
96122515 | 121 | int AliHLTTPCHWClusterTransformComponent::DoInit( int argc, const char** argv ) |
122 | { | |
123 | // see header file for class documentation | |
dccee396 | 124 | |
aa0d6ff8 | 125 | AliTPCcalibDB *calib=AliTPCcalibDB::Instance(); |
126 | if(!calib){ | |
127 | HLTError("AliTPCcalibDB does not exist"); | |
128 | return -ENOENT; | |
129 | } | |
130 | calib->SetRun(GetRunNo()); | |
131 | calib->UpdateRunInformations(GetRunNo()); | |
9eb867b1 | 132 | |
96122515 | 133 | if( !fgTransform.IsInitialised() ){ |
134 | int err = fgTransform.Init( GetBz(), GetTimeStamp() ); | |
135 | if( err!=0 ){ | |
136 | HLTError(Form("Cannot retrieve offline transform from AliTPCcalibDB, AliHLTTPCClusterTransformation returns %d",err)); | |
137 | return -ENOENT; | |
138 | } | |
b4c689c4 | 139 | } |
491d6af5 | 140 | |
141 | int iResult=0; | |
84e36c27 | 142 | iResult = ConfigureFromCDBTObjString(fgkOCDBEntryHWTransform); |
143 | ||
144 | if (iResult>=0 && argc>0) | |
145 | iResult=ConfigureFromArgumentString(argc, argv); | |
146 | ||
fd086f6c | 147 | if (iResult>=0) { |
148 | fpDecoder=new AliHLTTPCHWCFData; | |
149 | if (!fpDecoder) iResult=-ENOMEM; | |
150 | } | |
151 | ||
84e36c27 | 152 | return iResult; |
6af4f584 | 153 | } // end DoInit() |
154 | ||
155 | int AliHLTTPCHWClusterTransformComponent::DoDeinit() { | |
bd1ecd64 | 156 | // see header file for class documentation |
fd086f6c | 157 | if (!fpDecoder) delete fpDecoder; |
158 | fpDecoder=NULL; | |
96122515 | 159 | fgTransform.DeInit(); |
6af4f584 | 160 | return 0; |
161 | } | |
162 | ||
163 | int AliHLTTPCHWClusterTransformComponent::DoEvent(const AliHLTComponentEventData& evtData, | |
491d6af5 | 164 | const AliHLTComponentBlockData* blocks, |
165 | AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, | |
166 | AliHLTUInt32_t& size, | |
167 | vector<AliHLTComponentBlockData>& outputBlocks ){ | |
6af4f584 | 168 | // see header file for class documentation |
9eb867b1 | 169 | |
7b86c66e | 170 | UInt_t maxOutSize = size; |
171 | size = 0; | |
172 | int iResult = 0; | |
fd086f6c | 173 | if(!IsDataEvent()) return 0; |
174 | ||
175 | if (!fpDecoder) return -ENODEV; | |
96122515 | 176 | if( !fgTransform.IsInitialised() ){ |
177 | HLTError(" TPC Transformation is not initialised "); | |
178 | return -ENOENT; | |
179 | } | |
a5dc9013 | 180 | |
181 | fBenchmark.StartNewEvent(); | |
182 | fBenchmark.Start(0); | |
183 | ||
96122515 | 184 | // Initialise the transformation here once more for the case of off-line reprocessing |
185 | if( !fgTimeInitialisedFromEvent ){ | |
186 | Long_t currentTime = static_cast<AliHLTUInt32_t>(time(NULL)); | |
e412e5ed | 187 | Long_t eventTimeStamp = GetTimeStamp(); |
96122515 | 188 | if( TMath::Abs( fgTransform.GetCurrentTimeStamp() - eventTimeStamp )>60 && |
189 | TMath::Abs( currentTime - eventTimeStamp)>60*60*5 ){ | |
190 | int err = fgTransform.SetCurrentTimeStamp( eventTimeStamp ); | |
191 | if( err!=0 ){ | |
192 | HLTError(Form("Cannot set time stamp, AliHLTTPCClusterTransformation returns %d",err)); | |
193 | return -ENOENT; | |
194 | } | |
195 | } | |
196 | fgTimeInitialisedFromEvent = 1; | |
197 | } | |
198 | ||
199 | for( unsigned long ndx=0; ndx<evtData.fBlockCnt; ndx++ ){ | |
7b86c66e | 200 | |
201 | const AliHLTComponentBlockData *iter = blocks+ndx; | |
202 | ||
203 | fBenchmark.AddInput(iter->fSize); | |
204 | ||
205 | HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s", | |
206 | evtData.fEventID, evtData.fEventID, | |
207 | DataType2Text( iter->fDataType).c_str(), | |
208 | DataType2Text(AliHLTTPCDefinitions::fgkHWClustersDataType).c_str()); | |
209 | ||
210 | if(iter->fDataType == (AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo | kAliHLTDataOriginTPC) ){ | |
211 | // simply forward MC labels | |
212 | ||
213 | if( size+iter->fSize > maxOutSize ){ | |
214 | HLTWarning( "Output buffer (%db) is too small, required %db", maxOutSize, size+iter->fSize); | |
215 | iResult = -ENOSPC; | |
216 | break; | |
217 | } | |
dccee396 | 218 | |
7b86c66e | 219 | memcpy( outputPtr, iter->fPtr, iter->fSize ); |
61c1f30c | 220 | |
7b86c66e | 221 | AliHLTComponentBlockData bd; |
222 | FillBlockData( bd ); | |
223 | bd.fOffset = size; | |
224 | bd.fSize = iter->fSize; | |
225 | bd.fSpecification = iter->fSpecification; | |
226 | bd.fDataType = iter->fDataType; | |
227 | outputBlocks.push_back( bd ); | |
228 | fBenchmark.AddOutput(bd.fSize); | |
229 | size += bd.fSize; | |
230 | outputPtr += bd.fSize; | |
231 | continue; | |
232 | } | |
a5dc9013 | 233 | |
7b86c66e | 234 | if(iter->fDataType != (AliHLTTPCDefinitions::fgkHWClustersDataType | kAliHLTDataOriginTPC)) continue; |
235 | ||
236 | UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); | |
237 | UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(*iter); | |
238 | //UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(*iter); | |
239 | //UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(*iter); | |
fd086f6c | 240 | float padpitch=1.0; |
241 | if ((int)minPartition<AliHLTTPCTransform::GetNRowLow()) | |
242 | padpitch=AliHLTTPCTransform::GetPadPitchWidthLow(); | |
243 | else | |
244 | padpitch=AliHLTTPCTransform::GetPadPitchWidthUp(); | |
245 | float zwidth=AliHLTTPCTransform::GetZWidth(); | |
a5dc9013 | 246 | |
7b86c66e | 247 | fBenchmark.SetName(Form("HWClusterTransform slice %d patch %d",minSlice,minPartition)); |
a5dc9013 | 248 | |
7b86c66e | 249 | HLTDebug("minSlice: %d, minPartition: %d", minSlice, minPartition); |
6af4f584 | 250 | |
7b86c66e | 251 | AliHLTTPCClusterData* outPtr = (AliHLTTPCClusterData*)outputPtr; |
fd086f6c | 252 | outPtr->fSpacePointCnt=0; |
61c1f30c | 253 | |
7b86c66e | 254 | long maxPoints = ((long)maxOutSize-size-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData); |
fd086f6c | 255 | |
7b86c66e | 256 | AliHLTUInt32_t *buffer; |
16e6f752 | 257 | buffer = (AliHLTUInt32_t*)iter->fPtr; |
258 | AliHLTCDHWrapper cdh(iter->fPtr); | |
6af4f584 | 259 | |
6af4f584 | 260 | // skip the first 8 32-bit CDH words |
16e6f752 | 261 | buffer += cdh.GetHeaderSize()/sizeof(AliHLTUInt32_t); |
262 | UInt_t bufferSize32 = ((Int_t)iter->fSize - cdh.GetHeaderSize() )/sizeof(AliHLTUInt32_t); | |
6af4f584 | 263 | |
fd086f6c | 264 | if (fpDecoder->Init(reinterpret_cast<AliHLTUInt8_t*>(buffer), bufferSize32*sizeof(AliHLTUInt32_t))>=0 && fpDecoder->CheckVersion()>=0) { |
536e7d6d | 265 | for (AliHLTTPCHWCFData::iterator cl=fpDecoder->begin(); cl!=fpDecoder->end(); ++cl) { |
fd086f6c | 266 | if(outPtr->fSpacePointCnt>=maxPoints){ |
7b86c66e | 267 | HLTWarning("No more space to add clusters, exiting!"); |
268 | iResult = -ENOSPC; | |
269 | break; | |
270 | } | |
fd086f6c | 271 | |
272 | AliHLTTPCSpacePointData& c=outPtr->fSpacePoints[outPtr->fSpacePointCnt]; | |
536e7d6d | 273 | int padrow=cl.GetPadRow(); |
fd086f6c | 274 | if (padrow<0) { |
275 | // something wrong here, padrow is stored in the cluster header | |
276 | // word which has bit pattern 0x3 in bits bit 30 and 31 which was | |
277 | // not recognized | |
536e7d6d | 278 | ALIHLTERRORGUARD(1, "can not read cluster header word"); |
fd086f6c | 279 | break; |
280 | } | |
45d57965 | 281 | padrow+=AliHLTTPCTransform::GetFirstRow(minPartition); |
536e7d6d | 282 | AliHLTUInt32_t charge=cl.GetCharge(); |
fd086f6c | 283 | |
536e7d6d | 284 | float pad=cl.GetPad(); |
285 | float time=cl.GetTime(); | |
286 | float sigmaY2=cl.GetSigmaY2(); | |
287 | float sigmaZ2=cl.GetSigmaZ2(); | |
fd086f6c | 288 | sigmaY2*=padpitch*padpitch; |
fd086f6c | 289 | sigmaZ2*=zwidth*zwidth; |
290 | c.SetPadRow(padrow); | |
291 | c.SetCharge(charge); | |
292 | c.SetSigmaY2(sigmaY2); | |
293 | c.SetSigmaZ2(sigmaZ2); | |
536e7d6d | 294 | c.SetQMax(cl.GetQMax()); |
fd086f6c | 295 | |
7b86c66e | 296 | Float_t xyz[3]; |
96122515 | 297 | int err = fgTransform.Transform( minSlice, padrow, pad, time, xyz ); |
298 | if( err!=0 ){ | |
299 | HLTWarning(Form("Cannot transform the cluster, AliHLTTPCClusterTransformation returns error %d, %s",err, fgTransform.GetLastError())); | |
300 | continue; | |
301 | } | |
fd086f6c | 302 | c.SetX(xyz[0]); |
303 | c.SetY(xyz[1]); | |
304 | c.SetZ(xyz[2]); | |
305 | ||
7b86c66e | 306 | // set the cluster ID so that the cluster dump printout is the same for FCF and SCF |
fd086f6c | 307 | c.SetID( minSlice, minPartition, outPtr->fSpacePointCnt ); |
7b86c66e | 308 | |
fd086f6c | 309 | HLTDebug("Cluster number %d: %f, Y: %f, Z: %f, charge: %d \n", outPtr->fSpacePointCnt, cluster.fX, cluster.fY, cluster.fZ, (UInt_t)cluster.fCharge); |
7b86c66e | 310 | |
fd086f6c | 311 | outPtr->fSpacePointCnt++; |
312 | } // end of loop over clusters | |
313 | } | |
314 | HLTDebug("Number of found clusters: %d", outPtr->fSpacePointCnt); | |
6af4f584 | 315 | |
7b86c66e | 316 | UInt_t mysize = sizeof(AliHLTTPCClusterData) + sizeof(AliHLTTPCSpacePointData)*outPtr->fSpacePointCnt; |
6af4f584 | 317 | |
318 | AliHLTComponentBlockData bd; | |
319 | FillBlockData( bd ); | |
7b86c66e | 320 | bd.fOffset = size; |
6af4f584 | 321 | bd.fSize = mysize; |
7b86c66e | 322 | bd.fSpecification = iter->fSpecification; |
491d6af5 | 323 | if(fDataId==kFALSE) bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType; |
324 | else bd.fDataType = AliHLTTPCDefinitions::fgkAlterClustersDataType; | |
325 | ||
326 | //HLTDebug("datatype: %s", DataType2Text(bd.fDataType).c_str()); | |
327 | ||
6af4f584 | 328 | outputBlocks.push_back( bd ); |
329 | ||
7b86c66e | 330 | fBenchmark.AddOutput(bd.fSize); |
331 | size += mysize; | |
332 | outputPtr += mysize; | |
6af4f584 | 333 | |
e9530747 | 334 | if (fPublishRawClusters) { |
335 | ||
336 | long maxRawClusters = ((long)maxOutSize-size-sizeof(AliHLTTPCRawClusterData))/sizeof(AliHLTTPCRawCluster); | |
337 | ||
338 | if( maxRawClusters<=0 ) { | |
339 | HLTWarning("No more space to add raw clusters, exiting!"); | |
340 | iResult = -ENOSPC; | |
341 | } else { | |
342 | ||
343 | // copy raw cluster data from input | |
344 | ||
345 | AliHLTTPCRawClusterData* outputRaw= (AliHLTTPCRawClusterData*)(outputPtr); | |
346 | ||
347 | outputRaw->fVersion = 0; | |
348 | outputRaw->fCount = 0; | |
349 | ||
536e7d6d | 350 | // check if there are clusters available, if not the format might |
351 | // not even been decoded at that moment | |
352 | if (fpDecoder->GetNumberOfClusters()>0) { | |
353 | for (AliHLTTPCHWCFData::iterator cl=fpDecoder->begin(); cl!=fpDecoder->end(); ++cl) { | |
fd086f6c | 354 | if(outputRaw->fCount>=maxRawClusters){ |
355 | HLTWarning("No more space to add clusters, exiting!"); | |
356 | iResult = -ENOSPC; | |
e9530747 | 357 | break; |
358 | } | |
fd086f6c | 359 | AliHLTTPCRawCluster &c = outputRaw->fClusters[outputRaw->fCount]; |
536e7d6d | 360 | int padrow=cl.GetPadRow(); |
fd086f6c | 361 | if (padrow<0) { |
362 | // something wrong here, padrow is stored in the cluster header | |
363 | // word which has bit pattern 0x3 in bits bit 30 and 31 which was | |
364 | // not recognized | |
365 | break; | |
366 | } | |
45d57965 | 367 | padrow+=AliHLTTPCTransform::GetFirstRow(minPartition); |
536e7d6d | 368 | AliHLTUInt32_t charge= cl.GetCharge(); |
fd086f6c | 369 | |
536e7d6d | 370 | float pad =cl.GetPad(); |
371 | float time =cl.GetTime(); | |
372 | float sigmaP2=cl.GetSigmaY2(); | |
373 | float sigmaT2=cl.GetSigmaZ2(); | |
fd086f6c | 374 | c.SetPadRow(padrow); |
375 | c.SetCharge(charge); | |
376 | c.SetPad(pad); | |
377 | c.SetTime(time); | |
378 | c.SetSigmaY2(sigmaP2); | |
379 | c.SetSigmaZ2(sigmaT2); | |
536e7d6d | 380 | c.SetQMax(cl.GetQMax()); |
fd086f6c | 381 | |
382 | // store cluster and continue | |
383 | outputRaw->fCount++; | |
384 | } | |
536e7d6d | 385 | } |
fd086f6c | 386 | |
e9530747 | 387 | // fill into HLT output data |
388 | AliHLTComponentBlockData bdRawClusters; | |
389 | FillBlockData( bdRawClusters ); | |
390 | bdRawClusters.fOffset = size; | |
391 | bdRawClusters.fSize = sizeof(AliHLTTPCRawClusterData)+outputRaw->fCount*sizeof(AliHLTTPCRawCluster); | |
392 | bdRawClusters.fSpecification = iter->fSpecification; | |
393 | bdRawClusters.fDataType = AliHLTTPCDefinitions::fgkRawClustersDataType | kAliHLTDataOriginTPC; | |
394 | outputBlocks.push_back( bdRawClusters ); | |
395 | fBenchmark.AddOutput(bdRawClusters.fSize); | |
396 | size += bdRawClusters.fSize; | |
397 | outputPtr += bdRawClusters.fSize; | |
398 | } | |
399 | } | |
400 | } // end of loop over data blocks | |
a5dc9013 | 401 | |
402 | fBenchmark.Stop(0); | |
403 | HLTInfo(fBenchmark.GetStatistics()); | |
e9530747 | 404 | |
7b86c66e | 405 | return iResult; |
6af4f584 | 406 | } // end DoEvent() |
84e36c27 | 407 | |
408 | int AliHLTTPCHWClusterTransformComponent::ScanConfigurationArgument(int argc, const char** argv){ | |
409 | ||
410 | // see header file for class documentation | |
411 | ||
412 | if (argc<=0) return 0; | |
413 | int i=0; | |
414 | TString argument=argv[i]; | |
415 | ||
416 | if (argument.CompareTo("-solenoidBz")==0){ | |
417 | if (++i>=argc) return -EPROTO; | |
418 | argument=argv[i]; | |
419 | AliTPCcalibDB* calib=AliTPCcalibDB::Instance(); | |
420 | if(!calib){ | |
66a3e955 | 421 | HLTError("CalibDB instance cannot be created."); |
422 | return 0; | |
84e36c27 | 423 | } |
424 | Float_t magneticField = argument.Atof(); | |
425 | calib->SetExBField(magneticField); | |
426 | HLTInfo("SolenoidBz is set to %f in the calibDB",magneticField); | |
427 | return 2; | |
428 | } | |
429 | ||
430 | if (argument.CompareTo("-change-dataId")==0){ | |
431 | HLTDebug("Change data ID received."); | |
432 | fDataId = kTRUE; | |
433 | return 1; | |
434 | } | |
58df4cfa | 435 | |
436 | if (argument.CompareTo("-charge-threshold")==0) { | |
437 | if (++i>=argc) return -EPROTO; | |
5ab9dcd9 | 438 | argument=argv[i]; |
439 | HLTInfo("The argument -charge-threshold is deprecated."); | |
58df4cfa | 440 | return 2; |
441 | } | |
84e36c27 | 442 | |
e9530747 | 443 | if (argument.CompareTo("-publish-raw")==0) { |
444 | fPublishRawClusters=kTRUE; | |
445 | return 1; | |
446 | } | |
447 | ||
84e36c27 | 448 | // unknown argument |
449 | return -EINVAL; | |
450 | } | |
451 | ||
84e36c27 | 452 | int AliHLTTPCHWClusterTransformComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/) { |
491d6af5 | 453 | // see header file for class documentation |
84e36c27 | 454 | return ConfigureFromCDBTObjString(fgkOCDBEntryHWTransform); |
491d6af5 | 455 | } |
6af4f584 | 456 | |
457 | void AliHLTTPCHWClusterTransformComponent::PrintDebug(AliHLTUInt32_t *buffer, Int_t size){ | |
458 | // see header file for class documentation | |
459 | ||
460 | HLTInfo("The size is: %d", size); | |
461 | for(Int_t n32bit=0; n32bit<size; n32bit++){ | |
462 | ||
463 | AliHLTUInt8_t *wordPtr = reinterpret_cast<AliHLTUInt8_t*>(&buffer[n32bit]); | |
464 | // cout << "word ptr initialized"<<endl; | |
465 | for(Int_t w=3;w>=0;w--){ | |
466 | // cout <<"accessing word"<<endl; | |
467 | AliHLTUInt8_t word = wordPtr[w]; | |
468 | // cout<< "word was accessed"<<endl; | |
469 | for(int n=7; n>=0; n--){ | |
470 | //print the byte values | |
471 | if((((word>>n)<<7)&0x80) != 0){ | |
472 | printf("1"); | |
473 | } | |
474 | else{ | |
475 | printf("0"); | |
476 | } | |
477 | } | |
478 | printf(" "); | |
479 | } | |
480 | printf("\n"); | |
481 | } | |
482 | } // end of PrintDebug | |
1c29fee7 | 483 | |
fe1a26cb | 484 | void AliHLTTPCHWClusterTransformComponent::GetOCDBObjectDescription( TMap* const targetMap) |
485 | { | |
486 | // Get a list of OCDB object description needed for the particular component | |
1c29fee7 | 487 | if (!targetMap) return; |
fe1a26cb | 488 | |
489 | // OCDB entries for component arguments | |
490 | ||
1c29fee7 | 491 | targetMap->Add(new TObjString("HLT/ConfigTPC/TPCHWClusterTransform"), new TObjString("component argument for the charge threshold")); |
fe1a26cb | 492 | |
493 | // OCDB entries to be fetched by the TAXI (access via the AliTPCcalibDB class) | |
494 | targetMap->Add(new TObjString("TPC/Calib/Parameters"), new TObjString("unknown content")); | |
495 | targetMap->Add(new TObjString("TPC/Calib/TimeDrift"), new TObjString("drift velocity calibration")); | |
f240af21 | 496 | targetMap->Add(new TObjString("TPC/Calib/TimeGain"), new TObjString("time gain calibration")); |
fe1a26cb | 497 | targetMap->Add(new TObjString("TPC/Calib/Temperature"), new TObjString("temperature map")); |
498 | targetMap->Add(new TObjString("TPC/Calib/PadGainFactor"), new TObjString("gain factor pad by pad")); | |
499 | targetMap->Add(new TObjString("TPC/Calib/ClusterParam"), new TObjString("cluster parameters")); | |
f240af21 | 500 | targetMap->Add(new TObjString("TPC/Calib/Correction"), new TObjString("coreection")); |
501 | targetMap->Add(new TObjString("TPC/Calib/RecoParam"), new TObjString("reconstruction parameters")); | |
502 | ||
fe1a26cb | 503 | // OCDB entries needed to be fetched by the Pendolino |
504 | targetMap->Add(new TObjString("TPC/Calib/AltroConfig"), new TObjString("contains the altro config, e.g. info about the L0 trigger timing")); | |
505 | targetMap->Add(new TObjString("GRP/CTP/CTPtiming"), new TObjString("content used in the cluster coordinate transformation in relation to the L0 trigger timing")); | |
506 | ||
507 | // OCDB entries necessary for replaying data on the HLT cluster | |
508 | targetMap->Add(new TObjString("GRP/GRP/Data"), new TObjString("contains magnetic field info")); | |
509 | ||
510 | // OCDB entries needed to suppress fatals/errors/warnings during reconstruction | |
f240af21 | 511 | targetMap->Add(new TObjString("TPC/Calib/Distortion"), new TObjString("distortion map")); |
512 | targetMap->Add(new TObjString("TPC/Calib/GainFactorDedx"), new TObjString("gain factor dedx")); | |
fe1a26cb | 513 | targetMap->Add(new TObjString("TPC/Calib/PadTime0"), new TObjString("time0 offset pad by pad")); |
514 | targetMap->Add(new TObjString("TPC/Calib/PadNoise"), new TObjString("pad noise values")); | |
515 | targetMap->Add(new TObjString("TPC/Calib/Pedestals"), new TObjString("pedestal info")); | |
516 | targetMap->Add(new TObjString("TPC/Calib/Pulser"), new TObjString("pulser info")); | |
517 | targetMap->Add(new TObjString("TPC/Calib/CE"), new TObjString("CE laser calibration result")); | |
518 | targetMap->Add(new TObjString("TPC/Calib/Raw"), new TObjString("unknown content")); | |
519 | targetMap->Add(new TObjString("TPC/Calib/QA"), new TObjString("not important")); | |
520 | targetMap->Add(new TObjString("TPC/Calib/Mapping"), new TObjString("unknown content")); | |
521 | targetMap->Add(new TObjString("TPC/Calib/Goofie"), new TObjString("Goofie values, not used at the moment (05.03.2010)")); | |
522 | targetMap->Add(new TObjString("TPC/Calib/HighVoltage"), new TObjString("high voltage values, not used")); | |
523 | targetMap->Add(new TObjString("TPC/Calib/Ref"), new TObjString("unknown content")); | |
1c29fee7 | 524 | } |