ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonSegmentOverlapRemovalTool Class Reference

tool to remove overlaps between segments More...

#include <MuonSegmentOverlapRemovalTool.h>

Inheritance diagram for Muon::MuonSegmentOverlapRemovalTool:
Collaboration diagram for Muon::MuonSegmentOverlapRemovalTool:

Public Types

typedef std::vector< MuonSegment * > SegVec

Public Member Functions

 MuonSegmentOverlapRemovalTool (const std::string &, const std::string &, const IInterface *)
 constructor
virtual ~MuonSegmentOverlapRemovalTool ()=default
 destructor
StatusCode initialize () override
 AlgTool initilize.
void removeDuplicates (Trk::SegmentCollection &segments) const override
 remove duplicates from a vector of segments.
std::unique_ptr< MuonSegmentCombinationremoveDuplicates (const MuonSegmentCombination &combi) const override
 remove duplicates from a MuonSegmentCombination.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 access to tool interface

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

SegVec removeDuplicates (MuonSegmentCombination::SegmentVec &segments) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvcm_edmHelperSvc
 EDM Helper tool.
PublicToolHandle< Muon::MuonEDMPrinterToolm_printer
 EDM printer tool.
Gaudi::Property< bool > m_removePartialOverlaps
 remove partial overlaps between segments
Gaudi::Property< double > m_overlapFractionCut
 cut on overlap fraction for segments
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

tool to remove overlaps between segments

Definition at line 25 of file MuonSegmentOverlapRemovalTool.h.

Member Typedef Documentation

◆ SegVec

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonSegmentOverlapRemovalTool()

Muon::MuonSegmentOverlapRemovalTool::MuonSegmentOverlapRemovalTool ( const std::string & ty,
const std::string & na,
const IInterface * pa )

constructor

Definition at line 14 of file MuonSegmentOverlapRemovalTool.cxx.

14 :
15 AthAlgTool(ty, na, pa) {
16 declareInterface<IMuonSegmentOverlapRemovalTool>(this);
17 }
AthAlgTool()
Default constructor:

◆ ~MuonSegmentOverlapRemovalTool()

virtual Muon::MuonSegmentOverlapRemovalTool::~MuonSegmentOverlapRemovalTool ( )
virtualdefault

destructor

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ initialize()

StatusCode Muon::MuonSegmentOverlapRemovalTool::initialize ( )
override

AlgTool initilize.

Definition at line 19 of file MuonSegmentOverlapRemovalTool.cxx.

19 {
20 ATH_CHECK(AlgTool::initialize());
21 ATH_CHECK(m_edmHelperSvc.retrieve());
22 ATH_CHECK(m_printer.retrieve());
23 ATH_CHECK(m_idHelperSvc.retrieve());
24 return StatusCode::SUCCESS;
25 }
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
EDM Helper tool.
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
EDM printer tool.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

const InterfaceID & Muon::IMuonSegmentOverlapRemovalTool::interfaceID ( )
inlinestaticinherited

access to tool interface

Definition at line 25 of file IMuonSegmentOverlapRemovalTool.h.

25 {
26 static const InterfaceID IID_IMuonSegmentOverlapRemovalTool("Muon::IMuonSegmentOverlapRemovalTool", 1, 0);
27 return IID_IMuonSegmentOverlapRemovalTool;
28 }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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.

◆ removeDuplicates() [1/3]

std::unique_ptr< MuonSegmentCombination > Muon::MuonSegmentOverlapRemovalTool::removeDuplicates ( const MuonSegmentCombination & combi) const
overridevirtual

remove duplicates from a MuonSegmentCombination.

The callers should take ownership of the new SegmentCombination. If the combination is unchanged the routine will return a nullptr

Implements Muon::IMuonSegmentOverlapRemovalTool.

Definition at line 173 of file MuonSegmentOverlapRemovalTool.cxx.

