35 {
36
39
40 if ( ks->
vertexId() != 310 )
return false;
41
42 if( !m_useBFC ){
44 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
45 if ( ks->
chi2() >= m_maxChisq )
return false;
46
47 if( !m_doSecondaryVFit ) return true;
48 }
49
50
51
52
53
58
63
64
66 HepSymMatrix evWideVertex(3, 0);
67
68 evWideVertex[0][0] = 1.0e12;
69 evWideVertex[1][1] = 1.0e12;
70 evWideVertex[2][2] = 1.0e12;
71
72
74 HepSymMatrix evBeamSpot(3, 0);
75
77 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
81 for (unsigned int ivx = 0; ivx < 3; ivx++){
82 vBeamSpot[ivx] = dbv[ivx];
83 evBeamSpot[ivx][ivx] = vv[ivx] * vv[ivx];
84 }
85 }
86 else{
87 cout << "KSSELECTOR ERROR: Could not find a vertex from VertexDbSvc" << endl;
88 return false;
89 }
90
91 if(m_useVFrefine){
92
94
95 wideVertex.
setVx(vWideVertex);
96 wideVertex.
setEvx(evWideVertex);
97
98
101
105
106 bool fitok = vtxfitr->
Fit();
107
108 HepLorentzVector ppi1 = vtxfitr->
pfit(0);
109 HepLorentzVector ppi2 = vtxfitr->
pfit(1);
110 HepLorentzVector pks = ppi1 + ppi2;
111
112 double mass = pks.m();
113 double chisqvtx = vtxfitr->
chisq(0);
114
115 if( m_useBFC ){
116 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
117
118 if ( chisqvtx >= m_maxChisq ) return false;
119
120 if( !m_doSecondaryVFit ) return true;
121 }
122
123
126
127
129
130 beamSpot.
setVx(vBeamSpot);
131 beamSpot.
setEvx(evBeamSpot);
132
135
136
138
139
141
142
143
144 if( !svtxfit->
Fit() )
return false;
145
146
149 double vfitchi2 = svtxfit->
chisq();
150 double flightsig = 0;
151 if( vfiterror != 0 )
152 flightsig = vfitlength/vfiterror;
153
154
155
156 if( vfitchi2 > m_maxVFitChisq ) return false;
157 if( flightsig < m_minFlightSig ) return false;
158
159 return true;
160
161 }else{
163
164 wideVertex.
setVx(vWideVertex);
165 wideVertex.
setEvx(evWideVertex);
166
167
170
171
172 vtxfit->
AddTrack(0,veeInitialWTrack1);
173 vtxfit->
AddTrack(1,veeInitialWTrack2);
175
176
180
184
185 HepLorentzVector pks = wks.
p();
186
187 double mass = pks.m();
188 double chisqvtx = vtxfit->
chisq(0);
189
190 if( m_useBFC ){
191 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
192
193 if ( chisqvtx >= m_maxChisq ) return false;
194
195 if( !m_doSecondaryVFit ) return true;
196 }
197
198
201
202
204
205 beamSpot.
setVx(vBeamSpot);
206 beamSpot.
setEvx(evBeamSpot);
207
210
211
213
214
216
217
218
219 if( !svtxfit->
Fit() )
return false;
220
221
224 double vfitchi2 = svtxfit->
chisq();
225 double flightsig = 0;
226 if( vfiterror != 0 )
227 flightsig = vfitlength/vfiterror;
228
229
230
231 if( vfitchi2 > m_maxVFitChisq ) return false;
232 if( flightsig < m_minFlightSig ) return false;
233
234 return true;
235
236
237 }
238
239
240
241}
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
HepLorentzVector pfit(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 wtrk(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)
HepLorentzVector p() const