]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/AliPWG0Helper.h
d3aaf39531fcb9ac8e0e11c065f49259935666a3
[u/mrichter/AliRoot.git] / PWG0 / AliPWG0Helper.h
1 /* $Id$ */
2
3 #ifndef ALIPWG0HELPER_H
4 #define ALIPWG0HELPER_H
5
6 #include <TObject.h>
7
8 // static helper functions
9
10 class AliESD;
11 class AliESDEvent;
12 class AliESDVertex;
13 class TParticle;
14 class TH1;
15 class TH2;
16 class TH3;
17 class AliHeader;
18 class AliGenEventHeader;
19 class AliStack;
20 class TTree;
21
22 class AliPWG0Helper : public TObject
23 {
24   public:
25     enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR }; // definition from ALICE-INT-2005-025
26     enum AnalysisMode { kInvalid = -1, kSPD = 0, kTPC, kTPCITS };
27     // in case we want to use bitmaps...
28     enum MCProcessType { kInvalidProcess = -1, kND = 0x1, kDD = 0x2, kSD = 0x4 };
29
30     static Bool_t IsEventTriggered(const AliESD* aEsd, Trigger trigger = kMB2);
31     static Bool_t IsEventTriggered(ULong64_t triggerMask, Trigger trigger = kMB2);
32     static const AliESDVertex* GetVertex(AliESDEvent* aEsd, AnalysisMode analysisMethod, Bool_t debug = kFALSE,Bool_t bRedoTPC = false);
33     static Bool_t TestVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug = kFALSE);
34
35     static Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries, Bool_t adebug = kFALSE);
36
37     static AliPWG0Helper::MCProcessType GetEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
38     static AliPWG0Helper::MCProcessType GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
39     static AliPWG0Helper::MCProcessType GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
40     static Int_t GetLastProcessType() { return fgLastProcessType; }
41
42     static TParticle* FindPrimaryMother(AliStack* stack, Int_t label);
43     static Int_t FindPrimaryMotherLabel(AliStack* stack, Int_t label);
44
45     static void CreateProjections(TH3* hist, Bool_t save = kFALSE);
46     static void CreateDividedProjections(TH3* hist, TH3* hist2, const char* axis = 0, Bool_t putErrors = kFALSE, Bool_t save = kFALSE);
47     static const char* GetAxisTitle(TH3* hist, const char axis);
48
49     static void NormalizeToBinWidth(TH1* hist);
50     static void NormalizeToBinWidth(TH2* hist);
51
52     static void PrintConf(AnalysisMode analysisMode, Trigger trigger);
53
54   protected:
55     static Int_t fgLastProcessType;    // stores the raw value of the last process type extracnted
56  
57     ClassDef(AliPWG0Helper, 0)
58
59   private:
60     AliPWG0Helper(const AliPWG0Helper&);
61     AliPWG0Helper& operator=(const AliPWG0Helper&);
62 };
63
64 #endif
65