|
ATLAS Offline Software
|
Go to the documentation of this file.
26 #include "Gaudi/Property.h"
27 #include "GaudiKernel/ThreadLocalContext.h"
38 const std::string&
name,
39 ISvcLocator* pSvcLocator)
56 ATH_MSG_INFO(
"InDetForwardTrackParticles thinning not required");
58 ATH_MSG_INFO(
"InDetForwardTrackParticles will be thinned");
63 return StatusCode::FAILURE;
69 return StatusCode::SUCCESS;
79 <<
" were SiliconAssociatedForward muons");
81 <<
" of the SiliconAssociatedForward muons were "
82 "associated with InDetForwardTrackParticles");
84 return StatusCode::SUCCESS;
95 return StatusCode::SUCCESS;
102 std::vector<bool> trackMask;
103 unsigned int nTracks = tracks->size();
105 trackMask.assign(nTracks,
false);
107 unsigned int nSiFwdAssoc = 0;
108 unsigned int nSiFwdMuons = 0;
117 m_nMuons.fetch_add(muons->
size(), std::memory_order_relaxed);
119 for (
const auto*
muon : *muons) {
120 if (
muon->muonType() == xAOD::Muon::SiliconAssociatedForwardMuon) {
123 if (
muon->inDetTrackParticleLink().isValid())
124 muTrk = *(
muon->inDetTrackParticleLink());
125 if (muTrk !=
nullptr) {
127 if (
search != tracks->end()) {
129 trackMask[(*search)->index()] =
true;
136 m_nSiFwdAssoc.fetch_add(nSiFwdAssoc, std::memory_order_relaxed);
137 m_nSiFwdMuons.fetch_add(nSiFwdMuons, std::memory_order_relaxed);
140 unsigned int nTracksThinned = 0;
141 for (
unsigned int i = 0;
i < nTracks; ++
i) {
147 tracks.
keep(trackMask);
149 return StatusCode::SUCCESS;
std::atomic< unsigned long > m_nSiFwdMuons
std::string find(const std::string &s)
return a remapped string
virtual StatusCode initialize() override
Athena algorithm's initalize hook.
Handle for requesting thinning for a data object.
StringProperty m_streamName
std::atomic< unsigned long > m_nMuons
std::atomic< unsigned long > m_nTracksProcessed
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Handle for requesting thinning for a data object.
An algorithm that can be simultaneously executed in multiple threads.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
::StatusCode StatusCode
StatusCode definition for legacy code.
std::atomic< unsigned long > m_nSiFwdAssoc
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
std::atomic< unsigned long > m_nTracksThinned
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_tracksKey
ThinInDetForwardTrackParticlesAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Class describing a TrackParticle.
Handle class for reading from StoreGate.
virtual StatusCode finalize() override
Athena algorithm's finalize hook.
size_type size() const noexcept
Returns the number of elements in the collection.
std::atomic< unsigned long > m_nEventsProcessed
Counters.
virtual StatusCode execute(const EventContext &ctx) const override
Athena algorithm's execute hook.
BooleanProperty m_doThinning
Should the thinning run?