extention of the functionality: TLists can be merged now
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalHistoCollector.h
CommitLineData
e419c1ae 1// -*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALIHLTGLOBALHISTOCOLLECTOR_H
5#define ALIHLTGLOBALHISTOCOLLECTOR_H
6
7//* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
10
11 /** @file AliHLTGlobalHistoCollector.h
12 @author Kalliopi Kanaki, Kenneth Aamodt
13 @date
14 @brief Component for acting upon histograms
15 */
16
17// see below for class documentation
18// or
19// refer to README to build package
20// or
21// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22
23#include "AliHLTProcessor.h"
24#include "AliHLTDataTypes.h"
25#include <vector>
26
27class TH1;
28class TH2;
29
30/**
31 * @class AliHLTGlobalHistoCollector
32 * Implementation of the component to read histograms from other
33 * components and add, divide etc.
34 * The component implements the interface methods of the @ref AliHLTProcessor.
35 *
36 * The component has the following component arguments:
37 *
38 * -sum-noise-histograms Loops over the output of TPCNoiseMap and sums the partition histograms
39 * They are sorted per TPC side.
40 *
41 * -sum-krypton-histograms Loops over the output of the krypton CF and sums the histograms
42 * (it will become obsolete, when the next option does all the work)
43 *
44 * -use-general It will become the standard general option for summing histograms
45 *
46 * -ignore-specification It ignores the last part of the histogram name, if it has
47 * the form "_Slice_%.2d%.2d_Partition_%.2d%.2d, minSlice, maxSlice, minPartition, maxPartition".
48 * It keeps the first part of the hist name and uses it to name the summed histogram.
49 *
50 * @ingroup alihlt_tpc
51 */
52class AliHLTGlobalHistoCollector : public AliHLTProcessor {
53
54public:
dcb913a8 55 struct AliHLTGlobalHCInstance
e419c1ae 56 {
dcb913a8 57 TObject *fObject;
58 AliHLTUInt32_t fHLTSpecification;
e419c1ae 59 };
60
dcb913a8 61 struct AliHLTGlobalHCCollection
e419c1ae 62 {
dcb913a8 63 public:
64 AliHLTGlobalHCCollection():fMergedObject(0),fHLTDataType(kAliHLTVoidDataType),fInstances(){}
65 AliHLTGlobalHCCollection( const AliHLTGlobalHCCollection &x):fMergedObject(x.fMergedObject),fHLTDataType(x.fHLTDataType),fInstances(x.fInstances){}
66 AliHLTGlobalHCCollection &operator=( const AliHLTGlobalHCCollection &x){
67 fMergedObject = x.fMergedObject;
68 fHLTDataType = x.fHLTDataType;
69 fInstances = x.fInstances;
70 return *this;
71 }
72
73 ~AliHLTGlobalHCCollection(){}
74
75 TObject *fMergedObject;
76 AliHLTComponentDataType fHLTDataType;
77 std::vector<AliHLTGlobalHCInstance> fInstances;
e419c1ae 78 };
e419c1ae 79
80 /** standard constructor */
81 AliHLTGlobalHistoCollector();
82 /** destructor */
83 virtual ~AliHLTGlobalHistoCollector();
84
85 // Public functions to implement AliHLTComponent's interface.
86 // These functions are required for the registration process
87
88 /** interface function, see AliHLTComponent for description */
89 const char* GetComponentID();
90 /** interface function, see AliHLTComponent for description */
91 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
92 /** interface function, see AliHLTComponent for description */
93 AliHLTComponentDataType GetOutputDataType();
94 /** interface function, see AliHLTComponent for description */
95 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
96 /** interface function, see AliHLTComponent for description */
97 AliHLTComponent* Spawn();
98
99protected:
100
101 // Protected functions to implement AliHLTComponent's interface.
102 // These functions provide initialization as well as the actual processing capabilities of the component.
103
104 int DoInit( int argc, const char** argv );
105 int DoDeinit();
106 int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
107 int Reconfigure(const char* cdbEntry, const char* chainId);
108
109 using AliHLTProcessor::DoEvent;
110
111private:
112
113 int Configure(const char* arguments);
114
115 /** copy constructor prohibited */
116 AliHLTGlobalHistoCollector(const AliHLTGlobalHistoCollector&);
117
118 /** assignment operator prohibited */
119 AliHLTGlobalHistoCollector& operator=(const AliHLTGlobalHistoCollector&);
120
121 void Clear(); // reset the store
122
123 AliHLTUInt32_t fUID;// uID of the component
124
dcb913a8 125 std::vector<AliHLTGlobalHCCollection> fStore;
e419c1ae 126
e419c1ae 127};
128
129#endif