ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonSegContainerMergerAlg Class Reference

The MuonSegContainerMergerAlg merges all MuonSegments assocaited with the combined muon tags into a single Trk::Segment container. More...

#include <MuonSegContainerMergerAlg.h>

Inheritance diagram for MuonSegContainerMergerAlg:
Collaboration diagram for MuonSegContainerMergerAlg:

Public Member Functions

 MuonSegContainerMergerAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~MuonSegContainerMergerAlg ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKeyArray< MuonCandidateCollectionm_muonCandidateKeys {this, "MuonCandidateMaps", {"MuonCandidates"}, "Muon candidates"}
 Name of all MuonCandidate tags (Main / LRT / EMEO) More...
 
SG::ReadHandleKeyArray< MuonCombined::InDetCandidateToTagMapm_tagMaps
 List of all InDetCandidate tags MuidCo, MuGirl from all muon reconstruction streams. More...
 
SG::ReadHandleKeyArray< Trk::SegmentCollectionm_inputSegContainerName
 Optionally segments from containers that are not associated with any segment candidate are dumped into a seperate container. More...
 
SG::WriteHandleKey< Trk::SegmentCollectionm_segTrkContainerName
 Name of the bulk segment output container. More...
 
SG::WriteHandleKey< MuonCombined::MuonTagToSegMapm_assocMapKey {this, "AssocMapKey", "MuonTagSegMap"}
 
SG::WriteHandleKey< Trk::SegmentCollectionm_unassocTrkContainerName {this, "UnassociatedSegmentKey", "UnAssocMuonTrkSegments"}
 Name of the unassociated segment container name. More...
 
ToolHandle< Trk::ITrackAmbiguityProcessorToolm_ambiguityProcessor {this, "AmbiguityProcessor", ""}
 
Gaudi::Property< bool > m_saveUnassocSegs
 
Gaudi::Property< bool > m_solveAmbi {this, "solveAmbiguities", true, "Solves the ambiguities between unassociated segments"}
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

The MuonSegContainerMergerAlg merges all MuonSegments assocaited with the combined muon tags into a single Trk::Segment container.

The container is further converted into a xAOD::MuonSegmentContainer downstream and finally dumped to disk. In order to avoid an unnecssary coping of all muon tags in memory, the MuonTagToSegMap is saved into the storegate which allows for a mapping of the transient segments associated with the segment container to the persistent ones in the MuonCreatorAlg downstream

Definition at line 23 of file MuonSegContainerMergerAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonSegContainerMergerAlg()

MuonSegContainerMergerAlg::MuonSegContainerMergerAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 20 of file MuonSegContainerMergerAlg.cxx.

20  :
21  AthReentrantAlgorithm(name, pSvcLocator) {}

◆ ~MuonSegContainerMergerAlg()

MuonSegContainerMergerAlg::~MuonSegContainerMergerAlg ( )
default

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode MuonSegContainerMergerAlg::execute ( const EventContext &  ctx) const
overridevirtual

Create the output segment containers

Copy over all segments stemming from the Muon Candidates

Next proceed with the segment candidates the Combined tags

Sort according to the author

2 times a combined muon track

One of them has a primary track

Retrieve the list of associated segments

Write the segment container & the map to the store gate

If the remainder segment container is not needed we can quit here

Retrieve the list of segments to be copied

The segment has already been used

Solve ambiguities between the segments to keep the container size small

Convert the segments to tracks

Should never happen but we never know

Dynamic cast to the MuonSegment pointer

Definition at line 47 of file MuonSegContainerMergerAlg.cxx.

