]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnPairDef.h
AliRsnCut:
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPairDef.h
1 //
2 // Class AliRsnPairDef
3 //
4 // Defines a decay channel for a resonance,
5 // resulting in a specified PDG code for the mother,
6 // and the particle type for the daughters, defined
7 // according to the internal PID format of the package
8 //
9 // author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
10 //
11
12 #ifndef ALIRSNPAIRDEF_H
13 #define ALIRSNPAIRDEF_H
14
15 #include "AliPID.h"
16 #include "AliRsnDaughter.h"
17 #include "AliRsnDaughterDef.h"
18
19 class AliRsnMother;
20
21 class AliRsnPairDef : public TObject {
22 public:
23
24    AliRsnPairDef();
25    AliRsnPairDef(EPARTYPE type1, Char_t sign1, EPARTYPE type2, Char_t sign2, Int_t motherPDG = 0, Double_t motherMass = 0.0);
26    AliRsnPairDef(const AliRsnPairDef &copy);
27    const AliRsnPairDef& operator= (const AliRsnPairDef &copy);
28    virtual ~AliRsnPairDef() { }
29
30    // getters
31    Int_t                    GetMotherPDG()  const {return fMotherPDG;}
32    Double_t                 GetMotherMass() const {return fMotherMass;}
33    const char*              GetPairName()   const;
34    virtual const char*      GetName()       const {return GetPairName();}
35    
36    AliRsnDaughterDef*       GetDef1()                {return &fDef1;}
37    Double_t                 GetMass1()         const {return fDef1.GetMass();}
38    Char_t                   GetCharge1()       const {return fDef1.GetCharge();}
39    Short_t                  GetChargeShort1()  const {return fDef1.GetChargeShort();}
40    AliPID::EParticleType    GetPID1()          const {return fDef1.GetPID();}
41    AliRsnDaughter::ERefType GetDaughterType1() const {return fDef1.GetDaughterType();}
42    
43    AliRsnDaughterDef*       GetDef2()                {return &fDef2;}
44    Double_t                 GetMass2()         const {return fDef2.GetMass();}
45    Char_t                   GetCharge2()       const {return fDef2.GetCharge();}
46    Short_t                  GetChargeShort2()  const {return fDef2.GetChargeShort();}
47    AliPID::EParticleType    GetPID2()          const {return fDef2.GetPID();}
48    AliRsnDaughter::ERefType GetDaughterType2() const {return fDef2.GetDaughterType();}
49    
50    AliRsnDaughterDef*       GetDef(Int_t i)                {if (i<1) return GetDef1(); else return GetDef2();}
51    Double_t                 GetMass(Int_t i)         const {if (i<1) return GetMass1(); else return GetMass2();}
52    Char_t                   GetCharge(Int_t i)       const {if (i<1) return GetCharge1(); else return GetCharge2();}
53    Short_t                  GetChargeShort(Int_t i)  const {if (i<1) return GetChargeShort1(); else return GetChargeShort2();}
54    AliPID::EParticleType    GetPID(Int_t i)          const {if (i<1) return GetPID1(); else return GetPID2();}
55    AliRsnDaughter::ERefType GetDaughterType(Int_t i) const {if (i<1) return GetDaughterType1(); else return GetDaughterType2();}
56
57    // setters
58    void   SetMotherPDG(Int_t pdg)                           {fMotherPDG = pdg;}
59    void   SetMotherMass(Double_t mass)                      {fMotherMass = mass;}
60    Bool_t SetDef1(AliPID::EParticleType pid, Char_t charge) {return fDef1.SetDaughter(pid, charge);}
61    Bool_t SetDef2(AliPID::EParticleType pid, Char_t charge) {return fDef2.SetDaughter(pid, charge);}
62    Bool_t SetDefs(AliPID::EParticleType pid1, Char_t ch1, AliPID::EParticleType pid2, Char_t ch2) {return (SetDef1(pid1, ch1) && SetDef2(pid2, ch2));}
63
64    // checkers
65    Bool_t IsLikeSign()  const {return (GetCharge1() == GetCharge2());}
66    Bool_t HasEqualPID() const {return (GetPID1() == GetPID2());}
67
68 private:
69
70    Double_t          fMotherMass;  // nominal mass of true mother
71    Int_t             fMotherPDG;   // PDG code of true mother (if known)
72    AliRsnDaughterDef fDef1;        // definitions for daughter #1 (see class)
73    AliRsnDaughterDef fDef2;        // definitions for daughter #2 (see class)
74
75    // ROOT dictionary
76    ClassDef(AliRsnPairDef, 1)
77 };
78
79 #endif