#include "AliAODVertex.h"
+#include "AliAODTrack.h"
+
ClassImp(AliAODVertex)
//______________________________________________________________________________
AliAODVertex::AliAODVertex() :
TObject(),
- fChi2(-999.),
+ fChi2perNDF(-999.),
+ fID(-1),
+ fType(kUndef),
fCovMatrix(NULL),
- fParent(0x0),
- fDaughters(),
- fType(kUndef)
- {
+ fParent(),
+ fDaughters()
+ {
// default constructor
fPosition[0] = fPosition[1] = fPosition[2] = -999.;
//______________________________________________________________________________
AliAODVertex::AliAODVertex(const Double_t position[3],
- const Double_t covMatrix[6],
- Double_t chi2,
+ const Double_t covMatrix[6],
+ Double_t chi2perNDF,
TObject *parent,
+ Short_t id,
Char_t vtype) :
TObject(),
- fChi2(chi2),
+ fChi2perNDF(chi2perNDF),
+ fID(id),
+ fType(vtype),
fCovMatrix(NULL),
fParent(parent),
- fDaughters(),
- fType(vtype)
+ fDaughters()
{
// constructor
//______________________________________________________________________________
AliAODVertex::AliAODVertex(const Float_t position[3],
const Float_t covMatrix[6],
- Double_t chi2,
+ Double_t chi2perNDF,
TObject *parent,
+ Short_t id,
Char_t vtype) :
+
TObject(),
- fChi2(chi2),
+ fChi2perNDF(chi2perNDF),
+ fID(id),
+ fType(vtype),
fCovMatrix(NULL),
fParent(parent),
- fDaughters(),
- fType(vtype)
+ fDaughters()
{
// constructor
//______________________________________________________________________________
AliAODVertex::AliAODVertex(const Double_t position[3],
- Double_t chi2,
+ Double_t chi2perNDF,
Char_t vtype) :
TObject(),
- fChi2(chi2),
+ fChi2perNDF(chi2perNDF),
+ fID(-1),
+ fType(vtype),
fCovMatrix(NULL),
- fParent(0x0),
- fDaughters(),
- fType(vtype)
+ fParent(),
+ fDaughters()
{
// constructor without covariance matrix
//______________________________________________________________________________
AliAODVertex::AliAODVertex(const Float_t position[3],
- Double_t chi2,
+ Double_t chi2perNDF,
Char_t vtype) :
TObject(),
- fChi2(chi2),
+ fChi2perNDF(chi2perNDF),
+ fID(-1),
+ fType(vtype),
fCovMatrix(NULL),
- fParent(0x0),
- fDaughters(),
- fType(vtype)
+ fParent(),
+ fDaughters()
{
// constructor without covariance matrix
//______________________________________________________________________________
AliAODVertex::AliAODVertex(const AliAODVertex& vtx) :
TObject(vtx),
- fChi2(vtx.fChi2),
+ fChi2perNDF(vtx.fChi2perNDF),
+ fID(vtx.fID),
+ fType(vtx.fType),
fCovMatrix(NULL),
fParent(vtx.fParent),
- fDaughters(vtx.fDaughters),
- fType(vtx.fType)
+ fDaughters(vtx.fDaughters)
{
// Copy constructor.
for (int i = 0; i < 3; i++)
fPosition[i] = vtx.fPosition[i];
- fChi2 = vtx.fChi2;
+ fChi2perNDF = vtx.fChi2perNDF;
+ fID = vtx.fID;
+ fType = vtx.fType;
//covariance matrix
delete fCovMatrix;
//other stuff
fParent = vtx.fParent;
fDaughters = vtx.fDaughters;
- fType = vtx.fType;
}
return *this;
*/
}
+//______________________________________________________________________________
+Int_t AliAODVertex::GetNContributors() const
+{
+ // Returns the number of tracks used to fit this vertex.
+
+ Int_t cont = 0;
+
+ for (Int_t iDaug = 0; iDaug < GetNDaughters(); iDaug++) {
+ if (((AliAODTrack*)fDaughters.At(iDaug))->GetUsedForVtxFit()) cont++;
+ }
+
+ return cont;
+}
+
//______________________________________________________________________________
Bool_t AliAODVertex::HasDaughter(TObject *daughter) 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);
fCovMatrix[4],
fCovMatrix[5]);
} */
- printf(" Chi^2 = %f\n", fChi2);
+ printf(" Chi^2/NDF = %f\n", fChi2perNDF);
}