ROOT logo
#ifndef ALIRSNMOTHER_H
#define ALIRSNMOTHER_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

////////////////////////////////////////////////////////////////////////////////
//
//  Interface to candidate resonance decaying into 2 bodies.
//
////////////////////////////////////////////////////////////////////////////////

#include <TMath.h>
#include <TLorentzVector.h>

#include "AliRsnDaughter.h"

class AliRsnEvent;

class AliRsnMother : public TObject {
public:

   AliRsnMother() : fRefEvent(0), fSum(), fSumMC(), fRef(), fRefMC(), fDCAproduct(0) {fDaughter[0] = fDaughter[1] = 0;}
   AliRsnMother(const AliRsnMother &obj);
   AliRsnMother &operator=(const AliRsnMother &obj);
   virtual ~AliRsnMother();

   // setters (4-vectors cannot be set)
   void  Reset();
   void  SetDaughter(Int_t i, AliRsnDaughter *d) {fDaughter[CkID(i)] = d;}
   void  SetRefEvent(AliRsnEvent *event)         {fRefEvent = event;}

   // getters
   AliRsnEvent      *GetRefEvent()               {return fRefEvent;}
   AliRsnDaughter   *GetDaughter(const Int_t &i) {return fDaughter[CkID(i)];}
   TLorentzVector   &Sum(Bool_t mc)              {return (mc ? fSumMC : fSum);}
   TLorentzVector   &Ref(Bool_t mc)              {return (mc ? fRefMC : fRef);}
   Bool_t            GetResolution(Double_t &value);
   Double_t          Rapidity(Bool_t mc)         {if (mc) return fRefMC.Rapidity(); else return fRef.Rapidity();}
   Double_t          DCAproduct();

   // checks
   Bool_t    IsLabelEqual()  const {return TMath::Abs(fDaughter[0]->GetLabel()) == TMath::Abs(fDaughter[1]->GetLabel());}
   Bool_t    IsIndexEqual()  const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
   Bool_t    IsOwnerEqual()  const {return (fDaughter[0]->GetOwnerEvent() == fDaughter[1]->GetOwnerEvent());}
   Int_t     CommonMother()  const;

   // angles
   Double_t  AngleTo(AliRsnDaughter *track, Bool_t mc = kFALSE) {return track->P(mc).Angle(Sum(mc).Vect());}
   Double_t  AngleToLeading(Bool_t &success);

   // computations
   void      ComputeSum(Double_t mass1, Double_t mass2, Double_t motherMass);
   Double_t  CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);
   void      PrintInfo(const Option_t *option = "ALL") const;
   Bool_t    CheckPair(Bool_t checkMC = kFALSE) const;

private:

   Int_t CkID(Int_t i) const {if (i < 1) return 0; else return 1;}

   AliRsnDaughter  *fDaughter[2];      // elements of the pair
   AliRsnEvent     *fRefEvent;         // reference event
   TLorentzVector   fSum;              // sum computed from the two daughters (rec)
   TLorentzVector   fSumMC;            // sum computed from the two daughters (sim)
   TLorentzVector   fRef;              // same to sum, but with fixed mass hypothesis (rec)
   TLorentzVector   fRefMC;            // same to sum, but with fixed mass hypothesis (sim)
   Double_t         fDCAproduct;       // product of the daughter's DCA to Primary Vertex

   ClassDef(AliRsnMother, 2)
};

#endif
 AliRsnMother.h:1
 AliRsnMother.h:2
 AliRsnMother.h:3
 AliRsnMother.h:4
 AliRsnMother.h:5
 AliRsnMother.h:6
 AliRsnMother.h:7
 AliRsnMother.h:8
 AliRsnMother.h:9
 AliRsnMother.h:10
 AliRsnMother.h:11
 AliRsnMother.h:12
 AliRsnMother.h:13
 AliRsnMother.h:14
 AliRsnMother.h:15
 AliRsnMother.h:16
 AliRsnMother.h:17
 AliRsnMother.h:18
 AliRsnMother.h:19
 AliRsnMother.h:20
 AliRsnMother.h:21
 AliRsnMother.h:22
 AliRsnMother.h:23
 AliRsnMother.h:24
 AliRsnMother.h:25
 AliRsnMother.h:26
 AliRsnMother.h:27
 AliRsnMother.h:28
 AliRsnMother.h:29
 AliRsnMother.h:30
 AliRsnMother.h:31
 AliRsnMother.h:32
 AliRsnMother.h:33
 AliRsnMother.h:34
 AliRsnMother.h:35
 AliRsnMother.h:36
 AliRsnMother.h:37
 AliRsnMother.h:38
 AliRsnMother.h:39
 AliRsnMother.h:40
 AliRsnMother.h:41
 AliRsnMother.h:42
 AliRsnMother.h:43
 AliRsnMother.h:44
 AliRsnMother.h:45
 AliRsnMother.h:46
 AliRsnMother.h:47
 AliRsnMother.h:48
 AliRsnMother.h:49
 AliRsnMother.h:50
 AliRsnMother.h:51
 AliRsnMother.h:52
 AliRsnMother.h:53
 AliRsnMother.h:54
 AliRsnMother.h:55
 AliRsnMother.h:56
 AliRsnMother.h:57
 AliRsnMother.h:58
 AliRsnMother.h:59
 AliRsnMother.h:60
 AliRsnMother.h:61
 AliRsnMother.h:62
 AliRsnMother.h:63
 AliRsnMother.h:64
 AliRsnMother.h:65
 AliRsnMother.h:66
 AliRsnMother.h:67
 AliRsnMother.h:68
 AliRsnMother.h:69
 AliRsnMother.h:70
 AliRsnMother.h:71
 AliRsnMother.h:72
 AliRsnMother.h:73