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

#include <LocalPionSelector.h>

Inheritance diagram for LocalPionSelector:

Public Member Functions

 LocalPionSelector (const std::string &type, const std::string &name, const IInterface *parent)
bool operator() (CDChargedPion &aPion) override
void setpidtype (int type) override

Detailed Description

Definition at line 9 of file LocalPionSelector.h.

Constructor & Destructor Documentation

◆ LocalPionSelector()

LocalPionSelector::LocalPionSelector ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 16 of file LocalPionSelector.cxx.

18 : base_class( type, name, parent ) {
19 m_pidtype = 0;
20
21 // Declare the properties
22 declareProperty( "RxyCut", m_VrCut = 1.0 );
23 declareProperty( "Vz0Cut", m_VzCut = 10.0 );
24 declareProperty( "CosThetaCut", m_CosThetaCut = 0.93 );
25
26 declareProperty( "PID", m_PID = true );
27 declareProperty( "useSimplePID", m_useSimplePID = true );
28
29 declareProperty( "PidUseDedx", m_useDedx = true );
30 declareProperty( "PidUseTof1", m_useTof1 = true );
31 declareProperty( "PidUseTof2", m_useTof2 = true );
32 declareProperty( "PidUseTofE", m_useTofE = false );
33 declareProperty( "PidUseTofQ", m_useTofQ = false );
34 declareProperty( "PidUseEmc", m_useEmc = false );
35 declareProperty( "PidUseMuc", m_useMuc = false );
36
37 declareProperty( "PidwithProbability", m_probability = true );
38 declareProperty( "PidProbCut", m_PidProbCut = 0.001 );
39 declareProperty( "RejectKaon", m_rejectKaon = true );
40 declareProperty( "RejectProton", m_rejectProton = false );
41
42 declareProperty( "PidwithLikelihood", m_likelihood = false );
43 declareProperty( "PidwithNeuronNetwork", m_neuronNetwork = false );
44 declareProperty( "NeuronValue", m_neuronValCut = { 1.5, 2.5 } );
45}

Referenced by LocalPionSelector().

Member Function Documentation

◆ operator()()

bool LocalPionSelector::operator() ( CDChargedPion & aPion)
override

Definition at line 47 of file LocalPionSelector.cxx.

47 {
48
49 aPion.setUserTag( 1 );
50 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aPion.track() );
51
52 // MDC track selection
53
55 if ( !recTrk->isMdcKalTrackValid() ) return false;
56 RecMdcKalTrack* mdcKalTrk = recTrk->mdcKalTrack();
57 if ( mdcKalTrk->charge() == 0 ) return false;
58
59 Hep3Vector xorigin( 0, 0, 0 );
60 IVertexDbSvc* vtxsvc;
61 StatusCode sc = serviceLocator()->service( "VertexDbSvc", vtxsvc );
62 if ( vtxsvc->isVertexValid() )
63 {
64 double* dbv = vtxsvc->PrimaryVertex();
65 double* vv = vtxsvc->SigmaPrimaryVertex();
66 xorigin.setX( dbv[0] );
67 xorigin.setY( dbv[1] );
68 xorigin.setZ( dbv[2] );
69 }
70 HepVector a = mdcKalTrk->getZHelix();
71 HepSymMatrix Ea = mdcKalTrk->getZError();
72 HepPoint3D point0( 0., 0., 0. );
73 HepPoint3D IP( xorigin[0], xorigin[1], xorigin[2] );
74 VFHelix helixip3( point0, a, Ea );
75 helixip3.pivot( IP );
76 HepVector vecipa = helixip3.a();
77
78 double dr = fabs( vecipa[0] );
79 double dz = fabs( vecipa[3] );
80 double costheta = cos( mdcKalTrk->theta() );
81 if ( dr >= m_VrCut ) return false;
82 if ( dz >= m_VzCut ) return false;
83 if ( fabs( costheta ) >= m_CosThetaCut ) return false;
84
85 if ( !m_PID ) return true;
86
87 if ( m_useSimplePID )
88 {
89 // PID
90 ISimplePIDSvc* m_simplePIDSvc;
91 StatusCode sc = serviceLocator()->service( "SimplePIDSvc", m_simplePIDSvc );
92 m_simplePIDSvc->preparePID( recTrk );
93 if ( !m_simplePIDSvc->ispion() ) { aPion.setUserTag( 2 ); }
94 }
95 else
96 {
97 // particleID pacakge
98 ParticleID* pid = ParticleID::instance();
99 pid->init();
100 pid->setMethod( pid->methodProbability() );
101 pid->setChiMinCut( 4 );
102 pid->setRecTrack( recTrk );
103 pid->usePidSys( pid->useDedx() | pid->useTofCorr() );
104 pid->identify( pid->onlyPion() | pid->onlyKaon() );
105 pid->calculate();
106
107 if ( !( pid->probPion() > 0 && pid->probPion() > pid->probKaon() ) ) aPion.setUserTag( 2 );
108 }
109
110 if ( m_pidtype == 0 ) return true;
111
112 if ( aPion.userTag() == 1 ) return true;
113 else return false;
114}
HepGeom::Point3D< double > HepPoint3D
void setUserTag(int tag)
int userTag() const
virtual bool ispion()=0
virtual void preparePID(EvtRecTrack *track)=0
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
static ParticleID * instance()
void calculate()
void init()

◆ setpidtype()

void LocalPionSelector::setpidtype ( int type)
inlineoverride

Definition at line 15 of file LocalPionSelector.h.

15{ m_pidtype = type; }

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