Introducing a new AOD class: AliAODcascade (A.Maire)
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Jul 2008 17:38:02 +0000 (17:38 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Jul 2008 17:38:02 +0000 (17:38 +0000)
STEER/AODLinkDef.h
STEER/AliAODcascade.cxx [new file with mode: 0644]
STEER/AliAODcascade.h [new file with mode: 0644]
STEER/libAOD.pkg

index f1a5be6..e7ecf10 100644 (file)
@@ -30,6 +30,7 @@
 #pragma link C++ class AliAODRedCov<6>+;
 #pragma link C++ class AliAODRecoDecay+;
 #pragma link C++ class AliAODv0+;
+#pragma link C++ class AliAODcascade+;
 #pragma link C++ class AliAODHandler+;
 #pragma link C++ class AliAODInputHandler+;
 #pragma link C++ class AliMultiAODInputHandler+;
diff --git a/STEER/AliAODcascade.cxx b/STEER/AliAODcascade.cxx
new file mode 100644 (file)
index 0000000..f283dd5
--- /dev/null
@@ -0,0 +1,329 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-------------------------------------------------------------------------
+//     Implementation of the Analysis Oriented Data (AOD) Xi vertex class
+//     Origin: A.Maire, IReS, antonin.maire@ires.in2p3.fr 
+//             G.Van Buren, BNL,  gene@bnl.gov      (original STAR MuDsts)
+//
+//     Purpose: Having physics observables available for Xis
+//-------------------------------------------------------------------------
+
+#include <TObject.h>
+#include <TVector3.h>
+#include <TMath.h>
+
+#include "AliAODcascade.h"
+#include "AliAODTrack.h"
+#include <AliAODVertex.h>
+
+
+ClassImp(AliAODcascade)
+
+
+
+
+AliAODcascade::AliAODcascade() : 
+  AliAODv0(),
+     
+  fDecayVertexXi(0x0),
+  fChargeXi(0),
+
+  fDcaXiDaughters(999),
+  fDcaXiToPrimVertex(999),
+  fDcaBachToPrimVertex(999),
+  
+  fMomBachX(999),
+  fMomBachY(999),
+  fMomBachZ(999)
+   
+{
+  //--------------------------------------------------------------------
+  // Default constructor
+  //--------------------------------------------------------------------
+}
+
+
+
+AliAODcascade::AliAODcascade(const AliAODcascade& rSource) : 
+   AliAODv0( rSource ),
+  
+  fDecayVertexXi( rSource.fDecayVertexXi ),
+  fChargeXi(      rSource.fChargeXi ),
+  
+  fDcaXiDaughters(      rSource.fDcaXiDaughters ),
+  fDcaXiToPrimVertex(   rSource.fDcaXiToPrimVertex ),
+  fDcaBachToPrimVertex( rSource.fDcaBachToPrimVertex ),
+  
+  fMomBachX( rSource.fMomBachX ),
+  fMomBachY( rSource.fMomBachY ),
+  fMomBachZ( rSource.fMomBachZ )
+  
+{
+  //--------------------------------------------------------------------
+  // Copy constructor
+  //--------------------------------------------------------------------
+  
+}
+
+
+
+AliAODcascade::AliAODcascade( AliAODVertex* rAODVertexXi, 
+                      Int_t         rChargeXi,
+                     Double_t      rDcaXiDaughters,
+                     Double_t      rDcaXiToPrimVertex,
+                     Double_t      rDcaBachToPrimVertex,
+               const Double_t*     rMomBach,
+               
+                             AliAODVertex* rAODVertexV0,
+                     Double_t rDcaV0Daughters,
+                     Double_t rDcaV0ToPrimVertex,
+               const Double_t *rMomPos,
+               const Double_t *rMomNeg,
+                     Double_t *rDcaDaughterToPrimVertex
+               ) :
+  AliAODv0(rAODVertexV0, rDcaV0Daughters, rDcaV0ToPrimVertex, rMomPos, rMomNeg, rDcaDaughterToPrimVertex),
+  fDecayVertexXi( rAODVertexXi ),
+  fChargeXi( rChargeXi ),    
+  fDcaXiDaughters( rDcaXiDaughters ),     
+  fDcaXiToPrimVertex( rDcaXiToPrimVertex ),
+  fDcaBachToPrimVertex( rDcaBachToPrimVertex ),
+  fMomBachX( rMomBach[0] ),          
+  fMomBachY( rMomBach[1] ),      
+  fMomBachZ( rMomBach[2] )  
+{
+  //--------------------------------------------------------------------
+  // Constructor via setting each data member
+  //--------------------------------------------------------------------
+}
+
+
+
+
+AliAODcascade::AliAODcascade( AliAODVertex* rAODVertexXi,  
+                      Int_t         rChargeXi,
+                     Double_t      rDcaXiDaughters,
+                     Double_t      rDcaXiToPrimVertex,
+                     Double_t      rDcaBachToPrimVertex,
+               const Double_t*     rMomBach,
+               const AliAODv0&     rAODv0 ) :
+  AliAODv0(rAODv0),
+  fDecayVertexXi(rAODVertexXi),
+  fChargeXi( rChargeXi ),    
+  fDcaXiDaughters( rDcaXiDaughters ),     
+  fDcaXiToPrimVertex( rDcaXiToPrimVertex ),
+  fDcaBachToPrimVertex( rDcaBachToPrimVertex ),
+  fMomBachX( rMomBach[0] ),          
+  fMomBachY( rMomBach[1] ),      
+  fMomBachZ( rMomBach[2] )
+{
+  //--------------------------------------------------------------------
+  // Constructor via setting each Xi data member + setting AODv0 
+  //--------------------------------------------------------------------
+}
+
+
+
+
+
+AliAODcascade& AliAODcascade::operator=(const AliAODcascade& rSource){
+  //--------------------------------------------------------------------
+  // Assignment overload
+  //--------------------------------------------------------------------
+  
+  if (this == &rSource) return *this;
+     
+  AliAODv0::operator=(rSource);
+  
+  this->fDecayVertexXi       = rSource.fDecayVertexXi;
+  this->fChargeXi            = rSource.fChargeXi;
+
+  this->fDcaXiDaughters      = rSource.fDcaXiDaughters;
+  this->fDcaXiToPrimVertex   = rSource.fDcaXiToPrimVertex;
+  this->fDcaBachToPrimVertex = rSource.fDcaBachToPrimVertex;
+
+  this->fMomBachX            = rSource.fMomBachX;
+  this->fMomBachY            = rSource.fMomBachY;
+  this->fMomBachZ            = rSource.fMomBachZ;
+  
+  return *this;
+}
+
+
+
+AliAODcascade::~AliAODcascade(){
+  //--------------------------------------------------------------------
+  // Empty destructor
+  //--------------------------------------------------------------------
+}
+
+
+
+void  AliAODcascade::Fill( AliAODVertex* rAODVertexXi, 
+                      Int_t         rChargeXi,
+                     Double_t      rDcaXiDaughters,
+                     Double_t      rDcaXiToPrimVertex,
+                     Double_t      rDcaBachToPrimVertex,
+               const Double_t*     rMomBach,
+               
+                     AliAODVertex* rAODVertexV0,
+                     Double_t      rDcaV0Daughters,
+                     Double_t      rDcaV0ToPrimVertex,
+               const Double_t*     rMomPos,
+               const Double_t*     rMomNeg,
+                     Double_t*     rDcaDaughterToPrimVertex )
+{
+  //--------------------------------------------------------------------
+  //  Fill the AODcascade
+  //--------------------------------------------------------------------
+
+  AliAODv0::Fill(rAODVertexV0,rDcaV0Daughters,rDcaV0ToPrimVertex,rMomPos,rMomNeg,rDcaDaughterToPrimVertex);
+      fDecayVertexXi =  rAODVertexXi;
+      fChargeXi      =  rChargeXi;
+
+      fDcaXiDaughters       = rDcaXiDaughters;   
+      fDcaXiToPrimVertex    = rDcaXiToPrimVertex;   
+      fDcaBachToPrimVertex  = rDcaBachToPrimVertex;
+
+      fMomBachX = rMomBach[0];   
+      fMomBachY = rMomBach[1];          
+      fMomBachZ = rMomBach[2];        
+}                
+
+
+
+void AliAODcascade::ResetXi(){
+  //--------------------------------------------------------------------
+  // Reset the values of the AOD data members to the default ones
+  //--------------------------------------------------------------------
+  
+  ResetV0();
+      
+  GetDecayVertexXi()->SetChi2perNDF(-999);
+  GetDecayVertexXi()->RemoveCovMatrix();              
+  GetDecayVertexXi()->RemoveDaughters();               
+  GetDecayVertexXi()->SetID(-1);                      
+  GetDecayVertexXi()->SetParent((TObject*) 0x0);      
+  GetDecayVertexXi()->SetPosition(-999, -999, -999);
+  GetDecayVertexXi()->SetType( AliAODVertex::kUndef );
+
+  fChargeXi = 0;
+  
+  fDcaXiDaughters = 999;
+  fDcaXiToPrimVertex = 999;
+  fDcaBachToPrimVertex = 999;
+  
+  fMomBachX = 999;
+  fMomBachY = 999;
+  fMomBachZ = 999;
+  
+  
+}
+
+void AliAODcascade::PrintXi(const Double_t& rPrimVtxX, 
+                            const Double_t& rPrimVtxY, 
+                            const Double_t& rPrimVtxZ) const
+{
+   AliAODv0::Print();  
+   printf("- \n");
+   printf("AliAODcascade : posXiVtx (%.6f, %.6f, %.6f) \n", DecayVertexXiX(), DecayVertexXiY(), DecayVertexXiZ() );
+   printf("AliAODcascade : chargeXi =   %d \n", ChargeXi() );   
+   printf("AliAODcascade : dca (bachtpv %.6f, xid %.6f, xitpv-calc %.6f, xitpv-mb %.6f) \n",
+                     DcaBachToPrimVertex(), 
+                    DcaXiDaughters(), 
+                    DcaXiToPrimVertex( rPrimVtxX, rPrimVtxY, rPrimVtxZ),
+                    DcaXiToPrimVertex()  );
+   printf("AliAODcascade : cos(PtgAngle Xi) =     %.6f \n", CosPointingAngleXi(rPrimVtxX, rPrimVtxY, rPrimVtxZ) );
+   
+     
+   printf("AliAODcascade : posVtxXI  (x  %.6f, y  %.6f, z  %.6f) \n", DecayVertexXiX(),DecayVertexXiY(),DecayVertexXiZ() );
+   printf("AliAODcascade : decaylgth (V0 %.6f, Xi %.6f) \n", DecayLengthV0(),DecayLengthXi(rPrimVtxX, rPrimVtxY, rPrimVtxZ) );
+   printf("AliAODcascade : momBach   (px %.6f, py %.6f, pz %.6f, ptot2 %.6f) \n",  
+                      MomBachX(), 
+                     MomBachY(), 
+                     MomBachZ(),
+                     Ptot2Bach() );
+   printf("AliAODcascade : momXi     (px %.6f, py %.6f, pz %.6f, ptot2 %.6f, pt2 %.6f) \n", 
+                      MomXiX(), 
+                     MomXiY(),
+                     MomXiZ(),
+                     Ptot2Xi(),
+                     Pt2Xi()   );
+   printf("AliAODcascade :  momAlongXi  (Bach     %.6f, V0 %.6f) \n", MomBachAlongXi(), MomV0AlongXi() );
+   printf("AliAODcascade :  cin (alphaXi %.6f, PtArmXi     %.6f) \n", AlphaXi(), PtArmXi() );
+   printf("AliAODcascade :  rap (Xi      %.6f, Omega       %.6f) \n", RapXi(),RapOmega() );
+   printf("AliAODcascade :  nrg (BachPi  %.6f, BachK-      %.6f, Omega %.6f, Xi  %.6f ) \n", 
+                      EBachPion(), 
+                     EBachKaon(), 
+                     EOmega(),
+                     EXi() );
+   printf("AliAODcascade : inv mass (Xi  %.6f, Omega       %.6f) \n",  MassXi(), MassOmega()  );
+   printf("- \n");
+   // Methods Not printed =  GetBachID(),  Chi2Xi()
+}
+
+Double_t AliAODcascade::CosPointingAngleXi(const Double_t& rPrimVtxX, 
+                                           const Double_t& rPrimVtxY, 
+                                           const Double_t& rPrimVtxZ) const { 
+  // Cosine of Xi pointing angle in 3D space, with respect to a point 
+  // (primary vtx ...)
+  
+  TVector3 rMomXi( MomXiX(),MomXiY(),MomXiZ() );
+  TVector3 rVect_1rVtxToXi(DecayVertexXiX() - rPrimVtxX,
+                           DecayVertexXiY() - rPrimVtxY,
+                           DecayVertexXiZ() - rPrimVtxZ);
+               
+  Double_t PtgAngle = rMomXi.Angle(rVect_1rVtxToXi);
+
+  return TMath::Cos(PtgAngle); 
+
+}
+
+Double_t AliAODcascade::DcaXiToPrimVertex(const Double_t& rPrimVtxX, 
+                                          const Double_t& rPrimVtxY, 
+                                          const Double_t& rPrimVtxZ) const {
+  //
+  // Compute the DCA between this Xi and the primary vertex
+  //
+    Double_t rMomXiX = MomXiX();
+    Double_t rMomXiY = MomXiY();
+    Double_t rMomXiZ = MomXiZ();
+    Double_t dx = (rPrimVtxY- DecayVertexXiY() )*rMomXiZ - (rPrimVtxZ- DecayVertexXiZ() )*rMomXiY; 
+    Double_t dy = (rPrimVtxZ- DecayVertexXiZ() )*rMomXiX - (rPrimVtxX- DecayVertexXiX() )*rMomXiZ;
+    Double_t dz = (rPrimVtxX- DecayVertexXiX() )*rMomXiY - (rPrimVtxY- DecayVertexXiY() )*rMomXiX;
+  return TMath::Sqrt((dx*dx+dy*dy+dz*dz)/ Ptot2Xi() );
+}
+
+Int_t  AliAODcascade::GetBachID()  const     {
+  //
+  // Return the ID of the bachelor
+  //
+
+       if( GetDecayVertexXi() == 0) return -1;
+
+       AliAODTrack *rBachTrack = (AliAODTrack *) ( GetDecayVertexXi()->GetDaughter(0) );
+       // The fDecayVertexXi should just have one stored daughter. To be managed within the AliAnalysisTaskESDFilter
+       Short_t rBachId = rBachTrack->GetID();
+       return rBachId;
+}
+
+
+
diff --git a/STEER/AliAODcascade.h b/STEER/AliAODcascade.h
new file mode 100644 (file)
index 0000000..92f3e5a
--- /dev/null
@@ -0,0 +1,291 @@
+#ifndef ALIAODCASCADE_H
+#define ALIAODCASCADE_H
+
+/* Copyright(c) 2004-2005, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+//     Implementation of the Analysis Oriented Data (AOD) Xi vertex class
+//     Origin: A.Maire, IReS, antonin.maire@ires.in2p3.fr 
+//             G.Van Buren, BNL,  gene@bnl.gov      (original STAR MuDsts)
+//
+//     Purpose: Having physics observables available for Xis
+//-------------------------------------------------------------------------
+
+#include <TDatabasePDG.h>
+
+#include <AliAODv0.h>
+
+
+#define MASS(PID)  TDatabasePDG::Instance()->GetParticle((PID))->Mass()
+#define MASS2(PID) MASS((PID))*MASS((PID))
+
+
+class AliAODTrack;
+class AliAODVertex;
+
+
+
+class AliAODcascade : public AliAODv0 {
+
+public:
+  AliAODcascade();
+  
+  AliAODcascade(const AliAODcascade& rSource);
+  
+  AliAODcascade( AliAODVertex* rAODVertexXi,  // No "const" param, constructor "TRef(const TObject*)" doesn't exist.
+                      Int_t         rChargeXi,
+                     Double_t      rDcaXiDaughters,
+                     Double_t      rDcaXiToPrimVertex,
+                     Double_t      rDcaBachToPrimVertex,
+               const Double_t*     rMomBach,
+               
+                AliAODVertex* rAODVertexV0,  // No "const" param, see above.
+                     Double_t      rDcaV0Daughters,    
+                     Double_t      rDcaV0ToPrimVertex, 
+               const Double_t*     rMomPos,            
+               const Double_t*     rMomNeg,
+                     Double_t*     rDcaDaughterToPrimVertex ); // const? -> Need agreement at AliAODRecoDecay level
+
+               
+  AliAODcascade( AliAODVertex* rAODVertexXi,  // No "const" param, see above.
+                      Int_t         rChargeXi,
+                     Double_t      rDcaXiDaughters,
+                     Double_t      rDcaXiToPrimVertex,
+                     Double_t      rDcaBachToPrimVertex,
+               const Double_t*     rMomBach,
+               const AliAODv0&     rAODv0 );
+               
+               
+               
+  virtual ~AliAODcascade();
+
+  AliAODcascade& operator=(const AliAODcascade& rSource);
+  
+  void  Fill(   AliAODVertex*   rAODVertexXi, // No "const" param, see above.
+                      Int_t     rChargeXi,
+                     Double_t  rDcaXiDaughters,
+                     Double_t  rDcaXiToPrimVertex,
+                     Double_t  rDcaBachToPrimVertex,
+               const Double_t* rMomBach,
+                       
+               AliAODVertex*   rAODVertexV0, // No "const" param, see above.
+                     Double_t  rDcaV0Daughters,
+                     Double_t  rDcaV0ToPrimVertex,
+               const Double_t* rMomPos,
+               const Double_t* rMomNeg,
+                     Double_t* rDcaDaughterToPrimVertex ); // const? -> Need agreement at AliAODRecoDecay level
+  
+//   void  Fill(   AliAODVertex*   rAODVertexXi, 
+//                       Int_t     rChargeXi,
+//                   Double_t  rDcaXiDaughters,
+//                   Double_t  rDcaXiToPrimVertex,
+//                   Double_t  rDcaBachToPrimVertex,
+//             const Double_t* rMomBach,
+//             const AliAODv0& rAODv0  );          // -> To be implemented ...       
+                     
+                     
+  void  ResetXi();                                       
+  void  PrintXi(const Double_t& rPrimVtxX, 
+                const Double_t& rPrimVtxY, 
+                const Double_t& rPrimVtxZ) const; 
+
+// ----
+  Int_t    ChargeXi()                const;
+  Int_t           GetBachID()               const;
+  Int_t    GetLabel()                const {return -1;}
+  
+  AliAODVertex* GetDecayVertexXi()   const; 
+  Double_t DecayVertexXiX()          const;
+  Double_t DecayVertexXiY()          const;
+  Double_t DecayVertexXiZ()          const;
+  Double_t Chi2Xi()                  const;
+  
+    
+  Double_t DcaBachToPrimVertex() const;
+  Double_t DcaXiDaughters()          const;
+  Double_t DcaXiToPrimVertex()       const;
+  Double_t DcaXiToPrimVertex(const Double_t& rPrimVtxX, // hopefully, temporary method ...
+                             const Double_t& rPrimVtxY, 
+                             const Double_t& rPrimVtxZ) const;
+  Double_t CosPointingAngleXi(const Double_t& rPrimVtxX, 
+                              const Double_t& rPrimVtxY, 
+                              const Double_t& rPrimVtxZ) const;  
+  
+
+  Double_t DecayLengthV0()           const;
+  Double_t DecayLengthXi(const Double_t& rPrimVtxX, 
+                         const Double_t& rPrimVtxY, 
+                         const Double_t& rPrimVtxZ) const;
+  
+                      
+  Double_t MomBachX()       const;
+  Double_t MomBachY()       const;
+  Double_t MomBachZ()       const;
+  
+  Double_t MomXiX()         const;
+  Double_t MomXiY()         const;
+  Double_t MomXiZ()         const;
+
+// ---- 
+  Double_t Ptot2Bach()      const;
+  Double_t Ptot2Xi()        const;
+  Double_t Pt2Xi()          const;
+  Double_t MomBachAlongXi() const;
+  Double_t MomV0AlongXi()   const;
+  Double_t AlphaXi()        const;
+  Double_t PtArmXi()        const;
+  Double_t EBachPion()      const;
+  Double_t EBachKaon()      const;
+  Double_t EXi()            const;
+  Double_t EOmega()         const;
+  Double_t MassXi()         const;
+  Double_t MassOmega()      const;
+  Double_t RapXi()          const;
+  Double_t RapOmega()       const;
+
+
+protected:
+
+  TRef          fDecayVertexXi;           // ref to decay vertex of the cascade (Xi vertex)
+  Short_t       fChargeXi;                // charge of Xi
+    
+  Double32_t    fDcaXiDaughters;          // dca between Xi daughters
+  Double32_t    fDcaXiToPrimVertex;       // dca of Xi to primary vertex 
+  Double32_t    fDcaBachToPrimVertex; // dca of bachelor to primary vertex 
+  
+  Double32_t    fMomBachX;            // momemtum of bachelor along X
+  Double32_t    fMomBachY;            // momemtum of bachelor along Y
+  Double32_t    fMomBachZ;            // momemtum of bachelor along Z
+
+  
+  ClassDef(AliAODcascade,1)   
+};
+
+
+
+
+//-----------------------------------------------------------
+
+
+
+inline Int_t    AliAODcascade::ChargeXi()   const     {return fChargeXi; }
+
+inline AliAODVertex* AliAODcascade::GetDecayVertexXi() const { return  (AliAODVertex*)fDecayVertexXi.GetObject(); }
+inline Double_t AliAODcascade::DecayVertexXiX() const {return GetDecayVertexXi()->GetX(); }
+inline Double_t AliAODcascade::DecayVertexXiY() const {return GetDecayVertexXi()->GetY(); }
+inline Double_t AliAODcascade::DecayVertexXiZ() const {return GetDecayVertexXi()->GetZ(); }
+
+inline Double_t AliAODcascade::Chi2Xi()         const {return GetDecayVertexXi()->GetChi2(); }
+
+
+
+inline Double_t AliAODcascade::DcaBachToPrimVertex() const {return fDcaBachToPrimVertex;}
+inline Double_t AliAODcascade::DcaXiDaughters()          const {return fDcaXiDaughters;}
+inline Double_t AliAODcascade::DcaXiToPrimVertex()       const {return fDcaXiToPrimVertex;}
+
+
+
+
+inline Double_t AliAODcascade::DecayLengthV0() const {
+    return ::sqrt(::pow(DecayVertexV0X() - DecayVertexXiX(),2) +
+                 ::pow(DecayVertexV0Y() - DecayVertexXiY(),2) +
+                 ::pow(DecayVertexV0Z() - DecayVertexXiZ(),2));
+}
+
+inline Double_t AliAODcascade::DecayLengthXi(const Double_t& rPrimVtxX, 
+                                             const Double_t& rPrimVtxY, 
+                                             const Double_t& rPrimVtxZ) const {
+  return ::sqrt(::pow(DecayVertexXiX() - rPrimVtxX,2) +
+               ::pow(DecayVertexXiY() - rPrimVtxY,2) +
+               ::pow(DecayVertexXiZ() - rPrimVtxZ,2));
+}
+
+
+
+
+
+
+inline Double_t AliAODcascade::MomBachX() const {return fMomBachX;}
+inline Double_t AliAODcascade::MomBachY() const {return fMomBachY;}
+inline Double_t AliAODcascade::MomBachZ() const {return fMomBachZ;}
+
+inline Double_t AliAODcascade::MomXiX() const {return MomV0X()+fMomBachX;}
+inline Double_t AliAODcascade::MomXiY() const {return MomV0Y()+fMomBachY;}
+inline Double_t AliAODcascade::MomXiZ() const {return MomV0Z()+fMomBachZ;}
+
+inline Double_t AliAODcascade::Ptot2Bach() const {
+  return (::pow(fMomBachX,2) + ::pow(fMomBachY,2) + ::pow(fMomBachZ,2) );
+}
+inline Double_t AliAODcascade::Ptot2Xi() const {return ( Pt2Xi() + ::pow(MomXiZ(),2) );}
+inline Double_t AliAODcascade::Pt2Xi() const {
+  return (::pow(MomXiX(),2) + ::pow(MomXiY(),2) );
+}
+
+inline Double_t AliAODcascade::MomBachAlongXi() const {
+  Double_t rPtot2Xi = Ptot2Xi();
+  if (rPtot2Xi)
+    return (MomBachX()*MomXiX() +
+           MomBachY()*MomXiY() +
+           MomBachZ()*MomXiZ()) / ::sqrt(rPtot2Xi);
+  else return 0.;
+}
+
+inline Double_t AliAODcascade::MomV0AlongXi() const {
+  Double_t rPtot2Xi = Ptot2Xi();
+  if (rPtot2Xi)
+    return (MomV0X()*MomXiX() +
+           MomV0Y()*MomXiY() +
+           MomV0Z()*MomXiZ()) / ::sqrt(rPtot2Xi);
+  return 0.;
+}
+
+inline Double_t AliAODcascade::AlphaXi() const {
+  Double_t rMomV0AlongXi   = MomV0AlongXi();
+  Double_t rMomBachAlongXi = MomBachAlongXi();
+
+  return (((Float_t) ChargeXi()) * (rMomBachAlongXi - rMomV0AlongXi)/
+                                   (rMomBachAlongXi + rMomV0AlongXi));
+}
+
+inline Double_t AliAODcascade::PtArmXi() const {
+  return ::sqrt(Ptot2Bach()-MomBachAlongXi()*MomBachAlongXi());
+}
+
+inline Double_t AliAODcascade::EBachPion() const {
+  return ::sqrt(Ptot2Bach()+MASS2("pi-"));
+}
+
+inline Double_t AliAODcascade::EBachKaon() const {
+  return ::sqrt(Ptot2Bach()+MASS2("K-"));
+}
+
+inline Double_t AliAODcascade::EXi() const {
+  return ::sqrt(Ptot2Xi()+MASS2("Xi-"));
+}
+
+inline Double_t AliAODcascade::EOmega() const {
+  return ::sqrt(Ptot2Xi()+MASS2("Omega-"));
+}
+
+inline Double_t AliAODcascade::MassXi() const {
+  return ::sqrt(::pow(ELambda()+EBachPion(),2)-Ptot2Xi());
+}
+
+inline Double_t AliAODcascade::MassOmega() const {
+  return ::sqrt(::pow(ELambda()+EBachKaon(),2)-Ptot2Xi());
+}
+
+inline Double_t AliAODcascade::RapXi() const {
+  Double_t exi = EXi();
+  Double_t rMomXiZ = MomXiZ();
+  return 0.5*::log((exi+rMomXiZ)/(exi-rMomXiZ));
+}
+
+inline Double_t AliAODcascade::RapOmega() const {
+  Double_t eom = EOmega();
+  Double_t rMomXiZ = MomXiZ();
+  return 0.5*::log((eom+rMomXiZ)/(eom-rMomXiZ));
+}
+
+#endif
index a9cbf7b..40e3996 100644 (file)
@@ -5,7 +5,7 @@ SRCS = AliAODEvent.cxx AliAODHeader.cxx \
        AliAODCluster.cxx AliAODCaloCluster.cxx AliAODPmdCluster.cxx AliAODFmdCluster.cxx \
        AliAODJet.cxx AliAODPhoton.cxx AliAODRedCov.cxx AliAODRecoDecay.cxx \
        AliAODHandler.cxx AliAODTracklets.cxx AliAODTagCreator.cxx \
-       AliAODv0.cxx AliAODCaloCells.cxx AliAODInputHandler.cxx AliMultiAODInputHandler.cxx AliAODDiJet.cxx
+       AliAODv0.cxx AliAODcascade.cxx AliAODCaloCells.cxx AliAODInputHandler.cxx AliMultiAODInputHandler.cxx AliAODDiJet.cxx
 
 HDRS:= $(SRCS:.cxx=.h)