]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnMother.h
bugfix
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMother.h
1 //
2 // Class AliRsnMother
3 //
4 // Implementation of a pair of tracks, for several purposes
5 // - computing the total 4-momentum & inv. mass for output histos filling
6 // - evaluating cut checks on the pair of particles
7 // - evaluating any kind of kinematic value over their sum
8 //
9 // authors: Martin Vala (martin.vala@cern.ch)
10 //          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
11 //
12
13 #ifndef ALIRSNMOTHER_H
14 #define ALIRSNMOTHER_H
15
16 #include <TLorentzVector.h>
17
18 #include "AliRsnDaughter.h"
19
20 class AliRsnPairDef;
21
22 class AliRsnMother : public TObject
23 {
24   public:
25
26     AliRsnMother();
27     AliRsnMother(const AliRsnMother &obj);
28     AliRsnMother& operator=(const AliRsnMother &obj);
29     virtual ~AliRsnMother();
30     
31     void              SetDefaultMass(Double_t mass) {fDefaultMass = mass; fRef.SetXYZM(fSum.X(),fSum.Y(),fSum.Z(),mass); fRefMC.SetXYZM(fSumMC.X(),fSumMC.Y(),fSumMC.Z(),mass);}
32     TLorentzVector&   Sum() {return fSum;}
33     TLorentzVector&   Ref() {return fRef;}
34     TLorentzVector&   SumMC() {return fSumMC;}
35     TLorentzVector&   RefMC() {return fRefMC;}
36     Double_t          OpeningAngle(Bool_t mc = kFALSE) const {if (fDaughter[0] && fDaughter[1]) return fDaughter[0]->P(mc).Angle(fDaughter[1]->P(mc).Vect()); return 1E6;}
37     Double_t          AngleTo(AliRsnDaughter track, Bool_t mc = kFALSE) const {return fSum.Angle(track.P(mc).Vect());}
38     Double_t          CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);
39
40     AliRsnDaughter*   GetDaughter(const Int_t &index) const {if (index==0||index==1) return fDaughter[index]; return 0x0;}
41
42     Bool_t            IsLabelEqual() const {return abs(fDaughter[0]->GetLabel()) == abs(fDaughter[1]->GetLabel());}
43     Bool_t            IsIndexEqual() const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
44     Int_t             CommonMother() const;
45
46     void              SetDaughters(AliRsnDaughter * const daughter1, Double_t mass1, AliRsnDaughter * const daughter2, Double_t mass2);
47     void              ResetPair();
48     void              PrintInfo(const Option_t *option = "ALL") const;
49     Bool_t            CheckPair() const;
50     Bool_t            MatchesDef(AliRsnPairDef *pairDef);
51
52   private:
53
54     Bool_t           fUseMC;            // choose if momenta are taken from ESD/AOD or MC
55     Double_t         fDefaultMass;      // nominal resonance mass
56     AliRsnDaughter  *fDaughter[2];      // elements of the pair
57     TLorentzVector   fSum;              // sum computed from the two daughters
58     TLorentzVector   fSumMC;            // sum computed from the two daughters
59     TLorentzVector   fRef;              // a 4-vector with same momentum as the sum but the nominal mass of mother
60     TLorentzVector   fRefMC;            // a 4-vector with same momentum as the sum but the nominal mass of mother
61
62     ClassDef(AliRsnMother,1)
63 };
64
65 #endif