|
ATLAS Offline Software
|
Implementation of an IMuonTrackFinder.
More...
#include <MuonTrackSteering.h>
|
| MuonTrackSteering (const std::string &, const std::string &, const IInterface *) |
| default AlgTool constructor More...
|
|
virtual | ~MuonTrackSteering ()=default |
| destructor More...
|
|
virtual StatusCode | initialize () override |
| initialize method, method taken from bass-class AlgTool More...
|
|
std::unique_ptr< TrackCollection > | find (const EventContext &ctx, const MuonSegmentCollection &coll) const override |
| find tracks starting from a MuonSegmentCollection More...
|
|
virtual std::unique_ptr< TrackCollection > | find (const EventContext &ctx, const std::vector< const MuonSegment * > &segments) const =0 |
| interface for tools to find track in the muon system starting from a vector of segments 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 |
|
|
std::unique_ptr< TrackCollection > | selectTracks (std::vector< std::unique_ptr< MuPatTrack >> &candidates, bool takeOwnership=true) const |
|
std::unique_ptr< TrackCollection > | findTracks (const EventContext &ctx, SegColVec &chamberSegments, SegColVec &stationSegments) const |
| actual find method More...
|
|
bool | extractSegments (const EventContext &ctx, const MuonSegmentCollection &coll, SegColVec &chamberSegments, SegColVec &stationSegments, ChSet &chambersWithSegments, StSet &stationsWithSegments, GarbageContainer &trash_bin) const |
|
StatusCode | decodeStrategyVector (const std::vector< std::string > &strategy) |
|
std::unique_ptr< const MuonTrackSteeringStrategy > | decodeStrategy (const std::string &strategy) const |
|
std::vector< std::unique_ptr< MuPatTrack > > | extendWithLayer (const EventContext &ctx, MuPatTrack &candidate, const SegColVec &segcol, unsigned int nextlayer, const unsigned int endlayer, int cutLevel=0) const |
|
std::vector< std::unique_ptr< MuPatTrack > > | findTrackFromSeed (const EventContext &ctx, MuPatSegment &seedSeg, const MuonTrackSteeringStrategy &strat, const unsigned int layer, const SegColVec &segs) const |
| Find tracks starting from a good segment. More...
|
|
void | refineTracks (const EventContext &ctx, std::vector< std::unique_ptr< MuPatTrack >> &candidates) const |
|
void | solveAmbiguities (std::vector< std::unique_ptr< MuPatTrack >> &tracks, const MuonTrackSteeringStrategy *strat=nullptr) const |
| Resolve ambiguities among tracks for a single strategy This allows a strategy-specific ambiguity solving (with some options per strategy) More...
|
|
void | combineOverlapSegments (const EventContext &ctx, std::vector< MuPatSegment * > &ch1, std::vector< MuPatSegment * > &ch2, SegColVec &stationSegments, StSet &stationsWithSegments, GarbageContainer &trash_bin) 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...
|
|
|
static bool | decodeList (const std::string &input, std::vector< std::string > &list) |
|
|
ServiceHandle< IMuonEDMHelperSvc > | m_edmHelperSvc |
|
PublicToolHandle< MuonEDMPrinterTool > | m_printer {this, "MuonPrinterTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"} |
|
ToolHandle< MuPatCandidateTool > | m_candidateTool {this, "MuPatCandidateTool", "Muon::MuPatCandidateTool/MuPatCandidateTool"} |
|
ToolHandle< IMuonTrackBuilder > | m_trackBTool {this, "TrackBuilderTool", "Muon::MooTrackBuilder/MooMuonTrackBuilder"} |
|
ToolHandle< Trk::ITrackAmbiguityProcessorTool > | m_ambiTool |
|
ToolHandle< MooTrackBuilder > | m_mooBTool {this, "MooBuilderTool", "Muon::MooTrackBuilder/MooMuonTrackBuilder"} |
|
ToolHandle< MooCandidateMatchingTool > | m_candidateMatchingTool |
|
ToolHandle< IMuonTrackRefiner > | m_trackRefineTool {this, "TrackRefinementTool", "Muon::MooTrackBuilder/MooMuonTrackBuilder"} |
|
ToolHandle< IMuonSegmentFittingTool > | m_segmentFitter |
|
ToolHandle< Muon::MuonTrackSelectorTool > | m_trackSelector |
|
ToolHandle< IMuonHoleRecoveryTool > | m_muonHoleRecoverTool |
|
ToolHandle< Trk::IExtendedTrackSummaryTool > | m_trackSummaryTool {this, "TrackSummaryTool", "MuonTrackSummaryTool"} |
|
std::vector< std::unique_ptr< const MuonTrackSteeringStrategy > > | m_strategies |
|
std::vector< std::string > | m_stringStrategies |
|
std::array< int, 3 > | m_segQCut {} |
| Required segment quality for seed, 2nd, and other segments. More...
|
|
bool | m_outputSingleStationTracks |
|
bool | m_combinedSLOverlaps |
|
bool | m_doSummary |
|
bool | m_useTightMatching |
|
bool | m_onlyMDTSeeding |
|
int | m_segThreshold |
|
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 |
|
Implementation of an IMuonTrackFinder.
For more details look at the mainpage of this package.
Definition at line 51 of file MuonTrackSteering.h.
◆ ChCit
◆ ChIt
◆ ChSet
◆ SegCol
◆ SegColIt
◆ SegColVec
◆ SegColVecCit
◆ SegColVecIt
◆ StCit
◆ StIt
◆ StoreGateSvc_t
◆ StSet
◆ TrkCollVec
◆ TrkVec
◆ MuonTrackSteering()
Muon::MuonTrackSteering::MuonTrackSteering |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
default AlgTool constructor
Definition at line 50 of file MuonTrackSteering.cxx.
52 declareInterface<IMuonTrackFinder>(
this);
◆ ~MuonTrackSteering()
virtual Muon::MuonTrackSteering::~MuonTrackSteering |
( |
| ) |
|
|
virtualdefault |
◆ combineOverlapSegments()
try to find small/large overlaps, insert segment into stationVec
Start with -1 as the first operation in the loop over the second set of chambers is the counter incrementation
Actually this should be always 1. What should it conceptionally reject? The angle between the combined segment and the segment from the first collection?
Definition at line 161 of file MuonTrackSteering.cxx.
167 if (ch1.empty() && ch2.empty())
return;
172 SegCol& stationVec = stationSegments[stIndex];
175 std::vector<bool> wasMatched2(ch2.size(),
false);
178 for (MuPatSegment* sit1 : ch1) {
180 int qualityLevel1 = ch1.size() > 5 ? 1 : 2;
181 if (sit1->quality < qualityLevel1) {
182 ATH_MSG_VERBOSE(
"resolveSLOverlaps::bad segment1 q: " << sit1->quality <<
" cut " << qualityLevel1 << std::endl
184 stationVec.push_back(sit1);
188 bool wasMatched1 =
false;
191 int qualityLevel2 = ch2.size() > 5 ? 1 : 2;
195 for (MuPatSegment* sit2 : ch2) {
198 if (sit2->quality < qualityLevel2) {
199 ATH_MSG_VERBOSE(
"resolveSLOverlaps::bad segment2: q " << sit2->quality <<
" cut " << qualityLevel2 << std::endl
203 if (sit1->quality < 2 && sit2->quality < 2) {
204 ATH_MSG_VERBOSE(
"resolveSLOverlaps:: combination of insufficient quality " << std::endl
205 <<
" q1 " << sit1->quality <<
" q2 "
211 <<
m_printer->print(*sit1->segment) << std::endl
215 ATH_MSG_VERBOSE(
" overlap combination rejected based on matching" << std::endl <<
m_printer->print(*sit2->segment));
221 std::unique_ptr<MuonSegment> newseg{
m_mooBTool->combineToSegment(ctx, *sit1, *sit2, emptyPhiHits)};
235 std::unique_ptr<MuPatSegment> segInfo =
m_candidateTool->createSegInfo(ctx, *newseg);
237 if (segInfo->quality < 2 || (segInfo->quality < sit1->quality || segInfo->quality < sit2->quality)) {
241 int shared_eta = 0, shared_phi = 0;
243 const MuPatSegment* const_sit1 = sit1;
244 const MuPatSegment* const_sit2 = sit2;
245 for (
const MuPatHitPtr& hit_ch1 : const_sit1->hitList()) {
246 for (
const MuPatHitPtr& hit_ch2 : const_sit2->hitList()) {
247 if (hit_ch1->info().id == hit_ch2->info().id) {
248 if (hit_ch1->info().measuresPhi)
256 if (sit1->etaHits().size() + sit2->etaHits().size() - shared_eta - segInfo->etaHits().size() > 1) {
257 ATH_MSG_VERBOSE(
"resolveSLOverlaps::more than one eta measurement removed, dropping track "
263 int phiHitDiff = sit1->phiHits().size() + sit2->phiHits().size() - shared_phi - segInfo->phiHits().size();
264 if (phiHitDiff > 1 || (sit1->phiHits().size() + sit2->phiHits().size() > 0 && segInfo->phiHits().empty())) {
265 ATH_MSG_VERBOSE(
"resolveSLOverlaps::more than one phi measurement removed, dropping track "
272 double cosPointingAngle = (newseg->globalPosition().x() * newseg->globalDirection().x() +
273 newseg->globalPosition().y() * newseg->globalDirection().y()) /
274 (newseg->globalPosition().perp() * newseg->globalDirection().perp());
275 if (cosPointingAngle < 0.995) {
276 ATH_MSG_VERBOSE(
"resolveSLOverlaps: rejected due to too large pointing angle " << std::endl
280 ATH_MSG_VERBOSE(
"created SL overlap segment: cos pointing " << cosPointingAngle << std::endl
285 wasMatched2[idx_ch2] =
true;
288 stationVec.push_back(segInfo.get());
289 trash_bin.push_back(std::move(newseg));
290 trash_bin.push_back(std::move(segInfo));
295 if (!wasMatched1) { stationVec.push_back(sit1); }
299 for (
unsigned int i = 0;
i < wasMatched2.size(); ++
i) {
300 if (!wasMatched2[
i]) { stationVec.push_back(ch2[
i]); }
304 if (!stationVec.empty()) { stationsWithSegments.insert(stIndex); }
307 std::stable_sort(stationVec.begin(), stationVec.end(), SortSegInfoByQuality());
◆ 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]
◆ decodeList()
bool Muon::MuonTrackSteering::decodeList |
( |
const std::string & |
input, |
|
|
std::vector< std::string > & |
list |
|
) |
| |
|
staticprivate |
Definition at line 812 of file MuonTrackSteering.cxx.
814 std::string::size_type begIdx = 0;
815 std::string::size_type endIdx = 0;
817 endIdx =
input.find(
',', begIdx);
818 std::string::size_type lstIdx = endIdx;
819 if (std::string::npos == endIdx) { lstIdx =
input.length(); }
820 std::string
item =
input.substr(begIdx, lstIdx - begIdx);
823 }
while (std::string::npos != endIdx);
◆ decodeStrategy()
Definition at line 719 of file MuonTrackSteering.cxx.
720 const std::string delims(
" \t[],;");
727 std::vector<std::string>
options;
731 typedef std::vector<std::string> ChamberGroup;
732 std::vector<ChamberGroup> sequence;
735 bool success =
false;
736 std::unique_ptr<const MuonTrackSteeringStrategy>
result;
741 std::string::size_type begIdx, endIdx;
742 begIdx =
strategy.find_first_not_of(delims);
743 if (std::string::npos != begIdx) {
744 endIdx =
strategy.find(
':', begIdx);
745 if (std::string::npos != endIdx) {
747 std::string nameopt =
strategy.substr(begIdx, endIdx - begIdx);
748 std::string::size_type bi = nameopt.find(
'[');
749 if (std::string::npos != bi) {
750 name = nameopt.substr(0, bi);
753 std::string::size_type ei = nameopt.find(
']', bi);
754 if (std::string::npos == ei) { ei = nameopt.length(); }
755 std::string inputOpt = nameopt.substr(bi + 1, ei - bi - 1);
763 ATH_MSG_DEBUG(
"From strat: " <<
strategy <<
" with success " << success <<
" end " << endIdx <<
" beg " << begIdx
764 <<
" Name: " <<
name <<
" options: ");
772 endIdx =
strategy.find(
';', begIdx);
773 std::string::size_type lstIdx = endIdx;
774 if (std::string::npos == endIdx) { lstIdx =
strategy.length(); }
775 std::string grpString =
strategy.substr(begIdx, lstIdx - begIdx);
778 sequence.push_back(
group);
780 }
while (std::string::npos != endIdx && success);
784 std::vector<std::vector<MuonStationIndex::ChIndex> >
path;
785 for (
unsigned int i = 0;
i < sequence.size(); ++
i) {
786 std::vector<MuonStationIndex::ChIndex> idxGrp;
787 for (
unsigned int j = 0; j < sequence[
i].size(); ++j) {
790 if (sequence[
i][j] !=
"all" && sequence[
i][j] !=
"ALL" && sequence[
i][j] !=
"All") {
799 idxGrp.push_back(
idx);
802 path.push_back(idxGrp);
◆ decodeStrategyVector()
StatusCode Muon::MuonTrackSteering::decodeStrategyVector |
( |
const std::vector< std::string > & |
strategy | ) |
|
|
private |
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extendWithLayer()
std::vector< std::unique_ptr< MuPatTrack > > Muon::MuonTrackSteering::extendWithLayer |
( |
const EventContext & |
ctx, |
|
|
MuPatTrack & |
candidate, |
|
|
const SegColVec & |
segcol, |
|
|
unsigned int |
nextlayer, |
|
|
const unsigned int |
endlayer, |
|
|
int |
cutLevel = 0 |
|
) |
| const |
|
private |
Definition at line 617 of file MuonTrackSteering.cxx.
620 std::vector<std::unique_ptr<MuPatTrack> >
result;
621 if (nextlayer < endlayer) {
622 for (; nextlayer != endlayer; nextlayer++) {
623 if (segs[nextlayer].
empty())
continue;
625 std::vector<std::unique_ptr<MuPatTrack> > nextTracks =
m_trackBTool->find(ctx, candidate, segs[nextlayer]);
626 if (!nextTracks.empty()) {
627 for (std::unique_ptr<MuPatTrack>& cit : nextTracks) {
628 std::vector<std::unique_ptr<MuPatTrack> > nextTracks2 =
630 if (!nextTracks2.empty()) {
631 result.insert(
result.end(), std::make_move_iterator(nextTracks2.begin()),
632 std::make_move_iterator(nextTracks2.end()));
634 result.push_back(std::move(cit));
◆ extractSegments()
Definition at line 103 of file MuonTrackSteering.cxx.
105 if (coll.empty())
return false;
117 if (chIndex < 0 || stIndex < 0) {
121 chambersWithSegments.insert(chIndex);
122 stationsWithSegments.insert(stIndex);
124 std::vector<MuPatSegment*>& segments = chamberSegments[chIndex];
125 segments.push_back(aSeg.get());
127 std::vector<MuPatSegment*>& segments2 = stationSegments[stIndex];
128 segments2.push_back(aSeg.get());
130 trash_bin.push_back(std::move(aSeg));
135 stationsWithSegments, trash_bin);
137 stationsWithSegments, trash_bin);
139 stationsWithSegments, trash_bin);
141 stationsWithSegments, trash_bin);
143 stationsWithSegments, trash_bin);
145 stationsWithSegments, trash_bin);
147 stationsWithSegments, trash_bin);
149 stationsWithSegments, trash_bin);
151 if (!segments.empty()) {
155 segs.insert(segs.end(), segments.begin(), segments.end());
◆ 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
◆ find() [1/2]
find tracks starting from a MuonSegmentCollection
- Parameters
-
coll | a reference to a MuonSegmentCollection |
- Returns
- a pointer to a vector of tracks, the ownership of the tracks is passed to the client calling the tool.
Definition at line 85 of file MuonTrackSteering.cxx.
86 GarbageContainer trash_bin{};
87 trash_bin.reserve(150);
89 std::unique_ptr<TrackCollection>
result = std::make_unique<TrackCollection>();
93 ChSet chambersWithSegments;
94 StSet stationsWithSegments;
96 if (
extractSegments(ctx, coll, chamberSegments, stationSegments, chambersWithSegments, stationsWithSegments, trash_bin)) {
◆ find() [2/2]
interface for tools to find track in the muon system starting from a vector of segments
- Parameters
-
segments | a vector of input segments |
- Returns
- a pointer to a vector of Trk::Track objects, zero if no tracks are found. The ownership of the tracks is passed to the client calling the tool.
◆ findTrackFromSeed()
Find tracks starting from a good segment.
- Parameters
-
seedSeg | the seeding MuonSegment pointer |
strat | the current track finding strategy |
layer | the current layer for the seed |
Loop over layers following the seed layer
Definition at line 539 of file MuonTrackSteering.cxx.
543 std::vector<std::unique_ptr<MuPatTrack> >
result;
545 const unsigned int endLayer = strat.getAll().size();
547 for (
unsigned int ilayer = 0; ilayer < strat.getAll().
size(); ++ilayer) {
548 if (ilayer ==
layer)
continue;
550 if (segs[ilayer].
empty())
continue;
552 std::vector<MuPatSegment*> matchedSegs;
553 bool tightCuts =
false;
556 double phiSeed = (seedSeg.segment)->globalPosition().phi();
557 double etaSeed = (seedSeg.segment)->globalPosition().eta();
560 for (
unsigned int j = 0; j < segs[ilayer].size(); j++) {
561 double phiSeg = (*segs[ilayer][j]).
segment->globalPosition().phi();
562 double etaSeg = (*segs[ilayer][j]).
segment->globalPosition().eta();
565 double deltaEta = std::abs(etaSeed - etaSeg);
568 if (
deltaR < 0.35) segsInCone++;
572 for (
unsigned int j = 0; j < segs[ilayer].size(); ++j) {
575 if (
isMatched) matchedSegs.push_back(segs[ilayer][j]);
577 if (matchedSegs.empty())
continue;
582 std::vector<std::unique_ptr<MuPatTrack> > tracks;
587 tracks =
m_trackBTool->find(ctx, seedSeg, segs[ilayer]);
588 if (!tracks.empty()) {
590 if (ilayer + 1 == strat.getAll().size()) {
591 result.insert(
result.end(), std::make_move_iterator(tracks.begin()), std::make_move_iterator(tracks.end()));
596 for (std::unique_ptr<MuPatTrack>& cit : tracks) {
597 unsigned int nextLayer = ilayer + 1;
598 if (nextLayer < strat.getAll().size()) {
599 int cutLevel = tightCuts ? 1 : 0;
600 std::vector<std::unique_ptr<MuPatTrack> > nextTracks =
602 if (!nextTracks.empty()) {
603 result.insert(
result.end(), std::make_move_iterator(nextTracks.begin()),
604 std::make_move_iterator(nextTracks.end()));
606 result.push_back(std::move(cit));
613 ATH_MSG_DEBUG(
"Constructed " <<
result.size() <<
" tracks with strategy " << strat.getName());
◆ findTracks()
actual find method
Definition at line 312 of file MuonTrackSteering.cxx.
317 std::vector<std::unique_ptr<MuPatTrack> > resultAll;
325 std::vector<std::unique_ptr<MuPatTrack> >
result;
332 std::set<MuonStationIndex::StIndex> stations;
334 for (
unsigned int lit = 0; lit <
strategy.getAll().
size(); ++lit) {
335 std::vector<MuonStationIndex::ChIndex> chambers =
strategy.getCh(lit);
340 for (
unsigned int chin = 0; chin < chambers.size(); ++chin) {
345 if (stations.count(stIndex))
continue;
346 SegCol& segments = stationSegments[stIndex];
352 for (
unsigned int iseg = 0; iseg < segments.size(); iseg++) {
353 double thetaSeg = std::abs((*segments[iseg]).
segment->globalPosition().theta());
356 if ((0.74159 > thetaSeg && thetaSeg > 0.51159) || (2.63 > thetaSeg && thetaSeg > 2.40))
357 mySegColVec[lit].push_back(segments[iseg]);
360 mySegColVec[lit].insert(mySegColVec[lit].
end(), segments.begin(), segments.end());
363 stations.insert(stIndex);
368 for (
unsigned int chin = 0; chin < chambers.size(); ++chin) {
369 SegCol& segments = chamberSegments[chambers[chin]];
371 mySegColVec[lit].insert(mySegColVec[lit].
end(), segments.begin(), segments.end());
378 for (
unsigned int lit = 0; lit < mySegColVec.size(); ++lit) {
383 bool hasSegments =
false;
384 for (
unsigned int lit = 0; lit < mySegColVec.size(); ++lit) {
385 if (!mySegColVec[lit].
empty()) {
392 for (
unsigned int lit = 0; lit < mySegColVec.size(); ++lit)
393 for (
unsigned int sit = 0; sit < mySegColVec[lit].size(); ++sit)
404 std::vector<unsigned int> seeds;
409 std::vector<std::pair<int, unsigned int> > occupancy;
410 for (
unsigned int lit = 0; lit < mySegColVec.size(); ++lit) {
411 occupancy.emplace_back(mySegColVec[lit].
size(), lit);
414 for (
unsigned int lit = 0; lit < occupancy.size(); ++lit) { seeds.push_back(occupancy[lit].
second); }
418 for (
unsigned int j = 0; j < mySegColVec.size(); ++j) seeds.push_back(j);
423 MuPatSegment* seedSeg =
nullptr;
425 for (
unsigned int lin = 0; lin < seeds.size(); ++lin) {
427 ATH_MSG_VERBOSE(
"New seed layer " << lin <<
" segments in layer " << mySegColVec[lin].
size());
429 for (
unsigned int sin = 0;
sin < mySegColVec[lin].size();
sin++) {
430 seedSeg = mySegColVec[lin].operator[](
sin);
431 if (!seedSeg)
continue;
434 if (cutSeeds && seedSeg->usedInFit)
continue;
438 (
m_segQCut[0] == -99 && !(seedSeg->segQuality && seedSeg->segQuality->isStrict())))
443 double phiSeed = seedSeg->segment->globalPosition().phi();
444 double etaSeed = seedSeg->segment->globalPosition().eta();
445 for (
unsigned int sin2 = 0; sin2 < mySegColVec[lin].size(); sin2++) {
446 if (
sin == sin2)
continue;
447 MuPatSegment* seg = mySegColVec[lin].operator[](sin2);
449 if (seg->quality <
m_segQCut[0] || (
m_segQCut[0] == -99 && !(seg->segQuality && seg->segQuality->isStrict())))
452 double phiSeg = seg->segment->globalPosition().phi();
453 double etaSeg = seg->segment->globalPosition().eta();
456 double deltaEta = std::abs(etaSeed - etaSeg);
459 if (
deltaR < 0.35) segsInCone++;
465 std::vector<std::unique_ptr<MuPatTrack> >
found =
469 if (!
found.empty()) {
470 result.insert(
result.end(), std::make_move_iterator(
found.begin()), std::make_move_iterator(
found.end()));
487 resultAll.insert(resultAll.end(), std::make_move_iterator(
result.begin()), std::make_move_iterator(
result.end()));
496 if (!emSegments.empty()) {
497 for (MuPatSegment* sit : emSegments) {
499 if (!sit->tracks().empty())
continue;
502 if (sit->quality < 2)
continue;
505 std::unique_ptr<Trk::Track> segmentTrack(
m_segmentFitter->fit(*sit->segment));
509 if (recoveredTrack) segmentTrack.swap(recoveredTrack);
516 std::unique_ptr<MuPatTrack>
can =
m_candidateTool->createCandidate(*sit, segmentTrack);
518 resultAll.push_back(std::move(
can));
527 if (!resultAll.empty()) {
533 std::unique_ptr<TrackCollection> finalTrack =
nullptr;
534 if (!resultAll.empty()) { finalTrack =
selectTracks(resultAll); }
◆ initialize()
StatusCode Muon::MuonTrackSteering::initialize |
( |
| ) |
|
|
overridevirtual |
initialize method, method taken from bass-class AlgTool
Definition at line 65 of file MuonTrackSteering.cxx.
82 return StatusCode::SUCCESS;
◆ 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::IMuonTrackFinder::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
access to tool interface
Definition at line 30 of file IMuonTrackFinder.h.
31 static const InterfaceID IID_IMuonTrackFinder(
"Muon::IMuonTrackFinder", 1, 0);
32 return IID_IMuonTrackFinder;
◆ 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.
◆ refineTracks()
void Muon::MuonTrackSteering::refineTracks |
( |
const EventContext & |
ctx, |
|
|
std::vector< std::unique_ptr< MuPatTrack >> & |
candidates |
|
) |
| const |
|
private |
◆ renounce()
◆ renounceArray()
◆ selectTracks()
std::unique_ptr< TrackCollection > Muon::MuonTrackSteering::selectTracks |
( |
std::vector< std::unique_ptr< MuPatTrack >> & |
candidates, |
|
|
bool |
takeOwnership = true |
|
) |
| const |
|
private |
◆ solveAmbiguities()
Resolve ambiguities among tracks for a single strategy This allows a strategy-specific ambiguity solving (with some options per strategy)
- Parameters
-
vector | of tracks that were found |
strat | the steering strategy |
Definition at line 671 of file MuonTrackSteering.cxx.
674 std::unique_ptr<TrackCollection> trkColl(
selectTracks(tracks,
false));
675 if (!trkColl || trkColl->empty()) {
return; }
677 std::unique_ptr<const TrackCollection> resolvedTracks(
m_ambiTool->process(trkColl.get()));
678 if (!resolvedTracks) {
return; }
680 ATH_MSG_DEBUG(
" resolved track candidates: old size " << trkColl->size() <<
" new size " << resolvedTracks->size());
682 std::vector<std::unique_ptr<MuPatTrack> >
::iterator pat = tracks.begin();
683 for (;
pat != tracks.end();) {
685 for (
const Trk::Track* rtrk : *resolvedTracks) {
686 if (&(*pat)->track() == rtrk) {
◆ 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_ambiTool
Initial value:{this, "AmbiguityTool",
"Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"}
Definition at line 135 of file MuonTrackSteering.h.
◆ m_candidateMatchingTool
Initial value:{this, "CandidateMatchingTool",
"Muon::MooCandidateMatchingTool/MooCandidateMatchingTool"}
Definition at line 138 of file MuonTrackSteering.h.
◆ m_candidateTool
◆ m_combinedSLOverlaps
bool Muon::MuonTrackSteering::m_combinedSLOverlaps |
|
private |
◆ m_detStore
◆ m_doSummary
bool Muon::MuonTrackSteering::m_doSummary |
|
private |
◆ m_edmHelperSvc
Initial value:{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface"}
Definition at line 130 of file MuonTrackSteering.h.
◆ m_evtStore
◆ m_mooBTool
◆ m_muonHoleRecoverTool
Initial value:{this, "HoleRecoveryTool",
"Muon::MuonChamberHoleRecoveryTool/MuonChamberHoleRecoveryTool"}
Definition at line 145 of file MuonTrackSteering.h.
◆ m_onlyMDTSeeding
bool Muon::MuonTrackSteering::m_onlyMDTSeeding |
|
private |
◆ m_outputSingleStationTracks
bool Muon::MuonTrackSteering::m_outputSingleStationTracks |
|
private |
◆ m_printer
◆ m_segmentFitter
Initial value:{this, "MuonSegmentFittingTool",
"Muon::MuonSegmentFittingTool/MuonSegmentFittingTool"}
Definition at line 141 of file MuonTrackSteering.h.
◆ m_segQCut
std::array<int, 3> Muon::MuonTrackSteering::m_segQCut {} |
|
private |
Required segment quality for seed, 2nd, and other segments.
Definition at line 152 of file MuonTrackSteering.h.
◆ m_segThreshold
int Muon::MuonTrackSteering::m_segThreshold |
|
private |
◆ m_strategies
◆ m_stringStrategies
std::vector<std::string> Muon::MuonTrackSteering::m_stringStrategies |
|
private |
◆ m_trackBTool
◆ m_trackRefineTool
◆ m_trackSelector
Initial value:{this, "MuonTrackSelector",
"Muon::MuonTrackSelectorTool/MuonTrackSelectorTool"}
Definition at line 143 of file MuonTrackSteering.h.
◆ m_trackSummaryTool
◆ m_useTightMatching
bool Muon::MuonTrackSteering::m_useTightMatching |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::array< int, 3 > m_segQCut
Required segment quality for seed, 2nd, and other segments.
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
std::vector< MuPatSegment * > SegCol
static ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
static bool decodeList(const std::string &input, std::vector< std::string > &list)
path
python interpreter configuration --------------------------------------—
void refineTracks(const EventContext &ctx, std::vector< std::unique_ptr< MuPatTrack >> &candidates) const
std::unique_ptr< const MuonTrackSteeringStrategy > decodeStrategy(const std::string &strategy) const
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
PublicToolHandle< MuonEDMPrinterTool > m_printer
bool isMatched(int matchInfo)
#define ATH_MSG_VERBOSE(x)
MuonSegment_v1 MuonSegment
Reference the current persistent version:
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
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.
bool m_outputSingleStationTracks
virtual void setOwner(IDataHandleHolder *o)=0
bool m_combinedSLOverlaps
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
std::vector< std::unique_ptr< MuPatTrack > > extendWithLayer(const EventContext &ctx, MuPatTrack &candidate, const SegColVec &segcol, unsigned int nextlayer, const unsigned int endlayer, int cutLevel=0) const
ToolHandle< Muon::MuonTrackSelectorTool > m_trackSelector
std::set< MuonStationIndex::StIndex > StSet
std::vector< std::unique_ptr< const MuonTrackSteeringStrategy > > m_strategies
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
std::set< MuonStationIndex::ChIndex > ChSet
std::vector< SegCol > SegColVec
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)
std::unique_ptr< TrackCollection > findTracks(const EventContext &ctx, SegColVec &chamberSegments, SegColVec &stationSegments) const
actual find method
ToolHandle< IMuonSegmentFittingTool > m_segmentFitter
bool extractSegments(const EventContext &ctx, const MuonSegmentCollection &coll, SegColVec &chamberSegments, SegColVec &stationSegments, ChSet &chambersWithSegments, StSet &stationsWithSegments, GarbageContainer &trash_bin) const
std::shared_ptr< MuPatHit > MuPatHitPtr
ToolHandle< IMuonTrackRefiner > m_trackRefineTool
ToolHandle< IMuonHoleRecoveryTool > m_muonHoleRecoverTool
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StatusCode decodeStrategyVector(const std::vector< std::string > &strategy)
ToolHandle< MooTrackBuilder > m_mooBTool
ToolHandle< MuPatCandidateTool > m_candidateTool
std::unique_ptr< TrackCollection > selectTracks(std::vector< std::unique_ptr< MuPatTrack >> &candidates, bool takeOwnership=true) const
ToolHandle< MooCandidateMatchingTool > m_candidateMatchingTool
void solveAmbiguities(std::vector< std::unique_ptr< MuPatTrack >> &tracks, const MuonTrackSteeringStrategy *strat=nullptr) const
Resolve ambiguities among tracks for a single strategy This allows a strategy-specific ambiguity solv...
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::vector< std::unique_ptr< MuPatTrack > > findTrackFromSeed(const EventContext &ctx, MuPatSegment &seedSeg, const MuonTrackSteeringStrategy &strat, const unsigned int layer, const SegColVec &segs) const
Find tracks starting from a good segment.
std::vector< std::string > m_stringStrategies
ChIndex
enum to classify the different chamber layers in the muon spectrometer
void combineOverlapSegments(const EventContext &ctx, std::vector< MuPatSegment * > &ch1, std::vector< MuPatSegment * > &ch2, SegColVec &stationSegments, StSet &stationsWithSegments, GarbageContainer &trash_bin) const
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
ToolHandle< IMuonTrackBuilder > m_trackBTool
std::vector< const Trk::PrepRawData * > PrepVec
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ToolHandle< Trk::ITrackAmbiguityProcessorTool > m_ambiTool
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)