38 {
39
42
43 if ( fabs(lambda->
vertexId()) != 3122 )
return false;
44
45 if( !m_useBFC ){
47 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
48 if ( lambda->
chi2() >= m_maxChisq )
return false;
49 }
50
51
52 int index[2] = {0, 1};
54 index[0] = 1;
55 index[1] = 0;
56 }
57
60
61 if(m_UseProtonPID){
67
72 }
73
74 if( !m_useBFC ){
75 if( !m_doSecondaryVFit ) return true;
76 }
77
78
79
80
85
89
90
92 HepSymMatrix evWideVertex(3, 0);
93
94 evWideVertex[0][0] = 1.0e12;
95 evWideVertex[1][1] = 1.0e12;
96 evWideVertex[2][2] = 1.0e12;
97
98
100 HepSymMatrix evBeamSpot(3, 0);
101
103 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
107 for (unsigned int ivx = 0; ivx < 3; ivx++){
108 vBeamSpot[ivx] = dbv[ivx];
109 evBeamSpot[ivx][ivx] = vv[ivx] * vv[ivx];
110 }
111 }
112 else{
113 cout << "LambdaSELECTOR ERROR: Could not find a vertex from VertexDbSvc" << endl;
114 return false;
115 }
116
117 if(m_useVFrefine){
118
120
121 wideVertex.
setVx(vWideVertex);
122 wideVertex.
setEvx(evWideVertex);
123
124
127
131
132 bool fitok = vtxfitr->
Fit();
133
134 HepLorentzVector ppr = vtxfitr->
pfit(0);
135 HepLorentzVector ppi = vtxfitr->
pfit(1);
136 HepLorentzVector plambda = ppr + ppi;
137
138 double mass = plambda.m();
139 double chisqvtx = vtxfitr->
chisq(0);
140
141 if( m_useBFC ){
142 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
143
144 if ( chisqvtx >= m_maxChisq ) return false;
145
146 if( !m_doSecondaryVFit ) return true;
147 }
148
149
152
153
155
156 beamSpot.
setVx(vBeamSpot);
157 beamSpot.
setEvx(evBeamSpot);
158
161
162
164
165
167
168
169
170 if( !svtxfit->
Fit() )
return false;
171
172
175 double vfitchi2 = svtxfit->
chisq();
176 double flightsig = 0;
177 if( vfiterror != 0 )
178 flightsig = vfitlength/vfiterror;
179
180
181
182 if( vfitchi2 > m_maxVFitChisq ) return false;
183 if( flightsig < m_minFlightSig ) return false;
184
185 return true;
186
187 }else{
189
190 wideVertex.
setVx(vWideVertex);
191 wideVertex.
setEvx(evWideVertex);
192
193
196
197
201
202
206
208
209 HepLorentzVector plambda = wlambda.
p();
210
211 double mass = plambda.m();
212 double chisqvtx = vtxfit->
chisq(0);
213
214 if( m_useBFC ){
215 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
216
217 if ( chisqvtx >= m_maxChisq ) return false;
218
219 if( !m_doSecondaryVFit ) return true;
220 }
221
222
225
226
228 beamSpot.
setVx(vBeamSpot);
229 beamSpot.
setEvx(evBeamSpot);
230
233
234
236
237
239
240
241
242 if( !svtxfit->
Fit() )
return false;
243
244
247 double vfitchi2 = svtxfit->
chisq();
248 double flightsig = 0;
249 if( vfiterror != 0 )
250 flightsig = vfitlength/vfiterror;
251
252
253
254 if( vfitchi2 > m_maxVFitChisq ) return false;
255 if( flightsig < m_minFlightSig ) return false;
256
257 return true;
258
259
260 }
261
262
263
264
265
266
267}
virtual const EvtRecVeeVertex * navLambda() const
static void setPidType(PidType pidType)
RecMdcKalTrack * mdcKalTrack()
SmartRef< EvtRecTrack > & daughter(int i)
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
int methodProbability() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
void identify(const int pidcase)
void usePidSys(const int pidsys)
static ParticleID * instance()
double probProton() const
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
HepSymMatrix & getZErrorP()
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 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