]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/util/AliHLTRootSchemaEvolutionComponent.h
adding component for the generation of streamer info for objects in the HLTOUT
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRootSchemaEvolutionComponent.h
CommitLineData
65106d07 1// -*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALIHLTROOTSCHEMAEVOLUTIONCOMPONENT_H
5#define ALIHLTROOTSCHEMAEVOLUTIONCOMPONENT_H
6//* This file is property of and copyright by the ALICE HLT Project *
7//* ALICE Experiment at CERN, All rights reserved. *
8//* See cxx source for full Copyright notice *
9
10/** @file AliHLTRootSchemaEvolutionComponent.h
11 @author Matthias Richter
12 @date 2009-10-18
13 @brief Handler component for ROOT schema evolution of streamed objects
14*/
15
16#include "AliHLTProcessor.h"
17
18class TObjArray;
19
20/**
21 * @class AliHLTRootSchemaEvolutionComponent
22 *
23 * <h2>General properties:</h2>
24 *
25 * Component ID: \b ROOTFileWriter <br>
26 * Library: \b libAliHLTUtil.so <br>
27 * Input Data Types: ::kAliHLTAnyDataType <br>
28 * Output Data Types: none <br>
29 *
30 * <h2>Mandatory arguments:</h2>
31 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
32 *
33 * <h2>Optional arguments:</h2>
34 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
35 * \li -fxs<=off> <br>
36 * push streamer info to FXS, fetched by Shuttle and store in the entry
37 * HLT/Calib/StreamerInfo
38 * default off
39 * \li -hltout<=[all,first,eor,off]> <br>
40 * push streamer info to output, the streamer info is stored in the
41 * events in all, the first, and/or the EOR.
42 *
43 * <h2>Configuration:</h2>
44 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
45 * Configuration by component arguments.
46 *
47 * <h2>Default CDB entries:</h2>
48 * The component loads no CDB entries.
49 *
50 * <h2>Performance:</h2>
51 * The component does not process any event data.
52 *
53 * <h2>Memory consumption:</h2>
54 * The component does not process any event data.
55 *
56 * <h2>Output size:</h2>
57 * Depending on the mode.
58 *
59 * @ingroup alihlt_util_components
60 */
61class AliHLTRootSchemaEvolutionComponent : public AliHLTProcessor
62{
63 public:
64 /// standard constructor
65 AliHLTRootSchemaEvolutionComponent();
66 /// destructor
67 virtual ~AliHLTRootSchemaEvolutionComponent();
68
69 /// inherited from AliHLTComponent: return id of the component.
70 virtual const char* GetComponentID() {return "ROOTSchemaEvolutionComponent";};
71 /// inherited from AliHLTComponent: input data types
72 virtual void GetInputDataTypes(AliHLTComponentDataTypeList&);
73 /// inherited from AliHLTComponent: output data types
74 virtual AliHLTComponentDataType GetOutputDataType();
75 /// inherited from AliHLTComponent: output data size
76 virtual void GetOutputDataSize(unsigned long&, double&);
77
78 /// inherited from AliHLTComponent: spawn function, create an instance.
79 virtual AliHLTComponent* Spawn() {return new AliHLTRootSchemaEvolutionComponent;}
80
81 enum {
82 /// push streamer info to the HLTOUT for the first event
83 kHLTOUTatFirstEvent = 0x1,
84 /// push streamer info to the HLTOUT for all events
85 kHLTOUTatAllEvents = 0x2,
86 /// push streamer info to the HLTOUT at EOR, this has no relevance
87 /// for reconstruction as it is too late and just in one raw file,
88 /// but it allows archival at the end of the run
89 kHLTOUTatEOR = 0x4,
90 /// push streamer info to FXS
91 kFXS = 0x100,
92 };
93
94 /// Update the array of known streamer infos from a list of infos
95 /// Checks whether the provided infos are already there in the present version
96 /// and adds if it is a new info.
97 int UpdateStreamerInfos(const TList* list, TObjArray* infos) const;
98
99 protected:
100 /// inherited from AliHLTComponent: custom initialization
101 int DoInit( int argc, const char** argv );
102 /// inherited from AliHLTComponent: cleanup
103 int DoDeinit();
104
105 /// inherited from AliHLTProcessor processing
106 virtual int DoEvent( const AliHLTComponentEventData& evtData,
107 AliHLTComponentTriggerData& trigData );
108
109 using AliHLTProcessor::DoEvent;
110
111 /**
112 * Inherited from AliHLTComponent
113 * Scan one argument and adjacent parameters.
114 * @return number of scanned parameters, neg. error code if failed
115 */
116 virtual int ScanConfigurationArgument(int argc, const char** argv);
117
118 void SetBits(AliHLTUInt32_t b) {fFlags|=b;}
119 void ClearBits(AliHLTUInt32_t b) {fFlags&=~b;}
120 bool TestBits(AliHLTUInt32_t b) {return (fFlags&b) != 0;}
121
122private:
123 /** copy constructor prohibited */
124 AliHLTRootSchemaEvolutionComponent(const AliHLTRootSchemaEvolutionComponent&);
125 /** assignment operator prohibited */
126 AliHLTRootSchemaEvolutionComponent& operator=(const AliHLTRootSchemaEvolutionComponent&);
127
128 AliHLTUInt32_t fFlags; //! property flags
129
130 TObjArray* fpStreamerInfos; //! array of streamer infos
131
132 AliHLTUInt32_t fFXSPrescaler; //! prescalar for the publishing to FXS
133
134 static const char* fgkConfigurationObject; //! configuration object
135
136 ClassDef(AliHLTRootSchemaEvolutionComponent, 1) // ROOT schema evolution component
137};
138#endif