]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnMother.h
Some small code changes to adapt to requests for implementation of mixing.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMother.h
1 #ifndef ALIRSNMOTHER_H
2 #define ALIRSNMOTHER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6  
7 ////////////////////////////////////////////////////////////////////////////////
8 //
9 //  Interface to candidate resonance decaying into 2 bodies.
10 //
11 ////////////////////////////////////////////////////////////////////////////////
12
13 #include <TMath.h>
14 #include "AliRsnDaughter.h"
15
16 class AliRsnEvent;
17
18 class AliRsnMother : public TObject {
19 public:
20
21    AliRsnMother() : fRefEvent(0), fSum(), fSumMC() {fDaughter[0] = fDaughter[1] = 0;}
22    AliRsnMother(const AliRsnMother &obj);
23    AliRsnMother& operator=(const AliRsnMother &obj);
24    virtual ~AliRsnMother();
25
26    // setters (4-vectors cannot be set)
27    void  SetDaughter(Int_t i, AliRsnDaughter *d) {fDaughter[CkID(i)] = d;}
28    void  SetRefEvent(AliRsnEvent *event)         {fRefEvent = event;}
29    
30    // getters
31    AliRsnEvent*      GetRefEvent()               {return fRefEvent;}
32    AliRsnDaughter*   GetDaughter(const Int_t &i) {return fDaughter[CkID(i)];}
33    TLorentzVector&   Sum()                       {return fSum;}
34    TLorentzVector&   SumMC()                     {return fSumMC;}
35    
36    // checks
37    Bool_t    IsLabelEqual()  const {return TMath::Abs(fDaughter[0]->GetLabel()) == TMath::Abs(fDaughter[1]->GetLabel());}
38    Bool_t    IsIndexEqual()  const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
39    Bool_t    IsOwnerEqual()  const {return (fDaughter[0]->GetOwnerEvent() == fDaughter[1]->GetOwnerEvent());}
40    Int_t     CommonMother()  const {Int_t d0, d1; return CommonMother(d0, d1);}
41    Int_t     CommonMother(Int_t &m0, Int_t &m1) const;
42    
43    // useful computations/operations
44    void      ComputeSum(Double_t mass1, Double_t mass2);
45    Double_t  AngleTo(AliRsnDaughter track, Bool_t mc = kFALSE);
46    Double_t  AngleToLeading(Bool_t &success);
47    Double_t  CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);
48    void      ResetPair();
49    void      PrintInfo(const Option_t *option = "ALL") const;
50    Bool_t    CheckPair(Bool_t checkMC = kFALSE) const;
51
52 private:
53
54    Int_t CkID(Int_t i) {if (i < 1) return 0; else return 1;}
55
56    AliRsnDaughter  *fDaughter[2];      // elements of the pair
57    AliRsnEvent     *fRefEvent;         // reference event
58    TLorentzVector   fSum;              // sum computed from the two daughters
59    TLorentzVector   fSumMC;            // sum computed from the two daughters
60
61    ClassDef(AliRsnMother, 1)
62 };
63
64 #endif