]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnPairDef.h
Restored call to CreateDigitizer (F.Prino)
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPairDef.h
1 #ifndef ALIRSNPAIRDEF_H
2 #define ALIRSNPAIRDEF_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6  
7 ////////////////////////////////////////////////////////////////////////////////
8 //
9 //  Resonance decay tree definition.
10 //
11 ////////////////////////////////////////////////////////////////////////////////
12
13 #include "AliRsnDaughter.h"
14 #include "AliRsnDaughterDef.h"
15
16 class AliRsnPairDef : public TObject {
17 public:
18
19    AliRsnPairDef();
20    AliRsnPairDef(EPARTYPE type1, Char_t sign1, EPARTYPE type2, Char_t sign2, Int_t motherPDG = 0, Double_t motherMass = 0.0);
21    AliRsnPairDef(AliRsnDaughter::ESpecies type1, Char_t sign1, AliRsnDaughter::ESpecies type2, Char_t sign2, Int_t motherPDG = 0, Double_t motherMass = 0.0);
22    AliRsnPairDef(const AliRsnPairDef &copy);
23    const AliRsnPairDef& operator= (const AliRsnPairDef &copy);
24    virtual ~AliRsnPairDef() { }
25
26    // getters
27    Int_t                    GetMotherPDG()  const {return fMotherPDG;}
28    Double_t                 GetMotherMass() const {return fMotherMass;}
29    const char*              GetPairName()   const;
30    virtual const char*      GetName()       const {return GetPairName();}
31    
32    AliRsnDaughterDef*       GetDef1()           {return &fDef1;}
33    Double_t                 GetMass1()    const {return fDef1.GetMass();}
34    Char_t                   GetChargeC1() const {return fDef1.GetChargeC();}
35    Short_t                  GetChargeS1() const {return fDef1.GetChargeS();}
36    AliRsnDaughter::ESpecies GetPID1()     const {return fDef1.GetPID();}
37    AliRsnDaughter::ERefType GetRefType1() const {return fDef1.GetRefType();}
38    
39    AliRsnDaughterDef*       GetDef2()           {return &fDef2;}
40    Double_t                 GetMass2()    const {return fDef2.GetMass();}
41    Char_t                   GetChargeC2() const {return fDef2.GetChargeC();}
42    Short_t                  GetChargeS2() const {return fDef2.GetChargeS();}
43    AliRsnDaughter::ESpecies GetPID2()     const {return fDef2.GetPID();}
44    AliRsnDaughter::ERefType GetRefType2() const {return fDef2.GetRefType();}
45    
46    AliRsnDaughterDef*       GetDef(Int_t i)           {if (i<1) return GetDef1(); else return GetDef2();}
47    Double_t                 GetMass(Int_t i)    const {if (i<1) return GetMass1(); else return GetMass2();}
48    Char_t                   GetChargeC(Int_t i) const {if (i<1) return GetChargeC1(); else return GetChargeS2();}
49    Short_t                  GetChargeS(Int_t i) const {if (i<1) return GetChargeS1(); else return GetChargeS2();}
50    AliRsnDaughter::ESpecies GetPID(Int_t i)     const {if (i<1) return GetPID1(); else return GetPID2();}
51    AliRsnDaughter::ERefType GetRefType(Int_t i) const {if (i<1) return GetRefType1(); else return GetRefType2();}
52
53    // setters
54    void SetMotherPDG(Int_t pdg)                              {fMotherPDG = pdg;}
55    void SetMotherMass(Double_t mass)                         {fMotherMass = mass;}
56    void SetDef1(EPARTYPE pid, Char_t charge)                 {fDef1.SetCharge(charge); fDef1.SetPID(AliRsnDaughter::FromAliPID(pid));}
57    void SetDef2(EPARTYPE pid, Char_t charge)                 {fDef2.SetCharge(charge); fDef2.SetPID(AliRsnDaughter::FromAliPID(pid));}
58    void SetDef1(AliRsnDaughter::ESpecies pid, Char_t charge) {fDef1.SetCharge(charge); fDef1.SetPID(pid);}
59    void SetDef2(AliRsnDaughter::ESpecies pid, Char_t charge) {fDef2.SetCharge(charge); fDef2.SetPID(pid);}
60    
61    void SetDefs(EPARTYPE pid1, Char_t ch1, AliPID::EParticleType pid2, Char_t ch2)                 {SetDef1(pid1, ch1); SetDef2(pid2, ch2);}
62    void SetDefs(AliRsnDaughter::ESpecies pid1, Char_t ch1, AliPID::EParticleType pid2, Char_t ch2) {SetDef1(pid1, ch1); SetDef2(pid2, ch2);}
63
64    // checkers
65    Bool_t IsLikeSign()  const {return (GetChargeC1() == GetChargeC2());}
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