BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
LocalPionSelector Class Reference

#include <LocalPionSelector.h>

+ Inheritance diagram for LocalPionSelector:

Public Member Functions

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

Detailed Description

Definition at line 7 of file LocalPionSelector.h.

Constructor & Destructor Documentation

◆ LocalPionSelector()

LocalPionSelector::LocalPionSelector ( )

Definition at line 20 of file LocalPionSelector.cxx.

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

Member Function Documentation

◆ operator()()

bool LocalPionSelector::operator() ( CDChargedPion aPion)
virtual

Implements DCSelectionFunction< CDChargedPion >.

Definition at line 60 of file LocalPionSelector.cxx.

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

◆ setpidtype()

void LocalPionSelector::setpidtype ( int  type)
inline

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