]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnMother.h
Coverity fixes
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMother.h
index ac70d61b591e7bdea9cb23193ba862618b385dd8..8c3002d2a04a3f339c9455225370eb666781c0a3 100644 (file)
@@ -1,66 +1,50 @@
-//
-// Class AliRsnMother
-//
-// Implementation of a pair of tracks, for several purposes
-// - computing the total 4-momentum & inv. mass for output histos filling
-// - evaluating cut checks on the pair of particles
-// - evaluating any kind of kinematic value over their sum
-//
-// authors: Martin Vala (martin.vala@cern.ch)
-//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
-
 #ifndef ALIRSNMOTHER_H
 #define ALIRSNMOTHER_H
 
-#include <TLorentzVector.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 "AliRsnDaughter.h"
 
-class AliRsnPairDef;
-
-class AliRsnMother : public TObject
-{
-  public:
+class AliRsnMother : public TObject {
+public:
 
-    AliRsnMother();
-    AliRsnMother(const AliRsnMother &obj);
-    AliRsnMother& operator=(const AliRsnMother &obj);
-    virtual ~AliRsnMother();
-    
-    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);}
-    TLorentzVector&   Sum() {return fSum;}
-    TLorentzVector&   Ref() {return fRef;}
-    TLorentzVector&   SumMC() {return fSumMC;}
-    TLorentzVector&   RefMC() {return fRefMC;}
-    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;}
-    Double_t          AngleTo(AliRsnDaughter track, Bool_t mc = kFALSE) const {return fSum.Angle(track.P(mc).Vect());}
-    Double_t          CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);
+   AliRsnMother();
+   AliRsnMother(const AliRsnMother &obj);
+   AliRsnMother& operator=(const AliRsnMother &obj);
+   virtual ~AliRsnMother();
 
-    AliRsnDaughter*   GetDaughter(const Int_t &index) const {if (index==0||index==1) return fDaughter[index]; return 0x0;}
+   AliRsnDaughter*   GetDaughter(const Int_t &index)    const {if (index < 1) return   fDaughter[0] ; return   fDaughter[1] ;}
+   AliRsnDaughter&   GetDaughterRef(const Int_t &index) const {if (index < 1) return (*fDaughter[0]); return (*fDaughter[1]);}
+   TLorentzVector&   Sum()                                    {return fSum;}
+   TLorentzVector&   SumMC()                                  {return fSumMC;}
+   
+   Double_t          AngleTo(AliRsnDaughter *track, Bool_t mc = kFALSE) const {if (track) return fSum.Angle(track->P(mc).Vect()); return -99.0;}
+   Double_t          CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE);
 
-    Bool_t            IsLabelEqual() const {return abs(fDaughter[0]->GetLabel()) == abs(fDaughter[1]->GetLabel());}
-    Bool_t            IsIndexEqual() const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
-    Int_t             CommonMother(Int_t &m0, Int_t &m1) const;
-    Int_t             CommonMother() const {Int_t d0, d1; return CommonMother(d0,d1);}
+   Bool_t            IsLabelEqual() const {return abs(fDaughter[0]->GetLabel()) == abs(fDaughter[1]->GetLabel());}
+   Bool_t            IsIndexEqual() const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());}
+   Int_t             CommonMother(Int_t &m0, Int_t &m1) const;
+   Int_t             CommonMother() const {Int_t d0, d1; return CommonMother(d0, d1);}
 
-    void              SetDaughters(AliRsnDaughter * const daughter1, Double_t mass1, AliRsnDaughter * const daughter2, Double_t mass2);
-    void              ResetPair();
-    void              PrintInfo(const Option_t *option = "ALL") const;
-    Bool_t            CheckPair() const;
-    Bool_t            MatchesDef(AliRsnPairDef *pairDef);
+   void              SetDaughters(AliRsnDaughter * const daughter1, Double_t mass1, AliRsnDaughter * const daughter2, Double_t mass2);
+   void              ResetPair();
+   void              PrintInfo(const Option_t *option = "ALL") const;
+   Bool_t            CheckPair(Bool_t checkMC = kFALSE) const;
 
-  private:
+private:
 
-    Bool_t           fUseMC;            // choose if momenta are taken from ESD/AOD or MC
-    Double_t         fDefaultMass;      // nominal resonance mass
-    AliRsnDaughter  *fDaughter[2];      // elements of the pair
-    TLorentzVector   fSum;              // sum computed from the two daughters
-    TLorentzVector   fSumMC;            // sum computed from the two daughters
-    TLorentzVector   fRef;              // a 4-vector with same momentum as the sum but the nominal mass of mother
-    TLorentzVector   fRefMC;            // a 4-vector with same momentum as the sum but the nominal mass of mother
+   AliRsnDaughter  *fDaughter[2];      // elements of the pair
+   TLorentzVector   fSum;              // sum computed from the two daughters
+   TLorentzVector   fSumMC;            // sum computed from the two daughters
 
-    ClassDef(AliRsnMother,1)
+   ClassDef(AliRsnMother, 1)
 };
 
 #endif