30 {
31
33 EvtRecVeeVertex* lambda =
const_cast<EvtRecVeeVertex*
>( aLambda.
navLambda() );
34
35 if ( fabs( lambda->
vertexId() ) != 3122 )
return false;
36
37 if ( !m_useBFC )
38 {
40 if ( (
mass <= m_minMass ) || (
mass >= m_maxMass ) )
return false;
41 if ( lambda->
chi2() >= m_maxChisq )
return false;
42 }
43
44
45 int index[2] = { 0, 1 };
47 {
48 index[0] = 1;
49 index[1] = 0;
50 }
51
52 EvtRecTrack* recTrk_proton = lambda->
daughter( index[0] );
53 EvtRecTrack* recTrk_pion = lambda->
daughter( index[1] );
54
55 if ( m_UseProtonPID )
56 {
62
68 return false;
69 }
70
71 if ( !m_useBFC )
72 {
73 if ( !m_doSecondaryVFit ) return true;
74 }
75
76
77
78
79 RecMdcKalTrack* mdcKalTrk_proton = recTrk_proton->
mdcKalTrack();
81 WTrackParameter WTrk_proton;
82 WTrk_proton = WTrackParameter( 0.9314940054, mdcKalTrk_proton->
getZHelixP(),
84
85 RecMdcKalTrack* mdcKalTrk_pion = recTrk_pion->
mdcKalTrack();
87 WTrackParameter WTrk_pion =
88 WTrackParameter( 0.13957018, mdcKalTrk_pion->
getZHelix(), mdcKalTrk_pion->
getZError() );
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
102 IVertexDbSvc* vtxsvc;
103 StatusCode sc = serviceLocator()->service( "VertexDbSvc", vtxsvc );
105 {
108 for ( unsigned int ivx = 0; ivx < 3; ivx++ )
109 {
110 vBeamSpot[ivx] = dbv[ivx];
111 evBeamSpot[ivx][ivx] = vv[ivx] * vv[ivx];
112 }
113 }
114 else
115 {
116 cout << "LambdaSELECTOR ERROR: Could not find a vertex from VertexDbSvc" << endl;
117 return false;
118 }
119
120 if ( m_useVFrefine )
121 {
122
123 VertexParameter wideVertex;
124
125 wideVertex.
setVx( vWideVertex );
126 wideVertex.
setEvx( evWideVertex );
127
128
131
134 vtxfitr->
AddVertex( 0, wideVertex, 0, 1 );
135
136 bool fitok = vtxfitr->
Fit();
137
138 HepLorentzVector ppr = vtxfitr->
pfit( 0 );
139 HepLorentzVector ppi = vtxfitr->
pfit( 1 );
140 HepLorentzVector plambda = ppr + ppi;
141
142 double mass = plambda.m();
143 double chisqvtx = vtxfitr->
chisq( 0 );
144
145 if ( m_useBFC )
146 {
147 if ( (
mass <= m_minMass ) || (
mass >= m_maxMass ) )
return false;
148
149 if ( chisqvtx >= m_maxChisq ) return false;
150
151 if ( !m_doSecondaryVFit ) return true;
152 }
153
154
157
158
159 VertexParameter beamSpot;
160
161 beamSpot.
setVx( vBeamSpot );
162 beamSpot.
setEvx( evBeamSpot );
163
164 VertexParameter primaryVertex( beamSpot );
166
167
169
170
172
173
174
175 if ( !svtxfit->
Fit() )
return false;
176
177
180 double vfitchi2 = svtxfit->
chisq();
181 double flightsig = 0;
182 if ( vfiterror != 0 ) flightsig = vfitlength / vfiterror;
183
184
185
186 if ( vfitchi2 > m_maxVFitChisq ) return false;
187 if ( flightsig < m_minFlightSig ) return false;
188
189 return true;
190 }
191 else
192 {
193 VertexParameter wideVertex;
194
195 wideVertex.
setVx( vWideVertex );
196 wideVertex.
setEvx( evWideVertex );
197
198
201
202
205 vtxfit->
AddVertex( 0, wideVertex, 0, 1 );
206
207
211
213
214 HepLorentzVector plambda = wlambda.
p();
215
216 double mass = plambda.m();
217 double chisqvtx = vtxfit->
chisq( 0 );
218
219 if ( m_useBFC )
220 {
221 if ( (
mass <= m_minMass ) || (
mass >= m_maxMass ) )
return false;
222
223 if ( chisqvtx >= m_maxChisq ) return false;
224
225 if ( !m_doSecondaryVFit ) return true;
226 }
227
228
231
232
233 VertexParameter beamSpot;
234 beamSpot.
setVx( vBeamSpot );
235 beamSpot.
setEvx( evBeamSpot );
236
237 VertexParameter primaryVertex( beamSpot );
239
240
242
243
245
246
247
248 if ( !svtxfit->
Fit() )
return false;
249
250
253 double vfitchi2 = svtxfit->
chisq();
254 double flightsig = 0;
255 if ( vfiterror != 0 ) flightsig = vfitlength / vfiterror;
256
257
258
259 if ( vfitchi2 > m_maxVFitChisq ) return false;
260 if ( flightsig < m_minFlightSig ) return false;
261
262 return true;
263 }
264}
HepGeom::Point3D< double > HepPoint3D
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