Float_t and Double_t replace by Double32_t.
authormarkus <markus@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Oct 2007 13:32:30 +0000 (13:32 +0000)
committermarkus <markus@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Oct 2007 13:32:30 +0000 (13:32 +0000)
AliAODVertex* replaced by TRef to AliAODVertex.

STEER/AliAODRecoDecay.cxx
STEER/AliAODRecoDecay.h
STEER/AliAODv0.cxx
STEER/AliAODv0.h

index 34c4fea..d5aa302 100644 (file)
@@ -42,7 +42,6 @@ AliAODRecoDecay::AliAODRecoDecay() :
   //
   // Default Constructor
   //
-  fSecondaryVtx = new AliAODVertex();
 }
 //--------------------------------------------------------------------------
 AliAODRecoDecay::AliAODRecoDecay(AliAODVertex *vtx2,Int_t nprongs,
@@ -126,8 +125,8 @@ AliAODRecoDecay::AliAODRecoDecay(const AliAODRecoDecay &source) :
       memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
     }
     if(source.fDCA) {
-      fDCA = new Float_t[GetNProngs()*(GetNProngs()-1)/2];
-      memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
+      fDCA = new Double_t[GetNProngs()*(GetNProngs()-1)/2];
+      memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Double_t));
     }
   }
 }
@@ -161,8 +160,8 @@ AliAODRecoDecay &AliAODRecoDecay::operator=(const AliAODRecoDecay &source)
       memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
     }
     if(source.fDCA) {
-      fDCA = new Float_t[GetNProngs()*(GetNProngs()-1)/2];
-      memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
+      fDCA = new Double_t[GetNProngs()*(GetNProngs()-1)/2];
+      memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Double32_t));
     }
   }
   return *this;
@@ -172,7 +171,6 @@ AliAODRecoDecay::~AliAODRecoDecay() {
   //  
   // Default Destructor
   //
-  if(fSecondaryVtx) delete fSecondaryVtx;
   if(fPx) delete [] fPx;
   if(fPy) delete [] fPy;
   if(fPz) delete [] fPz;
@@ -308,7 +306,7 @@ Double_t AliAODRecoDecay::EProng(Int_t ip,UInt_t pdg) const
   // Index of prong ip
   //
   if(!GetNProngs()) return 999999;
-  UShort_t *indices = fSecondaryVtx->GetIndices();
+UShort_t *indices = GetSecondaryVtx()->GetIndices();
   return indices[ip];
 }*/
 //----------------------------------------------------------------------------
index a4dd21f..381564d 100644 (file)
@@ -10,6 +10,7 @@
 //***********************************************************
 
 #include <TMath.h>
+#include <TRef.h>
 #include "AliAODVertex.h"
 #include "AliVParticle.h"
 