47  {
49  std::unique_ptr<MuonCombined::MuonTagToSegMap> persistency_link = std::make_unique<MuonCombined::MuonTagToSegMap>();
50  std::unique_ptr<Trk::SegmentCollection> out_container = std::make_unique<Trk::SegmentCollection>();
51 
53  for (SG::ReadHandle<MuonCandidateCollection>& candidate_coll : m_muonCandidateKeys.makeHandles(ctx)) {
54  if (!candidate_coll.isValid()) {
55  ATH_MSG_FATAL("Failed to retrieve Muon segment candidates " << candidate_coll.fullKey());
56  return StatusCode::FAILURE;
57  } else {
58  ATH_MSG_VERBOSE("Retrieved "<<candidate_coll.fullKey()<< " with size "<<candidate_coll->size());
59  }
60  for (const MuonCombined::MuonCandidate* ms_cand : *candidate_coll) {
61  const std::vector<const Muon::MuonSegment*>& assoc_segs = ms_cand->getSegments();
62  if (assoc_segs.empty()) { ATH_MSG_WARNING("Muon candidate " << ms_cand->toString() << " does not have associated segments."); }
63  for (const Muon::MuonSegment* seg : assoc_segs) { persistency_link->persistify(seg, out_container.get()); }
64  }
65  }
67  std::vector<const MuonCombined::TagBase*> good_tags{};
68  for (SG::ReadHandle<MuonCombined::InDetCandidateToTagMap>& tag_map : m_tagMaps.makeHandles(ctx)) {
69  if (!tag_map.isValid()) {
70  ATH_MSG_FATAL("Failed to retrieve combined tag map "<<tag_map.fullKey());
71  return StatusCode::FAILURE;
72  } else {
73  ATH_MSG_VERBOSE("Retrieved "<<tag_map.fullKey()<< " with size "<<tag_map->size());
74  }
75  good_tags.reserve(tag_map->size() + good_tags.size());
76  for (const auto& tag_pair : *tag_map) {
77  good_tags.push_back(tag_pair.second.get());
78  }
79  }
80  std::stable_sort(good_tags.begin(),good_tags.end(),[](const MuonCombined::TagBase* a, const MuonCombined::TagBase* b){
81  if (a->isCommissioning() != b->isCommissioning()) return b->isCommissioning();
83  const int auth_a = MuonCombined::authorRank(a->author());
84  const int auth_b = MuonCombined::authorRank(b->author());
85  if (auth_a != auth_b) return auth_a < auth_b;
86  const Trk::Track* prim_a = a->primaryTrack();
87  const Trk::Track* prim_b = b->primaryTrack();
89  if (prim_a && prim_b) {
90  const Trk::Perigee* per_a = prim_a->perigeeParameters();
91  const Trk::Perigee* per_b = prim_b->perigeeParameters();
92  return per_a->pT() > per_b->pT();
93  }
95  if (prim_a || prim_b) return prim_a != nullptr;
96  std::vector<const Muon::MuonSegment*> seg_a = a->associatedSegments();
97  std::vector<const Muon::MuonSegment*> seg_b = b->associatedSegments();
98  const size_t n_segs_a = seg_a.size();
99  const size_t n_segs_b = seg_b.size();
100  if (n_segs_a != n_segs_b) return n_segs_a > n_segs_b;
101  if (!n_segs_a) return false;
102  return chi2(seg_a[0]) < chi2(seg_b[0]);
103  });
104 
105  for (const MuonCombined::TagBase* cmb_tag : good_tags) {
106  std::vector<const Muon::MuonSegment*> assoc_segs = cmb_tag->associatedSegments();
107  if (assoc_segs.empty() && cmb_tag->type() != xAOD::Muon::CaloTagged) {
108  ATH_MSG_WARNING("Combined candidate " << cmb_tag->toString() << " does not have associated segments");
109  }
110  for (const Muon::MuonSegment* seg : assoc_segs) {
111  persistency_link->persistify(seg, out_container.get());
112  }
113  }
114 
116  std::set<const Trk::Segment*> assoc_segs = persistency_link->getPersistifiedSegments();
119  ATH_CHECK(usedSegWriteHandle.record(std::move(out_container)));
121  ATH_CHECK(assocMapWriteHandle.record(std::move(persistency_link)));
123  if (!m_saveUnassocSegs) return StatusCode::SUCCESS;
124 
125  std::vector<const Trk::Segment*> to_copy{};
126 
128  for (SG::ReadHandle<Trk::SegmentCollection>& inputSegColl : m_inputSegContainerName.makeHandles(ctx)) {
129  if (!inputSegColl.isValid()) {
130  ATH_MSG_FATAL("Failed to retrieve segment collection " << inputSegColl.fullKey());
131  return StatusCode::FAILURE;
132  }
133  for (const Trk::Segment* seg : *inputSegColl) {
135  if (assoc_segs.count(seg)) continue;
136  to_copy.emplace_back(seg);
137  }
138  }
140  if (m_solveAmbi && to_copy.size() > 1) {
141  std::map<const Trk::Track*, const Trk::Segment*> track_seg_map{};
142  TrackCollection ambi_tracks{};
144  for (const Trk::Segment* seg : to_copy) {
145  auto tsos = std::make_unique<Trk::TrackStates>();
146  Trk::TrackInfo dummy_info{};
147  for (const Trk::MeasurementBase* meas : seg->containedMeasurements()) {
148  tsos->push_back(Muon::MuonTSOSHelper::createMeasTSOS(meas->uniqueClone(), nullptr, Trk::TrackStateOnSurface::Measurement));
149  }
150  std::unique_ptr<Trk::Track> trk =
151  std::make_unique<Trk::Track>(dummy_info, std::move(tsos), seg->fitQuality() ? seg->fitQuality()->uniqueClone() : nullptr);
152  track_seg_map[trk.get()] = seg;
153  ambi_tracks.push_back(std::move(trk));
154  }
155  std::unique_ptr<const TrackCollection> resolved_trks{m_ambiguityProcessor->process(&ambi_tracks)};
156  std::vector<const Trk::Segment*> resolved_copies{};
157  for (const Trk::Track* res : *resolved_trks) {
158  const Trk::Segment* seg = track_seg_map[res];
160  if (!seg) continue;
161  resolved_copies.emplace_back(seg);
162  }
163  ATH_MSG_DEBUG("Number of segments before the ambiguity solving " << to_copy.size() << " vs. after solving "
164  << resolved_copies.size());
165  to_copy = std::move(resolved_copies);
166  }
167 
168  out_container = std::make_unique<Trk::SegmentCollection>();
169  for (const Trk::Segment* seg : to_copy) {
171  const Muon::MuonSegment* muon_seg = dynamic_cast<const Muon::MuonSegment*>(seg);
172  if (!muon_seg) continue;
173  std::unique_ptr<Muon::MuonSegment> copy = std::make_unique<Muon::MuonSegment>(*muon_seg);
174  out_container->push_back(std::move(copy));
175  }
177  ATH_CHECK(unUsedSegWriteHandle.record(std::move(out_container)));
178  return StatusCode::SUCCESS;
179 }

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode MuonSegContainerMergerAlg::initialize ( )
overridevirtual

