1 |
dhidas |
1.1 |
/*
|
2 |
|
|
* PrimaryVertex.cpp
|
3 |
|
|
*
|
4 |
|
|
* Created on: 25 Jul 2010
|
5 |
|
|
* Author: kreczko
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
#include "../../interface/RecoObjects/Vertex.h"
|
9 |
|
|
#include <math.h>
|
10 |
|
|
namespace BAT {
|
11 |
|
|
|
12 |
|
|
Vertex::Vertex() :
|
13 |
|
|
is_fake(false), degreesOfFreedom(0), z_position(0), rho(0) {
|
14 |
|
|
|
15 |
|
|
}
|
16 |
|
|
|
17 |
|
|
Vertex::~Vertex() {
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
void Vertex::setDegreesOfFreedom(unsigned int ndof) {
|
21 |
|
|
degreesOfFreedom = ndof;
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
void Vertex::setZPosition(float z) {
|
25 |
|
|
z_position = z;
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
void Vertex::setRho(float rho) {
|
29 |
|
|
this->rho = rho;
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
void Vertex::setFake(bool fake) {
|
33 |
|
|
is_fake = fake;
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
unsigned int Vertex::ndof() const {
|
37 |
|
|
return degreesOfFreedom;
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
float Vertex::absoluteZPosition() const {
|
41 |
|
|
return fabs(z_position);
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
float Vertex::absoluteRho() const {
|
45 |
|
|
return fabs(rho);
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
bool Vertex::isFake() const {
|
49 |
|
|
return is_fake;
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
bool Vertex::isGood() const {
|
53 |
|
|
bool passesNDOF = ndof() >= 4;
|
54 |
|
|
bool passesZ = absoluteZPosition() <= 24;//cm
|
55 |
|
|
bool passesRho = absoluteRho() <= 2.0;
|
56 |
|
|
bool isNotFake = isFake() == false;
|
57 |
|
|
return passesNDOF && passesZ && passesRho && isNotFake;
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
float Vertex::z() const{
|
61 |
|
|
return z_position;
|
62 |
|
|
}
|
63 |
|
|
}
|