]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnMother.h
Classes for 'mini' subpackage for RSN analysis framework
[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(), fRef(), fRefMC() {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  Reset();
28    void  SetDaughter(Int_t i, AliRsnDaughter *d) {fDaughter[CkID(i)] = d;}
29    void  SetRefEvent(AliRsnEvent *event)         {fRefEvent = event;}
30    
31    // getters
32    AliRsnEvent*      GetRefEvent()               {return fRefEvent;}
33    AliRsnDaughter*   GetDaughter(const Int_t &i) {return fDaughter[CkID(i)];}
34    TLorentzVector&   Sum(Bool_t mc)              {return (mc ? fSumMC : fSum);}
35    TLorentzVector&   Ref(Bool_t mc)              {return (mc ? fRefMC : fRef);}
36    Bool_t            GetResolution(Double_t &value);
37    
38    // checks
39    Bool_t    IsLabelEqual()  const {return TMath::Abs(fDaughter[0]->GetLabel()) == TMath::Abs(fDaughter[1]->GetLabel());}
40    Bool_t    IsIndexEqual()  const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
41    Bool_t    IsOwnerEqual()  const {return (fDaughter[0]->GetOwnerEvent() == fDaughter[1]->GetOwnerEvent());}
42    Int_t     CommonMother()  const;
43    
44    // angles
45    Double_t  AngleTo(AliRsnDaughter *track, Bool_t mc = kFALSE) {return track->P(mc).Angle(Sum(mc).Vect());}
46    Double_t  AngleToLeading(Bool_t &success);
47    
48    // computations
49    void      ComputeSum(Double_t mass1, Double_t mass2, Double_t motherMass);
50    Double_t  CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);   
51    void      PrintInfo(const Option_t *option = "ALL") const;
52    Bool_t    CheckPair(Bool_t checkMC = kFALSE) const;
53
54 private:
55
56    Int_t CkID(Int_t i) {if (i < 1) return 0; else return 1;}
57
58    AliRsnDaughter  *fDaughter[2];      // elements of the pair
59    AliRsnEvent     *fRefEvent;         // reference event
60    TLorentzVector   fSum;              // sum computed from the two daughters (rec)
61    TLorentzVector   fSumMC;            // sum computed from the two daughters (sim)
62    TLorentzVector   fRef;              // same to sum, but with fixed mass hypothesis (rec)
63    TLorentzVector   fRefMC;            // same to sum, but with fixed mass hypothesis (sim)
64
65    ClassDef(AliRsnMother, 1)
66 };
67
68 #endif