]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalHistoCollector.h
- fixing binning
[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 <vector>
26
27 class TH1;
28 class 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  */
52 class AliHLTGlobalHistoCollector : public AliHLTProcessor {
53     
54 public:
55   struct AliHLTHistoData
56   {
57     TH1 *fHisto;
58     AliHLTUInt32_t fSpecification;
59   };
60
61   struct AliHLTHistoBaseData
62   {
63     AliHLTHistoBaseData():fMergedHisto(0),fDataType(kAliHLTVoidDataType),fHistos(){}
64     AliHLTHistoBaseData( const AliHLTHistoBaseData &x):fMergedHisto(x.fMergedHisto),fDataType(x.fDataType),fHistos(x.fHistos){}
65     AliHLTHistoBaseData &operator=( const AliHLTHistoBaseData &x){ fMergedHisto= x.fMergedHisto; fDataType=x.fDataType; fHistos = x.fHistos; return *this; }
66     TH1 *fMergedHisto;
67     AliHLTComponentDataType fDataType;
68     std::vector<AliHLTHistoData> fHistos;
69   };
70   //typedef struct AliHLTHistoData AliHLTHistoData; //!
71   //typedef struct AliHLTHistoBaseData AliHLTHistoBaseData; //!
72
73   /** standard constructor */    
74   AliHLTGlobalHistoCollector();           
75   /** destructor */
76   virtual ~AliHLTGlobalHistoCollector();
77
78   // Public functions to implement AliHLTComponent's interface.
79   // These functions are required for the registration process
80       
81   /** interface function, see AliHLTComponent for description */
82   const char* GetComponentID();                                                      
83   /** interface function, see AliHLTComponent for description */
84   void GetInputDataTypes( vector<AliHLTComponentDataType>& list);                            
85   /** interface function, see AliHLTComponent for description */
86   AliHLTComponentDataType GetOutputDataType();                       
87   /** interface function, see AliHLTComponent for description */
88   virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ); 
89   /** interface function, see AliHLTComponent for description */
90   AliHLTComponent* Spawn();                                                        
91
92 protected:
93         
94   // Protected functions to implement AliHLTComponent's interface.
95   // These functions provide initialization as well as the actual processing capabilities of the component. 
96
97   int DoInit( int argc, const char** argv );
98   int DoDeinit();
99   int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
100   int Reconfigure(const char* cdbEntry, const char* chainId);
101
102   using AliHLTProcessor::DoEvent;
103
104 private:
105    
106   int Configure(const char* arguments);
107           
108   /** copy constructor prohibited */
109   AliHLTGlobalHistoCollector(const AliHLTGlobalHistoCollector&);
110
111   /** assignment operator prohibited */
112   AliHLTGlobalHistoCollector& operator=(const AliHLTGlobalHistoCollector&);
113
114   void Clear(); // reset the store
115
116   AliHLTUInt32_t fUID;// uID of the component
117
118   std::vector<AliHLTHistoBaseData> fStore;
119
120   ClassDef(AliHLTGlobalHistoCollector, 0)
121 };
122
123 #endif