@@ -30,14 +31,14 @@ class AliAODRecoDecay : public AliVParticle {
    
 
   // decay vertex
-  Double_t GetSecVtxX() const {return fSecondaryVtx->GetX();}
-  Double_t GetSecVtxY() const {return fSecondaryVtx->GetY();}
-  Double_t GetSecVtxZ() const {return fSecondaryVtx->GetZ();}
+  Double_t GetSecVtxX() const {return GetSecondaryVtx()->GetX();}
+  Double_t GetSecVtxY() const {return GetSecondaryVtx()->GetY();}
+  Double_t GetSecVtxZ() const {return GetSecondaryVtx()->GetZ();}
   Double_t RadiusSecVtx() const;
   void     SetSecondaryVtx(AliAODVertex *vtx2) {fSecondaryVtx=vtx2;}
-  AliAODVertex* GetSecondaryVtx() const {return fSecondaryVtx;}
+  AliAODVertex* GetSecondaryVtx() const {return (AliAODVertex*)fSecondaryVtx.GetObject();}
   void     GetSecondaryVtx(Double_t vtx[3]) const;
-  Double_t GetReducedChi2() const {return fSecondaryVtx->GetChi2perNDF();}
+  Double_t GetReducedChi2() const {return GetSecondaryVtx()->GetChi2perNDF();}
   Short_t  Charge() const {return fCharge;}
   Short_t  GetCharge() const {return fCharge;}
   void     SetCharge(Short_t charge=0) {fCharge=charge;}
@@ -49,9 +50,9 @@ class AliAODRecoDecay : public AliVParticle {
   virtual const Double_t *PID() const { return fPID; }
 
   // prong-to-prong DCAs
-  void    SetDCAs(Int_t nDCA,Float_t *dca);
-  void    SetDCA(Float_t dca); // 2 prong
-  Float_t GetDCA(Int_t i=0) const {return fDCA[i];}
+  void    SetDCAs(Int_t nDCA,Double_t *dca);
+  void    SetDCA(Double_t dca); // 2 prong
+  Double_t GetDCA(Int_t i=0) const {return fDCA[i];}
 
   //event and run number
   void SetEventRunNumbers(Int_t en,Int_t rn) 
@@ -73,16 +74,16 @@ class AliAODRecoDecay : public AliVParticle {
   Double_t Y(UInt_t pdg) const {return 0.5*TMath::Log((E(pdg)+Pz())/(E(pdg)-Pz()+1.e-13));}
   Double_t DecayLength(Double_t point[3]) const;
   Double_t DecayLength(AliAODVertex *vtx1) const
-    {return fSecondaryVtx->DistanceToVertex(vtx1);}
+  {return GetSecondaryVtx()->DistanceToVertex(vtx1);}
   Double_t DecayLengthError(AliAODVertex *vtx1) const
-    {return fSecondaryVtx->ErrorDistanceToVertex(vtx1);}
+    {return GetSecondaryVtx()->ErrorDistanceToVertex(vtx1);}
   Double_t NormalizedDecayLength(AliAODVertex *vtx1) const 
     {return DecayLength(vtx1)/DecayLengthError(vtx1);}
   Double_t DecayLengthXY(Double_t point[3]) const;
   Double_t DecayLengthXY(AliAODVertex *vtx1) const
-    {return fSecondaryVtx->DistanceXYToVertex(vtx1);}
+    {return GetSecondaryVtx()->DistanceXYToVertex(vtx1);}
   Double_t DecayLengthXYError(AliAODVertex *vtx1) const
-    {return fSecondaryVtx->ErrorDistanceXYToVertex(vtx1);}
+    {return GetSecondaryVtx()->ErrorDistanceXYToVertex(vtx1);}
   Double_t NormalizedDecayLengthXY(AliAODVertex *vtx1) const 
     {return DecayLengthXY(vtx1)/DecayLengthXYError(vtx1);}
   Double_t Ct(UInt_t pdg,Double_t point[3]) const;
@@ -97,7 +98,7 @@ class AliAODRecoDecay : public AliVParticle {
   Double_t ImpParXY(AliAODVertex *vtx1) const;
 
   // prongs
-  //Int_t   GetNProngs() const {return fSecondaryVtx->GetNDaughters();}
+  //Int_t   GetNProngs() const {return GetSecondaryVtx()->GetNDaughters();}
   Int_t   GetNProngs() const {return fNProngs;}
 
   Short_t ChargeProng(Int_t ip) const;
@@ -134,7 +135,7 @@ class AliAODRecoDecay : public AliVParticle {
 
   // print
   void    Print(Option_t* option = "") const;
-  //void    PrintIndices() const {fSecondaryVtx->PrintIndices();}
+  //void    PrintIndices() const {GetSecondaryVtx()->PrintIndices();}
 
   // dummy functions for inheritance from AliVParticle
   Double_t E() const 
@@ -146,27 +147,27 @@ class AliAODRecoDecay : public AliVParticle {
 
  protected:
 
-  AliAODVertex *fSecondaryVtx;  // decay vertex
-  Short_t  fCharge; // charge, use this convention for prongs charges:
-                    // if(charge== 0) even-index prongs are +
-                    //                odd-index prongs are -
-                    // if(charge==+1) even-index prongs are +
-                    //                odd-index prongs are -
-                    // if(charge==-1) even-index prongs are -
-                    //                odd-index prongs are +
+  TRef     fSecondaryVtx;  // decay vertex
+  Short_t  fCharge;  // charge, use this convention for prongs charges:
+                     // if(charge== 0) even-index prongs are +
+                     //                odd-index prongs are -
+                     // if(charge==+1) even-index prongs are +
+                     //                odd-index prongs are -
+                     // if(charge==-1) even-index prongs are -
+                     //                odd-index prongs are +
 
   // TEMPORARY, to be removed when we do analysis on AliAODEvent
-  Int_t fNProngs;  // number of prongs
-  Int_t fNDCA;     // number of dca's
-  Int_t fNPID;     // number of PID probabilities
-  Double_t *fPx;   //[fNProngs] px of tracks at the vertex [GeV/c]
-  Double_t *fPy;   //[fNProngs] py of tracks at the vertex [GeV/c]
-  Double_t *fPz;   //[fNProngs] pz of tracks at the vertex [GeV/c]
-  Double_t *fd0;   //[fNProngs] rphi impact params w.r.t. Primary Vtx [cm]
-  Float_t *fDCA;   //[fNDCA] prong-to-prong DCA [cm]
-                   // convention:fDCA[0]=p0p1,fDCA[1]=p0p2,fDCA[2]=p1p2,...
-  Double_t *fPID;  //[fNPID] combined pid
-                   //  (combined detector response probabilities)
+  Int_t fNProngs;    // number of prongs
+  Int_t fNDCA;       // number of dca's
+  Int_t fNPID;       // number of PID probabilities
+  Double32_t *fPx;   //[fNProngs] px of tracks at the vertex [GeV/c]
+  Double32_t *fPy;   //[fNProngs] py of tracks at the vertex [GeV/c]
+  Double32_t *fPz;   //[fNProngs] pz of tracks at the vertex [GeV/c]
+  Double32_t *fd0;   //[fNProngs] rphi impact params w.r.t. Primary Vtx [cm]
+  Double32_t *fDCA;  //[fNDCA] prong-to-prong DCA [cm]
+                     // convention:fDCA[0]=p0p1,fDCA[1]=p0p2,fDCA[2]=p1p2,...
+  Double32_t *fPID;  //[fNPID] combined pid
+                     //  (combined detector response probabilities)
                             
   // TEMPORARY, to be removed when we do analysis on AliAODEvent
   Int_t fEventNumber;
@@ -208,7 +209,7 @@ inline Double_t AliAODRecoDecay::RadiusSecVtx() const
 
 inline void AliAODRecoDecay::GetSecondaryVtx(Double_t vtx[3]) const 
 {
-  fSecondaryVtx->GetPosition(vtx);
+  GetSecondaryVtx()->GetPosition(vtx);
   return;
 }
 
@@ -285,22 +286,22 @@ inline Double_t AliAODRecoDecay::QtProngFlightLine(Int_t ip,AliAODVertex *vtx1)
   return QtProngFlightLine(ip,v);
 }
 
-inline void AliAODRecoDecay::SetDCAs(Int_t nDCA,Float_t *dca) 
+inline void AliAODRecoDecay::SetDCAs(Int_t nDCA,Double_t *dca) 
 {
   if(nDCA!=(GetNProngs()*(GetNProngs()-1)/2)) { 
     printf("Wrong number of DCAs, must be nProngs*(nProngs-1)/2");
     return;
   }
   if(fDCA) delete [] fDCA;
-  fDCA = new Float_t[nDCA];
+  fDCA = new Double32_t[nDCA];
   for(Int_t i=0;i<nDCA;i++) 
     fDCA[i] = dca[i]; 
   return;
 }
 
-inline void AliAODRecoDecay::SetDCA(Float_t dca) 
+inline void AliAODRecoDecay::SetDCA(Double_t dca) 
 {
-  Float_t ddca[1]; ddca[0]=dca;
+  Double_t ddca[1]; ddca[0]=dca;
   SetDCAs(1,ddca);
   return;
 }
@@ -312,7 +313,7 @@ inline void AliAODRecoDecay::SetPID(Int_t nprongs,Double_t *pid)
     return;
   }
   if(fPID) delete [] fPID;
-  fPID = new Double_t[nprongs*5];
+  fPID = new Double32_t[nprongs*5];
   for(Int_t i=0;i<nprongs;i++) 
     for(Int_t j=0;j<5;j++)
       fPID[i*5+j] = pid[i*5+j]; 
index f304991..4163b3b 100644 (file)
@@ -40,7 +40,7 @@ ClassImp(AliAODv0)
   fNDCA    = 1;
   fNPID    = 2;
 
-  fDCA = new Float_t[fNDCA];
+  fDCA = new Double_t[fNDCA];
   fDCA[0] = 999;
 
   fPx = new Double_t[GetNProngs()];
@@ -71,7 +71,7 @@ ClassImp(AliAODv0)
 //  fNDCA    = 1;
 //  fNPID    = 2;
 
-//  fDCA = new Float_t[fNDCA];
+//  fDCA = new Double_t[fNDCA];
 
 //   fPx = new Double_t[GetNProngs()];
 //   fPy = new Double_t[GetNProngs()];
@@ -95,7 +95,7 @@ AliAODv0::AliAODv0(AliAODVertex* rAODVertex, Double_t rDcaV0Daughters, Double_t
   fNDCA    = 1;
   fNPID    = 2;
 
-  fDCA = new Float_t[fNDCA];
+  fDCA = new Double_t[fNDCA];
 
   fDCA[0] = rDcaV0Daughters;
   fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
@@ -140,21 +140,21 @@ AliAODv0::~AliAODv0(){
 // void AliAODv0::Fill(AliESDv0* rV0Vertex ,AliESDEvent* rEvent){
 
 //   Double_t tDecayVertexV0[3]; rV0Vertex->GetXYZ(tDecayVertexV0[0],tDecayVertexV0[1],tDecayVertexV0[2]); 
-//   fSecondaryVtx->SetX(tDecayVertexV0[0]);
-//   fSecondaryVtx->SetY(tDecayVertexV0[1]);
-//   fSecondaryVtx->SetZ(tDecayVertexV0[2]);
+//   GetSecondaryVtx()->SetX(tDecayVertexV0[0]);
+//   GetSecondaryVtx()->SetY(tDecayVertexV0[1]);
+//   GetSecondaryVtx()->SetZ(tDecayVertexV0[2]);
 
 //   Double_t lCovVtx[6];
 //   rV0Vertex->GetPosCov(lCovVtx);
-//   fSecondaryVtx->SetCovMatrix(lCovVtx);
+//   GetSecondaryVtx()->SetCovMatrix(lCovVtx);
 
-//   fSecondaryVtx->SetChi2perNDF(rV0Vertex->GetChi2V0());
-//   fSecondaryVtx->SetType(AliAODVertex::kV0);
+//   GetSecondaryVtx()->SetChi2perNDF(rV0Vertex->GetChi2V0());
+//   GetSecondaryVtx()->SetType(AliAODVertex::kV0);
 
 //   UInt_t lKeyPos = (UInt_t)TMath::Abs(rV0Vertex->GetPindex());// need to ask why Abs
 //   UInt_t lKeyNeg = (UInt_t)TMath::Abs(rV0Vertex->GetNindex());
-//   fSecondaryVtx->AddDaughter(rEvent->GetTrack(lKeyPos));
-//   fSecondaryVtx->AddDaughter(rEvent->GetTrack(lKeyNeg));
+//   GetSecondaryVtx()->AddDaughter(rEvent->GetTrack(lKeyPos));
+//   GetSecondaryVtx()->AddDaughter(rEvent->GetTrack(lKeyNeg));
 
 //   fDCA[0] = rV0Vertex->GetDcaV0Daughters();
 //   fDcaV0ToPrimVertex = rV0Vertex->GetD();
@@ -206,15 +206,15 @@ void AliAODv0::Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t
 
 void AliAODv0::ResetV0(){
 
-  fSecondaryVtx->SetX(999);
-  fSecondaryVtx->SetY(999);
-  fSecondaryVtx->SetZ(999);
-  fSecondaryVtx->SetChi2perNDF(999);
-  fSecondaryVtx->SetType(AliAODVertex::kUndef);
+  GetSecondaryVtx()->SetX(999);
+  GetSecondaryVtx()->SetY(999);
+  GetSecondaryVtx()->SetZ(999);
+  GetSecondaryVtx()->SetChi2perNDF(999);
+  GetSecondaryVtx()->SetType(AliAODVertex::kUndef);
 
-  Int_t lNumDaughters = fSecondaryVtx->GetNDaughters();
+  Int_t lNumDaughters = GetSecondaryVtx()->GetNDaughters();
   for(Int_t iDaughterIndex = 0; iDaughterIndex<lNumDaughters;iDaughterIndex++)
-    fSecondaryVtx->RemoveDaughter(fSecondaryVtx->GetDaughter(iDaughterIndex));
+    GetSecondaryVtx()->RemoveDaughter(GetSecondaryVtx()->GetDaughter(iDaughterIndex));
 
   fDCA[0] = 999;
   fDcaV0ToPrimVertex  = 999;
index 76b013d..db3ec75 100644 (file)
@@ -126,7 +126,7 @@ inline Double_t AliAODv0::MomNegZ() const {return fPz[1];}
 // inline Int_t AliAODv0::KeyPos() const {return fKeyPos;}
 // inline Int_t AliAODv0::KeyNeg() const {return fKeyNeg;}
 
-inline Double_t AliAODv0::Chi2V0() const {return fSecondaryVtx->GetChi2perNDF();}
+inline Double_t AliAODv0::Chi2V0() const {return GetSecondaryVtx()->GetChi2perNDF();}
 
 // Compare eventually AliAODv0::MomV0X() and AliAODRecoDecay::Px()
 inline Double_t AliAODv0::MomV0X() const {return MomPosX()+MomNegX();}