30{
31 const EventContext& ctx = Gaudi::Hive::currentContext();
32
33
34
35 SG::ThinningHandle<TrackCollection> trackCollection
38
39
40
43 {
45 << "' could not be retrieved from StoreGate!" );
46 return StatusCode::FAILURE;
47 }
48 else
49 {
51 << "' retrieved from StoreGate" );
52 }
53
54
55
58 {
60 << "' could not be retrieved from StoreGate!" );
61 return StatusCode::FAILURE;
62 }
63 else
64 {
66 << "' retrieved from StoreGate" );
67 }
68
69
70
71 std::set<int> goodTrackIDs;
72
75 for (; eleItr != eleItrEnd; ++eleItr)
76 {
78 {
79
80 ATH_MSG_DEBUG(
"Electron at eta = " << (*eleItr)->eta() <<
" phi = " << (*eleItr)->phi() );
81
82
83
84 std::set<int> eg_trackList =
findGoodTracks(trackCollection.cptr(), (*eleItr)->p4(),
m_dr );
85
86
87
88 goodTrackIDs.insert(eg_trackList.begin() , eg_trackList.end() ) ;
89
90 }
91
92 }
93
94
95
98 for (; phoItr != phoItrEnd; ++phoItr)
99 {
101 {
102
103 ATH_MSG_DEBUG(
"Photon at eta = " << (*phoItr)->eta() <<
" phi = " << (*phoItr)->phi() );
104
105
106
107 std::set<int> eg_trackList =
findGoodTracks(trackCollection.cptr(), (*phoItr)->p4(),
m_dr );
108
109
110
111 goodTrackIDs.insert(eg_trackList.begin() , eg_trackList.end() ) ;
112
113 }
114
115 }
116
117
118
120
121 ATH_MSG_DEBUG(
"Track thinning : tracks = " << trackCollection->size()
122 << " accepted = " << goodTrackIDs.size() );
123
124 return StatusCode::SUCCESS;
125}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
xAOD::ElectronContainer * electronContainer
xAOD::PhotonContainer * photonContainer
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
SG::ThinningHandleKey< TrackCollection > m_tracksCollectionName
std::set< int > findGoodTracks(const TrackCollection *trackCont, const TLorentzVector &candHepLorentz, double maxDeltaR) const
Gaudi::Property< double > m_minEtEg
Gaudi::Property< double > m_dr
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsContainerKey
StatusCode thinTracks(SG::ThinningHandle< TrackCollection > &trackCont, const std::set< int > &goodTracks) const
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonsContainerKey