ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCombinedR4::MuonCreatorAlg Class Reference

Algorithm to create the xAOD::Muon analysis objects from the various muon reconstruction chains. More...

#include <MuonCreatorAlg.h>

Inheritance diagram for MuonCombinedR4::MuonCreatorAlg:
Collaboration diagram for MuonCombinedR4::MuonCreatorAlg:

Classes

struct  DataShip
 Helper struct to ship the data containers across the methods. More...

Public Types

using TrackLink_t = ElementLink<xAOD::TrackParticleContainer>
 Abrivate the ElementLink to the track particles.

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode setupDataShip (const EventContext &ctx, DataShip &ship) const
 Load all containers from store gate and setup the output containers.
void createMuon (const EventContext &ctx, const std::span< const MuonR4::MuonTag *const > &muTags, DataShip &ship) const
 Create the xAOD::Muon from the list of muon tags.
TrackLink_t linkParticle (const EventContext &ctx, const xAOD::TrackParticle *trk) const
 Constructs an element link to the passed track particle If a nullptr is passed, an empty link is returned.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< CP::IMuonSelectionToolm_selectionTool {this, "SelectionTool", ""}
 The Muon selection tool to assess the muon quality.
SG::WriteHandleKey< xAOD::MuonContainerm_muonKey {this, "MuonKey", "MuonsR4"}
 Key name to store the primary muon container.
SG::ReadHandleKeyArray< MuonR4::MuonTagContainerm_tagKeys {this, "TagKeys", {}}
 Key name under which the input tags can be found.
ToolHandle< MuonR4::ITrackSummaryToolm_summaryTool {this, "TrackSummaryTool" , ""}
 Handle to the muon summary tool.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm to create the xAOD::Muon analysis objects from the various muon reconstruction chains.

The configured MuonTag containers are grouped by the commonly shared ID track particle and the tags are then ordered to define the muon's momentum and author. The parameters and track summaries are copied onto the muon as well as the links to the associated track particles

Definition at line 29 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ TrackLink_t

Member Function Documentation

◆ createMuon()

void MuonCreatorAlg::createMuon ( const EventContext & ctx,
const std::span< const MuonR4::MuonTag *const > & muTags,
DataShip & ship ) const
private

Create the xAOD::Muon from the list of muon tags.

The first tag in the list seves as primary author and to define the muon's momentum. The remaining ones just copy the parameters and additional track particle links onto the muon.

Parameters
ctxEventContext to establish the ElementLink
muTagsSorted list of muon tags to be transformed into a muon object
shipThe data holder in the event to whose containers the muon is appended to

Link the available particles

Definition at line 101 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.cxx.

