]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/EVE/AliHLTEveHistoMerger.h
bugfix: output of one extra cluster when the last rawcluster was accepted by the...
[u/mrichter/AliRoot.git] / HLT / EVE / AliHLTEveHistoMerger.h
1 // -*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTEVEHISTOMERGER_H
5 #define ALIHLTEVEHISTOMERGER_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   AliHLTEveHistoMerger.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 "AliHLTDataTypes.h"
24 #include <vector>
25
26 class TH1;
27 class TH2;
28 class TObject;
29
30 /**
31  * @class AliHLTEveHistoMerger
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
53 class AliHLTEveHistoMerger  {
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),fInstances(),fNeedToMerge(0){}
66     AliHLTGlobalHCCollection( const AliHLTGlobalHCCollection &x):fMergedObject(x.fMergedObject),fInstances(x.fInstances),fNeedToMerge(x.fNeedToMerge){}
67     AliHLTGlobalHCCollection &operator=( const AliHLTGlobalHCCollection &x){
68       if (this==&x) return *this;
69       fMergedObject = x.fMergedObject;
70       fInstances = x.fInstances;   
71       fNeedToMerge = x.fNeedToMerge;
72       return *this;
73     }
74
75    ~AliHLTGlobalHCCollection(){}
76     
77     TObject *fMergedObject;
78     std::vector<AliHLTGlobalHCInstance> fInstances;
79     bool fNeedToMerge;
80   };
81
82   /** standard constructor */    
83   AliHLTEveHistoMerger();           
84   /** destructor */
85   virtual ~AliHLTEveHistoMerger();
86
87   TObject* Process( const TObject* evtData, AliHLTUInt32_t spec);
88   
89 private:
90    
91   /** copy constructor prohibited */
92   AliHLTEveHistoMerger(const AliHLTEveHistoMerger&);
93
94   /** assignment operator prohibited */
95   AliHLTEveHistoMerger& operator=(const AliHLTEveHistoMerger&);
96
97   void Clear(); // reset the store
98
99
100   std::vector<AliHLTGlobalHCCollection> fStore;
101
102 };
103
104 #endif