//---- Root headers --------
#include <TSystem.h>
+#include <TClonesArray.h>
#include <TDirectory.h>
#include <TFile.h>
-#include <TTree.h>
-#include <TMatrixD.h>
//---- AliRoot headers -----
-#include "AliLog.h"
#include "AliStrLine.h"
#include "AliExternalTrackParam.h"
#include "AliNeutralTrackParam.h"
#include "AliVEvent.h"
#include "AliVTrack.h"
-#include "AliESDEvent.h"
#include "AliESDtrack.h"
#include "AliVertexerTracks.h"
fMinDetFitter(100.),
fMaxTgl(1000.),
fITSrefit(kTRUE),
+fITSpureSA(kFALSE),
fFiducialR(3.),
fFiducialZ(30.),
fnSigmaForUi00(1.5),
fMinDetFitter(100.),
fMaxTgl(1000.),
fITSrefit(kTRUE),
+fITSpureSA(kFALSE),
fFiducialR(3.),
fFiducialZ(30.),
fnSigmaForUi00(1.5),
// The objects pointed by the following pointer are not owned
// by this class and are not deleted
fCurrentVertex = 0;
- if(fTrksToSkip) { delete fTrksToSkip; fTrksToSkip=NULL; }
- if(fIdSel) { delete fIdSel; fIdSel=NULL; }
+ if(fTrksToSkip) { delete [] fTrksToSkip; fTrksToSkip=NULL; }
+ if(fIdSel) { delete [] fIdSel; fIdSel=NULL; }
}
//----------------------------------------------------------------------------
-AliESDVertex* AliVertexerTracks::FindPrimaryVertex(AliVEvent *vEvent)
+AliESDVertex* AliVertexerTracks::FindPrimaryVertex(const AliVEvent *vEvent)
{
//
// Primary vertex for current ESD or AOD event
}
if(skipThis) continue;
- // skip pure ITS SA tracks
- if(track->GetStatus()&AliESDtrack::kITSpureSA) continue;
+ // skip pure ITS SA tracks (default)
+ if(!fITSpureSA && (track->GetStatus()&AliESDtrack::kITSpureSA)) continue;
+ // or use only pure ITS SA tracks
+ if(fITSpureSA && !(track->GetStatus()&AliESDtrack::kITSpureSA)) continue;
// kITSrefit
if(fMode==0 && fITSrefit && !(track->GetStatus()&AliESDtrack::kITSrefit)) continue;
FindPrimaryVertex(&trkArrayOrig,idOrig);
if(fMode==0) trkArrayOrig.Delete();
- delete idOrig; idOrig=NULL;
+ delete [] idOrig; idOrig=NULL;
if(f) {
f->Close(); delete f; f = NULL;
return fCurrentVertex;
}
//----------------------------------------------------------------------------
-AliESDVertex* AliVertexerTracks::FindPrimaryVertex(TObjArray *trkArrayOrig,
+AliESDVertex* AliVertexerTracks::FindPrimaryVertex(const TObjArray *trkArrayOrig,
UShort_t *idOrig)
{
//
// fill fTrkArraySel, for VertexFinder()
fIdSel = new UShort_t[nTrksOrig];
PrepareTracks(*trkArrayOrig,idOrig,0);
- if(fIdSel) { delete fIdSel; fIdSel=NULL; }
+ if(fIdSel) { delete [] fIdSel; fIdSel=NULL; }
Double_t cutsave = fDCAcut;
fDCAcut = fDCAcutIter0;
// vertex finder
// between initVertex and fCurrentVertex)
for(Int_t iter=1; iter<=2; iter++) {
if(fOnlyFitter && iter==1) continue;
- if(fIdSel) { delete fIdSel; fIdSel=NULL; }
+ if(fIdSel) { delete [] fIdSel; fIdSel=NULL; }
fIdSel = new UShort_t[nTrksOrig];
Int_t nTrksSel = PrepareTracks(*trkArrayOrig,idOrig,iter);
AliDebug(1,Form("N tracks selected in iteration %d: %d",iter,nTrksSel));
indices[jj] = fIdSel[jj];
fCurrentVertex->SetIndices(nIndices,indices);
}
- if (indices) {delete indices; indices=NULL;}
+ if (indices) {delete [] indices; indices=NULL;}
//
// set vertex title
AliDebug(1,Form("xyz: %f %f %f; nc %d",fCurrentVertex->GetXv(),fCurrentVertex->GetYv(),fCurrentVertex->GetZv(),fCurrentVertex->GetNContributors()));
// clean up
- delete fIdSel; fIdSel=NULL;
+ delete [] fIdSel; fIdSel=NULL;
fTrkArraySel.Delete();
- if(fTrksToSkip) { delete fTrksToSkip; fTrksToSkip=NULL; }
+ if(fTrksToSkip) { delete [] fTrksToSkip; fTrksToSkip=NULL; }
//
return fCurrentVertex;
return det;
}
//-------------------------------------------------------------------------
-void AliVertexerTracks::GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t (*m)[3],Double_t *d)
+void AliVertexerTracks::GetStrLinDerivMatrix(const Double_t *p0,const Double_t *p1,Double_t (*m)[3],Double_t *d)
{
//
Double_t x12=p0[0]-p1[0];
}
//--------------------------------------------------------------------------
-void AliVertexerTracks::GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t *sigmasq,Double_t (*m)[3],Double_t *d)
+void AliVertexerTracks::GetStrLinDerivMatrix(const Double_t *p0,const Double_t *p1,const Double_t *sigmasq,Double_t (*m)[3],Double_t *d)
{
//
Double_t x12=p1[0]-p0[0];
}
//--------------------------------------------------------------------------
-Double_t AliVertexerTracks::GetStrLinMinDist(Double_t *p0,Double_t *p1,Double_t *x0)
+Double_t AliVertexerTracks::GetStrLinMinDist(const Double_t *p0,const Double_t *p1,const Double_t *x0)
{
//
Double_t x12=p0[0]-p1[0];
fVert.SetNContributors(ncombi);
}
//----------------------------------------------------------------------------
-Int_t AliVertexerTracks::PrepareTracks(TObjArray &trkArrayOrig,
- UShort_t *idOrig,
+Int_t AliVertexerTracks::PrepareTracks(const TObjArray &trkArrayOrig,
+ const UShort_t *idOrig,
Int_t optImpParCut)
{
//
}
//---------------------------------------------------------------------------
AliESDVertex* AliVertexerTracks::RemoveTracksFromVertex(AliESDVertex *inVtx,
- TObjArray *trkArray,
+ const TObjArray *trkArray,
UShort_t *id,
- Float_t *diamondxy) const
+ const Float_t *diamondxy) const
{
//
// Removes tracks in trksTree from fit of inVtx
}
}
outVtx->SetIndices(nIndices,outindices);
- if (outindices) delete outindices;
+ if (outindices) delete [] outindices;
/*
printf("Vertex before removing tracks:");
return;
}
//---------------------------------------------------------------------------
-void AliVertexerTracks::SetSkipTracks(Int_t n,Int_t *skipped)
+void AliVertexerTracks::SetSkipTracks(Int_t n,const Int_t *skipped)
{
//
// Mark the tracks not to be used in the vertex reconstruction.
delete [] linarray;
}
//---------------------------------------------------------------------------
-AliESDVertex AliVertexerTracks::TrackletVertexFinder(TClonesArray *lines, Int_t optUseWeights)
+AliESDVertex AliVertexerTracks::TrackletVertexFinder(const TClonesArray *lines, Int_t optUseWeights)
{
// Calculate the point at minimum distance to prepared tracks (TClonesArray)
const Int_t knacc = (Int_t)lines->GetEntriesFast();
Double_t det=GetDeterminant3X3(sum);
Double_t sigma=0;
- if(det!=0){
+ if(TMath::Abs(det) > kAlmost0){
for(Int_t zz=0;zz<3;zz++){
for(Int_t ww=0;ww<3;ww++){
for(Int_t kk=0;kk<3;kk++) vett[ww][kk]=sum[ww][kk];
}
AliESDVertex theVert(initPos,covmatrix,99999.,knacc);
theVert.SetDispersion(sigma);
- delete vectP0;
- delete vectP1;
+ delete [] vectP0;
+ delete [] vectP1;
return theVert;
}
}
if(!fTrkArraySel.IsEmpty()) fTrkArraySel.Delete();
- if(fIdSel) {delete fIdSel; fIdSel=NULL;}
- if(fTrksToSkip) {delete fTrksToSkip; fTrksToSkip=NULL;}
+ if(fIdSel) {delete [] fIdSel; fIdSel=NULL;}
+ if(fTrksToSkip) {delete [] fTrksToSkip; fTrksToSkip=NULL;}
return;
}
return;
}
//----------------------------------------------------------------------------
-AliESDVertex* AliVertexerTracks::VertexForSelectedTracks(TObjArray *trkArray,
+AliESDVertex* AliVertexerTracks::VertexForSelectedTracks(const TObjArray *trkArray,
UShort_t *id,
Bool_t optUseFitter,
Bool_t optPropagate,
}
// clean up
- if (indices) {delete indices; indices=NULL;}
- delete fIdSel; fIdSel=NULL;
+ if (indices) {delete [] indices; indices=NULL;}
+ delete [] fIdSel; fIdSel=NULL;
fTrkArraySel.Delete();
return fCurrentVertex;
VertexForSelectedTracks(trkArray,id,optUseFitter,optPropagate,optUseDiamondConstraint);
- delete id; id=NULL;
+ delete [] id; id=NULL;
return fCurrentVertex;
}