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