]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalHistoCollector.h
Introduction of decalibration in the simulations with anchor runs and raw:// OCDB.
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalHistoCollector.h
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 "AliHLTComponentBenchmark.h"
26 #include <vector>
27
28 class TH1;
29 class 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  */
53 class AliHLTGlobalHistoCollector : public AliHLTProcessor {
54     
55 public:
56   struct AliHLTGlobalHCInstance
57   {
58     TObject *fObject;
59     AliHLTUInt32_t fHLTSpecification;
60   };
61
62   struct AliHLTGlobalHCCollection
63   {
64   public:
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){}
67     AliHLTGlobalHCCollection &operator=( const AliHLTGlobalHCCollection &x){
68       fMergedObject = x.fMergedObject;
69       fHLTDataType = x.fHLTDataType;
70       fInstances = x.fInstances;   
71       fNeedToMerge = x.fNeedToMerge;
72       return *this;
73     }
74
75    ~AliHLTGlobalHCCollection(){}
76     
77     TObject *fMergedObject;
78     AliHLTComponentDataType fHLTDataType;
79     std::vector<AliHLTGlobalHCInstance> fInstances;
80     bool fNeedToMerge;
81   };
82
83   /** standard constructor */    
84   AliHLTGlobalHistoCollector();           
85   /** destructor */
86   virtual ~AliHLTGlobalHistoCollector();
87
88   // Public functions to implement AliHLTComponent's interface.
89   // These functions are required for the registration process
90       
91   /** interface function, see AliHLTComponent for description */
92   const char* GetComponentID();                                                      
93   /** interface function, see AliHLTComponent for description */
94   void GetInputDataTypes( vector<AliHLTComponentDataType>& list);                            
95   /** interface function, see AliHLTComponent for description */
96   AliHLTComponentDataType GetOutputDataType();                       
97   /** interface function, see AliHLTComponent for description */
98   virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ); 
99   /** interface function, see AliHLTComponent for description */
100   AliHLTComponent* Spawn();                                                        
101
102 protected:
103         
104   // Protected functions to implement AliHLTComponent's interface.
105   // These functions provide initialization as well as the actual processing capabilities of the component. 
106
107   int DoInit( int argc, const char** argv );
108   int DoDeinit();
109   int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
110   int Reconfigure(const char* cdbEntry, const char* chainId);
111
112   using AliHLTProcessor::DoEvent;
113
114 private:
115    
116   int Configure(const char* arguments);
117           
118   /** copy constructor prohibited */
119   AliHLTGlobalHistoCollector(const AliHLTGlobalHistoCollector&);
120
121   /** assignment operator prohibited */
122   AliHLTGlobalHistoCollector& operator=(const AliHLTGlobalHistoCollector&);
123
124   void Clear(); // reset the store
125
126   AliHLTUInt32_t fUID;// uID of the component
127
128   std::vector<AliHLTGlobalHCCollection> fStore;
129   AliHLTComponentBenchmark fBenchmark;// benchmark
130
131 };
132
133 #endif