Loading [MathJax]/extensions/tex2jax.js
 |
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 > &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 > &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...
|
|
|
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 167 of file MuonLayerAmbiguitySolverTool.cxx.
170 muonLayerDataHashVec.clear();
174 for (
const MuonLayerRecoData&
layer : allLayers) {
175 const MuonLayerSurface& layerSurface =
layer.intersection.layerSurface;
179 std::vector<MuonLayerIntersection> layerIntersections;
180 layerIntersections.reserve(
layer.segments.size());
181 for (
const std::shared_ptr<const MuonSegment>&
segment :
layer.segments) {
189 if (muonLayerDataHashVec[stIndex].
empty()) {
190 muonLayerDataHashVec[stIndex] = std::move(layerIntersections);
198 muonLayerDataHashVec[stIndex].
begin(), muonLayerDataHashVec[stIndex].
end(),
204 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 77 of file MuonLayerAmbiguitySolverTool.cxx.
82 if (inverseSeedLayerOrder.empty())
return true;
88 const std::vector<MuonLayerIntersection>& layerIntersections = muonLayerDataHashVec[currentStIndex];
89 if (!layerIntersections.empty()) {
91 std::vector<MuonCandidate> newCandidates;
96 unsigned int selectedSegmentsInLayer = 0;
98 for (
const MuonLayerIntersection& layerIntersection : layerIntersections) {
101 if (
match(ctx, candidate, layerIntersection)) {
103 if (selectedSegmentsInLayer == 0) {
104 candidate.layerIntersections.push_back(layerIntersection);
106 MuonCandidate newCandidate = candidate;
108 newCandidate.layerIntersections.back() = layerIntersection;
109 newCandidates.emplace_back(std::move(newCandidate));
111 ++selectedSegmentsInLayer;
116 if (!newCandidates.empty()) {
117 ATH_MSG_VERBOSE(
"Found multiple solutions, add new candidates " << newCandidates.size());
119 std::make_move_iterator(newCandidates.end()));
124 std::vector<MuonStationIndex::StIndex> newInverseSeedLayerOrder = inverseSeedLayerOrder;
125 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 138 of file MuonLayerAmbiguitySolverTool.cxx.
142 ATH_MSG_VERBOSE(
"getNextSeed, remaining layers " << inverseSeedLayerOrder.size());
144 std::vector<MuonStationIndex::StIndex>::const_reverse_iterator rit = inverseSeedLayerOrder.rbegin();
145 std::vector<MuonStationIndex::StIndex>::const_reverse_iterator rit_end = inverseSeedLayerOrder.rend();
146 for (; rit != rit_end; ++rit) {
148 for (
const MuonLayerIntersection& muonLayerIntersection : muonLayerDataHashVec[*rit]) {
153 if (usedSegments.count(
segment))
continue;
157 layerIntersection = muonLayerIntersection;
162 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;
41 MuonLayerIntersection layerIntersection;
42 if (!
getNextSeed(muonLayerDataHashVec, usedSegments, inverseSeedLayerOrder, layerIntersection)) {
48 std::vector<MuonLayerIntersection> layerIntersections = {layerIntersection};
49 std::vector<MuonCandidate>
candidates = {MuonCandidate(std::move(layerIntersections))};
55 msg(
MSG::VERBOSE) <<
" Candidate with layers " << candidate.layerIntersections.size();
56 for (
const auto&
entry : candidate.layerIntersections) {
65 for (
const auto&
layer : candidate.layerIntersections) { usedSegments.insert(
layer.segment.get()); }
67 resolvedCandidates.insert(resolvedCandidates.end(), std::make_move_iterator(
candidates.begin()),
73 ATH_MSG_DEBUG(
"Completed ambiguity solving using " << nseeds <<
" seeds, resulting in " << resolvedCandidates.size()
74 <<
" track candidates ");
◆ resolveSmallLargeOverlaps()
Definition at line 211 of file MuonLayerAmbiguitySolverTool.cxx.
214 ATH_MSG_VERBOSE(
" resolveSmallLargeOverlaps: existing " << existingLayerIntersections.size() <<
" new "
215 << newLayerIntersections.size());
218 std::set<const MuonSegment*> combinedSegments;
219 std::vector<MuonLayerIntersection> combinedIntersections;
222 for (
const MuonLayerIntersection& layerIntersection1 : existingLayerIntersections) {
225 for (
const MuonLayerIntersection& layerIntersection2 : newLayerIntersections) {
233 if (!
m_segmentMatchingTool->match(ctx, *layerIntersection1.segment, *layerIntersection2.segment))
continue;
237 std::shared_ptr<const MuonSegment> newseg{
238 m_muonTrackBuilder->combineToSegment(ctx, *layerIntersection1.segment, *layerIntersection2.segment, emptyVec)};
257 if (qualitynew < layerIntersection1.quality || qualitynew < layerIntersection2.quality) {
258 ATH_MSG_DEBUG(
"Quality got worse after combination: new " << qualitynew <<
" q1 " << layerIntersection1.quality
259 <<
" q2 " << layerIntersection2.quality);
268 if (!layerIntersection.intersection.trackParameters)
return 1e9;
269 return layerIntersection.intersection.trackParameters->position().dot(direction);
271 double dist1 =
getDistance(layerIntersection1, direction);
272 double dist2 =
getDistance(layerIntersection2, direction);
274 combinedIntersections.emplace_back(layerIntersection1.intersection, newseg, qualitynew);
276 combinedIntersections.emplace_back(layerIntersection2.intersection, newseg, qualitynew);
279 <<
" first " <<
m_printer->print(*layerIntersection1.segment) << std::endl
280 <<
" second " <<
m_printer->print(*layerIntersection2.segment) << std::endl
281 <<
" combined " <<
m_printer->print(*newseg));
284 combinedSegments.insert(layerIntersection1.segment.get());
285 combinedSegments.insert(layerIntersection2.segment.get());
291 return !combinedSegments.count(inter_sect.segment.get());
294 combinedIntersections.reserve(existingLayerIntersections.size() + newLayerIntersections.size());
295 std::copy_if(std::make_move_iterator(existingLayerIntersections.begin()), std::make_move_iterator(existingLayerIntersections.end()),
296 std::back_inserter(combinedIntersections), insert_intersection);
297 std::copy_if(std::make_move_iterator(newLayerIntersections.begin()), std::make_move_iterator(newLayerIntersections.end()),
298 std::back_inserter(combinedIntersections), insert_intersection);
299 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:
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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:
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.
virtual void setOwner(IDataHandleHolder *o)=0
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
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
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
StIndex
enum to classify the different station layers in the muon spectrometer
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
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)