1#include "GaudiKernel/Bootstrap.h"
2#include "GaudiKernel/IJobOptionsSvc.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/PropertyMgr.h"
5#include "GaudiKernel/SmartDataPtr.h"
14 IJobOptionsSvc* jobSvc;
15 Gaudi::svcLocator()->service(
"JobOptionsSvc", jobSvc);
17 PropertyMgr m_propMgr;
20 m_propMgr.declareProperty(
"MinEnergy", m_minEnergy = 0.025);
22 m_propMgr.declareProperty(
"InBarrelOrEndcap", m_useBarrelEndcap =
true);
23 m_propMgr.declareProperty(
"MaxCosThetaBarrel", m_maxCosThetaBarrel = 0.8);
24 m_propMgr.declareProperty(
"MinCosThetaEndcap", m_minCosThetaEndcap = 0.86);
25 m_propMgr.declareProperty(
"MaxCosThetaEndcap", m_maxCosThetaEndcap = 0.92);
26 m_propMgr.declareProperty(
"MinEndcapEnergy", m_minEndcapEnergy = 0.050);
28 m_propMgr.declareProperty(
"ApplyTimeCut", m_applyTimeCut =
true);
29 m_propMgr.declareProperty(
"MinTime", m_minTime = 0.);
30 m_propMgr.declareProperty(
"MaxTime", m_maxTime = 14.);
31 m_propMgr.declareProperty(
"PhotonDeltaTime", m_deltaTime = 10.);
33 m_propMgr.declareProperty(
"ApplyDangCut", m_applyDangCut =
false);
34 m_propMgr.declareProperty(
"MinDang", m_minDang = 20.0);
36 jobSvc->setMyProperties(
"LocalPhotonSelector", &m_propMgr);
50 double eraw = emcTrk->
energy();
51 double phi = emcTrk->
phi();
52 double the = emcTrk->
theta();
53 HepLorentzVector shP4( eraw *
sin(the) *
cos(phi),
54 eraw *
sin(the) *
sin(phi),
58 double cosThetaSh = shP4.vect().cosTheta();
62 if (shP4.e() <= m_minEnergy)
return false;
66 if ( m_useBarrelEndcap ) {
67 bool inBarrelEndcap =
false;
69 if(fabs(cosThetaSh) < m_maxCosThetaBarrel) inBarrelEndcap =
true;
71 if((fabs(cosThetaSh) > m_minCosThetaEndcap)
72 &&(fabs(cosThetaSh) < m_maxCosThetaEndcap)
73 &&(shP4.e() > m_minEndcapEnergy)) inBarrelEndcap =
true;
75 if ( !inBarrelEndcap )
return false;
79 if ( m_applyTimeCut ) {
81 if ( recEvt->totalCharged() > 0 ) {
82 if ( time < m_minTime || time > m_maxTime )
return false;
85 RecEmcShower* firstG = (*(recTrkCol->begin()))->emcShower();
86 double deltaTime = fabs(
time - firstG->
time());
87 if ( deltaTime > 10 )
return false;
92 if (m_applyDangCut && recEvt->totalCharged() > 0) {
93 Hep3Vector emcpos(emcTrk->
x(), emcTrk->
y(), emcTrk->
z());
96 for (
int j = 0; j < recEvt->totalCharged(); j++) {
98 if ( !(*jtTrk)->isExtTrackValid() )
continue;
102 double angd1 = extpos.angle(emcpos);
103 if ( angd1 < dang ) dang = angd1;
107 dang = dang * 180 / (CLHEP::pi);
108 if (dang <= m_minDang)
return(
false );
double sin(const BesAngle a)
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
LocalPhotonSelector photonSelector
IDataProviderSvc * eventSvc()
virtual const EvtRecTrack * photon() const
const Hep3Vector emcPosition() const
const int emcVolumeNumber() const
RecEmcShower * emcShower()
bool operator()(CDPhoton &aPhoton)
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol