]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODMCParticle.h
Updated version (Jens)
[u/mrichter/AliRoot.git] / STEER / AliAODMCParticle.h
index fbf30db500b38df6459eb4ada51943acd976c5fe..2715db5c237f7f13b41cdb0e290c5c037a56cb56 100644 (file)
@@ -68,14 +68,31 @@ class AliAODMCParticle: public AliVParticle {
     virtual Double_t GetCalcMass() const;
     virtual void SetDaughter(Int_t i,Int_t id){if(i<2)fDaughter[i] = id;}
     virtual Int_t GetDaughter(Int_t i) const {return fDaughter[i];}
+    virtual Int_t GetNDaughters  () const { return fDaughter[1]>0 ? fDaughter[1]-fDaughter[0]+1 : 0;}
     virtual void SetMother(Int_t im){fMother = im;}
     virtual Int_t GetMother() const {return fMother;}
     virtual void Print(const Option_t *opt = "") const;
     virtual Int_t GetPdgCode() const { return fPdgCode;}
-
+    virtual Int_t PdgCode()    const { return GetPdgCode();}
+    
     enum { kPrimary = 1<<0, kPhysicalPrim = 1<<1 };
-    void SetFlag(Int_t flag){fFlag = flag;}
-    Int_t GetFlag() const {return fFlag;}
+    void SetFlag(UInt_t flag){fFlag = flag;}
+    UInt_t GetFlag() const {return fFlag;}
+
+
+    // for the status we use the upper 16 bits/2 bytes of the flag word
+    void SetStatus(Int_t status){
+      // a TParticle can have a negative stuts, catch this here and do nothing
+      if(status<0)return;
+      // reset the upper bins keep the lower bins
+      fFlag &= 0xffff;
+      // bit shift by 16
+      fFlag |= (((UInt_t)status)<<16);
+    }
+    UInt_t GetStatus() const {
+      // bit shift by 16
+      return fFlag>>16;
+    }
 
     // Bitwise operations
     void SetPrimary(Bool_t b = kTRUE){
@@ -97,14 +114,14 @@ class AliAODMCParticle: public AliVParticle {
 
 
   Int_t            fPdgCode;              // PDG code of the particle
-  Int_t            fFlag;                 // Flag for indication of primary etc
+  UInt_t           fFlag;                 // Flag for indication of primary etc
   Int_t            fLabel;                // Label of the original MCParticle 
   Int_t            fMother;               // Index of the mother particles
   Int_t            fDaughter[2];          // Indices of the daughter particles
   Double32_t       fPx;                   // x component of momentum
   Double32_t       fPy;                   // y component of momentum
   Double32_t       fPz;                   // z component of momentum
-  Double32_t       fE;                    // [0.,0.,12]
+  Double32_t       fE;                    // Energy
 
   Double32_t       fVx;                   // [0.,0.,12] x of production vertex
   Double32_t       fVy;                   // [0.,0.,12] y of production vertex
@@ -113,7 +130,7 @@ class AliAODMCParticle: public AliVParticle {
 
   // Copy the uniquID to another data member? unique ID is correctly handled 
   // via TOBject Copy construct but not by AliVParticle ctor (no passing of 
-  // TParicles
+  // TParticles
   // Need a flag for primaries?
 
   /*
@@ -128,10 +145,7 @@ class AliAODMCParticle: public AliVParticle {
     };
   */
 
-
-
-  ClassDef(AliAODMCParticle,2)  // AliVParticle realisation for AODMCParticles
+  ClassDef(AliAODMCParticle,5)  // AliVParticle realisation for AODMCParticles
 
 };
 
@@ -162,7 +176,7 @@ inline Double_t AliAODMCParticle::Y()         const
     Double_t e  = E();
     Double_t pz = Pz();
     
-    if (e != TMath::Abs(pz)) { 
+    if (e > TMath::Abs(pz)) { 
        return 0.5*TMath::Log((e+pz)/(e-pz));
     } else { 
        return -999.;