]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnPairDef.h
Made a general review to fix as possible most coding conventions violations.
[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
17 class AliRsnDaughter;
18
19 class AliRsnPairDef : public TObject
20 {
21   public:
22
23     AliRsnPairDef();
24     AliRsnPairDef(Char_t sign1, AliPID::EParticleType type1,
25                   Char_t sign2, AliPID::EParticleType type2, Int_t motherPDG = 0);
26     AliRsnPairDef(AliPID::EParticleType type1, Char_t sign1,
27                   AliPID::EParticleType type2, Char_t sign2, Int_t motherPDG = 0);
28     AliRsnPairDef(const AliRsnPairDef &copy);
29     const AliRsnPairDef& operator= (const AliRsnPairDef &copy);
30     virtual ~AliRsnPairDef() { }
31
32     // getters
33     Char_t                GetCharge(Int_t i) const {if (i>=0&&i<2) return fCharge[i]; else return 0;}
34     Short_t               GetChargeShort(Int_t i) const {if (GetCharge(i) == '+') return 1; else if (GetCharge(i) == '-') return -1; else return 0;}
35     AliPID::EParticleType GetType(Int_t i) const {if (i>=0&&i<2) return fType[i]; else return AliPID::kUnknown;}
36     Double_t              GetMass(Int_t i) const {if (i>=0&&i<2) return fMass[i]; else return 0.0;}
37     Int_t                 GetMotherPDG() const {return fMotherPDG;}
38     TString               GetPairName() const;
39
40     // setters
41     Bool_t SetPairElement(Int_t i, Char_t charge, AliPID::EParticleType pid);
42     Bool_t SetPair(Char_t ch1, AliPID::EParticleType pid1, Char_t ch2, AliPID::EParticleType pid2);
43     void   SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;}
44
45     // pair information methods
46     Bool_t IsLikeSign() const {return (fCharge[0] == fCharge[1]);}
47     Bool_t HasEqualTypes() const {return (fType[0] == fType[1]);}
48
49   private:
50
51     // pair parameters
52     Int_t                  fMotherPDG;  // PDG code of true mother (if known)
53     Double_t               fMass[2];    // mass of particles
54     Char_t                 fCharge[2];  // charge of particles
55     AliPID::EParticleType  fType[2];    // PID of particles
56
57     // ROOT dictionary
58     ClassDef(AliRsnPairDef, 1)
59 };
60
61 #endif