]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnAnalysis.h
fixed coding conventions violations
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnAnalysis.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * See cxx source for full Copyright notice                               *
4  **************************************************************************/
5
6 //-------------------------------------------------------------------------
7 //                      Class AliRsnAnalysis
8 //             Reconstruction and analysis of K* Rsn
9 // ........................................
10 // ........................................
11 // ........................................
12 // ........................................
13 // 
14 // author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
15 //-------------------------------------------------------------------------
16
17 #ifndef AliRsnANALYSIS_H
18 #define AliRsnANALYSIS_H
19
20 #include <TNamed.h>
21
22 #include "AliPID.h"
23
24 class TH1D;
25 class TObjArray;
26 class AliRsnEvent;
27 class AliRsnDaughter;
28 class AliRsnDaughterCut;
29
30 class AliRsnAnalysis : public TObject
31 {
32 public:
33
34                  AliRsnAnalysis();
35                          AliRsnAnalysis(const AliRsnAnalysis &copy) : TObject(copy) { }
36                          AliRsnAnalysis& operator=(const AliRsnAnalysis & /*copy*/) { return (*this); }
37         virtual ~AliRsnAnalysis() {Clear();}
38         
39         void     AddCutPair(AliRsnDaughterCut *cut);
40         void     AddCutSingle(AliPID::EParticleType type, AliRsnDaughterCut *cut);
41         void     AddMixPairDef(AliPID::EParticleType p1, Char_t s1, AliPID::EParticleType p2, Char_t s2);
42         void     AddPairDef(AliPID::EParticleType p1, Char_t s1, AliPID::EParticleType p2, Char_t s2, Bool_t onlyTrue = kFALSE);
43         void     Clear(Option_t *option = "");  
44         Stat_t   EventMix(Int_t nmix = 5, Int_t multDiffMax = 10, Double_t vzDiffMax = 0.01, Bool_t compareTotalMult = kFALSE);
45         Stat_t   Process();
46         void     SetBins(Int_t nbins, Double_t min, Double_t max) {fNBins=nbins;fHistoMin=min;fHistoMax=max;}
47         void     SetEventsTree(TTree *tree)                       {fEventsTree = tree;}
48         void     SetRejectFakes(Bool_t doit=kTRUE)                {fRejectFakes = doit;}                
49         void     SetTrueMotherPDG(Int_t pdg)                      {fTrueMotherPDG = pdg;}
50         void     WriteHistograms() const;
51         
52 private:
53
54         class AliPairDef : public TNamed
55         {
56         public:
57         
58                 AliPairDef(AliPID::EParticleType p1, Char_t s1, AliPID::EParticleType p2, Char_t s2, Int_t pdg, Bool_t onlyTrue = kFALSE);
59                                    
60                 virtual ~AliPairDef()                 { }
61                 
62                 Char_t                 GetSign1() const {return fSign1;}
63                 Char_t                 GetSign2() const {return fSign2;}
64                 Bool_t                 GetOnlyTrue() const {return fOnlyTrue;}
65                 AliPID::EParticleType  GetParticle1() const {return fParticle1;}
66                 AliPID::EParticleType  GetParticle2() const {return fParticle2;}
67                 Double_t               GetMass1() const {return fMass1;}
68                 Double_t               GetMass2() const {return fMass2;}
69                                 
70             void SetSign1(Char_t value)                 {fSign1 = value;}
71                 void SetSign2(Char_t value)                 {fSign2 = value;}
72                 void SetOnlyTrue(Bool_t value = kTRUE)      {fOnlyTrue = value;}
73                 void SetTrueMotherPDG(Int_t pdg)            {fTrueMotherPDG = pdg;}
74                 void SetParticle1(AliPID::EParticleType p)  {fParticle1 = p;}
75                 void SetParticle2(AliPID::EParticleType p)  {fParticle2 = p;}
76                 
77                 Text_t* ParticleName(AliPID::EParticleType part) const;
78                 
79         private:
80         
81                 Bool_t                 fOnlyTrue;          // flag to be used for spectra of true pairs
82                 Int_t                  fTrueMotherPDG; // PDG code of true mother (if requested)
83                 
84                 Double_t               fMass1;     // info
85                 Char_t                 fSign1;     // about
86                 AliPID::EParticleType  fParticle1; // particle 1
87         
88                 Double_t               fMass2;     // info
89                 Char_t                 fSign2;     // about
90                 AliPID::EParticleType  fParticle2; // particle 2
91         };
92         
93         Stat_t     Compute(AliPairDef *pd, TH1D* &h, AliRsnEvent *ev1, AliRsnEvent *ev2);
94         Bool_t     SingleCutCheck(Int_t itype, AliRsnDaughter *track) const;
95         Bool_t     PairCutCheck(AliRsnDaughter *track1, AliRsnDaughter *track2) const;
96         
97         Bool_t     fRejectFakes;             // reject particles labeled as fake
98         
99         Int_t      fNBins;                   // number of histogram bins
100         Double_t   fHistoMin;                // minimum of the histograms
101         Double_t   fHistoMax;                // maximum of the histograms
102         
103         Int_t      fTrueMotherPDG;           // PDG code of true mother (used to create 'true' histos)
104         
105         TObjArray *fMixPairDefs;             //  list of pair definitions for histograms (event mixing)
106         TObjArray *fMixHistograms;           //! list of invmass histograms created (event mixing)
107         
108         TObjArray *fPairDefs;                //  list of pair definitions for histograms
109         TObjArray *fHistograms;              //! list of invmass histograms created
110
111         TObjArray *fCuts[AliPID::kSPECIES];  //! list of single particle cuts for each particle type
112         TObjArray *fPairCuts;                //! list of pair cuts
113         TTree     *fEventsTree;              //! TTree of events (can not be created here, must be passed)
114         
115         // Rsn analysis implementation
116         ClassDef(AliRsnAnalysis,1)
117 };
118
119 #endif