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

#include <LocalPhotonSelector.h>

Inheritance diagram for LocalPhotonSelector:

Public Member Functions

 LocalPhotonSelector (const std::string &type, const std::string &name, const IInterface *parent)
bool operator() (CDPhoton &aPhoton) override

Detailed Description

Definition at line 7 of file LocalPhotonSelector.h.

Constructor & Destructor Documentation

◆ LocalPhotonSelector()

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

Definition at line 11 of file LocalPhotonSelector.cxx.

13 : base_class( type, name, parent ) {
14 // Declare the properties
15 declareProperty( "MinEnergy", m_minEnergy = 0.025 );
16
17 declareProperty( "InBarrelOrEndcap", m_useBarrelEndcap = true );
18 declareProperty( "MaxCosThetaBarrel", m_maxCosThetaBarrel = 0.8 );
19 declareProperty( "MinCosThetaEndcap", m_minCosThetaEndcap = 0.86 );
20 declareProperty( "MaxCosThetaEndcap", m_maxCosThetaEndcap = 0.92 );
21 declareProperty( "MinEndcapEnergy", m_minEndcapEnergy = 0.050 );
22
23 declareProperty( "ApplyTimeCut", m_applyTimeCut = true );
24 declareProperty( "MinTime", m_minTime = 0. );
25 declareProperty( "MaxTime", m_maxTime = 14. );
26 declareProperty( "PhotonDeltaTime", m_deltaTime = 10. );
27
28 declareProperty( "ApplyDangCut", m_applyDangCut = false );
29 declareProperty( "MinDang", m_minDang = 20.0 );
30}

Referenced by LocalPhotonSelector().

Member Function Documentation

◆ operator()()

bool LocalPhotonSelector::operator() ( CDPhoton & aPhoton)
override

Minimum energy

Barrel/Endcap

Time, only apply timing cuts if "recEvt->totalCharged() > 0"

Dang

Definition at line 32 of file LocalPhotonSelector.cxx.

32 {
33
34 aPhoton.setUserTag( 1 );
35 SmartDataPtr<EvtRecEvent> recEvt( evtSvc(), EventModel::EvtRec::EvtRecEvent );
36 SmartDataPtr<EvtRecTrackCol> recTrkCol( evtSvc(), EventModel::EvtRec::EvtRecTrackCol );
37
38 EvtRecTrack* recTrk = const_cast<EvtRecTrack*>( aPhoton.photon() );
39
40 if ( !recTrk->isEmcShowerValid() ) return false;
41
42 RecEmcShower* emcTrk = recTrk->emcShower();
43 double eraw = emcTrk->energy();
44 double phi = emcTrk->phi();
45 double the = emcTrk->theta();
46 HepLorentzVector shP4( eraw * sin( the ) * cos( phi ), eraw * sin( the ) * sin( phi ),
47 eraw * cos( the ), eraw );
48
49 double cosThetaSh = shP4.vect().cosTheta();
50
51 /// Minimum energy
52 if ( shP4.e() <= m_minEnergy ) return false;
53
54 /// Barrel/Endcap
55 if ( m_useBarrelEndcap )
56 {
57 bool inBarrelEndcap = false;
58
59 if ( fabs( cosThetaSh ) < m_maxCosThetaBarrel ) inBarrelEndcap = true;
60
61 if ( ( fabs( cosThetaSh ) > m_minCosThetaEndcap ) &&
62 ( fabs( cosThetaSh ) < m_maxCosThetaEndcap ) && ( shP4.e() > m_minEndcapEnergy ) )
63 inBarrelEndcap = true;
64
65 if ( !inBarrelEndcap ) return false;
66 }
67
68 /// Time, only apply timing cuts if "recEvt->totalCharged() > 0"
69 if ( m_applyTimeCut )
70 {
71 double time = emcTrk->time();
72 if ( recEvt->totalCharged() > 0 )
73 {
74 if ( time < m_minTime || time > m_maxTime ) return false;
75 }
76 else
77 {
78 RecEmcShower* firstG = ( *( recTrkCol->begin() ) )->emcShower();
79 double deltaTime = fabs( time - firstG->time() );
80 if ( deltaTime > 10 ) return false;
81 }
82 }
83
84 /// Dang
85 if ( m_applyDangCut && recEvt->totalCharged() > 0 )
86 {
87 Hep3Vector emcpos( emcTrk->x(), emcTrk->y(), emcTrk->z() );
88 double dang = 200.;
89
90 for ( int j = 0; j < recEvt->totalCharged(); j++ )
91 {
92 EvtRecTrackIterator jtTrk = recTrkCol->begin() + j;
93 if ( !( *jtTrk )->isExtTrackValid() ) continue;
94 RecExtTrack* extTrk = ( *jtTrk )->extTrack();
95 if ( extTrk->emcVolumeNumber() == -1 ) continue;
96 Hep3Vector extpos = extTrk->emcPosition();
97 double angd1 = extpos.angle( emcpos );
98 if ( angd1 < dang ) dang = angd1;
99 }
100
101 if ( dang < 200 )
102 {
103 dang = dang * 180 / ( CLHEP::pi );
104 if ( dang <= m_minDang ) return ( false );
105 }
106 } // End of "recEvt->totalCharged() > 0" IF
107
108 return true;
109}
Double_t time
EvtRecTrackCol::iterator EvtRecTrackIterator
void setUserTag(int tag)
virtual const EvtRecTrack * photon() const
Definition CDPhoton.cxx:131

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