BOSS 7.0.5
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)
 
 LocalKaonSelector ()
 
bool operator() (CDChargedKaon &aKaon)
 
void setpidtype (int type)
 
- Public Member Functions inherited from DCSelectionFunction< CDChargedKaon >
 DCSelectionFunction ()
 
 DCSelectionFunction ()
 
virtual ~DCSelectionFunction ()
 
virtual ~DCSelectionFunction ()
 
virtual bool operator() (CDChargedKaon &)=0
 
bool operator() (CDChargedKaon &iArg) const
 
virtual bool operator() (CDChargedKaon &)=0
 
bool operator() (CDChargedKaon &iArg) const
 

Detailed Description

Constructor & Destructor Documentation

◆ LocalKaonSelector() [1/2]

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("PID", m_PID = true);
34 m_propMgr.declareProperty("useSimplePID", m_useSimplePID = true);
35
36 m_propMgr.declareProperty("PidUseDedx", m_useDedx = true);
37 m_propMgr.declareProperty("PidUseTof1", m_useTof1 = true);
38 m_propMgr.declareProperty("PidUseTof2", m_useTof2 = true);
39 m_propMgr.declareProperty("PidUseTofE", m_useTofE = false);
40 m_propMgr.declareProperty("PidUseTofQ", m_useTofQ = false);
41 m_propMgr.declareProperty("PidUseEmc", m_useEmc = false);
42 m_propMgr.declareProperty("PidUseMuc", m_useMuc = false);
43
44 m_propMgr.declareProperty("PidwithProbability", m_probability = true);
45 m_propMgr.declareProperty("PidProbCut", m_PidProbCut = 0.001);
46 m_propMgr.declareProperty("RejectPion", m_rejectPion = true);
47 m_propMgr.declareProperty("RejectProton", m_rejectProton = false);
48
49 m_propMgr.declareProperty("PidwithLikelihood", m_likelihood = false);
50 m_propMgr.declareProperty("PidwithNeuronNetwork", m_neuronNetwork = false);
51 m_neuronValCut.clear();
52 m_neuronValCut.push_back(1.5);
53 m_neuronValCut.push_back(2.5);
54 m_propMgr.declareProperty("NeuronValue", m_neuronValCut);
55
56 jobSvc->setMyProperties("LocalKaonSelector", &m_propMgr);
57}

◆ LocalKaonSelector() [2/2]

LocalKaonSelector::LocalKaonSelector ( )

Member Function Documentation

◆ operator()() [1/2]

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

Implements DCSelectionFunction< CDChargedKaon >.

Definition at line 59 of file LocalKaonSelector.cxx.

59 {
60
61 aKaon.setUserTag(1);
62 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aKaon.track() );
63
64 // MDC track selection
65
67 if ( !recTrk->isMdcKalTrackValid() ) return false;
68 RecMdcKalTrack* mdcKalTrk = recTrk->mdcKalTrack();
69 if ( mdcKalTrk->charge()==0 ) return false;
70
71 Hep3Vector xorigin(0,0,0);
72 IVertexDbSvc* vtxsvc;
73 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
74 if(vtxsvc->isVertexValid()){
75 double* dbv = vtxsvc->PrimaryVertex();
76 double* vv = vtxsvc->SigmaPrimaryVertex();
77 xorigin.setX(dbv[0]);
78 xorigin.setY(dbv[1]);
79 xorigin.setZ(dbv[2]);
80 }
81 HepVector a = mdcKalTrk->getZHelixK();
82 HepSymMatrix Ea = mdcKalTrk->getZErrorK();
83 HepPoint3D point0(0.,0.,0.);
84 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
85 VFHelix helixip3(point0,a,Ea);
86 helixip3.pivot(IP);
87 HepVector vecipa = helixip3.a();
88
89 double dr=fabs(vecipa[0]);
90 double dz=fabs(vecipa[3]);
91 double costheta=cos(mdcKalTrk->theta());
92 if ( dr>= m_VrCut ) return false;
93 if ( dz>= m_VzCut ) return false;
94 if ( fabs(costheta) >= m_CosThetaCut ) return false;
95
96 if(!m_PID) return true;
97
98 // Simple PID
99 if(m_useSimplePID){
100 ISimplePIDSvc* m_simplePIDSvc;
101 Gaudi::svcLocator()->service("SimplePIDSvc", m_simplePIDSvc);
102
103 m_simplePIDSvc->preparePID(recTrk);
104 if( !m_simplePIDSvc->iskaon() ){
105 aKaon.setUserTag(2);
106 }
107 }
108 else{
109 //particleID pacakge
111 pid->init();
112 pid->setMethod(pid->methodProbability());
113 pid->setChiMinCut(4);
114 pid->setRecTrack(recTrk);
115 pid->usePidSys(pid->useDedx() | pid->useTofCorr() );
116 pid->identify(pid->onlyPion() | pid->onlyKaon());
117 pid->calculate();
118
119 if( !(pid->probKaon()>0 && pid->probKaon()>pid->probPion()) )
120 aKaon.setUserTag(2);
121
122 }
123
124
125
126 if(m_pidtype==0) return true;
127
128 if(aKaon.userTag()==1)
129 return true;
130 else
131 return false;
132
133}
double cos(const BesAngle a)
void setUserTag(int tag)
Definition: CDCandidate.cxx:81
int userTag() const
virtual void preparePID(EvtRecTrack *track)=0
virtual bool iskaon()=0
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
static ParticleID * instance()
Definition: ParticleID.cxx:22
void calculate()
Definition: ParticleID.cxx:97
void init()
Definition: ParticleID.cxx:27
float costheta

◆ operator()() [2/2]

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

◆ setpidtype() [1/2]

void LocalKaonSelector::setpidtype ( int  type)
inline

◆ setpidtype() [2/2]

void LocalKaonSelector::setpidtype ( int  type)
inline

Definition at line 15 of file Reconstruction/DTagAlg/DTagAlg-00-01-09/DTagAlg/LocalKaonSelector.h.

15{m_pidtype=type;}

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