BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
LocalKaonSelector Class Reference

#include <LocalKaonSelector.h>

+ Inheritance diagram for LocalKaonSelector:

Public Member Functions

 LocalKaonSelector ()
 
bool operator() (CDChargedKaon &aKaon)
 
void setpidtype (int type)
 
- Public Member Functions inherited from DCSelectionFunction< CDChargedKaon >
 DCSelectionFunction ()
 
virtual ~DCSelectionFunction ()
 
virtual bool operator() (CDChargedKaon &)=0
 
bool operator() (CDChargedKaon &iArg) const
 

Detailed Description

Definition at line 7 of file LocalKaonSelector.h.

Constructor & Destructor Documentation

◆ LocalKaonSelector()

LocalKaonSelector::LocalKaonSelector ( )

Definition at line 19 of file LocalKaonSelector.cxx.

20{
21 m_pidtype=0;
22
23 IJobOptionsSvc* jobSvc;
24 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
25
26 PropertyMgr m_propMgr;
27
28 //Declare the properties
29 m_propMgr.declareProperty("RxyCut", m_VrCut = 1.0);
30 m_propMgr.declareProperty("Vz0Cut", m_VzCut = 10.0);
31 m_propMgr.declareProperty("CosThetaCut", m_CosThetaCut = 0.93);
32
33 m_propMgr.declareProperty("PidUseDedx", m_useDedx = true);
34 m_propMgr.declareProperty("PidUseTof1", m_useTof1 = true);
35 m_propMgr.declareProperty("PidUseTof2", m_useTof2 = true);
36 m_propMgr.declareProperty("PidUseTofE", m_useTofE = false);
37 m_propMgr.declareProperty("PidUseTofQ", m_useTofQ = false);
38 m_propMgr.declareProperty("PidUseEmc", m_useEmc = false);
39 m_propMgr.declareProperty("PidUseMuc", m_useMuc = false);
40
41 m_propMgr.declareProperty("PidwithProbability", m_probability = true);
42 m_propMgr.declareProperty("PidProbCut", m_PidProbCut = 0.001);
43 m_propMgr.declareProperty("RejectPion", m_rejectPion = true);
44 m_propMgr.declareProperty("RejectProton", m_rejectProton = false);
45
46 m_propMgr.declareProperty("PidwithLikelihood", m_likelihood = false);
47 m_propMgr.declareProperty("PidwithNeuronNetwork", m_neuronNetwork = false);
48 m_neuronValCut.clear();
49 m_neuronValCut.push_back(1.5);
50 m_neuronValCut.push_back(2.5);
51 m_propMgr.declareProperty("NeuronValue", m_neuronValCut);
52
53 jobSvc->setMyProperties("LocalKaonSelector", &m_propMgr);
54}

Member Function Documentation

◆ operator()()

bool LocalKaonSelector::operator() ( CDChargedKaon aKaon)
virtual

Implements DCSelectionFunction< CDChargedKaon >.

Definition at line 56 of file LocalKaonSelector.cxx.

56 {
57
58 aKaon.setUserTag(1);
59 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aKaon.track() );
60
61 // MDC track selection
62
64 if ( !recTrk->isMdcKalTrackValid() ) return false;
65 RecMdcKalTrack* mdcKalTrk = recTrk->mdcKalTrack();
66 if ( mdcKalTrk->charge()==0 ) return false;
67
68 Hep3Vector xorigin(0,0,0);
69 IVertexDbSvc* vtxsvc;
70 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
71 if(vtxsvc->isVertexValid()){
72 double* dbv = vtxsvc->PrimaryVertex();
73 double* vv = vtxsvc->SigmaPrimaryVertex();
74 xorigin.setX(dbv[0]);
75 xorigin.setY(dbv[1]);
76 xorigin.setZ(dbv[2]);
77 }
78 HepVector a = mdcKalTrk->getZHelixK();
79 HepSymMatrix Ea = mdcKalTrk->getZErrorK();
80 HepPoint3D point0(0.,0.,0.);
81 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
82 VFHelix helixip3(point0,a,Ea);
83 helixip3.pivot(IP);
84 HepVector vecipa = helixip3.a();
85
86 double dr=fabs(vecipa[0]);
87 double dz=fabs(vecipa[3]);
88 double costheta=cos(mdcKalTrk->theta());
89 if ( dr>= m_VrCut ) return false;
90 if ( dz>= m_VzCut ) return false;
91 if ( fabs(costheta) >= m_CosThetaCut ) return false;
92
93 // PID
94 ISimplePIDSvc* m_simplePIDSvc;
95 Gaudi::svcLocator()->service("SimplePIDSvc", m_simplePIDSvc);
96
97 m_simplePIDSvc->preparePID(recTrk);
98 if( !m_simplePIDSvc->iskaon() ){
99 aKaon.setUserTag(2);
100 }
101
102
103 if(m_pidtype==0) return true;
104
105 if(aKaon.userTag()==1)
106 return true;
107 else
108 return false;
109
110}
double cos(const BesAngle a)
Definition: BesAngle.h:213
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 void preparePID(EvtRecTrack *track)=0
virtual bool iskaon()=0
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
HepVector & getZHelixK()
HepSymMatrix & getZErrorK()

◆ setpidtype()

void LocalKaonSelector::setpidtype ( int  type)
inline

The documentation for this class was generated from the following files: