|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/SystemOfUnits.h"
37 return StatusCode::SUCCESS;
50 ATH_CHECK(eflowRecTracksWriteHandle.
record(std::make_unique<eflowRecTrackContainer>()));
54 if (!tracksReadHandle.
isValid()) {
55 ATH_MSG_WARNING(
"Can not retrieve xAOD::TrackParticleContainer with name: " << tracksReadHandle.
key());
56 return StatusCode::FAILURE;
61 for (
const auto *thisTrack : *tracksReadHandle){
68 ATH_MSG_DEBUG(
"Have track with E, pt, eta and phi of " << thisTrack->e() <<
", " << thisTrack->pt() <<
", "
69 << thisTrack->eta() <<
" and " << thisTrack->phi());
83 eta_track = thisTrack->eta();
84 pt_track = thisTrack->pt() *
invGeV;
89 eflowRecTracksWriteHandle->
push_back(std::move(thisEFRecTrack));
99 N_tracks = eflowRecTracksWriteHandle->
size();
101 return StatusCode::SUCCESS;
124 if (electronsReadHandle.
isValid()) {
126 for (
const auto* thisElectron : *electronsReadHandle) {
129 unsigned int nTrack = thisElectron->nTrackParticles();
134 if (
track == origTrack) {
139 ATH_MSG_WARNING(
"Electron object map has NULL pointer to original TrackParticle");
148 ATH_MSG_WARNING(
"Invalid ReadHandle for electrons with key: " << electronsReadHandle.
key());
161 if (muonsReadHandle.
isValid()) {
163 for (
const auto* theMuon : *muonsReadHandle) {
165 ATH_MSG_DEBUG(
"Considering muon in isMuon with e,pt, eta and phi of "
166 << theMuon->e() <<
", " << theMuon->pt() <<
", " << theMuon->eta() <<
" and " << theMuon->phi());
171 if (
track == ID_track){
Group
Properties of a chain group.
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsReadHandleKey
ReadHandleKey for the ElectronContainer to be used as input.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool selectTrack(const xAOD::TrackParticle &track) const
This applys a selection criteria to the track using the tracking CP track selection tool.
bool isValid() const
Test to see if the link can be dereferenced.
void setTrackId(int trackId)
An algorithm that can be simultaneously executed in multiple threads.
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelectorTool
ToolHandle to track selection tool provided by tracking CP.
StatusCode execute(const EventContext &ctx) const
bool isMuon(const xAOD::TrackParticle *track) const
check if track belongs to an muon
ToolHandle< GenericMonitoringTool > m_monTool
Online monitoring tool for recording histograms of the alg in action.
bool isElectron(const xAOD::TrackParticle *track) const
check if track belongs to an electron
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize()
Gaudi AthAlgorithm hooks.
SG::WriteHandleKey< eflowRecTrackContainer > m_eflowRecTracksWriteHandleKey
WriteHandleKey for the eflowRecTrackContainer to write out.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksReadHandleKey
ReadHandleKey for the TrackParticleContainer to be used as input.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
value_type push_back(value_type pElem)
Add an element to the end of the collection.
PFTrackSelector(const std::string &name, ISvcLocator *pSvcLocator)
Default constructor.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsReadHandleKey
ReadHandleKey for the MuonContainer to be used as input.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ToolHandle< eflowTrackExtrapolatorBaseAlgTool > m_theTrackExtrapolatorTool
ToolHandle for track extrapolation to calorimeter tool.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
Class describing a TrackParticle.
Declare a monitored scalar variable.
Gaudi::Property< float > m_upperTrackPtCut
Upper limit on track Pt for input tracks.
Helper class to create a scoped timer.
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.