|
ATLAS Offline Software
|
#include <EGammaTracksThinning.h>
|
StringProperty | m_streamName { this, "StreamName", "", "Name of the stream being thinned" } |
|
SG::ReadHandleKey< xAOD::ElectronContainer > | m_electronsContainerKey { this, "electronContainerName", "Electrons", "" } |
|
SG::ReadHandleKey< xAOD::PhotonContainer > | m_photonsContainerKey { this, "photonContainerName", "Photons", ""} |
|
SG::ThinningHandleKey< TrackCollection > | m_tracksCollectionName { this, "tracksCollectionName", "Tracks", "" } |
|
Gaudi::Property< double > | m_dr { this, "deltaR", 0.5, "" } |
|
Gaudi::Property< double > | m_minEtEg { this, "minEtEg", 0,""} |
|
Definition at line 30 of file EGammaTracksThinning.h.
◆ EGammaTracksThinning()
DerivationFramework::EGammaTracksThinning::EGammaTracksThinning |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~EGammaTracksThinning()
virtual DerivationFramework::EGammaTracksThinning::~EGammaTracksThinning |
( |
| ) |
|
|
inlinevirtual |
◆ doThinning()
StatusCode DerivationFramework::EGammaTracksThinning::doThinning |
( |
| ) |
const |
|
overridevirtual |
Definition at line 29 of file EGammaTracksThinning.cxx.
31 const EventContext& ctx = Gaudi::Hive::currentContext();
45 <<
"' could not be retrieved from StoreGate!" );
46 return StatusCode::FAILURE;
51 <<
"' retrieved from StoreGate" );
60 <<
"' could not be retrieved from StoreGate!" );
61 return StatusCode::FAILURE;
66 <<
"' retrieved from StoreGate" );
71 std::set<int> goodTrackIDs;
75 for (; eleItr != eleItrEnd; ++eleItr)
80 ATH_MSG_DEBUG(
"Electron at eta = " << (*eleItr)->eta() <<
" phi = " << (*eleItr)->phi() );
84 std::set<int> eg_trackList =
findGoodTracks(trackCollection.cptr(), (*eleItr)->p4(),
m_dr );
88 goodTrackIDs.insert(eg_trackList.begin() , eg_trackList.end() ) ;
98 for (; phoItr != phoItrEnd; ++phoItr)
103 ATH_MSG_DEBUG(
"Photon at eta = " << (*phoItr)->eta() <<
" phi = " << (*phoItr)->phi() );
107 std::set<int> eg_trackList =
findGoodTracks(trackCollection.cptr(), (*phoItr)->p4(),
m_dr );
111 goodTrackIDs.insert(eg_trackList.begin() , eg_trackList.end() ) ;
121 ATH_MSG_DEBUG(
"Track thinning : tracks = " << trackCollection->size()
122 <<
" accepted = " << goodTrackIDs.size() );
124 return StatusCode::SUCCESS;
◆ finalize()
StatusCode DerivationFramework::EGammaTracksThinning::finalize |
( |
| ) |
|
|
overridevirtual |
◆ findGoodTracks()
std::set< int > DerivationFramework::EGammaTracksThinning::findGoodTracks |
( |
const TrackCollection * |
trackCont, |
|
|
const TLorentzVector & |
candHepLorentz, |
|
|
double |
maxDeltaR |
|
) |
| const |
|
private |
Definition at line 132 of file EGammaTracksThinning.cxx.
137 std::set<int> goodTracks;
142 for (; trackItr != trackItrEnd; ++trackItr)
146 if (!
track){
continue; }
150 double trketa = 0.,trkphi = 0;
152 trketa = startPerigee->eta();
153 trkphi = startPerigee->parameters()[
Trk::phi0];
155 double deltaEta = trketa - candHepLorentz.Eta() ;
159 ATH_MSG_DEBUG(
"Thin Tracks: eta = " << trketa <<
" phi = " << trkphi <<
" deltaR = " <<
deltaR );
162 goodTracks.insert(
i );
163 ATH_MSG_DEBUG(
" Track in the cone, adding: " <<
" eta=" << trketa <<
" phi=" << trkphi );
◆ initialize()
StatusCode DerivationFramework::EGammaTracksThinning::initialize |
( |
| ) |
|
|
overridevirtual |
◆ thinTracks()
Return
Definition at line 179 of file EGammaTracksThinning.cxx.
190 std::vector<bool>
mask(trackCollection->size());
193 unsigned long nTotal = 0;
194 unsigned long nKeep = 0;
195 unsigned long nReject = 0;
199 for ( std::size_t
i=0;
i<trackCollection->size(); ++
i )
202 if ( goodTrackIDs.find(
i ) != goodTrackIDs.end() )
215 ATH_MSG_DEBUG(
" EGammaTracksThinning statistics: tracks processed " << nTotal
216 <<
" kept = " << nKeep
217 <<
" rejected " << nReject );
220 trackCollection.thin (
mask);
◆ m_dr
Gaudi::Property<double> DerivationFramework::EGammaTracksThinning::m_dr { this, "deltaR", 0.5, "" } |
|
private |
◆ m_electronsContainerKey
◆ m_minEtEg
Gaudi::Property<double> DerivationFramework::EGammaTracksThinning::m_minEtEg { this, "minEtEg", 0,""} |
|
private |
◆ m_photonsContainerKey
◆ m_streamName
StringProperty DerivationFramework::EGammaTracksThinning::m_streamName { this, "StreamName", "", "Name of the stream being thinned" } |
|
private |
◆ m_tracksCollectionName
The documentation for this class was generated from the following files:
xAOD::ElectronContainer * electronContainer
Gaudi::Property< double > m_dr
Const iterator class for DataVector/DataList.
StatusCode thinTracks(SG::ThinningHandle< TrackCollection > &trackCont, const std::set< int > &goodTracks) const
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
const std::string & key() const
Return the StoreGate ID for the referenced object.
Handle for requesting thinning for a data object.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< double > m_minEtEg
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
xAOD::PhotonContainer * photonContainer
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
#define ATH_MSG_WARNING(x)
StringProperty m_streamName
std::set< int > findGoodTracks(const TrackCollection *trackCont, const TLorentzVector &candHepLorentz, double maxDeltaR) const
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsContainerKey
SG::ThinningHandleKey< TrackCollection > m_tracksCollectionName
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonsContainerKey
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.