Initialize the data dependencies

Definition at line 23 of file MuonSegContainerMergerAlg.cxx.

23  {
25  ATH_CHECK(m_muonCandidateKeys.initialize());
26  ATH_CHECK(m_tagMaps.initialize());
27  if ( !(m_tagMaps.size() + m_muonCandidateKeys.size() ) ){
28  ATH_MSG_FATAL("No candidates were given to read the segments from");
29  return StatusCode::FAILURE;
30  }
31  ATH_MSG_INFO("Use the following Muon tags to dump the segments");
33  ATH_MSG_INFO(" *** "<<key.fullKey());
34  }
35  ATH_MSG_INFO("Use the following combined tags to dump the segments");
37  ATH_MSG_INFO(" --- "<<key.fullKey());
38  }
39  ATH_CHECK(m_segTrkContainerName.initialize());
44 
45  return StatusCode::SUCCESS;
46 }

◆ 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()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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 InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_ambiguityProcessor

ToolHandle<Trk::ITrackAmbiguityProcessorTool> MuonSegContainerMergerAlg::m_ambiguityProcessor {this, "AmbiguityProcessor", ""}
private

Definition at line 52 of file MuonSegContainerMergerAlg.h.

◆ m_assocMapKey

SG::WriteHandleKey<MuonCombined::MuonTagToSegMap> MuonSegContainerMergerAlg::m_assocMapKey {this, "AssocMapKey", "MuonTagSegMap"}
private

Definition at line 47 of file MuonSegContainerMergerAlg.h.

◆ 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 AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_inputSegContainerName

SG::ReadHandleKeyArray<Trk::SegmentCollection> MuonSegContainerMergerAlg::m_inputSegContainerName
private
Initial value:
{
this, "InputSegmentContainers", {"TrackMuonSegments"}, "Container names of muon segments not used in muon reconstruction"}

Optionally segments from containers that are not associated with any segment candidate are dumped into a seperate container.

Definition at line 41 of file MuonSegContainerMergerAlg.h.

◆ m_muonCandidateKeys

SG::ReadHandleKeyArray<MuonCandidateCollection> MuonSegContainerMergerAlg::m_muonCandidateKeys {this, "MuonCandidateMaps", {"MuonCandidates"}, "Muon candidates"}
private

Name of all MuonCandidate tags (Main / LRT / EMEO)

Definition at line 34 of file MuonSegContainerMergerAlg.h.

◆ m_saveUnassocSegs

Gaudi::Property<bool> MuonSegContainerMergerAlg::m_saveUnassocSegs
private
Initial value:
{this, "saveUnusedSegments", true,
"Dumps segments that were not fed into muon reconstruction into a second container"}

Definition at line 54 of file MuonSegContainerMergerAlg.h.

◆ m_segTrkContainerName

SG::WriteHandleKey<Trk::SegmentCollection> MuonSegContainerMergerAlg::m_segTrkContainerName
private
Initial value:
{this, "TrackSegmentContainerName", "TrkMuonSegments",
"Track segments"}

Name of the bulk segment output container.

Definition at line 45 of file MuonSegContainerMergerAlg.h.

◆ m_solveAmbi

