]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnPIDIndex.h
General PWG2/RESONANCES package upgrade
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPIDIndex.h
1 //
2 // Class AliRsnPIDIndex
3 //
4 // It sorts the indexes of all tracks in an AliRsnEvent
5 // for a fast retrieval of them according to charge and PID.
6 //
7 // author: M. Vala (email: martin.vala@cern.ch)
8 //
9
10 #ifndef AliRsnPIDIndex_h
11 #define AliRsnPIDIndex_h
12
13 #include <TArrayI.h>
14
15 #include "AliRsnEvent.h"
16 #include "AliAODTrack.h"
17 #include "AliRsnDaughter.h"
18 #include "AliRsnPIDDefESD.h"
19
20 class AliESDtrackCuts;
21
22 class AliRsnPIDIndex : public TObject
23 {
24   public:
25
26     AliRsnPIDIndex(Int_t num = 1000);
27     AliRsnPIDIndex(const AliRsnPIDIndex &copy);
28     AliRsnPIDIndex& operator= (const AliRsnPIDIndex& copy);
29
30     virtual  ~AliRsnPIDIndex();
31
32     void      Print(Option_t *option = "") const;
33     void      ResetAll(Int_t num=1000);
34     
35     void      FillFromEvent(AliRsnEvent *event = 0, AliESDtrackCuts *cuts = 0);
36
37     void      AddIndex(const Int_t index, AliRsnDaughter::EPIDMethod meth, Char_t sign, AliPID::EParticleType type);
38     void      SetCorrectIndexSize();
39
40     TArrayI*  GetTracksArray(AliRsnDaughter::EPIDMethod meth, Char_t sign, AliPID::EParticleType type);
41     TArrayI*  GetCharged(Char_t sign);
42     
43     // Prior probs
44     void            SetPriorProbability(AliPID::EParticleType type, Double_t p);
45     void            SetPriorProbability(Double_t *out);
46     void            DumpPriors();
47     void            GetPriorProbability(Double_t *out);
48
49     AliRsnPIDDefESD* GetPIDDef() {return &fPIDDef;}
50
51   private:
52
53     Int_t     ChargeIndex(Char_t sign) const;
54     Char_t    IndexCharge(Short_t sign) const;
55
56     TArrayI   fIndex[AliRsnDaughter::kMethods][2][AliPID::kSPECIES + 1];       // index arrays of pos/neg particles of each PID
57     Int_t     fNumOfIndex[AliRsnDaughter::kMethods][2][AliPID::kSPECIES + 1];  //! array size
58     
59     Double_t         fPrior[AliPID::kSPECIES]; // prior probabilities
60     AliRsnPIDDefESD  fPIDDef; // customization of weights
61
62     ClassDef(AliRsnPIDIndex, 1);
63 };
64
65 #endif