Commit PWG2 Makefile. To compile the code of the PWG2 module one has to do: make...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnReader.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 AliRsnEventReader
8 //             
9 //   Reader for conversion of ESD or Kinematics output into AliRsnEvent
10 // 
11 // author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
12 //-------------------------------------------------------------------------
13
14 #ifndef AliRSNREADER_H
15 #define AliRSNREADER_H
16
17 #include "AliPID.h"
18
19 class TH3D;
20 class TH1D;
21 class TOrdCollection;
22 class TTree;
23 class AliRunLoader;
24
25 class AliRsnReader : public TObject
26 {
27 public:
28
29         enum EPIDMethod { 
30                 kNoPID = 0,                  // no PID performed
31                 kPerfectPID = 1,             // use Kinematics to simulate a 100% PID efficiency
32                 kESDPID = 2,                 // use experimental ESD weights
33                 kPerfectPIDwithRecSign = 3   // get particle type from Kine and charge sign from reconstruction
34         };
35
36                    AliRsnReader();
37                            AliRsnReader(const AliRsnReader& copy);
38         virtual   ~AliRsnReader() {Clear("DELTREE");}
39         
40         void       Clear(Option_t *option = "");
41         Bool_t     EffSim(Int_t pdg, Double_t pt, Double_t eta, Double_t z);
42         TTree*     GetEvents() const                                                              {return fEvents;}
43         Double_t*  GetPIDprobabilities(AliRsnDaughter track);
44         void       Identify(AliRsnDaughter &track);
45         TTree*     ReadParticles(const char *path, Option_t *option="");
46         TTree*     ReadTracks(const char *path, Option_t *option="R");
47         TTree*     ReadTracksAndParticles(const char *path, Option_t *option="R");
48         void       SetEfficiencyHistogram(AliPID::EParticleType type, TH3D *h, Bool_t pos=kTRUE);
49         void       SetMaxRadius(Double_t value)                                           {fMaxRadius=value;}
50         void       SetPIDMethod(AliRsnReader::EPIDMethod pm)                    {fPIDMethod=pm;}
51         void       SetPriorProbabilities(Double_t *prior);
52         void       SetPriorProbability(AliPID::EParticleType type, Double_t p);
53         void       SetProbabilityThreshold(Double_t p)                        {fProbThreshold=p;}
54         void       SetPtLimit4PID(Double_t value)                                         {fPtLimit4PID=value;}
55         void       SetResolutionPt(TH1D *histo)                                 {fResPt=histo;}
56         void       SetResolutionLambda(TH1D *histo)                             {fResLambda=histo;}
57         void       SetResolutionPhi(TH1D *histo)                                {fResPhi=histo;}
58         void       SmearMomentum(Double_t &px, Double_t &py, Double_t &pz);
59         
60 protected:
61
62         AliPID::EParticleType FindType(Int_t pdg);
63         AliRunLoader*         OpenRunLoader(const char *path);
64
65         Bool_t     fDoEffSim;                 //  set to true to introduce efficiency effects
66         Bool_t     fDoSmearing;               //  when selecting only particles, set this to true 
67                                               //  to smear particle momentum
68         
69         EPIDMethod fPIDMethod;                //  PID method
70         Double_t   fPrior[AliPID::kSPECIES];  //  prior probabilities (in case of REAL pid)
71         Double_t   fPtLimit4PID;                          //  maximum transverse momentum to accept realistic PID
72         Double_t   fProbThreshold;                        //  minimum required probability to accept realistic PID
73         Double_t   fMaxRadius;                //  maximum allowed distance from primary vertex
74         
75         TTree     *fEvents;                   //! tree of read events
76         TH3D      *fEffPos[AliPID::kSPECIES]; //  tracking efficiency (in pt, eta and Zv) for positive particles
77         TH3D      *fEffNeg[AliPID::kSPECIES]; //  tracking efficiency (in pt, eta and Zv) for negative particles
78         TH1D      *fResPt;                    //  relative Pt resolution
79         TH1D      *fResLambda;                //  relative Lambda resolution
80         TH1D      *fResPhi;                   //  relative Phi resolution
81         
82         // Rsn event reader implementation
83         ClassDef(AliRsnReader,1)
84 };
85
86 #endif
87