10 #include "GaudiKernel/SystemOfUnits.h"
60 ATH_MSG_INFO(
"MuonCreatorAlg has been setup successfully");
69 return StatusCode::SUCCESS;
73 std::vector<const MuonCombined::InDetCandidateToTagMap*> tagMaps;
81 ATH_CHECK(wh_muons.recordNonConst(std::make_unique<xAOD::MuonContainer>(), std::make_unique<xAOD::MuonAuxContainer>()));
89 ATH_CHECK(wh_combtp.
record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
91 output.combinedTrackParticleContainer = wh_combtp.
ptr();
92 output.combinedTrackCollection = wh_combtrk.
ptr();
97 ATH_CHECK(wh_extrtp.
record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
99 output.extrapolatedTrackParticleContainer = wh_extrtp.
ptr();
100 output.extrapolatedTrackCollection = wh_extrtrk.
ptr();
105 ATH_CHECK(wh_msextrtp.
record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
107 output.msOnlyExtrapolatedTrackParticleContainer = wh_msextrtp.
ptr();
108 output.msOnlyExtrapolatedTrackCollection = wh_msextrtrk.
ptr();
113 output.xaodSegmentContainer = rh_segment.
ptr();
117 output.tagToSegmentAssocMap = rh_segAssocMap.
ptr();
121 std::unique_ptr<xAOD::CaloClusterContainer> caloclusters{
nullptr};
122 std::unique_ptr<xAOD::CaloClusterAuxContainer> caloclustersaux{
nullptr};
125 caloclusters = std::make_unique<xAOD::CaloClusterContainer>();
126 caloclustersaux = std::make_unique<xAOD::CaloClusterAuxContainer>();
127 caloclusters->setStore(caloclustersaux.get());
128 output.clusterContainer = caloclusters.get();
137 ATH_CHECK(wh_slowmuon.
record(std::make_unique<xAOD::SlowMuonContainer>(), std::make_unique<xAOD::SlowMuonAuxContainer>()));
138 output.slowMuonContainer = wh_slowmuon.
ptr();
141 if (!muonCandidateRH.isValid()) {
142 ATH_MSG_ERROR(
"Could not read " << muonCandidateRH.fullKey());
143 return StatusCode::FAILURE;
145 muon_candidates.insert(muon_candidates.end(), muonCandidateRH->begin(), muonCandidateRH->end());
153 std::unique_ptr<CaloClusterCellLinkContainer> clusterlinks = std::make_unique<CaloClusterCellLinkContainer>();
154 auto* sg = wh_clusters.storeHandle().get();
156 ATH_CHECK(wh_clusterslink.record(std::move(clusterlinks)));
157 ATH_CHECK(wh_clusters.record(std::move(caloclusters), std::move(caloclustersaux)));
175 std::vector<float> MDT_R, MDT_dR;
176 for(
const auto mu : *wh_muons ) {
177 if (!(
mu->muonType() == xAOD::Muon::CaloTagged ||
mu->muonType() == xAOD::Muon::SegmentTagged)) {
178 const Trk::Track* trk =
mu->primaryTrackParticle()->track();
192 [](
auto const& satrk) { return satrk->pt() * MeVtoGeV; });
198 [](
auto const& cbtrk) { return cbtrk->pt() * MeVtoGeV; });
207 [](
auto const& idtrk) {
return idtrk->indetTrackParticle().
pt() *
MeVtoGeV; });
209 [](
auto const& idtrk) {
return idtrk->indetTrackParticle().
eta(); });
211 [](
auto const& idtrk) {
return idtrk->indetTrackParticle().
phi(); });
212 auto monitorIt =
Monitored::Group(
m_monTool, muon_n, muon_pt, muon_eta, muon_phi, muon_MDT_R, muon_MDT_dR, satrks_n, satrks_pt, satrks_eta, satrks_phi,
213 cbtrks_n, cbtrks_pt, cbtrks_eta, cbtrks_phi, idtrks_n, idtrks_pt, idtrks_eta, idtrks_phi);
215 auto monitorIt =
Monitored::Group(
m_monTool, muon_n, muon_pt, muon_eta, muon_phi, muon_MDT_R, muon_MDT_dR, satrks_n, satrks_pt, satrks_eta, satrks_phi,
216 cbtrks_n, cbtrks_pt, cbtrks_eta, cbtrks_phi);
219 return StatusCode::SUCCESS;