]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnDaughterDef.h
Improved functionality of AliRsnDaughterDef::MatchesDaughter()
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnDaughterDef.h
1 //
2 // Class AliRsnDaughterDef
3 //
4 // Defines some requirements to select a good candidate daughter for a resonance
5 // among all available objects presend in each event (tracks, V0s, etc. ...).
6 // This includes:
7 // -- track type (charged track, V0, cascade)
8 // -- track charge
9 // -- track PID type and related mass (only for charged)
10 //
11 // author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
12 //
13
14 #ifndef ALIRSNDAUGHTERDEF_H
15 #define ALIRSNDAUGHTERDEF_H
16
17 #include "AliPID.h"
18 #include "AliRsnDaughter.h"
19
20 class AliRsnDaughterDef : public TObject {
21 public:
22
23    AliRsnDaughterDef(AliPID::EParticleType type = AliPID::kUnknown, Char_t sign = 0);
24    AliRsnDaughterDef(const AliRsnDaughterDef &copy);
25    const AliRsnDaughterDef& operator= (const AliRsnDaughterDef &copy);
26    virtual ~AliRsnDaughterDef() { }
27
28    // getters
29    Double_t                 GetMass()         const {return fMass;}
30    Char_t                   GetCharge()       const {return fCharge;}
31    Short_t                  GetChargeShort()  const {if (fCharge == '+') return 1; else if (fCharge == '-') return -1; else return 0;}
32    AliPID::EParticleType    GetPID()          const {return fPID;}
33    AliRsnDaughter::ERefType GetDaughterType() const {return fDaughterType;}
34    const char*              GetName()         const {return Form("%s%c", AliPID::ParticleShortName(fPID), fCharge);}
35
36    // setters
37    Bool_t SetDaughter(AliPID::EParticleType pid, Char_t charge);
38    void   SetDaughterType(AliRsnDaughter::ERefType type) {fDaughterType = type;}
39    
40    // checker
41    Bool_t MatchesDaughter(AliRsnDaughter *daughter, Bool_t truePID = kFALSE);
42
43 private:
44
45    Double_t                  fMass;         // mass of particles
46    Char_t                    fCharge;       // charge of particles
47    AliPID::EParticleType     fPID;          // PID of particles
48    AliRsnDaughter::ERefType  fDaughterType; // object type (track/V0)
49
50    // ROOT dictionary
51    ClassDef(AliRsnDaughterDef, 1)
52 };
53
54 #endif