]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTCompStatCollector.h
New Component:
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTCompStatCollector.h
1 // -*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTCOMPSTATCOLLECTOR_H
5 #define ALIHLTCOMPSTATCOLLECTOR_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   AliHLTCompStatCollector.h
11     @author Matthias Richter
12     @date   
13     @brief  Collector component for the component statistics information.
14 */
15
16 #include "AliHLTProcessor.h"
17
18 class TStopwatch;
19 class TH1F;
20 class TH2F;
21 class TH2C;
22 class TTree;
23 class TFolder;
24
25 /**
26  * @class AliHLTCompStatCollector
27  * Collector component for the statistics entries produced by the
28  * AliHLTComponent base class.
29  *
30  * <h2>General properties:</h2>
31  * This components collects all data blocks of types
32  * ::kAliHLTDataTypeComponentStatistics and ::kAliHLTDataTypeComponentTable
33  * which can be produced by the AliHLTComponent base class for every component
34  * and event. Component statistics entries are data blocks of
35  * ::AliHLTComponentStatistics arrays containing a couple of informations
36  * about each component. The information is extracted and stored into a
37  * TTree. The component table entries (AliHLTComponentTable structs) are sent
38  * on SOR and EOR events and are arranged in a TFolder hierarchy.
39  *
40  * Component ID: \b StatisticsCollector                                 <br>
41  * Library: \b libAliHLTUtil.so                                         <br>
42  * Input Data Types: kAliHLTDataTypeComponentStatistics                 <br>
43  * Output Data Types: kAliHLTDataTypeHistogram, kAliHLTDataTypeTNtuple  <br>
44  *
45  * <h2>Mandatory arguments:</h2>
46  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
47  *
48  * <h2>Optional arguments:</h2>
49  *
50  * <h2>Configuration:</h2>
51  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52  * Configuration by component arguments.
53  *
54  * <h2>Default CDB entries:</h2>
55  * The component loads no CDB entries.
56  *
57  * <h2>Performance:</h2>
58  *
59  * <h2>Memory consumption:</h2>
60  *
61  * <h2>Output size:</h2>
62  *
63  * @ingroup alihlt_util_components
64  */
65 class AliHLTCompStatCollector : public AliHLTProcessor
66 {
67  public:
68   /** standard constructor */
69   AliHLTCompStatCollector();
70   /** destructor */
71   virtual ~AliHLTCompStatCollector();
72
73   const char* GetComponentID() {return "StatisticsCollector";};
74   AliHLTComponent* Spawn() {return new AliHLTCompStatCollector;}
75   void GetInputDataTypes( vector<AliHLTComponentDataType>& );
76   AliHLTComponentDataType GetOutputDataType();
77   int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
78   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
79
80  protected:
81   int DoInit( int argc, const char** argv );
82   int DoDeinit();
83   int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
84   
85   using AliHLTProcessor::DoEvent;
86
87  private:
88   /** not a valid copy constructor, defined according to effective C++ style */
89   AliHLTCompStatCollector(const AliHLTCompStatCollector&);
90   /** not a valid assignment op, but defined according to effective C++ style */
91   AliHLTCompStatCollector& operator=(const AliHLTCompStatCollector&);
92
93   /**
94    * Reset all filling variables and lists.
95    */
96   void ResetFillingVariables();
97
98   /**
99    * Fill the lists from the component statistics block.
100    */
101   int FillVariablesSorted(void* ptr, int size);
102
103   /** delete all internal objects */
104   void ClearAll();
105
106   /**
107    * Remove entries from the parent list if they occur further down in the
108    * hierarchy.
109    */
110   int RemoveRecurrence(TFolder* pRoot) const;
111
112   /** event cycle timer */
113   TStopwatch* fpTimer; //!transient
114
115   /** top folder */
116   TFolder* fpFolder; //!transient
117
118   /** statistics tree */
119   TTree* fpStatTree; //!transient
120
121   /** branch filling variable */
122   Float_t fCycleTime; //!transient
123   /** branch filling variable */
124   Int_t fNofSets; //!transient
125   /** array size */
126   UInt_t fArraySize; //!transient
127   /** current position */
128   UInt_t fPosition; //!transient
129   /** branch filling variable */
130   UInt_t* fpLevelArray; //!transient
131   /** branch filling variable */
132   UInt_t* fpSpecArray; //!transient
133   /** branch filling variable */
134   UInt_t* fpBlockNoArray; //!transient
135   /** branch filling variable */
136   UInt_t* fpIdArray; //!transient
137   /** branch filling variable */
138   UInt_t* fpTimeArray; //!transient
139   /** branch filling variable */
140   UInt_t* fpCTimeArray; //!transient
141   /** branch filling variable */
142   UInt_t* fpInputBlockCountArray; //!transient
143   /** branch filling variable */
144   UInt_t* fpTotalInputSizeArray; //!transient
145   /** branch filling variable */
146   UInt_t* fpOutputBlockCountArray; //!transient
147   /** branch filling variable */
148   UInt_t* fpTotalOutputSizeArray; //!transient
149
150   ClassDef(AliHLTCompStatCollector, 1)
151 };
152 #endif