1#include "GaudiKernel/Bootstrap.h"
3#include "EvtRecEvent/EvtRecVeeVertex.h"
5#include "ParticleID/ParticleID.h"
6#include "VertexDbSvc/IVertexDbSvc.h"
7#include "VertexFit/SecondVertexFit.h"
8#include "VertexFit/VertexFit.h"
9#include "VertexFitRefine/VertexFitRefine.h"
14 const IInterface* parent )
15 : base_class(
type, name, parent ) {
16 declareProperty(
"LambdaMinMassCut", m_minMass = 1.10 );
17 declareProperty(
"LambdaMaxMassCut", m_maxMass = 1.13 );
18 declareProperty(
"LambdaMaxChisq", m_maxChisq = 100 );
19 declareProperty(
"UseProtonPID", m_UseProtonPID =
true );
20 declareProperty(
"ProtonPIDChiCut", m_ChiCut = 8 );
22 declareProperty(
"DoSecondaryVFit", m_doSecondaryVFit =
false );
23 declareProperty(
"LambdaMaxVFitChisq", m_maxVFitChisq = 100 );
24 declareProperty(
"LambdaMinFlightSig", m_minFlightSig = 2.0 );
25 declareProperty(
"UseVFRefine", m_useVFrefine =
true );
27 declareProperty(
"UseBFieldCorr", m_useBFC =
true );
35 if ( fabs( lambda->
vertexId() ) != 3122 )
return false;
40 if ( (
mass <= m_minMass ) || (
mass >= m_maxMass ) )
return false;
41 if ( lambda->
chi2() >= m_maxChisq )
return false;
45 int index[2] = { 0, 1 };
73 if ( !m_doSecondaryVFit )
return true;
92 HepSymMatrix evWideVertex( 3, 0 );
94 evWideVertex[0][0] = 1.0e12;
95 evWideVertex[1][1] = 1.0e12;
96 evWideVertex[2][2] = 1.0e12;
100 HepSymMatrix evBeamSpot( 3, 0 );
103 StatusCode sc = serviceLocator()->service(
"VertexDbSvc", vtxsvc );
108 for (
unsigned int ivx = 0; ivx < 3; ivx++ )
110 vBeamSpot[ivx] = dbv[ivx];
111 evBeamSpot[ivx][ivx] = vv[ivx] * vv[ivx];
116 cout <<
"LambdaSELECTOR ERROR: Could not find a vertex from VertexDbSvc" << endl;
125 wideVertex.
setVx( vWideVertex );
126 wideVertex.
setEvx( evWideVertex );
134 vtxfitr->
AddVertex( 0, wideVertex, 0, 1 );
136 bool fitok = vtxfitr->
Fit();
138 HepLorentzVector ppr = vtxfitr->
pfit( 0 );
139 HepLorentzVector ppi = vtxfitr->
pfit( 1 );
140 HepLorentzVector plambda = ppr + ppi;
142 double mass = plambda.m();
143 double chisqvtx = vtxfitr->
chisq( 0 );
147 if ( (
mass <= m_minMass ) || (
mass >= m_maxMass ) )
return false;
149 if ( chisqvtx >= m_maxChisq )
return false;
151 if ( !m_doSecondaryVFit )
return true;
161 beamSpot.
setVx( vBeamSpot );
162 beamSpot.
setEvx( evBeamSpot );
175 if ( !svtxfit->
Fit() )
return false;
180 double vfitchi2 = svtxfit->
chisq();
181 double flightsig = 0;
182 if ( vfiterror != 0 ) flightsig = vfitlength / vfiterror;
186 if ( vfitchi2 > m_maxVFitChisq )
return false;
187 if ( flightsig < m_minFlightSig )
return false;
195 wideVertex.
setVx( vWideVertex );
196 wideVertex.
setEvx( evWideVertex );
205 vtxfit->
AddVertex( 0, wideVertex, 0, 1 );
214 HepLorentzVector plambda = wlambda.
p();
216 double mass = plambda.m();
217 double chisqvtx = vtxfit->
chisq( 0 );
221 if ( (
mass <= m_minMass ) || (
mass >= m_maxMass ) )
return false;
223 if ( chisqvtx >= m_maxChisq )
return false;
225 if ( !m_doSecondaryVFit )
return true;
234 beamSpot.
setVx( vBeamSpot );
235 beamSpot.
setEvx( evBeamSpot );
248 if ( !svtxfit->
Fit() )
return false;
253 double vfitchi2 = svtxfit->
chisq();
254 double flightsig = 0;
255 if ( vfiterror != 0 ) flightsig = vfitlength / vfiterror;
259 if ( vfitchi2 > m_maxVFitChisq )
return false;
260 if ( flightsig < m_minFlightSig )
return false;
DECLARE_COMPONENT(BesBdkRc)
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
LocalLambdaSelector(const std::string &type, const std::string &name, const IInterface *parent)
bool operator()(CDLambda &aLambda) override
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