]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliAnalysisStatistics.h
2011 udates for event plane
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisStatistics.h
1 #ifndef ALIANALYSISSTATISTICS_H
2 #define ALIANALYSISSTATISTICS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 // Author: Andrei Gheata, 20/12/2010
8
9 //==============================================================================
10 //   AliAnalysisStatistics - Class holding statistics information regarding the
11 //      number of events processed, failed and accepted.
12 //==============================================================================
13
14 #ifndef ROOT_TNamed
15 #include "TNamed.h"
16 #endif
17
18 class TCollection;
19
20 class AliAnalysisStatistics : public TNamed {
21
22 protected:
23   Long64_t                    fNinput;            // Total number of input events
24   Long64_t                    fNprocessed;        // Number of events processed
25   Long64_t                    fNfailed;           // Number of events for which reading failed
26   Long64_t                    fNaccepted;         // Number of events that passed filtering criteria
27   UInt_t                      fOfflineMask;       // Offline mask used for accepted events
28 public:
29   AliAnalysisStatistics() : TNamed(),fNinput(0),fNprocessed(0),fNfailed(0),fNaccepted(0),fOfflineMask(0) {}
30   AliAnalysisStatistics(const char *name) : TNamed(name,""),fNinput(0),fNprocessed(0),fNfailed(0),fNaccepted(0),fOfflineMask(0) {}
31   AliAnalysisStatistics(const AliAnalysisStatistics &other);
32   virtual ~AliAnalysisStatistics() {}
33   
34   AliAnalysisStatistics& operator=(const AliAnalysisStatistics &other);
35   // Update methods
36   void                        AddInput(Int_t nevents=1)     {fNinput += nevents;}
37   void                        AddProcessed(Int_t nevents=1) {fNprocessed += nevents;}
38   void                        AddFailed(Int_t nevents=1)    {fNfailed += nevents;}
39   void                        AddAccepted(Int_t nevents=1)  {fNaccepted += nevents;}
40   // Getters
41   Long64_t                    GetNinput()     const         {return fNinput;}
42   Long64_t                    GetNprocessed() const         {return fNprocessed;}
43   Long64_t                    GetNfailed()    const         {return fNfailed;}
44   Long64_t                    GetNaccepted()  const         {return fNaccepted;}
45   UInt_t                      GetOfflineMask() const        {return fOfflineMask;}
46   static const char          *GetMaskAsString(UInt_t mask);
47   
48   void                        SetOfflineMask(UInt_t mask)   {fOfflineMask = mask;}
49   virtual Long64_t            Merge(TCollection* list);
50   virtual void                Print(const Option_t *option="") const;
51
52   ClassDef(AliAnalysisStatistics,1)  // Class holding the processed events statistics
53 };
54 #endif