173 {
174 // store pointers to segments that should be kept
175 std::set<MuonSegment*> segmentsToBeKept;
176 unsigned int nsegments = 0; // total number of segments
177
178 unsigned int nstations = combi.numberOfStations();
179
180 ATH_MSG_DEBUG(" removing duplicate from MuonSegmentCombination with " << nstations << " stations");
181
182 // loop over segments, add them to the chamber layers
183 // loop over chambers in combi and extract segments
184 for (unsigned int i = 0; i < nstations; ++i) {
185 // loop over segments in station
187
188 // check if not empty
189 if (!stationSegs || stationSegs->empty()) continue;
190
191 nsegments += stationSegs->size();
192
193 // clean segments
194 SegVec cleanedSegments = removeDuplicates(*stationSegs);
195 segmentsToBeKept.insert(cleanedSegments.begin(), cleanedSegments.end());
196 }
197
198 // check whether all segments were kept
199 if (nsegments == segmentsToBeKept.size()) {
200 ATH_MSG_DEBUG(" no segments removed ");
201 return nullptr;
202 }
203
204 std::unique_ptr<MuonSegmentCombination> newCombi = std::make_unique<MuonSegmentCombination>();
205
206 // create a new combination removing segments that overlap
207 for (unsigned int i = 0; i < nstations; ++i) {
208 // loop over segments in station
210
211 // check if not empty
212 if (!stationSegs || stationSegs->empty()) continue;
213
214 std::unique_ptr<std::vector<std::unique_ptr<MuonSegment>>> segVec =
215 std::make_unique<std::vector<std::unique_ptr<MuonSegment>>>();
216 segVec->reserve(stationSegs->size());
217
218 // loop over segments and add them if they are in the keep set
219 for (const std::unique_ptr<MuonSegment>& seg : *stationSegs) {
220 if (!segmentsToBeKept.count(seg.get())) {
221 continue;
222 } else {
223 segVec->emplace_back(seg->clone());
224 }
225 }
226 // if not empty add segments
227 if (!segVec->empty()) newCombi->addSegments(std::move(segVec));
228 }
229
230 ATH_MSG_DEBUG(" removed " << nsegments - segmentsToBeKept.size() << " duplicates, new size " << segmentsToBeKept.size());
231
232 return newCombi;
233 }
#define ATH_MSG_DEBUG(x)
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
unsigned int numberOfStations() const
Number of stations with segment.
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
void removeDuplicates(Trk::SegmentCollection &segments) const override
remove duplicates from a vector of segments.

◆ removeDuplicates() [2/3]

MuonSegmentOverlapRemovalTool::SegVec Muon::MuonSegmentOverlapRemovalTool::removeDuplicates ( MuonSegmentCombination::SegmentVec & segments) const
private

Definition at line 237 of file MuonSegmentOverlapRemovalTool.cxx.

