// Base class for Analysis Object Data
// Generic version
// Author: Markus Oldenburg, CERN
+// Inheritance from AliVVertex: A. Dainese
//-------------------------------------------------------------------------
#include "AliAODVertex.h"
-
#include "AliAODTrack.h"
ClassImp(AliAODVertex)
//______________________________________________________________________________
AliAODVertex::AliAODVertex() :
- TObject(),
+ AliVVertex(),
fChi2perNDF(-999.),
+ fID(-1),
fType(kUndef),
fCovMatrix(NULL),
- fParent(0x0),
+ fParent(),
fDaughters()
{
// default constructor
const Double_t covMatrix[6],
Double_t chi2perNDF,
TObject *parent,
+ Short_t id,
Char_t vtype) :
- TObject(),
+ AliVVertex(),
fChi2perNDF(chi2perNDF),
+ fID(id),
fType(vtype),
fCovMatrix(NULL),
fParent(parent),
const Float_t covMatrix[6],
Double_t chi2perNDF,
TObject *parent,
+ Short_t id,
Char_t vtype) :
- TObject(),
+ AliVVertex(),
fChi2perNDF(chi2perNDF),
+ fID(id),
fType(vtype),
fCovMatrix(NULL),
fParent(parent),
AliAODVertex::AliAODVertex(const Double_t position[3],
Double_t chi2perNDF,
Char_t vtype) :
- TObject(),
+ AliVVertex(),
fChi2perNDF(chi2perNDF),
+ fID(-1),
fType(vtype),
fCovMatrix(NULL),
- fParent(0x0),
+ fParent(),
fDaughters()
{
// constructor without covariance matrix
AliAODVertex::AliAODVertex(const Float_t position[3],
Double_t chi2perNDF,
Char_t vtype) :
- TObject(),
+ AliVVertex(),
fChi2perNDF(chi2perNDF),
+ fID(-1),
fType(vtype),
fCovMatrix(NULL),
- fParent(0x0),
+ fParent(),
fDaughters()
{
// constructor without covariance matrix
//______________________________________________________________________________
AliAODVertex::AliAODVertex(const AliAODVertex& vtx) :
- TObject(vtx),
+ AliVVertex(vtx),
fChi2perNDF(vtx.fChi2perNDF),
+ fID(vtx.fID),
fType(vtx.fType),
fCovMatrix(NULL),
fParent(vtx.fParent),
if (this != &vtx) {
// name and type
- TObject::operator=(vtx);
+ AliVVertex::operator=(vtx);
//momentum
for (int i = 0; i < 3; i++)
fPosition[i] = vtx.fPosition[i];
fChi2perNDF = vtx.fChi2perNDF;
+ fID = vtx.fID;
fType = vtx.fType;
//covariance matrix
return *this;
}
+//______________________________________________________________________________
+void AliAODVertex::AddDaughter(TObject *daughter)
+{
+ // Add reference to daughter track
+
+ if (fDaughters.GetEntries()==0) {
+ TRefArray* arr = &fDaughters;
+ new(arr)TRefArray(TProcessID::GetProcessWithUID(daughter));
+ }
+ fDaughters.Add(daughter);
+
+ return;
+}
+
//______________________________________________________________________________
template <class T> void AliAODVertex::GetSigmaXYZ(T sigma[3]) const
{
// rotation angles around z-axis (phi) and around new y-axis (theta)
// with which vtx is seen (used by RotatedCovMatrix... methods)
- phi = TMath::ATan2(vtx->GetY()-GetY(),vtx->GetX()-GetX());
+ phi = TMath::Pi()+TMath::ATan2(-vtx->GetY()+GetY(),-vtx->GetX()+GetX());
Double_t vtxxphi = vtx->GetX()*TMath::Cos(phi)+vtx->GetY()*TMath::Sin(phi);
Double_t xphi = GetX()*TMath::Cos(phi)+GetY()*TMath::Sin(phi);
theta = TMath::ATan2(vtx->GetZ()-GetZ(),vtxxphi-xphi);
TRefArrayIter iter(&fDaughters);
while (TObject *daugh = iter.Next()) {
- printf("Particle %p originates from this vertex.\n", daugh);
+ printf("Particle %p originates from this vertex.\n", static_cast<void*>(daugh));
}
}
printf(" x = %f\n", fPosition[0]);
printf(" y = %f\n", fPosition[1]);
printf(" z = %f\n", fPosition[2]);
- printf(" parent particle: %p\n", fParent.GetObject());
+ printf(" parent particle: %p\n", static_cast<void*>(fParent.GetObject()));
printf(" origin of %d particles\n", fDaughters.GetEntriesFast());
printf(" vertex type %d\n", fType);