BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
LocalPionSelector.cxx
Go to the documentation of this file.
1
2#include "GaudiKernel/Bootstrap.h"
3#include "GaudiKernel/IJobOptionsSvc.h"
4#include "GaudiKernel/ISvcLocator.h"
5#include "GaudiKernel/PropertyMgr.h"
6
13
15#include "VertexFit/VertexFit.h"
16#include "VertexFit/Helix.h"
17
19
21{
22 m_pidtype=0;
23
24 IJobOptionsSvc* jobSvc;
25 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
26
27 PropertyMgr m_propMgr;
28
29 //Declare the properties
30 m_propMgr.declareProperty("RxyCut", m_VrCut = 1.0);
31 m_propMgr.declareProperty("Vz0Cut", m_VzCut = 10.0);
32 m_propMgr.declareProperty("CosThetaCut", m_CosThetaCut = 0.93);
33
34 m_propMgr.declareProperty("PidUseDedx", m_useDedx = true);
35 m_propMgr.declareProperty("PidUseTof1", m_useTof1 = true);
36 m_propMgr.declareProperty("PidUseTof2", m_useTof2 = true);
37 m_propMgr.declareProperty("PidUseTofE", m_useTofE = false);
38 m_propMgr.declareProperty("PidUseTofQ", m_useTofQ = false);
39 m_propMgr.declareProperty("PidUseEmc", m_useEmc = false);
40 m_propMgr.declareProperty("PidUseMuc", m_useMuc = false);
41
42 m_propMgr.declareProperty("PidwithProbability", m_probability = true);
43 m_propMgr.declareProperty("PidProbCut", m_PidProbCut = 0.001);
44 m_propMgr.declareProperty("RejectKaon", m_rejectKaon = true);
45 m_propMgr.declareProperty("RejectProton", m_rejectProton = false);
46
47 m_propMgr.declareProperty("PidwithLikelihood", m_likelihood = false);
48 m_propMgr.declareProperty("PidwithNeuronNetwork", m_neuronNetwork = false);
49 m_neuronValCut.clear();
50 m_neuronValCut.push_back(1.5);
51 m_neuronValCut.push_back(2.5);
52 m_propMgr.declareProperty("NeuronValue", m_neuronValCut);
53
54 jobSvc->setMyProperties("LocalPionSelector", &m_propMgr);
55}
56
58
59 aPion.setUserTag(1);
60 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aPion.track() );
61
62
63 // MDC track selection
64
66 if ( !recTrk->isMdcKalTrackValid() ) return false;
67 RecMdcKalTrack* mdcKalTrk = recTrk->mdcKalTrack();
68 if ( mdcKalTrk->charge()==0 ) return false;
69
70 Hep3Vector xorigin(0,0,0);
71 IVertexDbSvc* vtxsvc;
72 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
73 if(vtxsvc->isVertexValid()){
74 double* dbv = vtxsvc->PrimaryVertex();
75 double* vv = vtxsvc->SigmaPrimaryVertex();
76 xorigin.setX(dbv[0]);
77 xorigin.setY(dbv[1]);
78 xorigin.setZ(dbv[2]);
79 }
80 HepVector a = mdcKalTrk->getZHelix();
81 HepSymMatrix Ea = mdcKalTrk->getZError();
82 HepPoint3D point0(0.,0.,0.);
83 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
84 VFHelix helixip3(point0,a,Ea);
85 helixip3.pivot(IP);
86 HepVector vecipa = helixip3.a();
87
88 double dr=fabs(vecipa[0]);
89 double dz=fabs(vecipa[3]);
90 double costheta=cos(mdcKalTrk->theta());
91 if ( dr>= m_VrCut ) return false;
92 if ( dz>= m_VzCut ) return false;
93 if ( fabs(costheta) >= m_CosThetaCut ) return false;
94
95
96 // PID
97 ISimplePIDSvc* m_simplePIDSvc;
98 Gaudi::svcLocator()->service("SimplePIDSvc", m_simplePIDSvc);
99 m_simplePIDSvc->preparePID(recTrk);
100 if( !m_simplePIDSvc->ispion() ){
101 aPion.setUserTag(2);
102 }
103
104 if(m_pidtype==0) return true;
105
106 if(aPion.userTag()==1)
107 return true;
108 else
109 return false;
110
111}
112
double cos(const BesAngle a)
Definition: BesAngle.h:213
LocalPionSelector pionSelector
void setUserTag(int tag)
Definition: CDCandidate.cxx:81
int userTag() const
virtual const EvtRecTrack * track() const
const double theta() const
static void setPidType(PidType pidType)
const int charge() const
bool isMdcKalTrackValid()
Definition: EvtRecTrack.h:44
RecMdcKalTrack * mdcKalTrack()
Definition: EvtRecTrack.h:54
virtual bool ispion()=0
virtual void preparePID(EvtRecTrack *track)=0
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
bool operator()(CDChargedPion &aPion)
const HepVector & getZHelix() const
const HepSymMatrix & getZError() const
const HepPoint3D & pivot(void) const
returns pivot position.
const HepVector & a(void) const
returns helix parameters.