Fixes for bug #52499: Field polarities inconsistiency
[u/mrichter/AliRoot.git] / STEER / AliVertex.h
CommitLineData
8a553be2 1#ifndef ALIVERTEX_H
2#define ALIVERTEX_H
3/* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6
7//-------------------------------------------------------
8// Base Vertex Class
9// Used for secondary vertices and as a base class for primary vertices
10// Origin: F. Prino, Torino, prino@to.infn.it
11//-------------------------------------------------------
12
d814c191 13#include <TString.h>
bdd011d6 14#include "AliVVertex.h"
8a553be2 15
bdd011d6 16class AliVertex : public AliVVertex {
8a553be2 17
18 public:
19
20 AliVertex();
21 AliVertex(Double_t position[3],Double_t dispersion,
22 Int_t nContributors);
2d57349e 23 AliVertex(const AliVertex &source);
24 AliVertex &operator=(const AliVertex &source);
8a553be2 25 virtual ~AliVertex();
26
74c2962e 27 virtual void Clear(Option_t *option="");
8a553be2 28 virtual void SetXYZ(Double_t pos[3])
29 {for(Int_t j=0; j<3; j++) fPosition[j]=pos[j];}
30 virtual void SetXv(Double_t xVert) {fPosition[0]=xVert; }
31 virtual void SetYv(Double_t yVert) {fPosition[1]=yVert; }
32 virtual void SetZv(Double_t zVert) {fPosition[2]=zVert; }
33 virtual void SetDispersion(Double_t disp) { fSigma=disp; }
34 virtual void SetNContributors(Int_t nContr) {fNContributors=nContr; }
35
36 virtual void GetXYZ(Double_t position[3]) const;
37 virtual Double_t GetXv() const { return fPosition[0]; }
38 virtual Double_t GetYv() const { return fPosition[1]; }
39 virtual Double_t GetZv() const { return fPosition[2]; }
bdd011d6 40 virtual Double_t GetX() const { return fPosition[0]; }
41 virtual Double_t GetY() const { return fPosition[1]; }
42 virtual Double_t GetZ() const { return fPosition[2]; }
8a553be2 43 virtual Double_t GetDispersion() const { return fSigma; }
44 virtual Int_t GetNContributors() const { return fNContributors; }
c1b20d31 45 virtual Int_t GetNIndices() const { return fNIndices; }
31135a30 46 virtual Bool_t GetStatus() const {
d814c191 47 TString title = GetTitle();
48 if(fNContributors>0 || (title.Contains("cosmics") && !title.Contains("failed"))) return 1;
d94d716c 49 if(title.Contains("smearMC")) return 1;
31135a30 50 return 0;
51 }
01783a46 52 virtual Bool_t IsFromVertexer3D() const {
53 TString title = GetTitle();
54 if(title.Contains("vertexer: 3D")) return kTRUE;
55 else return kFALSE;
56 }
57 virtual Bool_t IsFromVertexerZ() const {
58 TString title = GetTitle();
59 if(title.Contains("vertexer: Z")) return kTRUE;
60 else return kFALSE;
61 }
8a553be2 62
63 virtual void Print(Option_t* option = "") const;
c1b20d31 64 virtual void SetIndices(Int_t nindices,UShort_t *indices);
65 virtual UShort_t *GetIndices() const { return fIndices; }
66 virtual Bool_t UsesTrack(Int_t index) const;
67 virtual void PrintIndices() const { if(fNIndices>0)
68 for(Int_t i=0;i<fNIndices;i++) printf("AliVertex uses track %d\n",fIndices[i]); return; }
8a553be2 69
bdd011d6 70 virtual void GetCovarianceMatrix(Double_t covmatrix[6]) const;
71
72 virtual Double_t GetChi2perNDF() const {return -999.;}
73 virtual Double_t GetChi2() const {return -999.;}
74 virtual Int_t GetNDF() const {return -999;}
75
8a553be2 76 protected:
77
562dd0b4 78 Double32_t fPosition[3]; // vertex position
79 Double32_t fSigma; // track dispersion around found vertex
8a553be2 80 Int_t fNContributors; // # of tracklets/tracks used for the estimate
c1b20d31 81 Int_t fNIndices; // # of indices
82 UShort_t *fIndices; //[fNIndices] indices of tracks used for vertex
8a553be2 83
84
bdd011d6 85 ClassDef(AliVertex,4) // Class for Primary Vertex
8a553be2 86};
87
88#endif