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