103 {
104 // Create a new muon
105 xAOD::Muon* newMuon = ship.muons->push_back(std::make_unique<xAOD::Muon>());
106
107 bool p4Set{false}, summarySet{false};
108 using SegLink_t = ElementLink<xAOD::MuonSegmentContainer>;
109 std::vector<SegLink_t> segLinks{};
110
111 std::unordered_set<const xAOD::MuonSegment*> addedSegs{};
112 for (const MuonR4::MuonTag* tag : muTags) {
113 if (!p4Set) {
114 const xAOD::TrackParticle* pTrk = tag->primaryTrack();
115 newMuon->setP4(pTrk->pt(), pTrk->eta(), pTrk->phi());
116 newMuon->setCharge(pTrk->charge());
117 newMuon->setAuthor(tag->author());
118 }
119 if (!summarySet && tag->summary()) {
120 m_summaryTool->copySummary(*tag->summary(), *newMuon);
121 summarySet = true;
122 }
123 using Trk_t = xAOD::Muon::TrackParticleType;
125 if (!p4Set || !newMuon->trackParticle(Trk_t::InnerDetectorTrackParticle)){
126 newMuon->setTrackParticleLink(Trk_t::InnerDetectorTrackParticle,
127 linkParticle(ctx, tag->idTrack()));
128 }
129 if (!p4Set || !newMuon->trackParticle(Trk_t::ExtrapolatedMuonSpectrometerTrackParticle)){
130 newMuon->setTrackParticleLink(Trk_t::ExtrapolatedMuonSpectrometerTrackParticle,
131 linkParticle(ctx, tag->meTrack()));
132 }
133 if (!p4Set || !newMuon->trackParticle(Trk_t::MuonSpectrometerTrackParticle)){
134 newMuon->setTrackParticleLink(Trk_t::MuonSpectrometerTrackParticle,
135 linkParticle(ctx, tag->msTrack()));
136 }
137 if (!p4Set || !newMuon->trackParticle(Trk_t::CombinedTrackParticle)){
138 newMuon->setTrackParticleLink(Trk_t::CombinedTrackParticle,
139 linkParticle(ctx, tag->cbTrack()));
140 }
141 for (const xAOD::MuonSegment* seg : tag->segments()) {
142 if (addedSegs.insert(seg).second) {
143 segLinks.emplace_back(static_cast<const xAOD::MuonSegmentContainer&>(*seg->container()),
144 seg->index(), ctx);
145 }
146 }
147 newMuon->addAllAuthor(tag->author());
148 tag->copyParameters(*newMuon);
149 p4Set = true;
150 }
151 newMuon->setMuonSegmentLinks(segLinks);
152
153 switch(newMuon->author()){
154 using enum xAOD::Muon::Author;
155 case MuidCo:
156 case MuGirl:
157 case STACO:
158 newMuon->setMuonType(xAOD::Muon::MuonType::Combined);
159 break;
160 case MuidSA:
161 newMuon->setMuonType(xAOD::Muon::MuonType::MuonStandAlone);
162 break;
163 case MuTagIMO:
164 newMuon->setMuonType(xAOD::Muon::MuonType::SegmentTagged);
165 break;
166 default:
167 ATH_MSG_WARNING("Invalid muon author "<<newMuon->author()<<". Cannot determine the muon type");
168 ship.muons->pop_back();
169 }
170
171 return;
172 m_selectionTool->setPassesIDCuts(*newMuon);
173 m_selectionTool->setQuality(*newMuon);
174}
#define ATH_MSG_WARNING(x)
ElementLink< xAOD::MuonSegmentContainer > SegLink_t
ToolHandle< CP::IMuonSelectionTool > m_selectionTool
The Muon selection tool to assess the muon quality.
TrackLink_t linkParticle(const EventContext &ctx, const xAOD::TrackParticle *trk) const
Constructs an element link to the passed track particle If a nullptr is passed, an empty link is retu...
ToolHandle< MuonR4::ITrackSummaryTool > m_summaryTool
Handle to the muon summary tool.
void setAuthor(const Author auth)
set author
void setTrackParticleLink(TrackParticleType type, const ElementLink< TrackParticleContainer > &link)
Set method for TrackParticle links.
Definition Muon_v1.cxx:460
void addAllAuthor(const Author author)
add author to all authors
Definition Muon_v1.cxx:105
void setMuonType(MuonType type)
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be a nullptr) to the TrackParticle used in identification of this muon.
Definition Muon_v1.cxx:422
void setMuonSegmentLinks(const std::vector< ElementLink< MuonSegmentContainer > > &segments)
Set the vector of ElementLinks to the MuonSegments used to create this Muon.
void setP4(double pt, double eta, double phi)
Set method for IParticle values.
Definition Muon_v1.cxx:71
Author author() const
void setCharge(float charge)
Set the charge (must be the same as primaryTrackParticle() ).
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .).
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
MuonSegment_v1 MuonSegment
Reference the current persistent version:
@ STACO
Tracks produced by STACO.
@ MuGirl
MuGirl.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode MuonCreatorAlg::execute ( const EventContext & ctx) const
finaloverridevirtual

Create first the combined muon tags

Create then the other muon tags

Definition at line 24 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.cxx.

24 {
25 DataShip ship{};
26 ATH_CHECK(setupDataShip(ctx, ship));
27
29 for (const auto& [idTrk, muTags] : ship.combinedTags) {
30 ATH_MSG_DEBUG("Store new combined muon having associated ID track with"
31 <<idTrk->pt()*inGeV<<", eta: "<<idTrk->eta()<<", phi:" <<idTrk->phi()*inDeg);
32 createMuon(ctx, muTags, ship);
33 }
35 for (const MuonR4::MuonTag* saTag: ship.standaloneTags) {
36 ATH_MSG_DEBUG("Store new standalone muon with pt: "
37 <<saTag->msTrack()->pt()*inGeV
38 <<", eta: "<<saTag->msTrack()->eta()
39 <<", phi: "<<saTag->msTrack()->phi()*inDeg);
40 createMuon(ctx, std::array{saTag}, ship);
41 }
42 return StatusCode::SUCCESS;
43}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
constexpr float inDeg(const float rad)
void createMuon(const EventContext &ctx, const std::span< const MuonR4::MuonTag *const > &muTags, DataShip &ship) const
Create the xAOD::Muon from the list of muon tags.
StatusCode setupDataShip(const EventContext &ctx, DataShip &ship) const
Load all containers from store gate and setup the output containers.
const xAOD::TrackParticle * msTrack() const
Returns the ms track candidate from which the tag was built.
Definition MuonTag.cxx:19

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode MuonCreatorAlg::initialize ( )
finaloverridevirtual

Definition at line 17 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.cxx.

