]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnPairDef.h
fixed sig.segv
[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
18 class AliRsnDaughter;
19
20 class AliRsnPairDef : public TObject
21 {
22   public:
23
24     AliRsnPairDef();
25     AliRsnPairDef(AliPID::EParticleType type1, Char_t sign1, AliPID::EParticleType 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     Double_t                 GetMass(Int_t i) const {if (i>=0&&i<2) return fMass[i]; else return 0.0;}
34     Char_t                   GetCharge(Int_t i) const {if (i>=0&&i<2) return fCharge[i]; else return 0;}
35     Short_t                  GetChargeShort(Int_t i) const {if (GetCharge(i) == '+') return 1; else if (GetCharge(i) == '-') return -1; else return 0;}
36     AliPID::EParticleType    GetPID(Int_t i) const {if (i>=0&&i<2) return fPID[i]; else return AliPID::kUnknown;}
37     AliRsnDaughter::ERefType GetDaughterType(Int_t i) {if (i>=0&&i<2) return fDaughterType[i]; else return AliRsnDaughter::kNoType;}
38     const char*              GetPairName() const;
39
40     // setters
41     void   SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;}
42     void   SetMotherMass(Double_t mass) {fMotherMass = mass;}
43     Bool_t SetDaughter(Int_t i, AliPID::EParticleType pid, Char_t charge = 0);
44     Bool_t SetDaughters(AliPID::EParticleType type1, Char_t sign1, AliPID::EParticleType type2, Char_t sign2);
45
46     // pair information methods
47     Bool_t IsLikeSign() const {return (fCharge[0] == fCharge[1]);}
48     Bool_t HasEqualPID() const {return (fPID[0] == fPID[1]);}
49
50   private:
51
52     // pair parameters
53     Double_t                  fMotherMass;      // nominal mass of true mother
54     Int_t                     fMotherPDG;       // PDG code of true mother (if known)
55     
56     Double_t                  fMass[2];         // mass of particles
57     Char_t                    fCharge[2];       // charge of particles
58     AliPID::EParticleType     fPID[2];          // PID of particles
59     AliRsnDaughter::ERefType  fDaughterType[2]; // object type (track/V0)
60
61     // ROOT dictionary
62     ClassDef(AliRsnPairDef, 1)
63 };
64
65 #endif