 |
ATLAS Offline Software
|
#include <MuonLayerAmbiguitySolverTool.h>
|
| MuonLayerAmbiguitySolverTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Default AlgTool functions. More...
|
|
virtual | ~MuonLayerAmbiguitySolverTool ()=default |
|
virtual StatusCode | initialize () override |
|
virtual void | resolveOverlaps (const EventContext &ctx, const std::vector< Muon::MuonLayerRecoData > &allLayers, std::vector< MuonCandidate > &resolvedCandidates) const override |
| IMuonLayerAmbiguitySolverTool interface: find. More...
|
|
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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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, V, H > &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 |
|
|
void | buildLayerVec (const EventContext &ctx, const std::vector< MuonLayerRecoData > &allLayers, std::vector< std::vector< MuonLayerIntersection > > &muonLayerDataHashVec) const |
|
bool | getNextSeed (const std::vector< std::vector< MuonLayerIntersection > > &muonLayerDataHashVec, std::set< const MuonSegment * > &usedSegments, std::vector< MuonStationIndex::StIndex > &inverseSeedLayerOrder, MuonLayerIntersection &layerIntersection) const |
|
bool | extendCandidatesWithLayers (const EventContext &ctx, std::vector< MuonCandidate > &candidates, const std::vector< std::vector< MuonLayerIntersection > > &muonLayerRecoDataHashVec, const std::vector< MuonStationIndex::StIndex > &inverseSeedLayerOrder) const |
|
void | resolveSmallLargeOverlaps (const EventContext &ctx, std::vector< MuonLayerIntersection > &existingLayerIntersections, std::vector< MuonLayerIntersection > &newLayerIntersections) const |
|
bool | match (const EventContext &ctx, const MuonCandidate &candidate, const MuonLayerIntersection &layerIntersection) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
ToolHandle< IMuonSegmentSelectionTool > | m_segmentSelector |
|
ToolHandle< IMuonSegmentMatchingTool > | m_segmentMatchingTool |
|
ToolHandle< IMuonSegmentTrackBuilder > | m_muonTrackBuilder |
|
PublicToolHandle< MuonEDMPrinterTool > | m_printer {this, "MuonEDMPrinterTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"} |
|
Gaudi::Property< unsigned int > | m_maxSeeds {this, "MaxSeeds", 30, "maximum number of seeds to be tried"} |
|
Gaudi::Property< int > | m_seedQualityThreshold {this, "SeedQualityThreshold", 2, "seed quality threshold"} |
|
Gaudi::Property< int > | m_minSegmentQuality {this, "MinimumSegmentQuality", 1, "minimum quality for a segment to be considered"} |
|
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 |
|
◆ StoreGateSvc_t
◆ MuonLayerAmbiguitySolverTool()
Muon::MuonLayerAmbiguitySolverTool::MuonLayerAmbiguitySolverTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~MuonLayerAmbiguitySolverTool()
virtual Muon::MuonLayerAmbiguitySolverTool::~MuonLayerAmbiguitySolverTool |
( |
| ) |
|
|
virtualdefault |
◆ buildLayerVec()
Definition at line 166 of file MuonLayerAmbiguitySolverTool.cxx.
169 muonLayerDataHashVec.clear();
170 muonLayerDataHashVec.resize(
toInt(StIndex::StIndexMax));
173 for (
const MuonLayerRecoData&
layer : allLayers) {
174 const MuonLayerSurface& layerSurface =
layer.intersection.layerSurface;
178 std::vector<MuonLayerIntersection> layerIntersections;
179 layerIntersections.reserve(
layer.segments.size());
180 for (
const std::shared_ptr<const MuonSegment>&
segment :
layer.segments) {
188 if (muonLayerDataHashVec[
toInt(stIndex)].
empty()) {
189 muonLayerDataHashVec[
toInt(stIndex)] = std::move(layerIntersections);
196 std::ranges::stable_sort(muonLayerDataHashVec[
toInt(stIndex)],
202 for (
const auto&
vec : muonLayerDataHashVec) {
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extendCandidatesWithLayers()
replace the last intersection on the original candidate
Definition at line 76 of file MuonLayerAmbiguitySolverTool.cxx.
81 if (inverseSeedLayerOrder.empty())
return true;
87 const std::vector<MuonLayerIntersection>& layerIntersections = muonLayerDataHashVec[
toInt(currentStIndex)];
88 if (!layerIntersections.empty()) {
90 std::vector<MuonCandidate> newCandidates;
95 unsigned int selectedSegmentsInLayer = 0;
97 for (
const MuonLayerIntersection& layerIntersection : layerIntersections) {
100 if (
match(ctx, candidate, layerIntersection)) {
102 if (selectedSegmentsInLayer == 0) {
103 candidate.layerIntersections.push_back(layerIntersection);
105 MuonCandidate newCandidate = candidate;
107 newCandidate.layerIntersections.back() = layerIntersection;
108 newCandidates.emplace_back(std::move(newCandidate));
110 ++selectedSegmentsInLayer;
115 if (!newCandidates.empty()) {
116 ATH_MSG_VERBOSE(
"Found multiple solutions, add new candidates " << newCandidates.size());
118 std::make_move_iterator(newCandidates.end()));
123 std::vector<MuonStationIndex::StIndex> newInverseSeedLayerOrder = inverseSeedLayerOrder;
124 newInverseSeedLayerOrder.pop_back();
◆ extraDeps_update_handler()
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
◆ getNextSeed()
select segment
Definition at line 137 of file MuonLayerAmbiguitySolverTool.cxx.
141 ATH_MSG_VERBOSE(
"getNextSeed, remaining layers " << inverseSeedLayerOrder.size());
143 std::vector<MuonStationIndex::StIndex>::const_reverse_iterator rit = inverseSeedLayerOrder.rbegin();
144 std::vector<MuonStationIndex::StIndex>::const_reverse_iterator rit_end = inverseSeedLayerOrder.rend();
145 for (; rit != rit_end; ++rit) {
147 for (
const MuonLayerIntersection& muonLayerIntersection : muonLayerDataHashVec[
toInt(*rit)]) {
152 if (usedSegments.count(
segment))
continue;
156 layerIntersection = muonLayerIntersection;
161 inverseSeedLayerOrder.pop_back();
◆ initialize()
StatusCode Muon::MuonLayerAmbiguitySolverTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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.
◆ interfaceID()
static const InterfaceID& Muon::IMuonLayerAmbiguitySolverTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
IAlgTool interface.
Definition at line 22 of file IMuonLayerAmbiguitySolverTool.h.
23 static const InterfaceID IID_IMuonLayerAmbiguitySolverTool(
"Muon::IMuonLayerAmbiguitySolverTool", 1, 0);
24 return IID_IMuonLayerAmbiguitySolverTool;
◆ match()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ resolveOverlaps()
IMuonLayerAmbiguitySolverTool interface: find.
Implements Muon::IMuonLayerAmbiguitySolverTool.
Definition at line 27 of file MuonLayerAmbiguitySolverTool.cxx.
30 std::vector<std::vector<MuonLayerIntersection> > muonLayerDataHashVec;
34 unsigned int nseeds = 0;
35 std::set<const MuonSegment*> usedSegments;
40 MuonLayerIntersection layerIntersection;
41 if (!
getNextSeed(muonLayerDataHashVec, usedSegments, inverseSeedLayerOrder, layerIntersection)) {
47 std::vector<MuonLayerIntersection> layerIntersections = {layerIntersection};
48 std::vector<MuonCandidate>
candidates = {MuonCandidate(std::move(layerIntersections))};
54 msg(
MSG::VERBOSE) <<
" Candidate with layers " << candidate.layerIntersections.size();
55 for (
const auto&
entry : candidate.layerIntersections) {
64 for (
const auto&
layer : candidate.layerIntersections) { usedSegments.insert(
layer.segment.get()); }
66 resolvedCandidates.insert(resolvedCandidates.end(), std::make_move_iterator(
candidates.begin()),
72 ATH_MSG_DEBUG(
"Completed ambiguity solving using " << nseeds <<
" seeds, resulting in " << resolvedCandidates.size()
73 <<
" track candidates ");
◆ resolveSmallLargeOverlaps()
Definition at line 209 of file MuonLayerAmbiguitySolverTool.cxx.
212 ATH_MSG_VERBOSE(
" resolveSmallLargeOverlaps: existing " << existingLayerIntersections.size() <<
" new "
213 << newLayerIntersections.size());
216 std::set<const MuonSegment*> combinedSegments;
217 std::vector<MuonLayerIntersection> combinedIntersections;
220 for (
const MuonLayerIntersection& layerIntersection1 : existingLayerIntersections) {
223 for (
const MuonLayerIntersection& layerIntersection2 : newLayerIntersections) {
231 if (!
m_segmentMatchingTool->match(ctx, *layerIntersection1.segment, *layerIntersection2.segment))
continue;
235 std::shared_ptr<const MuonSegment> newseg{
236 m_muonTrackBuilder->combineToSegment(ctx, *layerIntersection1.segment, *layerIntersection2.segment, emptyVec)};
255 if (qualitynew < layerIntersection1.quality || qualitynew < layerIntersection2.quality) {
256 ATH_MSG_DEBUG(
"Quality got worse after combination: new " << qualitynew <<
" q1 " << layerIntersection1.quality
257 <<
" q2 " << layerIntersection2.quality);
266 if (!layerIntersection.intersection.trackParameters)
return 1e9;
267 return layerIntersection.intersection.trackParameters->position().dot(direction);
269 double dist1 =
getDistance(layerIntersection1, direction);
270 double dist2 =
getDistance(layerIntersection2, direction);
272 combinedIntersections.emplace_back(layerIntersection1.intersection, newseg, qualitynew);
274 combinedIntersections.emplace_back(layerIntersection2.intersection, newseg, qualitynew);
277 <<
" first " <<
m_printer->print(*layerIntersection1.segment) << std::endl
278 <<
" second " <<
m_printer->print(*layerIntersection2.segment) << std::endl
279 <<
" combined " <<
m_printer->print(*newseg));
282 combinedSegments.insert(layerIntersection1.segment.get());
283 combinedSegments.insert(layerIntersection2.segment.get());
289 return !combinedSegments.count(inter_sect.segment.get());
292 combinedIntersections.reserve(existingLayerIntersections.size() + newLayerIntersections.size());
293 std::copy_if(std::make_move_iterator(existingLayerIntersections.begin()), std::make_move_iterator(existingLayerIntersections.end()),
294 std::back_inserter(combinedIntersections), insert_intersection);
295 std::copy_if(std::make_move_iterator(newLayerIntersections.begin()), std::make_move_iterator(newLayerIntersections.end()),
296 std::back_inserter(combinedIntersections), insert_intersection);
297 existingLayerIntersections = std::move(combinedIntersections);
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_evtStore
◆ m_maxSeeds
Gaudi::Property<unsigned int> Muon::MuonLayerAmbiguitySolverTool::m_maxSeeds {this, "MaxSeeds", 30, "maximum number of seeds to be tried"} |
|
private |
◆ m_minSegmentQuality
Gaudi::Property<int> Muon::MuonLayerAmbiguitySolverTool::m_minSegmentQuality {this, "MinimumSegmentQuality", 1, "minimum quality for a segment to be considered"} |
|
private |
◆ m_muonTrackBuilder
◆ m_printer
◆ m_seedQualityThreshold
Gaudi::Property<int> Muon::MuonLayerAmbiguitySolverTool::m_seedQualityThreshold {this, "SeedQualityThreshold", 2, "seed quality threshold"} |
|
private |
◆ m_segmentMatchingTool
Initial value:{this, "MuonSegmentMatchingTool",
"Muon::MuonSegmentMatchingTool/MuonSegmentMatchingToolTight"}
Definition at line 54 of file MuonLayerAmbiguitySolverTool.h.
◆ m_segmentSelector
Initial value:{this, "MuonSegmentSelectionTool",
"Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool"}
Definition at line 52 of file MuonLayerAmbiguitySolverTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
const float EO[NO]
Energy levels for Oxygen.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
MuonSegment_v1 MuonSegment
Reference the current persistent version:
virtual void setOwner(IDataHandleHolder *o)=0
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Out copy_if(In first, const In &last, Out res, const Pred &p)
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StIndex
enum to classify the different station layers in the muon spectrometer
constexpr int toInt(const ParamDefs p)
Eigen::Matrix< double, 3, 1 > Vector3D
bool empty() const noexcept
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
double chiSquared() const
returns the of the overall track fit
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
std::vector< const Trk::PrepRawData * > PrepVec
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)