Gaudi::Property<bool> MuonSegContainerMergerAlg::m_solveAmbi {this, "solveAmbiguities", true, "Solves the ambiguities between unassociated segments"}
private

Definition at line 56 of file MuonSegContainerMergerAlg.h.

◆ m_tagMaps

SG::ReadHandleKeyArray<MuonCombined::InDetCandidateToTagMap> MuonSegContainerMergerAlg::m_tagMaps
private
Initial value:
{
this, "TagMaps", {"muidcoTagMap", "stacoTagMap", "muGirlTagMap", "caloTagMap", "segmentTagMap"}, "ID candidate to tag maps"}

List of all InDetCandidate tags MuidCo, MuGirl from all muon reconstruction streams.

Definition at line 36 of file MuonSegContainerMergerAlg.h.

◆ m_unassocTrkContainerName

SG::WriteHandleKey<Trk::SegmentCollection> MuonSegContainerMergerAlg::m_unassocTrkContainerName {this, "UnassociatedSegmentKey", "UnAssocMuonTrkSegments"}
private

Name of the unassociated segment container name.

Definition at line 50 of file MuonSegContainerMergerAlg.h.

◆ 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:
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonSegContainerMergerAlg::m_segTrkContainerName
SG::WriteHandleKey< Trk::SegmentCollection > m_segTrkContainerName
Name of the bulk segment output container.
Definition: MuonSegContainerMergerAlg.h:45
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
MuonSegContainerMergerAlg::m_saveUnassocSegs
Gaudi::Property< bool > m_saveUnassocSegs
Definition: MuonSegContainerMergerAlg.h:54
MuonSegContainerMergerAlg::m_solveAmbi
Gaudi::Property< bool > m_solveAmbi
Definition: MuonSegContainerMergerAlg.h:56
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonCombined::MuonCandidate
Definition: Reconstruction/MuonIdentification/MuonCombinedEvent/MuonCombinedEvent/MuonCandidate.h:25
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::MuonTSOSHelper::createMeasTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > createMeasTSOS(std::unique_ptr< Trk::MeasurementBase > meas, std::unique_ptr< Trk::TrackParameters > pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
create a TSOS with a measurement, takes ownership of the pointers
Definition: MuonTSOSHelper.h:62
Trk::Segment
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:56
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonSegContainerMergerAlg::m_muonCandidateKeys
SG::ReadHandleKeyArray< MuonCandidateCollection > m_muonCandidateKeys
Name of all MuonCandidate tags (Main / LRT / EMEO)
Definition: MuonSegContainerMergerAlg.h:34
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector< Trk::Track >
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
MuonSegContainerMergerAlg::m_ambiguityProcessor
ToolHandle< Trk::ITrackAmbiguityProcessorTool > m_ambiguityProcessor
Definition: MuonSegContainerMergerAlg.h:52
MuonCombined::MuonTagToSegMap::getPersistifiedSegments
std::set< const Trk::Segment * > getPersistifiedSegments() const
Returns the set of all store gate segments that were persitified.
Definition: MuonTagToSegMap.cxx:27
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::MeasurementBase
Definition: MeasurementBase.h:58
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonCombined::MuonTagToSegMap::persistify
unsigned int persistify(const Muon::MuonSegment *assoc_seg, Trk::SegmentCollection *container)
Pushes back the segment cached in the store gate back to the new segment container meant for write-ou...
Definition: MuonTagToSegMap.cxx:9
MuonSegContainerMergerAlg::m_assocMapKey
SG::WriteHandleKey< MuonCombined::MuonTagToSegMap > m_assocMapKey
Definition: MuonSegContainerMergerAlg.h:47
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
MuonSegContainerMergerAlg::m_tagMaps
SG::ReadHandleKeyArray< MuonCombined::InDetCandidateToTagMap > m_tagMaps
List of all InDetCandidate tags MuidCo, MuGirl from all muon reconstruction streams.
Definition: MuonSegContainerMergerAlg.h:36
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
MuonSegContainerMergerAlg::m_unassocTrkContainerName
SG::WriteHandleKey< Trk::SegmentCollection > m_unassocTrkContainerName
Name of the unassociated segment container name.
Definition: MuonSegContainerMergerAlg.h:50
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
calibdata.copy
bool copy
Definition: calibdata.py:27
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
MuonCombined::TagBase
base-class for combined reconstruction output Provides access to MuonType and Author
Definition: TagBase.h:48
fitman.k
k
Definition: fitman.py:528
MuonSegContainerMergerAlg::m_inputSegContainerName
SG::ReadHandleKeyArray< Trk::SegmentCollection > m_inputSegContainerName
Optionally segments from containers that are not associated with any segment candidate are dumped int...
Definition: MuonSegContainerMergerAlg.h:41
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37