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