1#include "GaudiKernel/Bootstrap.h"
2#include "GaudiKernel/IJobOptionsSvc.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/PropertyMgr.h"
16 IJobOptionsSvc* jobSvc;
17 Gaudi::svcLocator()->service(
"JobOptionsSvc", jobSvc);
19 PropertyMgr m_propMgr;
21 m_propMgr.declareProperty(
"KsMinMassCut", m_minMass = 0.470 );
22 m_propMgr.declareProperty(
"KsMaxMassCut", m_maxMass = 0.528 );
23 m_propMgr.declareProperty(
"KsMaxChisq", m_maxChisq = 100 );
25 m_propMgr.declareProperty(
"DoSecondaryVFit", m_doSecondaryVFit =
false );
26 m_propMgr.declareProperty(
"KsMaxVFitChisq", m_maxVFitChisq = 100 );
27 m_propMgr.declareProperty(
"KsMinFlightSig", m_minFlightSig = 2.0 );
28 m_propMgr.declareProperty(
"UseVFRefine", m_useVFrefine =
true);
30 m_propMgr.declareProperty(
"UseBFieldCorr", m_useBFC =
true);
32 jobSvc->setMyProperties(
"LocalKsSelector", &m_propMgr);
40 if ( ks->
vertexId() != 310 )
return false;
44 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
45 if ( ks->
chi2() >= m_maxChisq )
return false;
47 if( !m_doSecondaryVFit )
return true;
66 HepSymMatrix evWideVertex(3, 0);
68 evWideVertex[0][0] = 1.0e12;
69 evWideVertex[1][1] = 1.0e12;
70 evWideVertex[2][2] = 1.0e12;
74 HepSymMatrix evBeamSpot(3, 0);
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];
87 cout <<
"KSSELECTOR ERROR: Could not find a vertex from VertexDbSvc" << endl;
95 wideVertex.
setVx(vWideVertex);
96 wideVertex.
setEvx(evWideVertex);
106 bool fitok = vtxfitr->
Fit();
108 HepLorentzVector ppi1 = vtxfitr->
pfit(0);
109 HepLorentzVector ppi2 = vtxfitr->
pfit(1);
110 HepLorentzVector pks = ppi1 + ppi2;
112 double mass = pks.m();
113 double chisqvtx = vtxfitr->
chisq(0);
116 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
118 if ( chisqvtx >= m_maxChisq )
return false;
120 if( !m_doSecondaryVFit )
return true;
130 beamSpot.
setVx(vBeamSpot);
131 beamSpot.
setEvx(evBeamSpot);
144 if( !svtxfit->
Fit() )
return false;
149 double vfitchi2 = svtxfit->
chisq();
150 double flightsig = 0;
152 flightsig = vfitlength/vfiterror;
156 if( vfitchi2 > m_maxVFitChisq )
return false;
157 if( flightsig < m_minFlightSig )
return false;
164 wideVertex.
setVx(vWideVertex);
165 wideVertex.
setEvx(evWideVertex);
172 vtxfit->
AddTrack(0,veeInitialWTrack1);
173 vtxfit->
AddTrack(1,veeInitialWTrack2);
185 HepLorentzVector pks = wks.
p();
187 double mass = pks.m();
188 double chisqvtx = vtxfit->
chisq(0);
191 if ((
mass <= m_minMass)||(
mass >= m_maxMass))
return false;
193 if ( chisqvtx >= m_maxChisq )
return false;
195 if( !m_doSecondaryVFit )
return true;
205 beamSpot.
setVx(vBeamSpot);
206 beamSpot.
setEvx(evBeamSpot);
219 if( !svtxfit->
Fit() )
return false;
224 double vfitchi2 = svtxfit->
chisq();
225 double flightsig = 0;
227 flightsig = vfitlength/vfiterror;
231 if( vfitchi2 > m_maxVFitChisq )
return false;
232 if( flightsig < m_minFlightSig )
return false;
LocalKsSelector ksSelector
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
bool operator()(CDKs &aKs)
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