33 {
34
37
38 if ( ks->
vertexId() != 310 )
return false;
39
41 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
42 if ( ks->
chi2() >= m_maxChisq )
return false;
43
44 if( !m_doSecondaryVFit ) return true;
45
46
47
48
49
54
59
60
62 HepSymMatrix evWideVertex(3, 0);
63
64 evWideVertex[0][0] = 1.0e12;
65 evWideVertex[1][1] = 1.0e12;
66 evWideVertex[2][2] = 1.0e12;
67
68
70 HepSymMatrix evBeamSpot(3, 0);
71
73 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
77 for (unsigned int ivx = 0; ivx < 3; ivx++){
78 vBeamSpot[ivx] = dbv[ivx];
79 evBeamSpot[ivx][ivx] = vv[ivx] * vv[ivx];
80 }
81 }
82 else{
83 cout << "KSSELECTOR ERROR: Could not find a vertex from VertexDbSvc" << endl;
84 return false;
85 }
86
87 if(m_useVFrefine){
88
90
91 wideVertex.
setVx(vWideVertex);
92 wideVertex.
setEvx(evWideVertex);
93
94
97
101
102 bool fitok = vtxfitr->
Fit();
103
104
107
108
110
111 beamSpot.
setVx(vBeamSpot);
112 beamSpot.
setEvx(evBeamSpot);
113
116
117
119
120
122
123
124
125 if( !svtxfit->
Fit() )
return false;
126
127
130 double vfitchi2 = svtxfit->
chisq();
131 double flightsig = 0;
132 if( vfiterror != 0 )
133 flightsig = vfitlength/vfiterror;
134
135
136
137 if( vfitchi2 > m_maxVFitChisq ) return false;
138 if( flightsig < m_minFlightSig ) return false;
139
140 return true;
141
142 }else{
144
145 wideVertex.
setVx(vWideVertex);
146 wideVertex.
setEvx(evWideVertex);
147
148
151
152
153 vtxfit->
AddTrack(0,veeInitialWTrack1);
154 vtxfit->
AddTrack(1,veeInitialWTrack2);
156
157
161
162
165
166
168
169 beamSpot.
setVx(vBeamSpot);
170 beamSpot.
setEvx(evBeamSpot);
171
174
175
177
178
180
181
182
183 if( !svtxfit->
Fit() )
return false;
184
185
188 double vfitchi2 = svtxfit->
chisq();
189 double flightsig = 0;
190 if( vfiterror != 0 )
191 flightsig = vfitlength/vfiterror;
192
193
194
195 if( vfitchi2 > m_maxVFitChisq ) return false;
196 if( flightsig < m_minFlightSig ) return false;
197
198 return true;
199
200
201 }
202
203
204
205}
virtual const EvtRecVeeVertex * navKshort() const
static void setPidType(PidType pidType)
RecMdcKalTrack * mdcKalTrack()
std::pair< SmartRef< EvtRecTrack >, SmartRef< EvtRecTrack > > & pairDaughters()
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
void setPrimaryVertex(const VertexParameter vpar)
double decayLength() const
double decayLengthError() const
static SecondVertexFit * instance()
void setVpar(const VertexParameter vpar)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
WTrackParameter wVirtualTrack(int n) const
void AddTrack(const int index, RecMdcKalTrack *p, const RecMdcKalTrack::PidType pid)
static VertexFitRefine * instance()
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
VertexParameter vpar(int n) const
WTrackParameter wVirtualTrack(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
VertexParameter vpar(int n) const
void BuildVirtualParticle(int number)
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)