LCFIPlus  0.6.5
VertexFinderSuehara.h
Go to the documentation of this file.
1 // VertexFinderSuehara.h
2 
3 #ifndef VertexFinderSuehara_h
4 #define VertexFinderSuehara_h 1
5 
6 #include "lcfiplus.h"
7 //#include "VertexFitterLCFI.h"
8 //#include "VertexFitterSimple.h"
9 #include <list>
10 #include <vector>
11 
12 #include "algoSigProb.h"
13 #include "VertexSelector.h"
14 
15 using namespace std;
16 using namespace lcfiplus::algoSigProb;
17 
18 namespace lcfiplus {
19 
20 namespace VertexFinderSuehara {
21 class SortTracksByIPSig { // decending order
22  public:
24  priVertex = v;
25  }
26  bool operator() (const Track* p1, const Track* p2) {
27 // double ipsig1 = sqrt(pow(trackD0Significance(p1, priVertex),2) + pow(trackZ0Significance(p1,priVertex),2));
28 // double ipsig2 = sqrt(pow(trackD0Significance(p2, priVertex),2) + pow(trackZ0Significance(p2,priVertex),2));
29  double ipsig1 = sqrt(pow(p1->getD0() / p1->getCovMatrix()[tpar::d0d0],2) + pow(p1->getZ0() / p1->getCovMatrix()[tpar::z0z0],2));
30  double ipsig2 = sqrt(pow(p2->getD0() / p2->getCovMatrix()[tpar::d0d0],2) + pow(p2->getZ0() / p2->getCovMatrix()[tpar::z0z0],2));
31  return ipsig1 > ipsig2;
32  }
33 
35 };
36 /*
37  // find 2-track vertices
38  // track, chi-square threshold, maximum invmass, minimum impact parameter significance of tracks (either)
39  vector<lcfiplus::Vertex*> * findCandidates(TrackVec &tracks, double chi2th, double massth, double ipsigth);
40 
41  // find one vertex with build-up method
42  lcfiplus::Vertex* findOne(list<const Track *> &tracks, double chi2th, double massth, bool removeTracks);
43  // VertexFitterSimple version
44  lcfiplus::Vertex* findOne2(list<const Track *> &tracks, double chi2th, double massth, bool removeTracks);
45 */
46 // compare functions
47 bool VertexNearer(const Vertex* vtx1, const Vertex* vtx2);
48 bool VertexProbLarger(const Vertex* vtx1, const Vertex* vtx2);
49 
51  public:
52  // main parameters
53  VertexSelectorConfig v0selTrack; // selector for tight v0 selection: used for track rejection
54  VertexSelectorConfig v0selVertex;// selector for loose v0 selection: used for vertex rejection
55  double chi2th; // track chi2 threshold to accept vertices
56  double chi2thV0SelTrack; // track chi2 threshold to reject tracks in v0 rejection
57  double massth; // maximum mass to accept vertices
58  double chi2orderinglimit; // chi2 threshold to order distance rather than chi2 value
59 
60  // associateIPtracks parameters
61  double minimumdistIP; // minimum distance to associate IP tracks
62  double chi2ratioIP; // bias factor to associate IP rather than secondary
63 
64  // singletrackvertex parameters
65  double minPosSingle;
66  double maxPosSingle;
72 
73  //flg for AVF/chi2 algorithm
74  bool avf;
75  double temperature; //parameter for avf
76 
77  //flg for BNess tagger fake rejection
78  bool useBNess;
79  double cutBNess; //parameter for BNess
80  double cutBNessE1; //parameter for BNess
81 
82  // default values
84  v0selTrack.setV0Tight();
85  v0selTrack.rejectdist = true;
86  v0selTrack.rejectdistnegative = true;
87  v0selTrack.rejectdistor = true;
88  v0selTrack.minpos = 0.5;
89 
90  chi2thV0SelTrack = 2.;
91 
92  v0selVertex.setV0Loose();
93  v0selVertex.rejectdist = true;
94  v0selVertex.minpos = 0.3;
95 
96  chi2th = 9.;
97  massth = 10.;
98  chi2orderinglimit = 1.;
99 
100  minimumdistIP = 0.; // not used in default
101  chi2ratioIP = 2.; // biased twice for primary
102 
103  minPosSingle = 0.3;
104  maxPosSingle = 30.;
105  minEnergySingle = 1.;
106  maxAngleSingle = 0.5;
107  maxSeparationPerPosSingle = 0.1;
108  mind0SigSingle = 5.;
109  minz0SigSingle = 5.;
110 
111  avf = false; //default: use chi2 algorithm
112  temperature = 5.0;
113 
114  useBNess = false; //default: do not use BNess
115  cutBNess = -0.80;
116  cutBNessE1 = -0.15;
117  }
118 };
119 
120 // obtain vertex list
121 void GetVertexList(list<const Track*>& tracks, const Vertex* ip, vector<Vertex*>& vtx, vector<Vertex*>& v0vtx, VertexFinderSueharaConfig& cfg);
122 
123 // associating tracks to an existing vertex
124 lcfiplus::Vertex* associateTracks(Vertex* vertex, const VertexVec& v0vtx, list<const Track*>& tracks, VertexFinderSueharaConfig& cfg, list<const Track*>* residualTracks = 0);
125 void associateIPTracks(vector<Vertex*>& vertices, Vertex* ip, VertexFinderSueharaConfig& cfg);
126 //using AVF method
127 void associateIPTracksAVF(vector<Vertex*>& vertices, Vertex* ip, VertexFinderSueharaConfig& cfg);
128 
129 void buildUp(TrackVec& tracks, vector<Vertex*>& vtx, vector<Vertex*>& v0vtx, double chi2thpri, VertexFinderSueharaConfig& cfg, Vertex* ip = 0);
130 void buildUpForJetClustering(TrackVec& tracks, vector<Vertex*>& vtx);
131 
132 vector<Vertex*> makeSingleTrackVertices
133 (VertexVec& vtcs, TrackVec& tracks, VertexVec& v0vtx, const Vertex* ip, VertexFinderSueharaConfig& cfg);
134 vector<Vertex*> makeSingleTrackVertices
135 (Jet* jet, TrackVec& tracks, VertexVec& v0vtx, const Vertex* ip, VertexFinderSueharaConfig& cfg);
136 
137 void recombineVertices(vector<Vertex*>& vertices,vector<Vertex*>& singleVertices);
138 
139 //new function for BNess tagger
140 void recombineVertices(vector<Vertex*>& vertices, vector<Vertex*>& singleVertices, VertexFinderSueharaConfig& cfg );
141 
142 void optimizeTwoVertices(Vertex*& v1, Vertex*& v2, int nvr);
143 
144 }
145 
146 //vector<lcfiplus::Vertex*> * findSueharaVertices(const Event& evt, const Jet& jet);
147 }
148 
149 #endif
double maxAngleSingle
Definition: VertexFinderSuehara.h:68
double getZ0() const
Definition: lcfiplus.h:422
void GetVertexList(list< const Track * > &tracks, const Vertex *ip, vector< Vertex * > &vtx, vector< Vertex * > &v0vtx, VertexFinderSueharaConfig &cfg)
Definition: VertexFinderSuehara.cc:414
bool avf
Definition: VertexFinderSuehara.h:74
Definition: lcfiplus.h:771
double massth
Definition: VertexFinderSuehara.h:57
VertexSelectorConfig v0selVertex
Definition: VertexFinderSuehara.h:54
bool VertexNearer(const Vertex *vtx1, const Vertex *vtx2)
Definition: VertexFinderSuehara.cc:407
const double * getCovMatrix() const
Definition: lcfiplus.h:445
Definition: lcfiplus.h:384
VertexSelectorConfig v0selTrack
Definition: VertexFinderSuehara.h:53
void recombineVertices(vector< Vertex * > &vertices, vector< Vertex * > &singleVertices, VertexFinderSueharaConfig &cfg)
Definition: VertexFinderSuehara.cc:1377
void buildUp(TrackVec &tracks, vector< Vertex * > &vtx, vector< Vertex * > &v0vtx, double chi2thpri, VertexFinderSueharaConfig &cfg, Vertex *ip=0)
Definition: VertexFinderSuehara.cc:1039
double minEnergySingle
Definition: VertexFinderSuehara.h:67
double temperature
Definition: VertexFinderSuehara.h:75
Definition: lcfiplus.h:27
double chi2th
Definition: VertexFinderSuehara.h:55
double minimumdistIP
Definition: VertexFinderSuehara.h:61
void optimizeTwoVertices(Vertex *&v1, Vertex *&v2, int nvr)
Definition: VertexFinderSuehara.cc:1153
VertexFinderSueharaConfig()
Definition: VertexFinderSuehara.h:83
lcfiplus::Vertex * associateTracks(Vertex *vertex, const VertexVec &v0vtx, list< const Track * > &tracks, VertexFinderSueharaConfig &cfg, list< const Track * > *residualTracks=0)
Definition: VertexFinderSuehara.cc:704
double getD0() const
Definition: lcfiplus.h:419
bool useBNess
Definition: VertexFinderSuehara.h:78
double maxSeparationPerPosSingle
Definition: VertexFinderSuehara.h:69
double chi2orderinglimit
Definition: VertexFinderSuehara.h:58
void associateIPTracks(vector< Vertex * > &vertices, Vertex *ip, VertexFinderSueharaConfig &cfg)
Definition: VertexFinderSuehara.cc:801
double mind0SigSingle
Definition: VertexFinderSuehara.h:70
void associateIPTracksAVF(vector< Vertex * > &vertices, Vertex *ip, VertexFinderSueharaConfig &cfg)
Definition: VertexFinderSuehara.cc:865
double chi2thV0SelTrack
Definition: VertexFinderSuehara.h:56
Definition: lcfiplus.h:980
Definition: VertexSelector.h:15
double cutBNessE1
Definition: VertexFinderSuehara.h:80
const vector< const Track * > TrackVec
Definition: lcfiplus.h:72
SortTracksByIPSig(Vertex *v)
Definition: VertexFinderSuehara.h:23
double chi2ratioIP
Definition: VertexFinderSuehara.h:62
vector< Vertex * > makeSingleTrackVertices(Jet *jet, TrackVec &tracks, VertexVec &v0vtx, const Vertex *ip, VertexFinderSueharaConfig &cfg)
Definition: VertexFinderSuehara.cc:1087
double minPosSingle
Definition: VertexFinderSuehara.h:65
bool VertexProbLarger(const Vertex *vtx1, const Vertex *vtx2)
Definition: VertexFinderSuehara.cc:410
double cutBNess
Definition: VertexFinderSuehara.h:79
Vertex * priVertex
Definition: VertexFinderSuehara.h:34
Definition: VertexFinderSuehara.h:21
double minz0SigSingle
Definition: VertexFinderSuehara.h:71
double maxPosSingle
Definition: VertexFinderSuehara.h:66
Definition: lcfiplus.h:26
void buildUpForJetClustering(TrackVec &tracks, vector< Vertex * > &vtx)
Definition: VertexFinderSuehara.cc:1078
const vector< const Vertex * > VertexVec
Definition: lcfiplus.h:79