]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnMiniParticle.h
Classes for 'mini' subpackage for RSN analysis framework
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMiniParticle.h
1 #ifndef ALIRSNMINIPARTICLE_H
2 #define ALIRSNMINIPARTICLE_H
3
4 //
5 // This object is used as lightweight temporary container
6 // of all information needed from any input object and 
7 // useful for resonance analysis.
8 // 
9
10 #include <TMath.h>
11 #include <TObject.h>
12 #include <TLorentzVector.h>
13
14 class AliRsnDaughter;
15
16 class AliRsnMiniParticle : public TObject {
17 public:
18
19    AliRsnMiniParticle() : fCharge(0), fPDG(0), fMother(0), fMotherPDG(0), fCutBits(0x0) {Int_t i = 3; while (i--) fPsim[i] = fPrec[i] = 0.0;}
20
21    Char_t&        Charge()                   {return fCharge;}
22    Float_t&       PsimX()                    {return fPsim[0];}
23    Float_t&       PsimY()                    {return fPsim[1];}
24    Float_t&       PsimZ()                    {return fPsim[2];}
25    Float_t&       PrecX()                    {return fPrec[0];}
26    Float_t&       PrecY()                    {return fPrec[1];}
27    Float_t&       PrecZ()                    {return fPrec[2];}
28    Float_t&       Px(Bool_t mc)              {return (mc ? fPsim[0] : fPrec[0]);}
29    Float_t&       Py(Bool_t mc)              {return (mc ? fPsim[1] : fPrec[1]);}
30    Float_t&       Pz(Bool_t mc)              {return (mc ? fPsim[2] : fPrec[2]);}
31    Short_t&       PDG()                      {return fPDG;}
32    Short_t        PDGAbs()                   {return TMath::Abs(fPDG);}
33    Short_t&       Mother()                   {return fMother;}
34    Short_t&       MotherPDG()                {return fMotherPDG;}
35    UShort_t&      CutBits()                  {return fCutBits;}
36    Bool_t         HasCutBit(Int_t i)         {UShort_t bit = 1 << i; return ((fCutBits & bit) != 0);}
37    void           SetCutBit(Int_t i)         {UShort_t bit = 1 << i; fCutBits |=   bit;}
38    void           ClearCutBit(Int_t i)       {UShort_t bit = 1 << i; fCutBits &= (~bit);}
39    
40    void           Set4Vector(TLorentzVector &v, Float_t mass, Bool_t mc) {v.SetXYZM(Px(mc), Py(mc), Pz(mc), mass);}
41    void           CopyDaughter(AliRsnDaughter *daughter);
42
43 private:
44
45    Char_t    fCharge;       // track charge *character*: '+', '-', '0' (whatever else = undefined)
46    Float_t   fPsim[3];      // MC momentum of the track
47    Float_t   fPrec[3];      // reconstructed momentum of the track
48    Short_t   fPDG;          // particle PDG code
49    Short_t   fMother;       // index of mother in its container
50    Short_t   fMotherPDG;    // PDG code of mother
51    UShort_t  fCutBits;      // list of bits used to know what cuts were passed by this track
52    
53    ClassDef(AliRsnMiniParticle,1)
54 };
55
56 #endif