4 #ifndef ALIHLTGLOBALHISTOCOMPONENT_H
5 #define ALIHLTGLOBALHISTOCOMPONENT_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 *
10 /// @file AliHLTGlobalHistoComponent.h
11 /// @author Matthias Richter
13 /// @brief A histogramming component for global ESD properties based
14 /// on the AliHLTTTreeProcessor
16 #include "AliHLTTTreeProcessor.h"
22 * @class AliHLTGlobalHistoComponent
24 * <h2>General properties:</h2>
26 * Component ID: \b GlobalHisto <br>
27 * Library: \b libAliHLTGlobal.so <br>
28 * Input Data Types: ::kAliHLTAnyDataType <br>
29 * Output Data Types: none <br>
31 * <h2>Mandatory arguments:</h2>
32 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
34 * <h2>Optional arguments:</h2>
35 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
37 * <h2>Configuration:</h2>
38 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
39 * Configuration by component arguments.
41 * <h2>Default CDB entries:</h2>
42 * The component loads no CDB entries.
44 * <h2>Performance:</h2>
45 * The component does not process any event data.
47 * <h2>Memory consumption:</h2>
48 * The component does not process any event data.
50 * <h2>Output size:</h2>
51 * Depending on the mode.
53 * @ingroup alihlt_util_components
55 class AliHLTGlobalHistoComponent : public AliHLTTTreeProcessor
58 /// standard constructor
59 AliHLTGlobalHistoComponent();
61 virtual ~AliHLTGlobalHistoComponent();
63 /// inherited from AliHLTComponent: return id of the component.
64 virtual const char* GetComponentID() {return "GlobalHisto";};
65 /// inherited from AliHLTComponent: input data types
66 virtual void GetInputDataTypes(AliHLTComponentDataTypeList&);
68 /// inherited from AliHLTComponent: spawn function, create an instance.
69 virtual AliHLTComponent* Spawn() {return new AliHLTGlobalHistoComponent;}
71 void FillHistogramDefinitions();
73 /// @class AliHLTGlobalHistoVariables
74 /// container for the tree branch variables
75 class AliHLTGlobalHistoVariables {
77 AliHLTGlobalHistoVariables();
78 AliHLTGlobalHistoVariables(int capacity, const char* names);
79 ~AliHLTGlobalHistoVariables();
82 int Init(int capacity, const char* names);
84 /// capacity for every key
85 int Capacity() const {return fCapacity;}
86 /// number of variables
87 int Variables() const {return fArrays.size();}
89 /// fill variable at index
90 int Fill(unsigned index, float value);
91 /// fill variable at key
92 int Fill(const char* key, float value);
94 float* GetArray(const char* key);
95 /// get the key of an array
96 const char* GetKey(int index) const;
98 /// reset and cleanup arrays
101 /// reset the fill counts
105 int FindKey(const char* key) const;
107 /// capacity of all arrays
109 /// pointers of arrays
110 vector<float*> fArrays; //!
111 /// fill count for arrays
112 vector<int> fCount; //!
114 map<string,int> fKeys; //!
118 /// inherited from AliHLTTTreeProcessor: create the tree instance and all branches
119 TTree* CreateTree(int argc, const char** argv);
120 /// inherited from AliHLTTTreeProcessor: process input blocks and fill tree
121 int FillTree(TTree* pTree, const AliHLTComponentEventData& evtData,
122 AliHLTComponentTriggerData& trigData );
123 /// dtOrigin for PushBack.
124 AliHLTComponentDataType GetOriginDataType() const;
125 /// spec for PushBack
126 AliHLTUInt32_t GetDataSpec() const {return 0;}
128 int ResetVariables();
131 /// copy constructor prohibited
132 AliHLTGlobalHistoComponent(const AliHLTGlobalHistoComponent&);
133 /// assignment operator prohibited
134 AliHLTGlobalHistoComponent& operator=(const AliHLTGlobalHistoComponent&);
136 /// the event number, tree filling variable
138 /// track count, tree filling variable
140 /// x coordinate of vertex
142 /// y coordinate of vertex
144 /// z coordinate of vertex
147 /// filling arrays for track parameters
148 AliHLTGlobalHistoComponent::AliHLTGlobalHistoVariables fTrackVariables; //!
150 ClassDef(AliHLTGlobalHistoComponent, 0) // HLT Global Histogram component