]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnDaughter.h
Coding rule violations corrected.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnDaughter.h
index 5a16ae12b54a25855982eb1a3a557fd336b3e413..343341e5605823e881f957bf519f68797b8aec28 100644 (file)
@@ -1,22 +1,18 @@
-//
-// Class AliRsnDaughter
-//
-// Interface to candidate daughters of a resonance (tracks).
-// Points to the source of information, which is generally an AliVParticle-derived object
-// and contains few internal data-members to store "on fly" some important information
-// for the computations required during resonance analysis.
-// It contains a TLorentzVector data-member which, provided that a meaningful mass was assigned,
-// eases a lot the computation of invariant masses from summing up several of these objects.
-//
-// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//          M. Vala (martin.vala@cern.ch)
-//
-
 #ifndef ALIRSNDAUGHTER_H
 #define ALIRSNDAUGHTER_H
 
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Interface to single daughter candidate.
+//
+////////////////////////////////////////////////////////////////////////////////
+
 #include <TLorentzVector.h>
 
+#include "AliPID.h"
 #include "AliVTrack.h"
 #include "AliESDtrack.h"
 #include "AliESDv0.h"
@@ -38,6 +34,19 @@ public:
       kCascade,
       kNoType
    };
+   
+   enum ESpecies {
+      kElectron,
+      kMuon,
+      kPion,
+      kKaon,
+      kProton,
+      kKaon0,
+      kLambda,
+      kXi,
+      kOmega,
+      kUnknown
+   };
 
    AliRsnDaughter();
    AliRsnDaughter(const AliRsnDaughter &copy);
@@ -69,16 +78,8 @@ public:
    Bool_t  IsNeg()             const {return (fRef->Charge() < 0);}
    Bool_t  IsNeutral()         const {return (!IsPos() && !IsNeg());}
    Bool_t  IsSign(Char_t sign) const {if (sign == '+') return IsPos(); else if (sign == '-') return IsNeg(); else return IsNeutral();}
-   Short_t Charge()            const {if (IsPos()) return  1 ; else if (IsNeg()) return -1 ; else return  0 ;}
-   Char_t  ChargeChar()        const {if (IsPos()) return '+'; else if (IsNeg()) return '-'; else return '0';}
-
-   // utilities
-   void     Reset();
-   Int_t    GetPDG(Bool_t abs = kTRUE);
-   Int_t    GetID();
-   Bool_t   HasFlag(ULong_t flag);
-   Bool_t   SetMass(Double_t mass);
-   Bool_t   IsKinkDaughter();
+   Short_t ChargeS()           const {if (IsPos()) return  1 ; else if (IsNeg()) return -1 ; else return  0 ;}
+   Char_t  ChargeC()           const {if (IsPos()) return '+'; else if (IsNeg()) return '-'; else return '0';}
 
    // getters which automatically convert refs into allowed types
    AliVTrack*        GetRefVtrack()     {if (classMatchRef  (AliVTrack       ::Class())) return static_cast<AliVTrack*>       (fRef)  ; return 0x0;}
@@ -94,27 +95,43 @@ public:
 
    // check the input type
    Bool_t    IsMC()      {if (GetRefMCtrack()) return kTRUE; return kFALSE;}
-   Bool_t    IsAOD()     {if (GetRefAODtrack() || GetRefAODv0()) return kTRUE; return kFALSE;}
-   Bool_t    IsESD()     {if (GetRefESDtrack() || GetRefESDv0()) return kTRUE; return kFALSE;}
+   Bool_t    IsAOD()     {if (GetRefAODtrack() || GetRefAODv0() || GetRefESDcascade()) return kTRUE; return kFALSE;}
+   Bool_t    IsESD()     {if (GetRefESDtrack() || GetRefESDv0() || GetRefAODcascade()) return kTRUE; return kFALSE;}
    Bool_t    IsTrack()   {if (GetRefESDtrack() || GetRefAODtrack() || GetRefMCtrack()) return kTRUE; return kFALSE;}
    Bool_t    IsV0()      {if (GetRefESDv0() || GetRefAODv0()) return kTRUE; return kFALSE;}
    Bool_t    IsCascade() {if (GetRefESDcascade() || GetRefAODcascade()) return kTRUE; return kFALSE;}
    ERefType  RefType()   {if (IsTrack()) return kTrack; if (IsV0()) return kV0; if (IsCascade()) return kCascade; return kNoType;}
+   
+   // utilities
+   void     Reset();
+   Int_t    GetPDG(Bool_t abs = kTRUE);
+   Int_t    GetID();
+   Bool_t   SetMass(Double_t mass);
+   Bool_t   IsKinkDaughter();
+   
+   // static utilities
+   static ERefType    RefType(ESpecies species);
+   static Bool_t      IsCharged(ESpecies species) {return (species <= kProton);}
+   static const char* SpeciesName(ESpecies species);
+   static Int_t       SpeciesPDG(ESpecies species);
+   static Double_t    SpeciesMass(ESpecies species);
+   static EPARTYPE    ToAliPID(ESpecies species);
+   static ESpecies    FromAliPID(EPARTYPE species);
 
 private:
 
-   Bool_t classMatchRef  (TClass *ref) {if (fRef  ) return (fRef  ->IsA() == ref); return kFALSE;}
-   Bool_t classMatchRefMC(TClass *ref) {if (fRefMC) return (fRefMC->IsA() == ref); return kFALSE;}
+   Bool_t classMatchRef  (TClass *ref) {if (fRef  ) return (fRef  ->InheritsFrom(ref)); return kFALSE;}
+   Bool_t classMatchRefMC(TClass *ref) {if (fRefMC) return (fRefMC->InheritsFrom(ref)); return kFALSE;}
 
    Bool_t         fOK;          // internal utility flag which is kFALSE when this object should not be used
-   Int_t          fLabel;       // GEANT label of corresponding MC
+   Int_t          fLabel;       // GEANT label of corresponding MC particle
    Int_t          fMotherPDG;   // PDG code of mother (makes sense only if fRefMC is defined)
-   Int_t          fRsnID;       // id in rsn manager cout
+   Int_t          fRsnID;       // internal ID for monitoring purposes
 
    TLorentzVector fPrec;        // 4-vector filled with track info from default ref (if present)
    TLorentzVector fPsim;        // 4-vector filled with track info from MC ref (if present)
 
-   AliVParticle  *fRef;         // reference to reconstructed track in ESD/AOD
+   AliVParticle  *fRef;         // reference to reconstructed object
    AliVParticle  *fRefMC;       // reference to corresponding MC particle
 
    ClassDef(AliRsnDaughter, 9)