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