1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.5 |
// $Id: Vertex.h,v 1.4 2008/09/30 12:51:37 bendavid Exp $
|
3 |
loizides |
1.1 |
//
|
4 |
|
|
// Vertex
|
5 |
|
|
//
|
6 |
loizides |
1.5 |
// Vertex class implemented as holding a 3d vector as a point in space with fit information.
|
7 |
loizides |
1.1 |
//
|
8 |
|
|
// Authors: J.Bendavid
|
9 |
|
|
//--------------------------------------------------------------------------------------------------
|
10 |
|
|
|
11 |
loizides |
1.5 |
#ifndef MITANA_DATATREE_VERTEX_H
|
12 |
|
|
#define MITANA_DATATREE_VERTEX_H
|
13 |
loizides |
1.1 |
|
14 |
bendavid |
1.4 |
#include <TMath.h>
|
15 |
loizides |
1.1 |
#include "MitAna/DataTree/interface/DataObject.h"
|
16 |
|
|
|
17 |
|
|
namespace mithep
|
18 |
|
|
{
|
19 |
|
|
class Vertex : public DataObject
|
20 |
|
|
{
|
21 |
|
|
public:
|
22 |
loizides |
1.5 |
Vertex() :
|
23 |
|
|
fPosition(0,0,0), fXErr(0.0), fYErr(0.0), fZErr(0.0), fChi2(0.0), fNdof(0), fNTracks(0) {}
|
24 |
|
|
Vertex(Double_t x, Double_t y, Double_t z) :
|
25 |
|
|
fPosition(x,y,z), fXErr(0.0), fYErr(0.0), fZErr(0.0), fChi2(0.0), fNdof(0), fNTracks(0) {}
|
26 |
|
|
|
27 |
bendavid |
1.4 |
Vertex(Double_t x, Double_t y, Double_t z, Double_t xErr, Double_t yErr, Double_t zErr) :
|
28 |
loizides |
1.5 |
fPosition(x,y,z), fXErr(xErr), fYErr(yErr), fZErr(zErr), fChi2(0.0), fNdof(0), fNTracks(0) {}
|
29 |
bendavid |
1.4 |
Vertex(const ThreeVector &pos) :
|
30 |
loizides |
1.5 |
fPosition(pos), fXErr(0.0), fYErr(0.0), fZErr(0.0), fChi2(0.0), fNdof(0), fNTracks(0) {}
|
31 |
loizides |
1.1 |
~Vertex() {}
|
32 |
|
|
|
33 |
bendavid |
1.4 |
Double_t Chi2() const { return fChi2; }
|
34 |
|
|
UInt_t Ndof() const { return fNdof; }
|
35 |
loizides |
1.5 |
UInt_t NTracks() const { return fNTracks; }
|
36 |
|
|
Double_t Phi() const { return fPosition.Phi(); }
|
37 |
|
|
const ThreeVector &Position() const { return fPosition; }
|
38 |
|
|
Double_t Rho() const { return fPosition.Rho(); }
|
39 |
|
|
Double_t X() const { return fPosition.X(); }
|
40 |
bendavid |
1.4 |
Double_t XErr() const { return fXErr; }
|
41 |
loizides |
1.5 |
Double_t Y() const { return fPosition.Y(); }
|
42 |
bendavid |
1.4 |
Double_t YErr() const { return fYErr; }
|
43 |
loizides |
1.5 |
Double_t Z() const { return fPosition.Z(); }
|
44 |
bendavid |
1.4 |
Double_t ZErr() const { return fZErr; }
|
45 |
|
|
Double_t Prob() const { return TMath::Prob(fChi2,fNdof); }
|
46 |
loizides |
1.5 |
void SetChi2(Double_t chi2) { fChi2 = chi2; }
|
47 |
bendavid |
1.4 |
void SetErrors(Double_t xErr, Double_t yErr, Double_t zErr);
|
48 |
loizides |
1.5 |
void SetNdof(UInt_t nDof) { fNdof = nDof; }
|
49 |
|
|
void SetPosition(const ThreeVector &pos) { fPosition = pos; }
|
50 |
|
|
void SetPosition(Double_t x, Double_t y, Double_t z);
|
51 |
|
|
void SetNTracks(UInt_t ntrks) { fNTracks = ntrks; }
|
52 |
loizides |
1.1 |
|
53 |
|
|
protected:
|
54 |
bendavid |
1.4 |
ThreeVector fPosition; //point in space
|
55 |
loizides |
1.5 |
Double32_t fXErr; //error in x
|
56 |
|
|
Double32_t fYErr; //error in y
|
57 |
|
|
Double32_t fZErr; //error in z
|
58 |
|
|
Double32_t fChi2; //chi squared of conversion vertex fit
|
59 |
|
|
UInt_t fNdof; //number of degrees of freedom of conversion vertex fit
|
60 |
|
|
UInt_t fNTracks; //number of tracks used for the fit
|
61 |
loizides |
1.1 |
|
62 |
|
|
ClassDef(Vertex, 1) // Vertex class
|
63 |
|
|
};
|
64 |
|
|
}
|
65 |
bendavid |
1.4 |
|
66 |
|
|
//--------------------------------------------------------------------------------------------------
|
67 |
|
|
inline void mithep::Vertex::SetErrors(Double_t xErr, Double_t yErr, Double_t zErr)
|
68 |
|
|
{
|
69 |
loizides |
1.5 |
// Set uncertainties on vertex position.
|
70 |
bendavid |
1.4 |
|
71 |
|
|
fXErr = xErr;
|
72 |
|
|
fYErr = yErr;
|
73 |
|
|
fZErr = zErr;
|
74 |
|
|
}
|
75 |
loizides |
1.5 |
|
76 |
|
|
//--------------------------------------------------------------------------------------------------
|
77 |
|
|
inline void mithep::Vertex::SetPosition(Double_t x, Double_t y, Double_t z)
|
78 |
|
|
{
|
79 |
|
|
// Set vertex position.
|
80 |
|
|
|
81 |
|
|
fPosition.SetXYZ(x,y,z);
|
82 |
|
|
}
|
83 |
|
|
|
84 |
loizides |
1.1 |
#endif
|