]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnPairDef.h
Where possible, replaced dynamic_cast with ROOT RTTI using TClass.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPairDef.h
CommitLineData
06351446 1//
e2bafbbc 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//
06351446 11
12#ifndef ALIRSNPAIRDEF_H
13#define ALIRSNPAIRDEF_H
14
5eb970a4 15#include "AliPID.h"
2dab9030 16#include "AliRsnDaughter.h"
11ed73f6 17#include "AliRsnDaughterDef.h"
06351446 18
11ed73f6 19class AliRsnMother;
e2bafbbc 20
2a1c7696 21class AliRsnPairDef : public TObject {
22public:
06351446 23
2a1c7696 24 AliRsnPairDef();
11ed73f6 25 AliRsnPairDef(EPARTYPE type1, Char_t sign1, EPARTYPE type2, Char_t sign2, Int_t motherPDG = 0, Double_t motherMass = 0.0);
26 AliRsnPairDef(AliRsnDaughterDef def1, AliRsnDaughterDef def2);
2a1c7696 27 AliRsnPairDef(const AliRsnPairDef &copy);
28 const AliRsnPairDef& operator= (const AliRsnPairDef &copy);
29 virtual ~AliRsnPairDef() { }
06351446 30
2a1c7696 31 // getters
32 Int_t GetMotherPDG() const {return fMotherPDG;}
33 Double_t GetMotherMass() const {return fMotherMass;}
11ed73f6 34 const char* GetPairName() const;
99261e24 35 virtual const char* GetName() const {return GetPairName();}
11ed73f6 36
37 AliRsnDaughterDef* GetDef1() {return &fDef1;}
38 Double_t GetMass1() const {return fDef1.GetMass();}
39 Char_t GetCharge1() const {return fDef1.GetCharge();}
40 Short_t GetChargeShort1() const {return fDef1.GetChargeShort();}
41 AliPID::EParticleType GetPID1() const {return fDef1.GetPID();}
42 AliRsnDaughter::ERefType GetDaughterType1() const {return fDef1.GetDaughterType();}
43
44 AliRsnDaughterDef* GetDef2() {return &fDef2;}
45 Double_t GetMass2() const {return fDef2.GetMass();}
46 Char_t GetCharge2() const {return fDef2.GetCharge();}
47 Short_t GetChargeShort2() const {return fDef2.GetChargeShort();}
48 AliPID::EParticleType GetPID2() const {return fDef2.GetPID();}
49 AliRsnDaughter::ERefType GetDaughterType2() const {return fDef2.GetDaughterType();}
50
51 AliRsnDaughterDef* GetDef(Int_t i) {if (i<1) return GetDef1(); else return GetDef2();}
52 Double_t GetMass(Int_t i) const {if (i<1) return GetMass1(); else return GetMass2();}
53 Char_t GetCharge(Int_t i) const {if (i<1) return GetCharge1(); else return GetCharge2();}
54 Short_t GetChargeShort(Int_t i) const {if (i<1) return GetChargeShort1(); else return GetChargeShort2();}
55 AliPID::EParticleType GetPID(Int_t i) const {if (i<1) return GetPID1(); else return GetPID2();}
56 AliRsnDaughter::ERefType GetDaughterType(Int_t i) const {if (i<1) return GetDaughterType1(); else return GetDaughterType2();}
06351446 57
2a1c7696 58 // setters
11ed73f6 59 void SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;}
60 void SetMotherMass(Double_t mass) {fMotherMass = mass;}
61 Bool_t SetDef1(AliPID::EParticleType pid, Char_t charge) {return fDef1.SetDaughter(pid, charge);}
62 Bool_t SetDef2(AliPID::EParticleType pid, Char_t charge) {return fDef2.SetDaughter(pid, charge);}
63 Bool_t SetDefs(AliPID::EParticleType pid1, Char_t ch1, AliPID::EParticleType pid2, Char_t ch2) {return (SetDef1(pid1, ch1) && SetDef2(pid2, ch2));}
06351446 64
11ed73f6 65 // checkers
66 Bool_t IsLikeSign() const {return (GetCharge1() == GetCharge2());}
67 Bool_t HasEqualPID() const {return (GetPID1() == GetPID2());}
06351446 68
2a1c7696 69private:
06351446 70
11ed73f6 71 Double_t fMotherMass; // nominal mass of true mother
72 Int_t fMotherPDG; // PDG code of true mother (if known)
73 AliRsnDaughterDef fDef1; // definitions for daughter #1 (see class)
74 AliRsnDaughterDef fDef2; // definitions for daughter #2 (see class)
2a1c7696 75
76 // ROOT dictionary
77 ClassDef(AliRsnPairDef, 1)
06351446 78};
79
80#endif