238 {
239 ATH_MSG_DEBUG(" working on segment vector of size " << segments.size());
240
241 CompareMuonSegmentKeys compareSegmentKeys{};
242
243 // create a vector with pairs of MuonSegmentKey and a pointer to the corresponding segment to resolve ambiguities
244 std::vector<std::pair<MuonSegmentKey, MuonSegment*>> goodSegments;
245 goodSegments.reserve(segments.size());
246
247 // loop over new segments, copy them into collection
248 for (const std::unique_ptr<MuonSegment>& seg : segments) {
249 // create segment key object
250 MuonSegmentKey sk(*seg);
251 Identifier chId = m_edmHelperSvc->chamberId(*seg);
252 bool isCsc = m_idHelperSvc->isCsc(chId);
253
254 // should this segment be inserted?
255 bool insertAsGood(true);
256
257 // loop over already accepted segments and compare the current segment with the good ones
258 for (std::pair<MuonSegmentKey, MuonSegment*>& good_seg : goodSegments) {
259 CompareMuonSegmentKeys::OverlapResult overlapResult = compareSegmentKeys(good_seg.first, sk);
260 if (overlapResult == CompareMuonSegmentKeys::Identical) {
261 // for now keep the one with the best chi2
262 const Trk::FitQuality* fq1 = good_seg.second->fitQuality();
263 const Trk::FitQuality* fq2 = seg->fitQuality();
264 double chi2good = fq1 ? fq1->chiSquared() : 1e10;
265 double chi2current = fq2 ? fq2->chiSquared() : 1e10;
266 // we should not insert this segment
267 if (chi2good > chi2current) {
268 ATH_MSG_VERBOSE(" replacing (chi2) " << m_printer->print(*good_seg.second) << std::endl
269 << " with " << m_printer->print(*seg));
270
271 // good segment of worse quality, replace it
272 good_seg.first = sk;
273 good_seg.second = seg.get();
274 } else {
275 ATH_MSG_VERBOSE(" discarding (chi2) " << m_printer->print(*seg));
276 }
277 insertAsGood = false;
278 break;
279 } else if (overlapResult == CompareMuonSegmentKeys::SuperSet) {
280 // good segment of better quality, keep it and discard current segment
281 ATH_MSG_VERBOSE(" discarding (subset) " << m_printer->print(*seg));
282 insertAsGood = false;
283 break;
284 } else if (overlapResult == CompareMuonSegmentKeys::SubSet) {
285 // good segment of worse quality, replace it
286 ATH_MSG_VERBOSE(" replacing (superset) " << m_printer->print(*good_seg.second) << std::endl
287 << " with " << m_printer->print(*seg));
288 good_seg.first = sk;
289 good_seg.second = seg.get();
290 insertAsGood = false;
291 break;
293 // keep CSC segments with partial overlap
294 if (isCsc) continue;
295
296 // partial overlap, for now keep the one most hits
297 if (compareSegmentKeys.segment1Size < compareSegmentKeys.segment2Size) {
298 ATH_MSG_VERBOSE(" replacing (mdt hits) " << m_printer->print(*good_seg.second) << std::endl
299 << " with " << m_printer->print(*seg));
300
301 // good segment of worse quality, replace it
302 good_seg.first = sk;
303 good_seg.second = seg.get();
304 } else if (compareSegmentKeys.segment1Size == compareSegmentKeys.segment2Size) {
305 // same size
306
307 // if the original entry has more trigger hits discard current segment
308 if (compareSegmentKeys.segment1SizeTrigger > compareSegmentKeys.segment2SizeTrigger) {
309 ATH_MSG_VERBOSE(" discarding (trigger hits) " << m_printer->print(*seg));
310 insertAsGood = false;
311 break;
312 } else if (compareSegmentKeys.segment1SizeTrigger < compareSegmentKeys.segment2SizeTrigger) {
313 // good segment of worse quality, replace it
314 ATH_MSG_VERBOSE(" replacing (trigger hits) " << m_printer->print(*good_seg.second) << std::endl
315 << " with " << m_printer->print(*seg));
316 good_seg.first = sk;
317 good_seg.second = seg.get();
318 insertAsGood = false;
319 break;
320 } else if (compareSegmentKeys.segment1SizeTrigger == compareSegmentKeys.segment2SizeTrigger) {
321 // for now look at the overlap fraction
322 }
323 // calculate the overlap fraction
324 double overlapFraction = (double)compareSegmentKeys.intersectionSize / (double)compareSegmentKeys.segment1Size;
325 if (overlapFraction > m_overlapFractionCut) {
326 ATH_MSG_VERBOSE(" discarding (overlap fraction) " << m_printer->print(*seg));
327 insertAsGood = false;
328 break;
329 }
330
331 continue;
332 } else {
333 ATH_MSG_VERBOSE(" discarding " << m_printer->print(*seg));
334 }
335 insertAsGood = false;
336 break;
337 } else if (overlapResult == CompareMuonSegmentKeys::NoOverlap) {
338 // no overlap, move on to next segment
339 continue;
340 } else if (overlapResult == CompareMuonSegmentKeys::Unknown) {
341 ATH_MSG_WARNING(" Got invalid return argument comparing segments: " << compareSegmentKeys.print(overlapResult));
342 continue;
343 }
344 }
345
346 // add segment if needed
347 if (insertAsGood) {
348 ATH_MSG_VERBOSE(" no overlap " << m_printer->print(*seg));
349 goodSegments.emplace_back(sk, seg.get());
350 }
351 }
352
353 SegVec cleanedSegments;
354 for (const std::pair<MuonSegmentKey, MuonSegment*>& good_seg : goodSegments) { cleanedSegments.push_back(good_seg.second); }
355 ATH_MSG_DEBUG(" Segments after removal " << cleanedSegments.size() << " total number of removed segments "
356 << segments.size() - cleanedSegments.size());
357
358 return cleanedSegments;
359 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Gaudi::Property< double > m_overlapFractionCut
cut on overlap fraction for segments
Gaudi::Property< bool > m_removePartialOverlaps
remove partial overlaps between segments
double chiSquared() const
returns the of the overall track fit
Definition FitQuality.h:56
OverlapResult
enum for the overlap result

◆ removeDuplicates() [3/3]

void Muon::MuonSegmentOverlapRemovalTool::removeDuplicates ( Trk::SegmentCollection & segments) const
overridevirtual

remove duplicates from a vector of segments.

The caller should take ownership of the segments

Implements Muon::IMuonSegmentOverlapRemovalTool.

Definition at line 27 of file MuonSegmentOverlapRemovalTool.cxx.

27 {
28 ATH_MSG_DEBUG(" working on segment vector of size " << segments.size());
29
30 CompareMuonSegmentKeys compareSegmentKeys{};
31
32 // create a vector with pairs of MuonSegmentKey and a pointer to the corresponding segment to resolve ambiguities
33 std::vector<std::pair<MuonSegmentKey, MuonSegment*>> goodSegments;
34 goodSegments.reserve(segments.size());
35 std::vector<MuonSegment*> segmentsToErase;
36
37 // loop over new segments, copy them into collection
38 for (Trk::Segment* tseg : segments) {
39 // create segment key object
40 MuonSegment* seg = dynamic_cast<MuonSegment*>(tseg);
41 if (!seg) {
42 ATH_MSG_WARNING("segment is not MuonSegment");
43 continue;
44 }
45 MuonSegmentKey sk{*seg};
46 Identifier chId = m_edmHelperSvc->chamberId(*seg);
47 bool isCsc = m_idHelperSvc->isCsc(chId);
48
49 // should this segment be inserted?
50 bool insertAsGood = true;
51
52 // loop over already accepted segments and compare the current segment with the good ones
53 for (std::pair<MuonSegmentKey, MuonSegment*>& good_seg : goodSegments) {
54 CompareMuonSegmentKeys::OverlapResult overlapResult = compareSegmentKeys(good_seg.first, sk);
55 if (overlapResult == CompareMuonSegmentKeys::Identical) {
56 // for now keep the one with the best chi2
57 const Trk::FitQuality* fq1 = good_seg.second->fitQuality();
58 const Trk::FitQuality* fq2 = seg->fitQuality();
59 double chi2good = fq1 ? fq1->chiSquared() : 1e10;
60 double chi2current = fq2 ? fq2->chiSquared() : 1e10;
61 // we should not insert this segment
62 if (chi2good > chi2current) {
63 ATH_MSG_VERBOSE(" replacing (chi2) " << m_printer->print(*good_seg.second) << std::endl
64 << " with " << m_printer->print(*seg));
65
66 // good segment of worse quality, replace it
67 segmentsToErase.push_back(good_seg.second);
68 good_seg.first = sk;
69 good_seg.second = seg;
70
71 } else {
72 ATH_MSG_VERBOSE(" discarding (chi2) " << m_printer->print(*seg));
73 segmentsToErase.push_back(seg);
74 }
75 insertAsGood = false;
76 break;
77 } else if (overlapResult == CompareMuonSegmentKeys::SuperSet) {
78 // good segment of better quality, keep it and discard current segment
79 ATH_MSG_VERBOSE(" discarding (subset) " << m_printer->print(*seg));
80 segmentsToErase.push_back(seg);
81 insertAsGood = false;
82 break;
83 } else if (overlapResult == CompareMuonSegmentKeys::SubSet) {
84 // good segment of worse quality, replace it
85 ATH_MSG_VERBOSE(" replacing (superset) " << m_printer->print(*good_seg.second) << std::endl
86 << " with " << m_printer->print(*seg));
87 segmentsToErase.push_back(good_seg.second);
88 good_seg.first = sk;
89 good_seg.second = seg;
90 insertAsGood = false;
91 break;
93 // keep CSC segments with partial overlap
94 if (isCsc) continue;
95
96 // partial overlap, for now keep the one most hits
97 if (compareSegmentKeys.segment1Size < compareSegmentKeys.segment2Size) {
98 ATH_MSG_VERBOSE(" replacing (mdt hits) " << m_printer->print(*good_seg.second) << std::endl
99 << " with " << m_printer->print(*seg));
100
101 // good segment of worse quality, replace it
102 segmentsToErase.push_back(good_seg.second);
103 good_seg.first = sk;
104 good_seg.second = seg;
105 insertAsGood = false;
106 break;
107 } else if (compareSegmentKeys.segment1Size == compareSegmentKeys.segment2Size) {
108 // same size
109
110 // if the original entry has more trigger hits discard current segment
111 if (compareSegmentKeys.segment1SizeTrigger > compareSegmentKeys.segment2SizeTrigger) {
112 ATH_MSG_VERBOSE(" discarding (trigger hits) " << m_printer->print(*seg));
113 segmentsToErase.push_back(seg);
114 insertAsGood = false;
115 break;
116 } else if (compareSegmentKeys.segment1SizeTrigger < compareSegmentKeys.segment2SizeTrigger) {
117 // good segment of worse quality, replace it
118 ATH_MSG_VERBOSE(" replacing (trigger hits) " << m_printer->print(*good_seg.second) << std::endl
119 << " with " << m_printer->print(*seg));
120 segmentsToErase.push_back(good_seg.second);
121 good_seg.first = sk;
122 good_seg.second = seg;
123 insertAsGood = false;
124 break;
125 } else if (compareSegmentKeys.segment1SizeTrigger == compareSegmentKeys.segment2SizeTrigger) {
126 // for now look at the overlap fraction
127 }
128 // calculate the overlap fraction
129 double overlapFraction = (double)compareSegmentKeys.intersectionSize / (double)compareSegmentKeys.segment1Size;
130 if (overlapFraction > m_overlapFractionCut) {
131 ATH_MSG_VERBOSE(" discarding (overlap fraction) " << m_printer->print(*seg));
132 segmentsToErase.push_back(seg);
133 insertAsGood = false;
134 break;
135 }
136
137 continue;
138 } else {
139 ATH_MSG_VERBOSE(" discarding " << m_printer->print(*seg));
140 segmentsToErase.push_back(seg);
141 }
142 insertAsGood = false;
143 break;
144 } else if (overlapResult == CompareMuonSegmentKeys::NoOverlap) {
145 // no overlap, move on to next segment
146 continue;
147 } else if (overlapResult == CompareMuonSegmentKeys::Unknown) {
148 ATH_MSG_WARNING(" Got invalid return argument comparing segments: " << compareSegmentKeys.print(overlapResult));
149 continue;
150 }
151 }
152
153 // add segment if needed
154 if (insertAsGood) {
155 ATH_MSG_VERBOSE(" no overlap " << m_printer->print(*seg));
156 goodSegments.emplace_back(std::move(sk), seg);
157 }
158 }
159
160 // erase rejected segments
161 for (MuonSegment* to_erase : segmentsToErase) {
162 for (Trk::SegmentCollection::iterator sit = segments.begin(); sit != segments.end(); ++sit) {
163 // remove bad segments from collection, then delete them
164 Trk::Segment* tseg = *sit;
165 if (to_erase == dynamic_cast<MuonSegment*>(tseg)) {
166 segments.erase(sit);
167 break;
168 }
169 }
170 }
171 }
MuonSegment_v1 MuonSegment
Reference the current persistent version:
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
size_type size() const noexcept
Returns the number of elements in the collection.
const FitQuality * fitQuality() const
return the FitQuality object, returns NULL if no FitQuality is defined

◆ 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< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_edmHelperSvc

ServiceHandle<Muon::IMuonEDMHelperSvc> Muon::MuonSegmentOverlapRemovalTool::m_edmHelperSvc
private
Initial value:
{
this,
"edmHelper",
"Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface",
}

EDM Helper tool.

Definition at line 57 of file MuonSegmentOverlapRemovalTool.h.

57 {
58 this,
59 "edmHelper",
60 "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
61 "Handle to the service providing the IMuonEDMHelperSvc interface",
62 };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonSegmentOverlapRemovalTool::m_idHelperSvc
private
Initial value:
{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}

Definition at line 52 of file MuonSegmentOverlapRemovalTool.h.

52 {
53 this,
54 "MuonIdHelperSvc",
55 "Muon::MuonIdHelperSvc/MuonIdHelperSvc",
56 };

◆ m_overlapFractionCut

Gaudi::Property<double> Muon::MuonSegmentOverlapRemovalTool::m_overlapFractionCut
private
Initial value:
{
this, "OverlapFractionCut", 0.8,
"Cut overlap fraction, if fraction is smaller than cut both segments are kept"}

cut on overlap fraction for segments

Definition at line 73 of file MuonSegmentOverlapRemovalTool.h.

73 {
74 this, "OverlapFractionCut", 0.8,
75 "Cut overlap fraction, if fraction is smaller than cut both segments are kept"};

◆ m_printer

PublicToolHandle<Muon::MuonEDMPrinterTool> Muon::MuonSegmentOverlapRemovalTool::m_printer
private
Initial value:
{
this,
"Printer",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}

EDM printer tool.

Definition at line 64 of file MuonSegmentOverlapRemovalTool.h.

64 {
65 this,
66 "Printer",
67 "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
68 };

◆ m_removePartialOverlaps

Gaudi::Property<bool> Muon::MuonSegmentOverlapRemovalTool::m_removePartialOverlaps
private
Initial value:
{
this, "RemovePartialOverlaps", true,
"removal partial overlaps between segments"}

remove partial overlaps between segments

Definition at line 70 of file MuonSegmentOverlapRemovalTool.h.

70 {
71 this, "RemovePartialOverlaps", true,
72 "removal partial overlaps between segments"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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