17 {
18 ATH_CHECK(m_muonKey.initialize());
19 ATH_CHECK(m_tagKeys.initialize());
20 ATH_CHECK(m_selectionTool.retrieve());
21 ATH_CHECK(m_summaryTool.retrieve());
22 return StatusCode::SUCCESS;
23}
SG::WriteHandleKey< xAOD::MuonContainer > m_muonKey
Key name to store the primary muon container.
SG::ReadHandleKeyArray< MuonR4::MuonTagContainer > m_tagKeys
Key name under which the input tags can be found.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ linkParticle()

ElementLink< xAOD::TrackParticleContainer > MuonCreatorAlg::linkParticle ( const EventContext & ctx,
const xAOD::TrackParticle * trk ) const
private

Constructs an element link to the passed track particle If a nullptr is passed, an empty link is returned.

Parameters
ctxThe current event context
trkPointer to the track particle for which the link is to be constructed

Definition at line 91 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.cxx.

92 {
93 if (!trk) {
94 return TrackLink_t{};
95 }
96 return TrackLink_t{static_cast<const xAOD::TrackParticleContainer&>(*trk->container()),
97 trk->index(), ctx};
98}
ElementLink< xAOD::TrackParticleContainer > TrackLink_t
Abrivate the ElementLink to the track particles.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ setupDataShip()

StatusCode MuonCreatorAlg::setupDataShip ( const EventContext & ctx,
DataShip & ship ) const
private

Load all containers from store gate and setup the output containers.

Loop over the defined muon tag containers and sort them according to their ID track (Covers segmentTag, inside-out combined, combined)

try to asociate the tag with the combined tag

Definition at line 46 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.cxx.

46 {
47 ATH_CHECK(ship.muons.record(m_muonKey, ctx));
48
49 std::unordered_set<const xAOD::TrackParticle*> cmbMsTrks{};
50 std::vector<const MuonR4::MuonTagContainer*> tagContainers{};
51 tagContainers.resize(m_tagKeys.size(), nullptr);
52 for (const auto [idx, key] : Acts::enumerate(m_tagKeys)) {
53 ATH_CHECK(SG::get(tagContainers[idx], key, ctx));
54 }
55 std::ranges::sort(tagContainers, MuonR4::AuthorHierachy{});
59 for (const MuonR4::MuonTagContainer* tagCont: tagContainers) {
60 for (const MuonR4::MuonTag* muTag: *tagCont) {
61 if (muTag->idTrack() != nullptr) {
62 ship.combinedTags[muTag->idTrack()].emplace_back(muTag);
63 cmbMsTrks.insert(muTag->msTrack());
64 continue;
65 }
66 // Check whether the tag has an MS tag
67 if (!muTag->msTrack()) {
68 continue;
69 }
70 // If there is no combined tag with MS track the
71 // same MS track, then turn it into a standalone muon
72 if (cmbMsTrks.insert(muTag->msTrack()).second) {
73 ship.standaloneTags.emplace_back(muTag);
74 } else {
76 for (auto& [trk, tags]: ship.combinedTags) {
77 if (std::ranges::any_of(tags, [&muTag](const MuonR4::MuonTag* known){
78 return known->msTrack() == muTag->msTrack();
79 })) {
80 tags.push_back(muTag);
81 break;
82 }
83 }
84 }
85 }
86 }
87 return StatusCode::SUCCESS;
88}
std::vector< std::string > tags
Definition hcg.cxx:107
DataVector< MuonTag > MuonTagContainer
Definition MuonTag.h:125
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_muonKey

SG::WriteHandleKey<xAOD::MuonContainer> MuonCombinedR4::MuonCreatorAlg::m_muonKey {this, "MuonKey", "MuonsR4"}
private

Key name to store the primary muon container.

Definition at line 65 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.h.

65{this, "MuonKey", "MuonsR4"};

◆ m_selectionTool

ToolHandle<CP::IMuonSelectionTool> MuonCombinedR4::MuonCreatorAlg::m_selectionTool {this, "SelectionTool", ""}
private

The Muon selection tool to assess the muon quality.

Definition at line 63 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.h.

63{this, "SelectionTool", ""};

◆ m_summaryTool

ToolHandle<MuonR4::ITrackSummaryTool> MuonCombinedR4::MuonCreatorAlg::m_summaryTool {this, "TrackSummaryTool" , ""}
private

Handle to the muon summary tool.

Definition at line 69 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.h.

69{this, "TrackSummaryTool" , ""};

◆ m_tagKeys

SG::ReadHandleKeyArray<MuonR4::MuonTagContainer> MuonCombinedR4::MuonCreatorAlg::m_tagKeys {this, "TagKeys", {}}
private

Key name under which the input tags can be found.

Definition at line 67 of file MuonSpectrometer/MuonPhaseII/MuonIdentification/MuonCombinedAlgsR4/src/MuonCreatorAlg.h.

67{this, "TagKeys", {}};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: