BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
LocalProtonSelector Class Reference

#include <LocalProtonSelector.h>

+ Inheritance diagram for LocalProtonSelector:

Public Member Functions

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

Detailed Description

Definition at line 7 of file LocalProtonSelector.h.

Constructor & Destructor Documentation

◆ LocalProtonSelector()

LocalProtonSelector::LocalProtonSelector ( )

Definition at line 17 of file LocalProtonSelector.cxx.

18{
19 m_pidtype=0;
20
21 IJobOptionsSvc* jobSvc;
22 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
23
24 PropertyMgr m_propMgr;
25
26 //Declare the properties
27 m_propMgr.declareProperty("RxyCut", m_VrCut = 1.0);
28 m_propMgr.declareProperty("Vz0Cut", m_VzCut = 10.0);
29 m_propMgr.declareProperty("CosThetaCut", m_CosThetaCut = 0.93);
30
31 m_propMgr.declareProperty("PID", m_PID = true);
32 m_propMgr.declareProperty("ChiCut", m_ChiCut = 8);
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("RejectPion", m_rejectPion = true);
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("LocalProtonSelector", &m_propMgr);
55}

Member Function Documentation

◆ operator()()

bool LocalProtonSelector::operator() ( CDProton aProton)
virtual

Implements DCSelectionFunction< CDProton >.

Definition at line 57 of file LocalProtonSelector.cxx.

57 {
58
59 aProton.setUserTag(1);
60 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aProton.track() );
61
62 // MDC track selection
63
65 if ( !recTrk->isMdcKalTrackValid() ) return false;
66 RecMdcKalTrack* mdcKalTrk = recTrk->mdcKalTrack();
67 if ( mdcKalTrk->charge()==0 ) return false;
68
69 Hep3Vector xorigin(0,0,0);
70 IVertexDbSvc* vtxsvc;
71 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
72 if(vtxsvc->isVertexValid()){
73 double* dbv = vtxsvc->PrimaryVertex();
74 double* vv = vtxsvc->SigmaPrimaryVertex();
75 xorigin.setX(dbv[0]);
76 xorigin.setY(dbv[1]);
77 xorigin.setZ(dbv[2]);
78 }
79 HepVector a = mdcKalTrk->getZHelixP();
80 HepSymMatrix Ea = mdcKalTrk->getZErrorP();
81 HepPoint3D point0(0.,0.,0.);
82 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
83 VFHelix helixip3(point0,a,Ea);
84 helixip3.pivot(IP);
85 HepVector vecipa = helixip3.a();
86
87 double dr=fabs(vecipa[0]);
88 double dz=fabs(vecipa[3]);
89 double costheta=cos(mdcKalTrk->theta());
90 if ( dr>= m_VrCut ) return false;
91 if ( dz>= m_VzCut ) return false;
92 if ( fabs(costheta) >= m_CosThetaCut ) return false;
93
94 if(!m_PID) return true;
95
96
97 //ParticleID for Proton
99 pid->init();
100 pid->setMethod(pid->methodProbability());
101 pid->setChiMinCut(m_ChiCut);
102 pid->setRecTrack(recTrk);
103 //pid->usePidSys(pid->useDedx() | pid->useTof1() | pid->useTof2() | pid->useTof());
104 pid->usePidSys(pid->useDedx() | pid->useTofCorr() );
105 pid->identify(pid->onlyPion() | pid->onlyKaon() | pid->onlyProton());
106 pid->calculate();
107
108
109 if(!(pid->probProton() > 0. && pid->probProton() > pid->probPion() && pid->probProton() > pid->probKaon())) aProton.setUserTag(2);
110
111 if(m_pidtype==0) return true;
112
113 if(aProton.userTag()==1)
114 return true;
115 else
116 return false;
117
118}
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 isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
int useTofCorr() const
int onlyProton() 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
double probProton() const
Definition: ParticleID.h:125
HepVector & getZHelixP()
HepSymMatrix & getZErrorP()
float costheta

◆ setpidtype()

void LocalProtonSelector::setpidtype ( int  type)
inline

Definition at line 14 of file LocalProtonSelector.h.

14{m_pidtype=type;}

Referenced by LambdaCReconstruction::execute().


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