coverity 18019 fix
[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"
776446ad 25#include "AliHLTComponentBenchmark.h"
e419c1ae 26#include <vector>
27
28class TH1;
29class TH2;
30
31/**
32 * @class AliHLTGlobalHistoCollector
33 * Implementation of the component to read histograms from other
34 * components and add, divide etc.
35 * The component implements the interface methods of the @ref AliHLTProcessor.
36 *
37 * The component has the following component arguments:
38 *
39 * -sum-noise-histograms Loops over the output of TPCNoiseMap and sums the partition histograms
40 * They are sorted per TPC side.
41 *
42 * -sum-krypton-histograms Loops over the output of the krypton CF and sums the histograms
43 * (it will become obsolete, when the next option does all the work)
44 *
45 * -use-general It will become the standard general option for summing histograms
46 *
47 * -ignore-specification It ignores the last part of the histogram name, if it has
48 * the form "_Slice_%.2d%.2d_Partition_%.2d%.2d, minSlice, maxSlice, minPartition, maxPartition".
49 * It keeps the first part of the hist name and uses it to name the summed histogram.
50 *
51 * @ingroup alihlt_tpc
52 */
53class AliHLTGlobalHistoCollector : public AliHLTProcessor {
54
55public:
dcb913a8 56 struct AliHLTGlobalHCInstance
e419c1ae 57 {
dcb913a8 58 TObject *fObject;
59 AliHLTUInt32_t fHLTSpecification;
e419c1ae 60 };
61
dcb913a8 62 struct AliHLTGlobalHCCollection
e419c1ae 63 {
dcb913a8 64 public:
776446ad 65 AliHLTGlobalHCCollection():fMergedObject(0),fHLTDataType(kAliHLTVoidDataType),fInstances(),fNeedToMerge(0){}
66 AliHLTGlobalHCCollection( const AliHLTGlobalHCCollection &x):fMergedObject(x.fMergedObject),fHLTDataType(x.fHLTDataType),fInstances(x.fInstances),fNeedToMerge(x.fNeedToMerge){}
dcb913a8 67 AliHLTGlobalHCCollection &operator=( const AliHLTGlobalHCCollection &x){
4f8dc2f7 68 if( &x!=this ){
69 fMergedObject = x.fMergedObject;
70 fHLTDataType = x.fHLTDataType;
71 fInstances = x.fInstances;
72 fNeedToMerge = x.fNeedToMerge;
73 }
dcb913a8 74 return *this;
75 }
76
77 ~AliHLTGlobalHCCollection(){}
78
79 TObject *fMergedObject;
80 AliHLTComponentDataType fHLTDataType;
81 std::vector<AliHLTGlobalHCInstance> fInstances;
776446ad 82 bool fNeedToMerge;
e419c1ae 83 };
e419c1ae 84
85 /** standard constructor */
86 AliHLTGlobalHistoCollector();
87 /** destructor */
88 virtual ~AliHLTGlobalHistoCollector();
89
90 // Public functions to implement AliHLTComponent's interface.
91 // These functions are required for the registration process
92
93 /** interface function, see AliHLTComponent for description */
94 const char* GetComponentID();
95 /** interface function, see AliHLTComponent for description */
96 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
97 /** interface function, see AliHLTComponent for description */
98 AliHLTComponentDataType GetOutputDataType();
99 /** interface function, see AliHLTComponent for description */
100 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
101 /** interface function, see AliHLTComponent for description */
102 AliHLTComponent* Spawn();
103
104protected:
105
106 // Protected functions to implement AliHLTComponent's interface.
107 // These functions provide initialization as well as the actual processing capabilities of the component.
108
109 int DoInit( int argc, const char** argv );
110 int DoDeinit();
111 int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
112 int Reconfigure(const char* cdbEntry, const char* chainId);
113
114 using AliHLTProcessor::DoEvent;
115
116private:
117
118 int Configure(const char* arguments);
119
120 /** copy constructor prohibited */
121 AliHLTGlobalHistoCollector(const AliHLTGlobalHistoCollector&);
122
123 /** assignment operator prohibited */
124 AliHLTGlobalHistoCollector& operator=(const AliHLTGlobalHistoCollector&);
125
126 void Clear(); // reset the store
127
128 AliHLTUInt32_t fUID;// uID of the component
129
dcb913a8 130 std::vector<AliHLTGlobalHCCollection> fStore;
776446ad 131 AliHLTComponentBenchmark fBenchmark;// benchmark
e419c1ae 132
e419c1ae 133};
134
135#endif