]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/AliRsnMother.h
Adding macro to plot <Ncoll>
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMother.h
CommitLineData
2dab9030 1#ifndef ALIRSNMOTHER_H
2#define ALIRSNMOTHER_H
3
7356f978 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
61f275d1 6
7356f978 7////////////////////////////////////////////////////////////////////////////////
8//
9// Interface to candidate resonance decaying into 2 bodies.
10//
11////////////////////////////////////////////////////////////////////////////////
12
d7712d44 13#include <TMath.h>
b63357a0 14#include <TLorentzVector.h>
15
2dab9030 16#include "AliRsnDaughter.h"
17
d7712d44 18class AliRsnEvent;
19
2a1c7696 20class AliRsnMother : public TObject {
21public:
22
213adb92 23 AliRsnMother() : fRefEvent(0), fSum(), fSumMC(), fRef(), fRefMC(), fDCAproduct(0) {fDaughter[0] = fDaughter[1] = 0;}
2a1c7696 24 AliRsnMother(const AliRsnMother &obj);
61f275d1 25 AliRsnMother &operator=(const AliRsnMother &obj);
2a1c7696 26 virtual ~AliRsnMother();
27
d7712d44 28 // setters (4-vectors cannot be set)
f34f960b 29 void Reset();
d7712d44 30 void SetDaughter(Int_t i, AliRsnDaughter *d) {fDaughter[CkID(i)] = d;}
31 void SetRefEvent(AliRsnEvent *event) {fRefEvent = event;}
61f275d1 32
d7712d44 33 // getters
61f275d1 34 AliRsnEvent *GetRefEvent() {return fRefEvent;}
35 AliRsnDaughter *GetDaughter(const Int_t &i) {return fDaughter[CkID(i)];}
36 TLorentzVector &Sum(Bool_t mc) {return (mc ? fSumMC : fSum);}
37 TLorentzVector &Ref(Bool_t mc) {return (mc ? fRefMC : fRef);}
f34f960b 38 Bool_t GetResolution(Double_t &value);
b63357a0 39 Double_t Rapidity(Bool_t mc) {if (mc) return fRefMC.Rapidity(); else return fRef.Rapidity();}
213adb92 40 Double_t DCAproduct();
61f275d1 41
d7712d44 42 // checks
43 Bool_t IsLabelEqual() const {return TMath::Abs(fDaughter[0]->GetLabel()) == TMath::Abs(fDaughter[1]->GetLabel());}
44 Bool_t IsIndexEqual() const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
45 Bool_t IsOwnerEqual() const {return (fDaughter[0]->GetOwnerEvent() == fDaughter[1]->GetOwnerEvent());}
f34f960b 46 Int_t CommonMother() const;
61f275d1 47
f34f960b 48 // angles
49 Double_t AngleTo(AliRsnDaughter *track, Bool_t mc = kFALSE) {return track->P(mc).Angle(Sum(mc).Vect());}
d7712d44 50 Double_t AngleToLeading(Bool_t &success);
61f275d1 51
f34f960b 52 // computations
53 void ComputeSum(Double_t mass1, Double_t mass2, Double_t motherMass);
61f275d1 54 Double_t CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);
d7712d44 55 void PrintInfo(const Option_t *option = "ALL") const;
56 Bool_t CheckPair(Bool_t checkMC = kFALSE) const;
2a1c7696 57
58private:
59
b63357a0 60 Int_t CkID(Int_t i) const {if (i < 1) return 0; else return 1;}
d7712d44 61
2a1c7696 62 AliRsnDaughter *fDaughter[2]; // elements of the pair
d7712d44 63 AliRsnEvent *fRefEvent; // reference event
f34f960b 64 TLorentzVector fSum; // sum computed from the two daughters (rec)
65 TLorentzVector fSumMC; // sum computed from the two daughters (sim)
66 TLorentzVector fRef; // same to sum, but with fixed mass hypothesis (rec)
67 TLorentzVector fRefMC; // same to sum, but with fixed mass hypothesis (sim)
213adb92 68 Double_t fDCAproduct; // product of the daughter's DCA to Primary Vertex
2a1c7696 69
213adb92 70 ClassDef(AliRsnMother, 2)
2dab9030 71};
72
73#endif