ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSpectrometerProbeCollectorTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
9#include "muonEvent/Muon.h"
10
11//================ Constructor =================================================
12namespace Muon {
14 const std::string& n,
15 const IInterface* p )
16 :
17 AthAlgTool(t,n,p),
18 m_InsituPerformanceTools("InsituTrackPerformanceTools/TestTool")
19 {
20 declareInterface<IProbeCollectorTool>(this);
21
22 declareProperty("InnerTrackContainerName", m_InnerTrackContainerName = "TrackParticleCandidate");
23 declareProperty("MSTrackContainerName", m_MSTrackContainerName = "MuonboyTrackParticles" );
24 declareProperty("CombinedMuonTracksContainerName", m_CombinedMuonTracksContainerName = "StacoMuonCollection");
25 declareProperty("RequireTrigger", m_RequireTrigger = false);
26 declareProperty("InsituPerformanceTools", m_InsituPerformanceTools);
27 declareProperty("MuonPtCut", m_muonPtCut=20000.);
28 }
29
30 //================ Initialisation =================================================
31
33 {
34 ATH_CHECK(AlgTool::initialize());
35
38
39 ATH_MSG_INFO("initialize() successful");
40 return StatusCode::SUCCESS;
41 }
42
43 //============================================================================================
44
46 {
47 ATH_MSG_DEBUG("createProbeCollection() for Muon Spectrometer");
48
51 ATH_CHECK(evtStore()->record(m_MSProbeTrackContainer,"MuonSpectrometerProbeTracks"));
52 ATH_MSG_DEBUG("MuonSpectrometerProbeTracks Container recorded in evtStore.");
53
55 const Rec::TrackParticleContainer* trackTES=nullptr;
56 ATH_CHECK(evtStore()->retrieve( trackTES, m_InnerTrackContainerName));
57 if (!trackTES ) {
58 ATH_MSG_WARNING("No " << m_InnerTrackContainerName << " container found in TDS");
59 return StatusCode::FAILURE;
60 }
61 ATH_MSG_DEBUG("TrackParticleContainer successfully retrieved");
62
64 const Analysis::MuonContainer* muonTDS=nullptr;
66 if (!muonTDS) {
67 ATH_MSG_WARNING("No AOD "<<m_CombinedMuonTracksContainerName<<" container of muons found in TDS");
68 return StatusCode::FAILURE;
69 }
70 ATH_MSG_DEBUG("MuonContainer successfully retrieved");
71
73 Analysis::MuonContainer::const_iterator muonItr = muonTDS->begin();
74 Analysis::MuonContainer::const_iterator muonItrE = muonTDS->end();
75 for (; muonItr != muonItrE; ++muonItr)
76 {
77 if (((*muonItr)->pt()>m_muonPtCut) && ((*muonItr)->isCombinedMuon()))
78 {
79 const Rec::TrackParticle *muonTrack = (*muonItr)->track();
80 if ((m_RequireTrigger==false) || (m_InsituPerformanceTools->isTriggeredMuon(muonTrack)==true))
81 {
82 Rec::TrackParticleContainer::const_iterator innerTrackItr = trackTES->begin();
83 Rec::TrackParticleContainer::const_iterator innerTrackItrE = trackTES->end();
84 for (; innerTrackItr != innerTrackItrE; ++innerTrackItr)
85 {
86 const Rec::TrackParticle *innerTrack = (*innerTrackItr);
87 if (innerTrack->pt()>m_muonPtCut)
88 {
89 if (m_InsituPerformanceTools->isZBosonCandidate(innerTrack, muonTrack)==true)
90 {
92 temp.setPx(innerTrack->px());
93 temp.setPy(innerTrack->py());
94 temp.setPz(innerTrack->pz());
95 temp.setE(innerTrack->e());
96 m_MSProbeTrackContainer->push_back( new Rec::TrackParticle(temp));
97 }
98 }
99 }
100 }
101 }
102 }
104 return StatusCode::SUCCESS;
105 }
106}//namespace
107
108
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
definition of StoreGate container holding a vector of Analysis::Muon
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
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.
virtual double pt() const =0
transverse momentum
ToolHandle< IInsituTrackTools > m_InsituPerformanceTools
get a handle to the MuonSpectrometerProbeCollectorTool
std::string m_InnerTrackContainerName
member variables for algorithm properties:
virtual StatusCode initialize()
standard Athena-Algorithm method
MuonSpectrometerProbeCollectorTool(const std::string &, const std::string &, const IInterface *)
virtual double e() const
get energy data member
Definition P4PxPyPzE.h:132
virtual void setPx(double thePx)
set Px data member
Definition P4PxPyPzE.h:135
virtual double px() const
get px data member
Definition P4PxPyPzE.h:122
virtual double py() const
get py data member
Definition P4PxPyPzE.h:126
virtual double pz() const
get pz data member
Definition P4PxPyPzE.h:129
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.