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

◆ LocalKaonSelector() [2/2]

LocalKaonSelector::LocalKaonSelector ( )

Member Function Documentation

◆ operator()() [1/2]

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

Implements DCSelectionFunction< CDChargedKaon >.

Definition at line 58 of file LocalKaonSelector.cxx.

58 {
59
60 aKaon.setUserTag(1);
61 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aKaon.track() );
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->getZHelixK();
81 HepSymMatrix Ea = mdcKalTrk->getZErrorK();
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 // Simple PID
96 if(m_useSimplePID){
97 ISimplePIDSvc* m_simplePIDSvc;
98 Gaudi::svcLocator()->service("SimplePIDSvc", m_simplePIDSvc);
99
100 m_simplePIDSvc->preparePID(recTrk);
101 if( !m_simplePIDSvc->iskaon() ){
102 aKaon.setUserTag(2);
103 }
104 }
105 else{
106 //particleID pacakge
108 pid->init();
109 pid->setMethod(pid->methodProbability());
110 pid->setChiMinCut(4);
111 pid->setRecTrack(recTrk);
112 pid->usePidSys(pid->useDedx() | pid->useTofCorr() );
113 pid->identify(pid->onlyPion() | pid->onlyKaon());
114 pid->calculate();
115
116 if( !(pid->probKaon()>0 && pid->probKaon()>pid->probPion()) )
117 aKaon.setUserTag(2);
118
119 }
120
121
122
123 if(m_pidtype==0) return true;
124
125 if(aKaon.userTag()==1)
126 return true;
127 else
128 return false;
129
130}
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

◆ 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-05/DTagAlg/LocalKaonSelector.h.

15{m_pidtype=type;}

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