Line data Source code
1 : // @(#) $Id$
2 :
3 : #ifndef ALIHLTDATATYPES_H
4 : #define ALIHLTDATATYPES_H
5 : /* This file is property of and copyright by the ALICE HLT Project *
6 : * ALICE Experiment at CERN, All rights reserved. *
7 : * See cxx source for full Copyright notice */
8 :
9 : /** @file AliHLTDataTypes.h
10 : @author Matthias Richter, Timm Steinbeck, Jochen Thaeder
11 : @date
12 : @brief Data type declaration for the HLT module.
13 : */
14 :
15 : #include <string>
16 : #include <string.h>
17 : #include <cstdio>
18 :
19 : //////////////////////////////////////////////////////////////////////////
20 : //
21 : // version no of HLT data types
22 : //
23 : //////////////////////////////////////////////////////////////////////////
24 :
25 : /* Version Description
26 : * 1 first version until June 07; implicite, not tagged
27 : * 2 introduced June 07, enhanced/cleaned/arranged structure
28 : * 3 2007-11-15 RAW DDL data type added; some inconsistencies fixed
29 : * ('void' and 'any' origins); added signed HLT basic data types
30 : * 2007-11-23 origin defines have become variables in conjunction
31 : * to be used with the operator| (AliHLTComponentDataType)
32 : * 2007-11-24 added trigger structs and ESD tree data type
33 : * 4 Component configuration and DCS update events added
34 : * gkAliHLTDDLListSize set from 29 to 30 according to new PubSub
35 : * specs
36 : * 5 Data types for Run and Event summary, and for monitoring added
37 : * 6 Common data types for TreeD and TreeR defined
38 : * kAliHLTAllDataTypes and kAliHLTDataOriginSample added
39 : * kAliHLTDataOriginEMCAL added
40 : * kAliHLTDataTypeRunType added
41 : * 7 kAliHLTDataTypeComponentStatistics, kAliHLTDataTypeComponentTable,
42 : * and AliHLTComponentStatistics have been added for optional
43 : * component block statistics
44 : * 8 new wrapper interface has been introduced, old wrapper interface
45 : * deprecated but kept for backward compatibility, the PubSub
46 : * interface is going to be compiled independently of AliHLT, new
47 : * interface provided by the libHLTinterface.so
48 : * AliHLTComponentEnvironment -> AliHLTAnalysisEnvironment
49 : * 9 added data types for arrays of AliHLTExternalTrackParam sets and
50 : * TClonesArrays of AliExternalTrackParam objects.
51 : * 10 Changes for information objects neededfor running with offline
52 : * chains and analysis tasks.
53 : * kAliHLTMCObjectDataType added
54 : * kAliHLTDataOriginOffline added
55 : * kAliHLTDataOriginHLT added
56 : * 11 extended AliHLTComponentStatistics: one more member to store the
57 : * cycle time between events per component.
58 : * 12 added common data type id 'CLUSTERS'
59 : * added data type 'ECSPARAM' for the full ECS parameter string to
60 : * be sebt during SOR
61 : * added kAliHLTDataTypeTrackMC (TRACK_MC) data type
62 : * added data types (note: interface version stays the same
63 : * kAliHLTDataTypeDAQRDOUT (DAQRDOUT)
64 : * kAliHLTDataTypeTriggerDecision (TRIG_DEC)
65 : * kAliHLTDataTypeGlobalTrigger (GLOBTRIG)
66 : * kAliHLTDataTypeStreamerInfo (ROOTSTRI)
67 : * 13 Changed AliHLTEventDDL to now contain 31 words. The extra word is
68 : * for the EMCAL detector, which needs 46 DDLs after DCAL was added.
69 : * 14 Adding new data block type for HLT global trigger counters.
70 : * Adding data block type for ESD content
71 : * Adding data block type for forwarded component table blocks
72 : * Adding new event type for software triggers.
73 : * 15 Modifying data block types for trigger counter blocks.
74 : * 16 Adding data type for the meta data block to be forwarded by the
75 : * TCPDumpSubscriber for the Common Data Header (CDH) and readout
76 : * list information.
77 : * 17 New CDH v3 (10 32bit words, 100 trigger classes, etc.)
78 : * 18 Added AD detector in AliHLTEventDDLV2
79 : * 19 Added AD Component Data Types
80 : * 20 Add data type for ZMQ components and for internal custom triggers
81 : * 21 Add AliHLTDataTopic struct for ZMQ communication (as header).
82 : * 22 Add kAliHLTDataOriginPTR for passing pointers between threads
83 : * 23 Add Calo Trigger definitions
84 : * 24 Add CONFIG,INFO and CDBEntry data block types
85 : */
86 : #define ALIHLT_DATA_TYPES_VERSION 23
87 :
88 : //////////////////////////////////////////////////////////////////////////
89 : //
90 : // HLT data origin variables.
91 : //
92 : // By converting from defines to variables, the origins can be used with
93 : // the operator|
94 : //
95 : // AliHLTComponentDataType dt;
96 : // dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC;
97 : //
98 : //////////////////////////////////////////////////////////////////////////
99 :
100 : /** field size of datat type origin
101 : * @ingroup alihlt_component_datatypes
102 : */
103 : const int kAliHLTComponentDataTypefOriginSize=4;
104 :
105 :
106 : /** invalid data origin
107 : * @ingroup alihlt_component_datatypes
108 : */
109 : # define kAliHLTDataOriginVoid "\0\0\0"
110 : /** old invalid data origin, kept for backward compatibility */
111 : # define kAliHLTVoidDataOrigin "\0\0\0"
112 :
113 : /** wildcard data type origin
114 : * @ingroup alihlt_component_datatypes
115 : */
116 : # define kAliHLTDataOriginAny "***"
117 : /** old wildcard data type origin, kept for backward compatibility */
118 : # define kAliHLTAnyDataOrigin "***"
119 :
120 : /** Data origin HLT out
121 : * @ingroup alihlt_component_datatypes
122 : */
123 : extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
124 :
125 : /** Data origin HLT, used for HLT specifc data
126 : * in offline chains. This not a bug!
127 : * @ingroup alihlt_component_datatypes
128 : */
129 : extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize];
130 :
131 : /** Data origin Offline
132 : * @ingroup alihlt_component_datatypes
133 : */
134 : extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize];
135 :
136 : /** Data origin HLT/PubSub private internal
137 : * @ingroup alihlt_component_datatypes
138 : */
139 : extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
140 :
141 : /** Data origin TPC
142 : * @ingroup alihlt_component_datatypes
143 : */
144 : extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
145 :
146 : /** Data origin PHOS
147 : * @ingroup alihlt_component_datatypes
148 : */
149 : extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
150 :
151 : /** Data origin FMD
152 : * @ingroup alihlt_component_datatypes
153 : */
154 : extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
155 :
156 : /** Data origin MUON
157 : * @ingroup alihlt_component_datatypes
158 : */
159 : extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
160 :
161 : /** Data origin TRD
162 : * @ingroup alihlt_component_datatypes
163 : */
164 : extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
165 :
166 : /** Data origin ITS
167 : * @ingroup alihlt_component_datatypes
168 : */
169 : extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
170 :
171 : /** Data origin ITSOut
172 : * @ingroup alihlt_component_datatypes
173 : */
174 : extern const char kAliHLTDataOriginITSOut[kAliHLTComponentDataTypefOriginSize];
175 :
176 : /** Data origin ITS SPD
177 : * @ingroup alihlt_component_datatypes
178 : */
179 : extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
180 :
181 : /** Data origin ITS SDD
182 : * @ingroup alihlt_component_datatypes
183 : */
184 : extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
185 :
186 : /** Data origin ITS SSD
187 : * @ingroup alihlt_component_datatypes
188 : */
189 : extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
190 :
191 : /** Data origin for examples
192 : * @ingroup alihlt_component_datatypes
193 : */
194 : extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
195 :
196 : /** Data origin EMCAL
197 : * @ingroup alihlt_component_datatypes
198 : */
199 : extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
200 :
201 : /** Data origin TOF
202 : * @ingroup alihlt_component_datatypes
203 : */
204 : extern const char kAliHLTDataOriginTOF[kAliHLTComponentDataTypefOriginSize];
205 :
206 : /** Data origin HMPID
207 : * @ingroup alihlt_component_datatypes
208 : */
209 : extern const char kAliHLTDataOriginHMPID[kAliHLTComponentDataTypefOriginSize];
210 :
211 : /** Data origin CPV
212 : * @ingroup alihlt_component_datatypes
213 : */
214 : extern const char kAliHLTDataOriginCPV[kAliHLTComponentDataTypefOriginSize];
215 :
216 : /** Data origin PMD
217 : * @ingroup alihlt_component_datatypes
218 : */
219 : extern const char kAliHLTDataOriginPMD[kAliHLTComponentDataTypefOriginSize];
220 :
221 : /** Data origin T0
222 : * @ingroup alihlt_component_datatypes
223 : */
224 : extern const char kAliHLTDataOriginT0[kAliHLTComponentDataTypefOriginSize];
225 :
226 : /** Data origin VZERO
227 : * @ingroup alihlt_component_datatypes
228 : */
229 : extern const char kAliHLTDataOriginVZERO[kAliHLTComponentDataTypefOriginSize];
230 :
231 : /** Data origin ZDC
232 : * @ingroup alihlt_component_datatypes
233 : */
234 : extern const char kAliHLTDataOriginZDC[kAliHLTComponentDataTypefOriginSize];
235 :
236 : /** Data origin ACORDE
237 : * @ingroup alihlt_component_datatypes
238 : */
239 :
240 : extern const char kAliHLTDataOriginACORDE[kAliHLTComponentDataTypefOriginSize];
241 :
242 : /** Data origin TRG
243 : * @ingroup alihlt_component_datatypes
244 : */
245 : extern const char kAliHLTDataOriginTRG[kAliHLTComponentDataTypefOriginSize];
246 :
247 : /** Data origin AD
248 : * @ingroup alihlt_component_datatypes
249 : */
250 : extern const char kAliHLTDataOriginAD[kAliHLTComponentDataTypefOriginSize];
251 :
252 : /** Data origin pointer
253 : * for inter thread communication
254 : * @ingroup alihlt_component_datatypes
255 : */
256 : extern const char kAliHLTDataOriginPTR[kAliHLTComponentDataTypefOriginSize];
257 :
258 : //////////////////////////////////////////////////////////////////////////
259 : //
260 : // HLT common data type defines
261 : //
262 : //////////////////////////////////////////////////////////////////////////
263 :
264 : /** field size of data type id
265 : * @ingroup alihlt_component_datatypes
266 : */
267 : const int kAliHLTComponentDataTypefIDsize=8;
268 :
269 : /** field size of data type topic (ZMQ topic)
270 : * @ingroup alihlt_component_datatypes
271 : */
272 : const int kAliHLTComponentDataTypeTopicSize =
273 : kAliHLTComponentDataTypefIDsize+kAliHLTComponentDataTypefOriginSize;
274 :
275 : /** invalid data type id
276 : * @ingroup alihlt_component_datatypes
277 : */
278 : # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
279 :
280 : /** special id for all data types: any + void
281 : * @ingroup alihlt_component_datatypes
282 : */
283 : # define kAliHLTAllDataTypesID "ALLDATA"
284 :
285 : /** special id for any valid data type id
286 : * @ingroup alihlt_component_datatypes
287 : */
288 : # define kAliHLTAnyDataTypeID "*******"
289 :
290 : /** DDL RAW data
291 : * @ingroup alihlt_component_datatypes
292 : */
293 : # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
294 :
295 : /** CLUSTERS data
296 : * Common data type for the output of cluster finders, the exact
297 : * format depends on the origin (detector)
298 : * @ingroup alihlt_component_datatypes
299 : */
300 : # define kAliHLTClustersDataTypeID {'C','L','U','S','T','E','R','S'}
301 :
302 : /** calibration data for file exchange subscriber
303 : * @ingroup alihlt_component_datatypes
304 : */
305 : # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
306 :
307 : /** start of run (SOR) event
308 : * @ref AliHLTRunDesc
309 : * @ingroup alihlt_component_datatypes
310 : */
311 : # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
312 :
313 : /** end of run (EOR) event
314 : * @ref AliHLTRunDesc
315 : * @ingroup alihlt_component_datatypes
316 : */
317 : # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
318 :
319 : /** run type data block
320 : * string with run type as payload
321 : * @ingroup alihlt_component_datatypes
322 : */
323 : # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
324 :
325 : /** DDL list event
326 : * @ref AliHLTEventDDL
327 : * @ingroup alihlt_component_datatypes
328 : */
329 : # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
330 :
331 : /** DAQ readout list
332 : * @ingroup alihlt_component_datatypes
333 : */
334 : # define kAliHLTDAQRDOUTDataTypeID "DAQRDOUT"
335 :
336 : /** HLT readout list.
337 : * @ingroup alihlt_component_datatypes
338 : */
339 : # define kAliHLTReadoutListDataTypeID {'H','L','T','R','D','L','S','T'}
340 :
341 : /** EventType event
342 : * - empty payload, specification gives eventType
343 : * @ingroup alihlt_component_datatypes
344 : */
345 : # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
346 :
347 : /** ECS parameter event
348 : * - sent during the SOR event by the framework
349 : * - contains the full ECS parameter string
350 : * @ingroup alihlt_component_datatypes
351 : */
352 : # define kAliHLTECSParamDataTypeID {'E','C','S','P','A','R','A','M'}
353 :
354 : /** ComponentConfiguration event
355 : * - payload contains the CDB path as string
356 : * @ingroup alihlt_component_datatypes
357 : */
358 : # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
359 :
360 : /** Direct ComponentConfiguration event
361 : * - payload contains the configuration string
362 : * @ingroup alihlt_component_datatypes
363 : */
364 : # define kAliHLTConfigDataTypeID {'C','O','N','F','I','G','_','_'}
365 :
366 : /** Information string
367 : * - payload contains an information string
368 : * @ingroup alihlt_component_datatypes
369 : */
370 : # define kAliHLTInfoDataTypeID {'I','N','F','O','_','_','_','_'}
371 :
372 : /** CDB entry
373 : * - payload contains the ROOT object containing the CDB entry
374 : * @ingroup alihlt_component_datatypes
375 : */
376 : # define kAliHLTCDBEntryDataTypeID {'C','D','B','E','N','T','R','Y'}
377 :
378 : /** DCS value update event
379 : * - payload contains string of relevant detectors
380 : * @ingroup alihlt_component_datatypes
381 : */
382 : # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
383 :
384 : /** MC data block
385 : * an AliMCEvent object of varying origin
386 : * The 'V0' at the end allows a versioning
387 : * @ingroup alihlt_component_datatypes
388 : */
389 : # define kAliHLTMCObjectDataTypeID {'A','L','I','M','C','_','V','0'}
390 :
391 : /** ESDVertex data block
392 : * an AliESDVertex object of varying origin
393 : * The 'V0' at the end allows a versioning
394 : * @ingroup alihlt_component_datatypes
395 : */
396 : # define kAliHLTESDVertexDataTypeID {'E','S','D','V','T','X','V','0'}
397 :
398 : /** KFVertex data block
399 : * an AliKFVertex object of varying origin
400 : * The 'V0' at the end allows a versioning
401 : * @ingroup alihlt_component_datatypes
402 : */
403 : # define kAliHLTKFVertexDataTypeID {'A','L','I','K','F','V','V','0'}
404 :
405 :
406 : /** output of the GlobalVertexer data block
407 : * The 'V0' at the end allows a versioning
408 : * @ingroup alihlt_component_datatypes
409 : */
410 : # define kAliHLTDataTypeGlobalVertexerID {'G','L','B','V','T','X','V','0'}
411 :
412 : /** output of the PrimaryFinder data block
413 : * The 'V0' at the end allows a versioning
414 : * @ingroup alihlt_component_datatypes
415 : */
416 : # define kAliHLTDataTypePrimaryFinderID {'P','R','I','V','T','X','V','0'}
417 :
418 : /** output of the V0Finder data block
419 : * The 'V0' at the end allows a versioning
420 : * @ingroup alihlt_component_datatypes
421 : */
422 : # define kAliHLTDataTypeV0FinderID {'V','0','S','V','T','X','V','0'}
423 :
424 : /** ESD data block
425 : * an AliESD object of varying origin
426 : * The 'V0' at the end allows a versioning
427 : * @ingroup alihlt_component_datatypes
428 : */
429 : # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
430 :
431 : /** ESD friend data block
432 : * an AliESDfriend object of varying origin
433 : * The 'V0' at the end allows a versioning
434 : * @ingroup alihlt_component_datatypes
435 : */
436 : # define kAliHLTESDfriendObjectDataTypeID {'E','S','D','F','R','N','D','0'}
437 :
438 : /** Flat ESD Vertex data block
439 : * The '0' at the end allows a versioning
440 : * @ingroup alihlt_component_datatypes
441 : */
442 : # define kAliHLTFlatESDVertexDataTypeID {'F','L','A','T','V','T','X','0'}
443 :
444 : /** Flat ESD data block
445 : * an AliFlatESD object of varying origin
446 : * The '0' at the end allows a versioning
447 : * @ingroup alihlt_component_datatypes
448 : */
449 : # define kAliHLTFlatESDDataTypeID {'F','L','A','T','E','S','D','0'}
450 :
451 : /** Flat ESD data block
452 : * an AliFlatESDFriend object of varying origin
453 : * @ingroup alihlt_component_datatypes
454 : */
455 : # define kAliHLTFlatESDFriendDataTypeID {'F','L','A','T','F','R','N','D'}
456 :
457 : /** ESD
458 : * data blocks designated for the ESD
459 : * @ingroup alihlt_component_datatypes
460 : */
461 : # define kAliHLTESDContentDataTypeID {'E','S','D','_','C','O','N','T'}
462 :
463 : /** ESD
464 : * data blocks designated for the ESD
465 : * @ingroup alihlt_component_datatypes
466 : */
467 : # define kAliHLTESDFriendContentDataTypeID {'F','R','N','D','C','O','N','T'}
468 :
469 : /** ESD tree data block
470 : * TTree with an AliESD object of varying origin
471 : * @ingroup alihlt_component_datatypes
472 : */
473 : # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
474 :
475 : /** AliRoot TreeD
476 : * - the digits tree of an AliRoot module
477 : * @ingroup alihlt_component_datatypes
478 : */
479 : #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
480 :
481 : /** AliRoot TreeR
482 : * - the rec points tree of an AliRoot module
483 : * @ingroup alihlt_component_datatypes
484 : */
485 : #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'}
486 :
487 : /** HW Address selection data block
488 : * - a selection list for 16 bit HW addresses
489 : * - varying origin
490 : * @ingroup alihlt_component_datatypes
491 : */
492 : # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
493 :
494 : /** Event Statistics
495 : * - event statistics for given detectors
496 : * - varying origin
497 : * @ingroup alihlt_component_datatypes
498 : */
499 : # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
500 :
501 : /** Event Summary
502 : * - event summary
503 : * - origin : kAliHLTDataOriginOut ( HLT )
504 : * @ingroup alihlt_component_datatypes
505 : */
506 : # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
507 :
508 : /** Run Statistics
509 : * - run statistics for given detectors
510 : * - varying origin
511 : * @ingroup alihlt_component_datatypes
512 : */
513 : # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
514 :
515 : /** Run Summary
516 : * - run summary
517 : * - origin : kAliHLTDataOriginOut ( HLT )
518 : * @ingroup alihlt_component_datatypes
519 : */
520 : # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
521 :
522 : /** Trigger decision
523 : * - origin : kAliHLTDataOriginOut ( HLT )
524 : * @ingroup alihlt_component_datatypes
525 : */
526 : # define kAliHLTTriggerDecisionDataTypeID {'T','R','I','G','_','D','E','C'}
527 :
528 : /** Global trigger decision
529 : * - origin : kAliHLTDataOriginOut ( HLT )
530 : * @ingroup alihlt_component_datatypes
531 : */
532 : # define kAliHLTGlobalTriggerDataTypeID {'G','L','O','B','T','R','I','G'}
533 :
534 : /** Block Statistics
535 : * - small block statistics info added to the data stream by
536 : * the component base class
537 : * - origin kAliHLTDataOriginPrivate
538 : * @ingroup alihlt_component_datatypes
539 : */
540 : # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
541 :
542 : /** Component table
543 : * - list of components in the chain to be percolated through the chain
544 : * - each component adds it's chain id string and a generated 32bit id
545 : * @ingroup alihlt_component_datatypes
546 : */
547 : # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
548 :
549 : /** Forwarded component table
550 : * @ingroup alihlt_component_datatypes
551 : */
552 : # define kAliHLTComponentFwdTableDataTypeID {'C','O','M','P','T','A','B','F'}
553 :
554 : /** general ROOT TObject
555 : * - a general TObject exported from the HLT analysis
556 : * - varying origin
557 : * @ingroup alihlt_component_datatypes
558 : */
559 : #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
560 :
561 : /** ROOT streamer info
562 : * - used for the transmission of streamer info for objects in the HLTOUT
563 : * - origin kAliHLTDataOriginOut ( HLT )
564 : * @ingroup alihlt_component_datatypes
565 : */
566 : #define kAliHLTStreamerInfoDataTypeID {'R','O','O','T','S','T','R','I'}
567 :
568 : /** ROOT TObjArray
569 : * - a TObjArray exported from the HLT analysis
570 : * - varying origin
571 : * @ingroup alihlt_component_datatypes
572 : */
573 : #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
574 :
575 : /** ROOT TTree
576 : * - a TTree object exported from the HLT analysis
577 : * - varying origin
578 : * @ingroup alihlt_component_datatypes
579 : */
580 : #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
581 :
582 : /** ROOT histogram
583 : * - a histogram object exported from the HLT analysis
584 : * - class derives from TH1 (directly or indirectly) and inherits all common functionality
585 : * - varying origin
586 : * @ingroup alihlt_component_datatypes
587 : */
588 : #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
589 :
590 : /** ROOT TNtuple
591 : * - a TNtupl object exported from the HLT analysis
592 : * - varying origin
593 : * @ingroup alihlt_component_datatypes
594 : */
595 : #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
596 :
597 : /** HLT Track
598 : * - Struct for Tracks based on AliExternalTrackParam
599 : * - varying origin
600 : * @ingroup alihlt_component_datatypes
601 : */
602 : #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'}
603 :
604 : /** Track Monte Carlo information
605 : * @ingroup alihlt_component_datatypes
606 : */
607 : #define kAliHLTTrackMCDataTypeID {'T','R','A','C','K','_','M','C'}
608 :
609 : /** TClonesArray of AliExternalTrackParam
610 : * @ingroup alihlt_component_datatypes
611 : */
612 : #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'}
613 :
614 : /** HLT Jet
615 : * - Struct for jets based on AliHLTJETJets
616 : * - varying origin
617 : * @ingroup alihlt_component_datatypes
618 : */
619 : #define kAliHLTJetDataTypeID {'H','L','T','J','E','T','V','0'}
620 :
621 : /** dEdx data
622 : * Common data type for the dEdx
623 : * format depends on the origin (detector)
624 : * @ingroup alihlt_component_datatypes
625 : */
626 : # define kAliHLTdEdxDataTypeID {'D','E','D','X',' ',' ',' ',' '}
627 :
628 : /** dNdPt data
629 : * Common data type for the dNdPt output object
630 : * @ingroup alihlt_component_datatypes
631 : */
632 : # define kAliHLTdNdPtDataTypeID {'D','N','D','P','T',' ',' ',' '}
633 :
634 : /** Global input trigger counters data block type.
635 : * @ingroup alihlt_component_datatypes
636 : */
637 : # define kAliHLTInputTriggerCountersDataTypeID {'I','N','T','R','G','C','N','T'}
638 :
639 : /** Global output trigger counters data block type.
640 : * @ingroup alihlt_component_datatypes
641 : */
642 : # define kAliHLTOutputTriggerCountersDataTypeID {'O','T','T','R','G','C','N','T'}
643 :
644 : /** Generic meta data block type ID.
645 : * @ingroup alihlt_component_datatypes
646 : */
647 : # define kAliHLTMetaDataTypeID {'M','E','T','A','D','A','T','A'}
648 :
649 : extern "C" {
650 : //////////////////////////////////////////////////////////////////////////
651 : //
652 : // Basic HLT data types
653 : //
654 : //////////////////////////////////////////////////////////////////////////
655 :
656 : typedef unsigned char AliHLTUInt8_t;
657 :
658 : typedef signed char AliHLTInt8_t;
659 :
660 : typedef unsigned short AliHLTUInt16_t;
661 :
662 : typedef signed short AliHLTInt16_t;
663 :
664 : typedef unsigned int AliHLTUInt32_t;
665 :
666 : typedef signed int AliHLTInt32_t;
667 :
668 : typedef unsigned long long AliHLTUInt64_t;
669 :
670 : typedef signed long long AliHLTInt64_t;
671 :
672 : typedef float AliHLTFloat32_t;
673 :
674 : typedef double AliHLTFloat64_t;
675 :
676 : typedef AliHLTUInt64_t AliHLTEventID_t;
677 :
678 : //////////////////////////////////////////////////////////////////////////
679 : //
680 : // HLT logging levels
681 : //
682 : //////////////////////////////////////////////////////////////////////////
683 :
684 : /**
685 : * Logging severities of the HLT
686 : */
687 : enum AliHLTComponentLogSeverity {
688 : /** no logging */
689 : kHLTLogNone = 0,
690 : /** benchmark messages */
691 : kHLTLogBenchmark = 0x1,
692 : /** debug messages */
693 : kHLTLogDebug = 0x2,
694 : /** info messages */
695 : kHLTLogInfo = 0x4,
696 : /** warning messages */
697 : kHLTLogWarning = 0x8,
698 : /** error messages */
699 : kHLTLogError = 0x10,
700 : /** fatal error messages */
701 : kHLTLogFatal = 0x20,
702 : /** few important messages not to be filtered out.
703 : * redirected to kHLTLogInfo in AliRoot
704 : */
705 : kHLTLogImportant = 0x40,
706 : /** special value to enable all messages */
707 : kHLTLogAll = 0x7f,
708 : /** the default logging filter */
709 : kHLTLogDefault = 0x79
710 : };
711 :
712 : //////////////////////////////////////////////////////////////////////////
713 : //
714 : // HLT data structures for data exchange and external interface
715 : //
716 : //////////////////////////////////////////////////////////////////////////
717 :
718 : /**
719 : * @struct AliHLTComponentEventData
720 : * Event descriptor
721 : */
722 : struct AliHLTComponentEventData
723 : {
724 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
725 : AliHLTEventID_t fEventID; /// 64 bit event ID number.
726 : AliHLTUInt32_t fEventCreation_s; /// Event creation time in seconds (Should be added to fEventCreation_us*1e6).
727 : AliHLTUInt32_t fEventCreation_us; /// Fractional event creation time in micro seconds.
728 : AliHLTUInt32_t fBlockCnt; /// The number of raw data blocks received by the component.
729 : };
730 :
731 : /**
732 : * @struct AliHLTComponentShmData
733 : * Shared memory descriptor.
734 : * Irrelevant for analysis components.
735 : */
736 : struct AliHLTComponentShmData
737 : {
738 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
739 : AliHLTUInt32_t fShmType; /// The type code of the shared memory.
740 : AliHLTUInt64_t fShmID; /// The shared memory identifier.
741 : };
742 :
743 : /**
744 : * @defgroup alihlt_component_datatypes Common Component Data Types
745 : * The analysis framework defines a number of common data types for
746 : * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
747 : * and ::kAliHLTDataTypeDDLRaw. Those data types always have
748 : * origin ::kAliHLTDataOriginAny. The correct detector origin can be
749 : * set by using operator '|'
750 : * <pre>
751 : * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
752 : * </pre>
753 : * @ingroup alihlt_component
754 : */
755 :
756 : /**
757 : * @struct AliHLTComponentDataType
758 : * Data type descriptor for data blocks transferred through the processing
759 : * chain.
760 : * @ingroup alihlt_component_datatypes
761 : */
762 : struct AliHLTComponentDataType
763 : {
764 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
765 : char fID[kAliHLTComponentDataTypefIDsize]; /// Data type identifier.
766 : char fOrigin[kAliHLTComponentDataTypefOriginSize]; /// Subsystem or detector origin of the data.
767 :
768 : //assignment from a topic string
769 : AliHLTComponentDataType& operator=( const char topic[kAliHLTComponentDataTypeTopicSize] )
770 : {
771 0 : memcpy( fID, &topic[0], kAliHLTComponentDataTypefIDsize );
772 0 : memcpy( fOrigin, &topic[kAliHLTComponentDataTypefIDsize], kAliHLTComponentDataTypefOriginSize );
773 0 : return *this;
774 : }
775 :
776 : //Print this datatype to a string, bufferlen is the len of the buffer, this function will return a zero-terminated string of max len bufferLen - 1
777 : void PrintDataType(char* buffer, unsigned int bufferLen) const;
778 : };
779 :
780 : /**
781 : * @struct AliHLTComponentBlockData
782 : * This is the decription of data blocks exchanged between components.
783 : * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
784 : * output blocks:
785 : * - input blocks: The \em fPtr member always points to the beginning of the data
786 : * of size \em fSize. fOffset is ignored and should be in most
787 : * case 0.
788 : * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
789 : * must specify the start of the data relative to the output
790 : * buffer. The data block has size \em fSize.
791 : */
792 : struct AliHLTComponentBlockData
793 : {
794 : /** size and version of the struct */
795 : AliHLTUInt32_t fStructSize;
796 : /** shared memory key, ignored by processing components */
797 : AliHLTComponentShmData fShmKey;
798 : /** offset of output data relative to the output buffer */
799 : AliHLTUInt32_t fOffset;
800 : /** start of the data for input data blocks, fOffset to be ignored*/
801 : void* fPtr;
802 : /** size of the data block */
803 : AliHLTUInt32_t fSize;
804 : /** data type of the data block */
805 : AliHLTComponentDataType fDataType;
806 : /** data specification of the data block */
807 : AliHLTUInt32_t fSpecification;
808 :
809 0 : AliHLTComponentDataType GetDataType() const {return fDataType;}
810 0 : AliHLTUInt32_t GetSpecification() const {return fSpecification;}
811 : };
812 :
813 : /**
814 : * Helper function to compare topics
815 : * a topic is a string representation of AliHLTComponentDataType
816 : */
817 : inline bool Topicncmp(const char* topic, const char* reference, int topicSize=kAliHLTComponentDataTypeTopicSize, int referenceSize=kAliHLTComponentDataTypeTopicSize)
818 : {
819 0 : for (int i=0; i<((topicSize<referenceSize)?topicSize:referenceSize); i++)
820 : {
821 0 : if (!(topic[i]=='*' || reference[i]=='*' ||
822 0 : topic[i]=='\0' || reference[i]=='\0' ||
823 0 : topic[i]==reference[i])) {
824 0 : return false;
825 : }
826 : }
827 0 : return true;
828 0 : }
829 :
830 : //this struct is meant to be used as a universal data block descriptor ("topic" + specification)
831 : //for ZMQ communication
832 : struct AliHLTDataTopic
833 : {
834 : char fTopic[kAliHLTComponentDataTypeTopicSize]; /// Data type identifier + source id as char array.
835 : AliHLTUInt32_t fSpecification; /// data specification of the data block
836 :
837 : //ctor
838 : AliHLTDataTopic()
839 0 : : fTopic()
840 0 : , fSpecification(0)
841 0 : {
842 0 : }
843 :
844 : //copy ctor
845 : AliHLTDataTopic(const AliHLTComponentDataType& dataType)
846 0 : : fTopic()
847 0 : , fSpecification(0)
848 0 : {
849 0 : memcpy( fTopic, dataType.fID, kAliHLTComponentDataTypefIDsize );
850 0 : memcpy( fTopic+kAliHLTComponentDataTypefIDsize, dataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
851 0 : }
852 :
853 : //copy ctor
854 : AliHLTDataTopic(const AliHLTComponentBlockData& blockData)
855 0 : : fTopic()
856 0 : , fSpecification(blockData.fSpecification)
857 0 : {
858 0 : memcpy( fTopic, blockData.fDataType.fID, kAliHLTComponentDataTypefIDsize );
859 0 : memcpy( fTopic+kAliHLTComponentDataTypefIDsize, blockData.fDataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
860 0 : }
861 :
862 : //partial (no fSpecification) copy from AliHLTComponentDataType
863 : AliHLTDataTopic& operator=( const AliHLTComponentDataType& dataType )
864 : {
865 0 : memcpy( fTopic, dataType.fID, kAliHLTComponentDataTypefIDsize );
866 0 : memcpy( fTopic+kAliHLTComponentDataTypefIDsize, dataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
867 0 : return *this;
868 : }
869 :
870 : //assignment from a AliHLTComponentBlockData
871 : AliHLTDataTopic& operator=( const AliHLTComponentBlockData& blockData )
872 : {
873 0 : memcpy( fTopic, blockData.fDataType.fID, kAliHLTComponentDataTypefIDsize );
874 0 : memcpy( fTopic+kAliHLTComponentDataTypefIDsize, blockData.fDataType.fOrigin, kAliHLTComponentDataTypefOriginSize );
875 0 : fSpecification = blockData.fSpecification;
876 0 : return *this;
877 : }
878 :
879 : bool operator==( const AliHLTDataTopic& dt )
880 : {
881 0 : bool topicMatch = Topicncmp(dt.fTopic, fTopic);
882 0 : return topicMatch;
883 : }
884 :
885 : std::string Description() const
886 : {
887 0 : std::string description(fTopic, kAliHLTComponentDataTypeTopicSize);
888 0 : description+=" spec:";
889 0 : char numstr[21];
890 0 : snprintf(numstr, 21, "%x", fSpecification);
891 0 : description+=numstr;
892 : return description;
893 0 : }
894 :
895 : std::string GetOrigin() const
896 : {
897 0 : std::string origin(fTopic+kAliHLTComponentDataTypefIDsize, kAliHLTComponentDataTypefOriginSize);
898 : return origin;
899 0 : }
900 :
901 : std::string GetID() const
902 : {
903 0 : std::string id(fTopic, kAliHLTComponentDataTypefIDsize);
904 : return id;
905 0 : }
906 :
907 : };
908 :
909 : /**
910 : * @struct AliHLTComponentEventDoneData
911 : *
912 : */
913 : struct AliHLTComponentEventDoneData
914 : {
915 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
916 : AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
917 : void* fData; /// Start of the data section.
918 : };
919 :
920 : /**
921 : * @struct AliHLTRunDesc
922 : * Event descriptor.
923 : * The struct is sent with the SOR and EOR events.
924 : *
925 : * @note
926 : * The name of the member fRunType is a bit misleading. This is not
927 : * the ALICE Run Type given by the ECS to the sub-system. The member
928 : * is an internal HLT run type and a combination of the HLT running
929 : * mode and the beam type.
930 : * <pre>
931 : * Bit 0-2: beam type identifier
932 : * Bit 3-31: HLT mode
933 : * </pre>
934 : */
935 : struct AliHLTRunDesc
936 : {
937 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
938 : AliHLTUInt32_t fRunNo; /// The run number for the current active run.
939 : AliHLTUInt32_t fRunType; /// The HLT run type.
940 : };
941 :
942 : /**
943 : * @struct AliHLTComponentStatistics
944 : * Small block size summary added by the AliHLTComponent base class
945 : * if component statistics are enabled (--enable-compstat).
946 : *
947 : * fLevel is retrieved from incoming block statistics and incremented.
948 : * Incoming block statistics are appended to the newly added one if
949 : * --enable-compstat=full has been chosen.
950 : *
951 : * ChangeLog:
952 : * 2009-01-14 fComponentCycleTime added
953 : */
954 : struct AliHLTComponentStatistics
955 : {
956 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
957 : AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from.
958 : AliHLTUInt32_t fId; /// Unique identifier for the chain based on CRC code.
959 : AliHLTUInt32_t fTime; /// Real wall time used to process the data (micro seconds).
960 : AliHLTUInt32_t fCTime; /// CPU time used to process the data (micro seconds).
961 : AliHLTUInt32_t fInputBlockCount; /// Number of input data blocks.
962 : AliHLTUInt32_t fTotalInputSize; /// Total size in bytes of input data.
963 : AliHLTUInt32_t fOutputBlockCount; /// Number of output data blocks.
964 : AliHLTUInt32_t fTotalOutputSize; /// Total size in bytes of output data.
965 : AliHLTUInt32_t fComponentCycleTime; /// Real wall time indicating the start of the data processing (micro seconds).
966 : };
967 :
968 : /**
969 : * @struct AliHLTComponentTableEntry
970 : * Structure to be send on SOR event through the chain.
971 : * The 'length' of the structure is variable and depends on the length
972 : * of the buffer at the end.
973 : *
974 : * ComponentTableEntries are sent with data type @ref kAliHLTDataTypeComponentTable
975 : * and are identified by a 32bit Id specification generated by a CRC
976 : * algorithm from the chain Id of the component. This is not a 100% unique
977 : * id but with a high probability. This approach accounts for the fact
978 : * that all components are separated processes.
979 : *
980 : * The buffer consists of an array of 32bit Ids containing the Ids of
981 : * all direct parents taken from the specification of the data blocks.
982 : * The number of parents is stored in fNofParents. Each component forwards the
983 : * incoming component table entries with data type @ref kAliHLTDataTypeComponentFwdTable
984 : * by that the direct parents can be identified.
985 : *
986 : * Following this array a description string contains the chain id, component args, and
987 : * maybe more properties in the future. The current format is
988 : * 'chain_id{component_id:component args}' e.g. TPC-CF_00_0{TPCClusterFinder32Bit:-deconvolute-time}
989 : */
990 : struct AliHLTComponentTableEntry
991 : {
992 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
993 : AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from.
994 : AliHLTUInt16_t fNofParents; /// size of the array of parent ids
995 : AliHLTUInt8_t fSizeDescription; /// size of the description string in the appended buffer
996 : AliHLTUInt8_t fBuffer[1]; /// the strings: chain id, component args, reserved
997 : };
998 :
999 : //////////////////////////////////////////////////////////////////////////
1000 : //
1001 : // Trigger meta information
1002 : //
1003 : //////////////////////////////////////////////////////////////////////////
1004 :
1005 : /** field size of fAttribute */
1006 : const int gkAliHLTBlockDAttributeCount = 8;
1007 :
1008 : /** field size of fCommonHeader */
1009 : const int gkAliHLTCommonHeaderCountV2 = 8;
1010 : const int gkAliHLTCommonHeaderCountV3 = 10;
1011 : const int gkAliHLTCommonHeaderCount = gkAliHLTCommonHeaderCountV3;
1012 :
1013 : /** size of the DDL list first version */
1014 : const int gkAliHLTDDLListSizeV0 = 30;
1015 :
1016 : /** size of the DDL list after DCAL added to EMCAL */
1017 : const int gkAliHLTDDLListSizeV1 = 31;
1018 :
1019 : /** size of the DDL list with AD */
1020 : const int gkAliHLTDDLListSizeV2 =32;
1021 :
1022 : /** size of the DDL list */
1023 : const int gkAliHLTDDLListSize = gkAliHLTDDLListSizeV2;
1024 :
1025 : /** Number of Trigger Classes of CTP in CDH */
1026 : const int gkNCTPTriggerClassesV2 = 50;
1027 : const int gkNCTPTriggerClassesV3 = 100;
1028 : const int gkNCTPTriggerClasses = gkNCTPTriggerClassesV3;
1029 :
1030 : // make it also available as define for templates
1031 : #define NCTPTRIGGERCLASSES 100
1032 :
1033 : /**
1034 : * @struct AliHLTEventDDLV0
1035 : * First version of the DDL list event.
1036 : * The struct is send with the DDLLIST event.
1037 : * Used in the trigger structure for internal apperance of
1038 : * the DLLs as well as for the HLT readout list send to DAQ
1039 : * ( as DataType : kAliHLTDataTypeDDL )
1040 : */
1041 : struct AliHLTEventDDLV0
1042 : {
1043 : AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
1044 : AliHLTUInt32_t fList[gkAliHLTDDLListSizeV0]; /// The list of DDL enable/disable bits.
1045 : };
1046 :
1047 : /**
1048 : * @struct AliHLTEventDDLV1
1049 : * DDL list event structure with extra word for DCAL bits.
1050 : */
1051 : struct AliHLTEventDDLV1
1052 : {
1053 : AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
1054 : AliHLTUInt32_t fList[gkAliHLTDDLListSizeV1]; /// The list of DDL enable/disable bits.
1055 : };
1056 :
1057 : /**
1058 : * @struct AliHLTEventDDLV2
1059 : * DDL list event structure with extra word for AD bits.
1060 : */
1061 : struct AliHLTEventDDLV2
1062 : {
1063 : AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
1064 : AliHLTUInt32_t fList[gkAliHLTDDLListSizeV2]; /// The list of DDL enable/disable bits.
1065 : };
1066 :
1067 : /**
1068 : * @typedef AliHLTEventDDL
1069 : * Current used default version of the AliHLTEventDDL structure.
1070 : */
1071 : typedef AliHLTEventDDLV2 AliHLTEventDDL;
1072 :
1073 : /**
1074 : * @struct AliHLTEventTriggerData
1075 : */
1076 : struct AliHLTEventTriggerData
1077 : {
1078 : AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; /// List of data block attibutes.
1079 : AliHLTUInt64_t fHLTStatus; /// Bit field
1080 : AliHLTUInt32_t fCommonHeaderWordCnt; /// Number of words in fCommonHeader.
1081 : AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; /// The common header words.
1082 : union
1083 : {
1084 : AliHLTEventDDL fReadoutList; /// The default readout list structure.
1085 : AliHLTEventDDLV0 fReadoutListV0; /// Access to the old version of the readout list structure.
1086 : AliHLTEventDDLV1 fReadoutListV1; /// Access to the readout list structure with DCAL included.
1087 : AliHLTEventDDLV2 fReadoutListV2; /// Access to the readout list structure with AD included.
1088 : };
1089 : };
1090 :
1091 : /**
1092 : * @struct AliHLTComponentTriggerData
1093 : * Trigger data
1094 : */
1095 : struct AliHLTComponentTriggerData
1096 : {
1097 : AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
1098 : AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
1099 : void* fData; /// Start of the data section.
1100 : };
1101 :
1102 : //////////////////////////////////////////////////////////////////////////
1103 : //
1104 : // HLT Event Type Specification
1105 : //
1106 : //////////////////////////////////////////////////////////////////////////
1107 :
1108 : /** Unknown eventType specification */
1109 : const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
1110 : /** SOR eventType specification */
1111 : const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
1112 : /** Data eventType specification */
1113 : const AliHLTUInt32_t gkAliEventTypeData=2;
1114 : /** EOR eventType specification */
1115 : const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
1116 : /** Corrupt eventType specification */
1117 : const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
1118 : /** Calibration eventType specification */
1119 : const AliHLTUInt32_t gkAliEventTypeCalibration=16;
1120 : /** Software eventType specification */
1121 : const AliHLTUInt32_t gkAliEventTypeSoftware=24;
1122 : /** DataReplay eventType specification */
1123 : const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
1124 : /** Configuration eventType specification */
1125 : const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
1126 : /** Update DCS eventType specification */
1127 : const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
1128 : /** Tick eventType specification */
1129 : const AliHLTUInt32_t gkAliEventTypeTick=64;
1130 : /** Max eventType specification */
1131 : const AliHLTUInt32_t gkAliEventTypeMax=64;
1132 :
1133 : //////////////////////////////////////////////////////////////////////////
1134 : //
1135 : // HLT defines and defaults
1136 : //
1137 : //////////////////////////////////////////////////////////////////////////
1138 :
1139 : /** invalid event id
1140 : * @ingroup alihlt_component_datatypes
1141 : */
1142 : const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
1143 :
1144 : /** invalid data specification
1145 : * @ingroup alihlt_component_datatypes
1146 : */
1147 : const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
1148 :
1149 : /** invalid run no
1150 : * @ingroup alihlt_component_datatypes
1151 : */
1152 : const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
1153 :
1154 : /** invalid run type
1155 : * @ingroup alihlt_component_datatypes
1156 : */
1157 : const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
1158 :
1159 : /** invalid run descriptor
1160 : * @ingroup alihlt_component_datatypes
1161 : */
1162 : const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
1163 :
1164 : /** invalid shared memory type */
1165 : const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
1166 :
1167 : /** invalid shared memory id */
1168 : const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
1169 :
1170 : /** invalid data type
1171 : * @ingroup alihlt_component_datatypes
1172 : */
1173 : const AliHLTComponentDataType kAliHLTVoidDataType = {
1174 : sizeof(AliHLTComponentDataType),
1175 : kAliHLTVoidDataTypeID,
1176 : kAliHLTDataOriginVoid
1177 : };
1178 :
1179 : /** all data types, means any + void data type
1180 : * @ingroup alihlt_component_datatypes
1181 : */
1182 : const AliHLTComponentDataType kAliHLTAllDataTypes = {
1183 : sizeof(AliHLTComponentDataType),
1184 : kAliHLTAllDataTypesID,
1185 : kAliHLTDataOriginAny
1186 : };
1187 :
1188 : // there is currently a problem with rootcint if the predefined ids
1189 : // (commented below) are used. rootcint does not find the id if they
1190 : // are char arrays defined with {} and individual chars. If strings
1191 : // are used it works fine
1192 : /** any data type
1193 : * @ingroup alihlt_component_datatypes
1194 : */
1195 : const AliHLTComponentDataType kAliHLTAnyDataType = {
1196 : sizeof(AliHLTComponentDataType),
1197 : kAliHLTAnyDataTypeID,
1198 : kAliHLTDataOriginAny
1199 : };
1200 :
1201 : /** multiple output data types
1202 : * @ingroup alihlt_component_datatypes
1203 : */
1204 : extern const AliHLTComponentDataType kAliHLTMultipleDataType;
1205 :
1206 : /** data to file exchange subscriber
1207 : * @ingroup alihlt_component_datatypes
1208 : */
1209 : extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
1210 :
1211 : /** DDL list data type
1212 : * @ingroup alihlt_component_datatypes
1213 : */
1214 : extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
1215 :
1216 : /** DAQ readout list
1217 : * @ingroup alihlt_component_datatypes
1218 : */
1219 : extern const AliHLTComponentDataType kAliHLTDataTypeDAQRDOUT;
1220 :
1221 : /** CLUSTERS data
1222 : * Common data type for the output of cluster finders, the exact
1223 : * format depends on the origin (detector)
1224 : * @ingroup alihlt_component_datatypes
1225 : */
1226 : extern const AliHLTComponentDataType kAliHLTDataTypeClusters;
1227 :
1228 : /** SOR data type
1229 : * @ingroup alihlt_component_datatypes
1230 : */
1231 : extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
1232 :
1233 : /** EOR data type
1234 : * @ingroup alihlt_component_datatypes
1235 : */
1236 : extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
1237 :
1238 : /** Run type data block
1239 : * @ingroup alihlt_component_datatypes
1240 : */
1241 : extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
1242 :
1243 : /** Event type specification
1244 : * @ingroup alihlt_component_datatypes
1245 : */
1246 : extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
1247 :
1248 : /** ECS parameter event
1249 : * - sent during the SOR event by the framework
1250 : * - contains the full ECS parameter string
1251 : * @ingroup alihlt_component_datatypes
1252 : */
1253 : extern const AliHLTComponentDataType kAliHLTDataTypeECSParam; // {ECSPARAM:PRIV}
1254 :
1255 : /** Configuration event data type
1256 : * @ingroup alihlt_component_datatypes
1257 : */
1258 : extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
1259 :
1260 : /** Direct configuration string block data type
1261 : * @ingroup alihlt_component_datatypes
1262 : */
1263 : extern const AliHLTComponentDataType kAliHLTDataTypeConfig;
1264 :
1265 : /** Info string block data type
1266 : * @ingroup alihlt_component_datatypes
1267 : */
1268 : extern const AliHLTComponentDataType kAliHLTDataTypeInfo;
1269 :
1270 : /** CDB entry block data type
1271 : * @ingroup alihlt_component_datatypes
1272 : */
1273 : extern const AliHLTComponentDataType kAliHLTDataTypeCDBEntry;
1274 :
1275 : /** DCS value update event
1276 : * @ingroup alihlt_component_datatypes
1277 : */
1278 : extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
1279 :
1280 : /** RAW DDL data specification, origin is 'any', data publisher origin correctly
1281 : * @ingroup alihlt_component_datatypes
1282 : */
1283 : extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
1284 :
1285 : /** AliMCEvent object data specification, origin is 'OFFL'
1286 : * @ingroup alihlt_component_datatypes
1287 : */
1288 : extern const AliHLTComponentDataType kAliHLTDataTypeMCObject;
1289 :
1290 : /** ESD vertex object data specification, origin is 'any'
1291 : * @ingroup alihlt_component_datatypes
1292 : */
1293 : extern const AliHLTComponentDataType kAliHLTDataTypeESDVertex;
1294 :
1295 : /** KF vertex object data specification, origin is 'any'
1296 : * @ingroup alihlt_component_datatypes
1297 : */
1298 : extern const AliHLTComponentDataType kAliHLTDataTypeKFVertex;
1299 :
1300 : /** global vertexer data specification, origin is 'any'
1301 : * @ingroup alihlt_component_datatypes
1302 : */
1303 : extern const AliHLTComponentDataType kAliHLTDataTypeGlobalVertexer;
1304 :
1305 : /** primary finder data specification, origin is 'any'
1306 : * @ingroup alihlt_component_datatypes
1307 : */
1308 : extern const AliHLTComponentDataType kAliHLTDataTypePrimaryFinder;
1309 :
1310 : /** primary finder data specification, origin is 'any'
1311 : * @ingroup alihlt_component_datatypes
1312 : */
1313 : extern const AliHLTComponentDataType kAliHLTDataTypeV0Finder;
1314 :
1315 : /** flat ESD object data specification, origin is 'any'
1316 : * @ingroup alihlt_component_datatypes
1317 : */
1318 : extern const AliHLTComponentDataType kAliHLTDataTypeFlatESD;
1319 :
1320 : /** flat ESD friend object data specification, origin is 'any'
1321 : * @ingroup alihlt_component_datatypes
1322 : */
1323 : extern const AliHLTComponentDataType kAliHLTDataTypeFlatESDFriend;
1324 :
1325 : /** flat ESD vertex object data specification, origin is 'any'
1326 : * @ingroup alihlt_component_datatypes
1327 : */
1328 : extern const AliHLTComponentDataType kAliHLTDataTypeFlatESDVertex;
1329 :
1330 : /** ESD object data specification, origin is 'any'
1331 : * @ingroup alihlt_component_datatypes
1332 : */
1333 : extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
1334 :
1335 : /** ESD friend object data specification, origin is 'any'
1336 : * @ingroup alihlt_component_datatypes
1337 : */
1338 : extern const AliHLTComponentDataType kAliHLTDataTypeESDfriendObject;
1339 :
1340 : /** ESD content data specification, origin is 'any'
1341 : * @ingroup alihlt_component_datatypes
1342 : */
1343 : extern const AliHLTComponentDataType kAliHLTDataTypeESDContent;
1344 :
1345 : /** ESD friend content data specification, origin is 'any'
1346 : * @ingroup alihlt_component_datatypes
1347 : */
1348 : extern const AliHLTComponentDataType kAliHLTDataTypeESDFriendContent;
1349 :
1350 : /** ESD Tree data specification, origin is 'any'
1351 : * @ingroup alihlt_component_datatypes
1352 : */
1353 : extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
1354 :
1355 : /** AliRoot TreeD data specification, origin is 'any'
1356 : * @ingroup alihlt_component_datatypes
1357 : */
1358 : extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
1359 :
1360 : /** AliRoot TreeR data specification, origin is 'any'
1361 : * @ingroup alihlt_component_datatypes
1362 : */
1363 : extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
1364 :
1365 : /** 16 bit Hardware address selection data specification, origin is 'any'
1366 : * @ingroup alihlt_component_datatypes
1367 : */
1368 : extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
1369 :
1370 : /** Event statistics
1371 : * @ingroup alihlt_component_datatypes
1372 : */
1373 : extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
1374 :
1375 : /** Event summary
1376 : * @ingroup alihlt_component_datatypes
1377 : */
1378 : extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
1379 :
1380 : /** Event statistics
1381 : * @ingroup alihlt_component_datatypes
1382 : */
1383 : extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
1384 :
1385 : /** Run summary
1386 : * @ingroup alihlt_component_datatypes
1387 : */
1388 : extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
1389 :
1390 : /** Trigger decision
1391 : * - origin : kAliHLTDataOriginOut ( HLT )
1392 : * @ingroup alihlt_component_datatypes
1393 : */
1394 : extern const AliHLTComponentDataType kAliHLTDataTypeTriggerDecision; // {TRIG_DEC:HLT }
1395 :
1396 : /** Trigger decision
1397 : * - origin : kAliHLTDataOriginOut ( HLT )
1398 : * @ingroup alihlt_component_datatypes
1399 : */
1400 : extern const AliHLTComponentDataType kAliHLTDataTypeReadoutList; // {HLTRDLST:HLT }
1401 :
1402 : /** Global trigger decision
1403 : * - origin : kAliHLTDataOriginOut ( HLT )
1404 : * @ingroup alihlt_component_datatypes
1405 : */
1406 : extern const AliHLTComponentDataType kAliHLTDataTypeGlobalTrigger; // {GLOBTRIG:HLT }
1407 :
1408 : /** Component block statistics
1409 : * @ingroup alihlt_component_datatypes
1410 : */
1411 : extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
1412 :
1413 : /** Component table
1414 : * To be sent on SOR event, each component adds it's chain id string
1415 : * and a generated 32bit identifier to the table
1416 : * @ingroup alihlt_component_datatypes
1417 : */
1418 : extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
1419 :
1420 : /** Forwarded component table
1421 : * To be sent on SOR event, each component forwards blocks of type
1422 : * @ref kAliHLTDataTypeComponentTable was kAliHLTDataTypeComponentFwdTable
1423 : * after adding the parent ids to its own table struct.
1424 : * @ingroup alihlt_component_datatypes
1425 : */
1426 : extern const AliHLTComponentDataType kAliHLTDataTypeComponentFwdTable;
1427 :
1428 : /**
1429 : * Data type for the Common Data Header and readout list information sent by TCPDumpSubscriber.
1430 : * @ingroup alihlt_component_datatypes
1431 : */
1432 : extern const AliHLTComponentDataType kAliHLTDataTypeTriggerMetaBlock; // {METADATA:PRIV}
1433 :
1434 : //////////////////////////////////////////////////////////////////////////
1435 : //
1436 : // Data Types for Monitoring objects
1437 : //
1438 : //////////////////////////////////////////////////////////////////////////
1439 :
1440 : /** general ROOT TObject
1441 : * @ingroup alihlt_component_datatypes
1442 : */
1443 : extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
1444 :
1445 : /** ROOT streamer info
1446 : * @ingroup alihlt_component_datatypes
1447 : */
1448 : extern const AliHLTComponentDataType kAliHLTDataTypeStreamerInfo; // {ROOTSTRI,HLT }
1449 :
1450 : /** ROOT TObjArray
1451 : * @ingroup alihlt_component_datatypes
1452 : */
1453 : extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
1454 :
1455 : /** ROOT TTree
1456 : * @ingroup alihlt_component_datatypes
1457 : */
1458 : extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
1459 :
1460 : /** ROOT TH1 (can be used for all histograms, they derive from TH1)
1461 : * @ingroup alihlt_component_datatypes
1462 : */
1463 : extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
1464 :
1465 : /** ROOT TNtuple
1466 : * @ingroup alihlt_component_datatypes
1467 : */
1468 : extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
1469 :
1470 : /** Global input trigger counters.
1471 : * - origin : kAliHLTDataOriginOut ( HLT )
1472 : * @ingroup alihlt_component_datatypes
1473 : */
1474 : extern const AliHLTComponentDataType kAliHLTDataTypeInputTriggerCounters; // {INTRGCNT:HLT }
1475 :
1476 : /** Global output trigger counters.
1477 : * - origin : kAliHLTDataOriginOut ( HLT )
1478 : * @ingroup alihlt_component_datatypes
1479 : */
1480 : extern const AliHLTComponentDataType kAliHLTDataTypeOutputTriggerCounters; // {OTTRGCNT:HLT }
1481 :
1482 : /** General track array for the barrel tracks based on AliExternalTrackParam
1483 : * Data format defined by AliHLTTracksData
1484 : *
1485 : * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
1486 : * barrel tracks and detector tracks get names 'DETTracks'
1487 : * @ingroup alihlt_component_datatypes
1488 : */
1489 : extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"}
1490 :
1491 : /** Track Monte Carlo information
1492 : */
1493 : extern const AliHLTComponentDataType kAliHLTDataTypeTrackMC; // {TRACK_MC,"***"}
1494 :
1495 : /** TClonesArray of AliExternalTrackParam
1496 : * @ingroup alihlt_component_datatypes
1497 : */
1498 : extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam; // {TCAEXTTR,"***"}
1499 :
1500 : /** Container containing jets (AliHLTJETJets)
1501 : * Containing TClonesArray of AliAODJets
1502 : * @ingroup alihlt_component_datatypes
1503 : */
1504 : extern const AliHLTComponentDataType kAliHLTDataTypeJet; // {HLTJETV0,"***"}
1505 :
1506 : /** Container of ITS tracks
1507 : * @ingroup alihlt_component_datatypes
1508 : */
1509 : extern const AliHLTComponentDataType fgkITSTracksDataType;
1510 :
1511 : /** Container of ITS SAP tracker data
1512 : * @ingroup alihlt_component_datatypes
1513 : */
1514 : extern const AliHLTComponentDataType kAliHLTDataTypeITSSAPData;
1515 :
1516 : /** Container of calorimeter clusters
1517 : * @ingroup alihlt_component_datatypes
1518 : */
1519 : extern const AliHLTComponentDataType kAliHLTDataTypeCaloCluster;
1520 :
1521 : /** Container of calorimeter triggers
1522 : * @ingroup alihlt_component_datatypes
1523 : */
1524 : extern const AliHLTComponentDataType kAliHLTDataTypeCaloTrigger;
1525 :
1526 : /** Container of dEdx
1527 : * @ingroup alihlt_component_datatypes
1528 : */
1529 : extern const AliHLTComponentDataType kAliHLTDataTypedEdx;
1530 :
1531 : /** Container of dNdPt
1532 : * @ingroup alihlt_component_datatypes
1533 : */
1534 : extern const AliHLTComponentDataType kAliHLTDataTypedNdPt;
1535 :
1536 : extern const AliHLTComponentDataType kAliHLTDataTypeCustomTrigger;
1537 :
1538 : //////////////////////////////////////////////////////////////////////////
1539 : //
1540 : // FXS subscriber meta information
1541 : //
1542 : //////////////////////////////////////////////////////////////////////////
1543 :
1544 : const int gkAliHLTFXSHeaderfOriginSize = 4;
1545 : const int gkAliHLTFXSHeaderfFileIDSize = 128;
1546 : const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
1547 :
1548 : /** Header in front of the data payload, in order to sent data to the FXS. */
1549 : struct AliHLTFXSHeader
1550 : {
1551 : AliHLTUInt32_t fHeaderVersion; /// HLT software version number.
1552 : AliHLTUInt32_t fRunNumber; /// The current run number.
1553 : char fOrigin[gkAliHLTFXSHeaderfOriginSize]; /// The detector from which the FXS data is received.
1554 : char fFileID[gkAliHLTFXSHeaderfFileIDSize]; /// File identifier for the stored data.
1555 : char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; /// The DDL bits.
1556 : };
1557 :
1558 : //////////////////////////////////////////////////////////////////////////
1559 : //
1560 : // Component running environment
1561 : //
1562 : //////////////////////////////////////////////////////////////////////////
1563 :
1564 : /** definition of a void fct pointer */
1565 : typedef void (*AliHLTfctVoid)();
1566 :
1567 : /** logging function */
1568 : typedef int (*AliHLTfctLogging)( void* param,
1569 : AliHLTComponentLogSeverity severity,
1570 : const char* origin,
1571 : const char* keyword,
1572 : const char* message);
1573 :
1574 : /**
1575 : * @struct AliHLTAnalysisEnvironment
1576 : * Running environment for analysis components.
1577 : * The struct describes function callbacks for actions to be
1578 : * carried out by the calling framework, like memory allocation,
1579 : * property callbecks, logging, etc.
1580 : *
1581 : * @ingroup alihlt_wrapper_interface
1582 : */
1583 : struct AliHLTAnalysisEnvironment
1584 : {
1585 : /** size of the structure */
1586 : AliHLTUInt32_t fStructSize;
1587 :
1588 : /** the component parameter given by the framework on creation */
1589 : void* fParam;
1590 :
1591 : /** allocated memory */
1592 : void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1593 :
1594 : /** allocate an EventDoneData structure. */
1595 : int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1596 :
1597 : /** logging callback */
1598 : AliHLTfctLogging fLoggingFunc;
1599 : };
1600 : #if 0
1601 : // I just keep this as a note pad. Has to be added to the end of the structure
1602 : // future addition already foreseen/envisioned
1603 : // IMPORTANT: don not just remove the defines as this breaks the binary
1604 : // compatibility
1605 : int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
1606 : #endif
1607 :
1608 : /**
1609 : * @struct AliHLTComponentEnvironment
1610 : * This was the original definition of the running environment.
1611 : * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
1612 : * this structure can not be used any longer but is kept for backward
1613 : * compatibility.
1614 : * @note The external interface provided by the libHLTbase is now kept
1615 : * frozen but should not be used any more. Use the interface provided
1616 : * by the libHLTinterface library.
1617 : *
1618 : * @ingroup alihlt_wrapper_interface_deprecated
1619 : */
1620 : struct AliHLTComponentEnvironment
1621 : {
1622 : AliHLTUInt32_t fStructSize;
1623 : void* fParam;
1624 : void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1625 : int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1626 : AliHLTfctLogging fLoggingFunc;
1627 : };
1628 :
1629 : //////////////////////////////////////////////////////////////////////////
1630 : //
1631 : // The external interface definition
1632 : //
1633 : //////////////////////////////////////////////////////////////////////////
1634 :
1635 : /**
1636 : * The component handle.
1637 : * Used as indification in the outside world.
1638 : * @ingroup alihlt_wrapper_interface
1639 : */
1640 : typedef void* AliHLTComponentHandle;
1641 :
1642 : /** @ingroup alihlt_wrapper_interface */
1643 : const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
1644 :
1645 : /**
1646 : * Get a system call of the interface.
1647 : * @param function signature
1648 : * @return pointer to system call
1649 : * @ingroup alihlt_wrapper_interface
1650 : */
1651 : typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1652 :
1653 : # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
1654 : # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
1655 :
1656 : /** @ingroup alihlt_wrapper_interface */
1657 : typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1658 :
1659 : /** @ingroup alihlt_wrapper_interface */
1660 : typedef int (*AliHLTExtFctDeinitSystem)();
1661 :
1662 : /** @ingroup alihlt_wrapper_interface */
1663 : typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1664 :
1665 : /** @ingroup alihlt_wrapper_interface */
1666 : typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1667 :
1668 : /** @ingroup alihlt_wrapper_interface */
1669 : typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1670 :
1671 : /** @ingroup alihlt_wrapper_interface */
1672 : typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1673 :
1674 : /** @ingroup alihlt_wrapper_interface */
1675 : typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
1676 : AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1677 : AliHLTUInt32_t*, AliHLTUInt32_t*,
1678 : AliHLTComponentBlockData**,
1679 : AliHLTComponentEventDoneData** );
1680 :
1681 : /** @ingroup alihlt_wrapper_interface */
1682 : typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1683 :
1684 : /** @ingroup alihlt_wrapper_interface */
1685 : typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1686 :
1687 : }
1688 :
1689 : #include <bitset>
1690 : typedef std::bitset<NCTPTRIGGERCLASSES> AliHLTTriggerMask_t;
1691 :
1692 : using namespace std;
1693 :
1694 : //////////////////////////////////////////////////////////////////////////
1695 : //
1696 : // Data type helper functions
1697 : //
1698 : //////////////////////////////////////////////////////////////////////////
1699 :
1700 : /** exact comparison of HLT component data types
1701 : * @ingroup alihlt_component_datatypes
1702 : */
1703 : inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1704 : {
1705 0 : for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1706 0 : if ( dt1.fID[i] != dt2.fID[i] )
1707 0 : return false;
1708 0 : for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1709 0 : if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1710 0 : return false;
1711 0 : return true;
1712 0 : }
1713 :
1714 : /** Comparison operator for HLT component data types.
1715 : * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1716 : * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1717 : * @ingroup alihlt_component_datatypes
1718 : */
1719 : inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1720 : {
1721 0 : if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1722 0 : if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1723 :
1724 : bool any1=true, any2=true, void1=true, void2=true, match=true;
1725 0 : for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1726 0 : any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1727 0 : any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1728 0 : void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1729 0 : void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1730 0 : match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1731 0 : if (!(match || (any2 && !void1) || (any1 && !void2)))
1732 0 : return false;
1733 : }
1734 :
1735 : any1=true, any2=true, match=true;
1736 0 : for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1737 0 : any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1738 0 : any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1739 0 : void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1740 0 : void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1741 0 : match&=dt1.fID[i]==dt2.fID[i];
1742 0 : if (!(match || (any2 && !void1) || (any1 && !void2)))
1743 0 : return false;
1744 : }
1745 0 : return true;
1746 0 : }
1747 :
1748 : /** Comparison operator for HLT component data types
1749 : * Invers of operator==
1750 : * @ingroup alihlt_component_datatypes
1751 : */
1752 : inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1753 : {
1754 0 : return !(dt1==dt2);
1755 : }
1756 :
1757 : /** merge operator for HLT component data types and origins
1758 : * @ingroup alihlt_component_datatypes
1759 : */
1760 : inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1761 : {
1762 54 : AliHLTComponentDataType dt=srcdt;
1763 270 : for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1764 108 : dt.fOrigin[i]=origin[i];
1765 27 : return dt;
1766 : }
1767 :
1768 : /**
1769 : * Helper function to initialize a data type from an id char array and origin string.
1770 : * @return data type structure initialized with the specified id and origin
1771 : * @ingroup alihlt_component_datatypes
1772 : */
1773 : inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1774 : {
1775 8136 : AliHLTComponentDataType dt=kAliHLTVoidDataType;
1776 : int i=0;
1777 105768 : for (i = 0; i < kAliHLTComponentDataTypefIDsize && id[i]!=0; i++)
1778 32544 : dt.fID[i]=id[i];
1779 52290 : for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1780 13941 : dt.fOrigin[i]=origin[i];
1781 : return dt;
1782 4068 : }
1783 :
1784 :
1785 : /**
1786 : * Helper function as above, but takes 0 terminates string input and pads with spaces on the right
1787 : */
1788 :
1789 : inline AliHLTComponentDataType AliHLTComponentDataTypeInitializerWithPadding(const char* ID, const char* origin)
1790 : {
1791 0 : char src[kAliHLTComponentDataTypefIDsize + 1];
1792 0 : char org[kAliHLTComponentDataTypefOriginSize + 1];
1793 : int j;
1794 0 : int max = kAliHLTComponentDataTypefIDsize < strlen(ID) ? kAliHLTComponentDataTypefIDsize : strlen(ID);
1795 0 : for (j = 0;j < max;j++) src[j] = ID[j];
1796 0 : for (;j < kAliHLTComponentDataTypefIDsize;j++) src[j] = ' ';
1797 0 : src[j] = 0;
1798 0 : max = kAliHLTComponentDataTypefOriginSize < strlen(origin) ? kAliHLTComponentDataTypefOriginSize : strlen(origin);
1799 0 : for (j = 0;j < max;j++) org[j] = origin[j];
1800 0 : for (;j < kAliHLTComponentDataTypefOriginSize;j++) org[j] = ' ';
1801 0 : org[j] = 0;
1802 0 : return AliHLTComponentDataTypeInitializer(src, org);
1803 0 : }
1804 :
1805 : /**
1806 : * Helper function to initialize a data type from a default data type and
1807 : * an origin string. Basically it merges the specified origin into the data
1808 : * type.
1809 : * @return data type structure initialized with the id from specified data type
1810 : * and origin
1811 : * @ingroup alihlt_component_datatypes
1812 : */
1813 : inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1814 : {
1815 0 : return AliHLTComponentDataTypeInitializer(src.fID, origin);
1816 : }
1817 :
1818 : #endif
|