ATLAS Offline Software
Loading...
Searching...
No Matches
HoleSearchValidation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6// HoleSearchValidation.cxx, (c) ATLAS Detector Software
8
10// Gaudi
11#include "GaudiKernel/MsgStream.h"
12// Trk
13#include "TrkTrack/Track.h"
14
16
18
25
26#include "CLHEP/Random/RandFlat.h"
27
28using namespace InDet;
29
30HoleSearchValidation::HoleSearchValidation(const std::string& name, ISvcLocator* pSvcLocator):
31 AthReentrantAlgorithm(name, pSvcLocator),
32 m_idHelper(nullptr),
33 m_pixelID(nullptr),
34 m_sctID(nullptr),
35 m_trtID(nullptr),
36 m_siliconID(nullptr),
37 m_holeSearchTool("InDet::InDetTrackHoleSearchTool"),
38 m_trackCollectionKey("Tracks"),
45 m_rndmGenSvc("AthRNGSvc", name),
46 m_randomEngineName("HoleSearchRnd")
47
48{
49 declareProperty("HoleSearchTool" , m_holeSearchTool);
50 declareProperty("TrackCollection" , m_trackCollectionKey, "Name of the reference track collection");
51
52 declareProperty("SaveNewTracksInSG" , m_saveNewTracksInSG , "Boolean: save tracks in SG");
53
54 // for (unsigned int part_i=0; part_i<Parts::kNParts; ++part_i) {
55 // m_removeParts[part_i]=false;
56 // }
57 declareProperty("RemovePIX0" , m_removeParts[Parts::kPix0] , "Remove hit(s) in PIXEL layer 0");
58 declareProperty("RemovePIX1" , m_removeParts[Parts::kPix1] , "Remove hit(s) in PIXEL layer 1");
59 declareProperty("RemovePIX2" , m_removeParts[Parts::kPix2] , "Remove hit(s) in PIXEL layer 2");
60
61 declareProperty("RemoveSCT0" , m_removeParts[Parts::kSct0] , "Remove hit(s) in SCT layer 0");
62 declareProperty("RemoveSCT1" , m_removeParts[Parts::kSct1] , "Remove hit(s) in SCT layer 1");
63 declareProperty("RemoveSCT2" , m_removeParts[Parts::kSct2] , "Remove hit(s) in SCT layer 2");
64 declareProperty("RemoveSCT3" , m_removeParts[Parts::kSct3] , "Remove hit(s) in SCT layer 3");
65
66 declareProperty("RemoveSCT4" , m_removeParts[Parts::kSct4] , "Remove hit(s) in SCT endcap layer 4");
67 declareProperty("RemoveSCT5" , m_removeParts[Parts::kSct5] , "Remove hit(s) in SCT endcap layer 5");
68 declareProperty("RemoveSCT6" , m_removeParts[Parts::kSct6] , "Remove hit(s) in SCT endcap layer 6");
69 declareProperty("RemoveSCT7" , m_removeParts[Parts::kSct7] , "Remove hit(s) in SCT endcap layer 7");
70 declareProperty("RemoveSCT8" , m_removeParts[Parts::kSct8] , "Remove hit(s) in SCT endcap layer 8");
71
72 declareProperty("RemoveSCTSide0" , m_removeParts[Parts::kSctSide0] , "Remove SCT hits on side 0");
73 declareProperty("RemoveSCTSide1" , m_removeParts[Parts::kSctSide1] , "Remove SCT hits on side 1");
74
75 declareProperty("RemoveOverlapHitsOnly" , m_removeOverlapHitsOnly, "Only remove overlap track hits");
76 declareProperty("IgnoreTrackEnds" , m_ignoreTrackEnds , "Ignore hits at the end of the track");
77
78 declareProperty("RandomRemovalMode" , m_randomRemovalMode , "Randomly remove track hits (overwrites the other flags!)");
79 declareProperty("MaximalHoles" , m_maxNumberOfHoles , "Number of maximal holes to be created");
80
82
83 // start with 10x10
84 m_trackStats = std::vector< std::vector< unsigned int> >(0, std::vector< unsigned int>(0));
85}
86
88
90 ATH_MSG_INFO( "HoleSearchValidation initialize()" ) ;
91
92 //ID Helper
93 StatusCode sc = detStore()->retrieve(m_idHelper, "AtlasID" );
94 if (sc.isFailure()) {
95 ATH_MSG_WARNING( "Could not get AtlasDetectorID !" ) ;
96 return StatusCode::SUCCESS;
97 }else{
98 ATH_MSG_DEBUG( "Found AtlasDetectorID" ) ;
99 }
100
101 sc = detStore()->retrieve(m_pixelID, "PixelID");
102 if (sc.isFailure()) {
103 ATH_MSG_WARNING( "Could not get Pixel ID helper !" ) ;
104 return StatusCode::SUCCESS;
105 }
106 ATH_MSG_DEBUG( "Initialized PixelIDHelper" ) ;
107
108 sc = detStore()->retrieve(m_sctID, "SCT_ID");
109 if (sc.isFailure()) {
110 ATH_MSG_WARNING( "Could not get SCT ID helper !" ) ;
111 return StatusCode::SUCCESS;
112 }
113 ATH_MSG_DEBUG( "Initialized SCTIDHelper" ) ;
114
115 sc = detStore()->retrieve(m_trtID, "TRT_ID");
116 if (sc.isFailure()) {
117 ATH_MSG_WARNING( "Could not get TRT ID helper !" ) ;
118 return StatusCode::SUCCESS;
119 }
120 ATH_MSG_DEBUG( "Initialized TRTIDHelper" ) ;
121
122 sc = detStore()->retrieve(m_siliconID, "SiliconID");
123 if (sc.isFailure()) {
124 ATH_MSG_WARNING( "Could not get Silicon ID helper !" ) ;
125 return StatusCode::SUCCESS;
126 }
127 ATH_MSG_DEBUG( "Initialized SiliconIDHelper" ) ;
128
129
130 // Get HoleSearchTool
131 sc = m_holeSearchTool.retrieve();
132 if (sc.isFailure()) {
133 ATH_MSG_FATAL( "Could not retrieve "<< m_holeSearchTool ) ;
134 return sc;
135 }
136
137 if ( m_rndmGenSvc.retrieve().isFailure() ){
138 ATH_MSG_FATAL( "Could not retrieve " << m_rndmGenSvc );
139 return StatusCode::FAILURE;
140 }
141
142 ATH_CHECK(m_trackCollectionKey.initialize());
144 m_trackCollectionOutputKey = m_trackCollectionKey.key() + "_removedHits";
146 }
147
148 return StatusCode::SUCCESS;
149}
150
151StatusCode HoleSearchValidation::execute(const EventContext& ctx) const {
152
153 ATHRNG::RNGWrapper* wrapper = m_rndmGenSvc->getEngine(this, m_randomEngineName);
154 wrapper->setSeed (this->name(), ctx);
155 CLHEP::HepRandomEngine* engine = wrapper->getEngine (ctx);
156
157 std::array<bool,Parts::kNParts> remove_parts{};
158 for (unsigned int part_i=0; part_i<Parts::kNParts; ++part_i) {
159 remove_parts[part_i]=( !m_randomRemovalMode ? m_removeParts[part_i] : false );
160 }
161 ATH_MSG_VERBOSE( "HoleSearchValidation execute() start" ) ;
162
163 std::unique_ptr<TrackCollection> newTrackCollection( m_saveNewTracksInSG ? std::make_unique<TrackCollection>() : nullptr );
164
165 // get track collection
167 if (!tracks.isValid()) {
168 ATH_MSG_ERROR("Missing input track collection " << m_trackCollectionKey.key());
169 return StatusCode::FAILURE;
170 }
171
172 // loop over tracks
173 TrackCollection::const_iterator trackIterator = tracks->begin();
174 for ( ; trackIterator < tracks->end(); ++trackIterator) {
175 if (!((*trackIterator))) {
176 ATH_MSG_WARNING( "TrackCollection " << m_trackCollectionKey.key() << "contains empty entries" ) ;
177 continue;
178 }
179
180 // get all TSOS
181 const Trk::Track& track = *(*trackIterator);
182 const Trk::TrackStates* tsos = track.trackStateOnSurfaces();
183 ATH_MSG_DEBUG( "Perform hole search on unmodified track (" << *trackIterator << ")"
184 << " which contains " << tsos->size() <<" track states" ) ;
185 // perform hole search
186 unsigned int oldHoles = doHoleSearch( *trackIterator );
187
188 auto vecTsos = std::make_unique<Trk::TrackStates>();
189
190 // loop over TSOS, copy TSOS and push into vector
192 Trk::TrackStates::const_iterator iTsosEnd = tsos->end();
193
194 unsigned int nRemoved = 0;
195
196 std::vector< unsigned int > pixelHitsPerLayer = std::vector< unsigned int>(3);
197 std::vector< unsigned int > sctHitsPerLayer = std::vector< unsigned int>(9);
198
199 // in case of removing the end hits we need to parse the track first once,
200 // variables will be call pl (for preloop)
201 int maxPixelLayerBarrel = -1;
202 int maxPixelLayerEndcap = -1;
203 int maxSctLayerBarrel = -1;
204 int maxSctLayerEndcap = -1;
205
207 ATH_MSG_VERBOSE( "Parsing track first to find end layers and maximal numbers" ) ;
208 for ( ; iTsos != iTsosEnd ; ++iTsos) {
209 //
210 Identifier plSurfaceID;
211 const Trk::MeasurementBase* plMesb = (*iTsos)->measurementOnTrack();
212 if (plMesb && plMesb->associatedSurface().associatedDetectorElement()){
213 plSurfaceID = plMesb->associatedSurface().associatedDetectorElement()->identify();
214 // to find out whether it is barrel / endcap
215 // check pixel / sct
216 if ( m_idHelper->is_pixel( plSurfaceID ) ) {
217 int plLayer = abs(m_pixelID->layer_disk( plSurfaceID ));
218 bool isBarrel = m_pixelID->is_barrel( plSurfaceID );
219 // set the maximal pixel layer: barrel / ec
220 if ( isBarrel )
221 maxPixelLayerBarrel = plLayer > maxPixelLayerBarrel ? plLayer : maxPixelLayerBarrel;
222 else
223 maxPixelLayerEndcap = plLayer > maxPixelLayerEndcap ? plLayer : maxPixelLayerEndcap;
224 } else if (m_idHelper->is_sct( plSurfaceID ) ) {
225 int plLayer = abs(m_sctID->layer_disk( plSurfaceID ));
226 bool isBarrel = m_sctID->is_barrel( plSurfaceID );
227 // set the maximal pixel layer: barrel / ec
228 if ( isBarrel )
229 maxSctLayerBarrel = plLayer > maxSctLayerBarrel ? plLayer : maxSctLayerBarrel;
230 else
231 maxSctLayerEndcap = plLayer > maxSctLayerEndcap ? plLayer : maxSctLayerEndcap;
232 }
233 }
234 }
235 // sct overrules pixels
236 maxPixelLayerBarrel = maxSctLayerBarrel > 0 ? -1 : maxPixelLayerBarrel;
237 maxPixelLayerEndcap = maxSctLayerEndcap > 0 ? -1 : maxPixelLayerEndcap;
238 // reset to start the main loop correctly
239 iTsos = tsos->begin();
240 }
241
242
243 for ( ; iTsos != iTsosEnd ; ++iTsos) {
244 if ((*iTsos)->type(Trk::TrackStateOnSurface::Measurement)) {
245
246 Identifier surfaceID;
247 const Trk::MeasurementBase* mesb = (*iTsos)->measurementOnTrack();
248
249 // also reset the identifiers
250 unsigned int randomHoles = 0;
252 // ---------------------------------------------------------------------------------------
253 randomHoles = (unsigned int)(m_maxNumberOfHoles*CLHEP::RandFlat::shoot(engine));
254 ATH_MSG_VERBOSE("Random mode chosen: will create " << randomHoles << " holes on the track.");
255
256 // max int pixel
257 unsigned int maxPixel = maxPixelLayerBarrel > maxPixelLayerEndcap
258 ? maxPixelLayerBarrel : maxPixelLayerEndcap;
259 // max int sct
260 unsigned int maxSct = maxSctLayerBarrel > maxSctLayerEndcap
261 ? maxSctLayerBarrel : maxSctLayerEndcap;
262 // -------------------------------------------------------------------
263 int maxHit = maxPixel + maxSct;
264 int holesTriggered = 0;
265 maxHit -= m_ignoreTrackEnds ? 1 : 0;
266 // make the switch
267 for (unsigned int ihole = 0; ihole < randomHoles && holesTriggered < int(randomHoles); ++ihole){
268 // throw the dices
269 unsigned int holeId = (unsigned int)(maxHit*CLHEP::RandFlat::shoot(engine));
270 ATH_MSG_VERBOSE( "Random mode : layer identifier " << holeId << " chosen." );
271 {
272 // now switch between --------
273 switch (holeId) {
274 case 0 : { remove_parts[Parts::kPix0] = true; ++holesTriggered; }; break;
275 case 1 : { remove_parts[Parts::kPix1] = true; ++holesTriggered; }; break;
276 case 2 : { remove_parts[Parts::kPix2] = true; ++holesTriggered; }; break;
277 case 3 : { remove_parts[Parts::kSct0] = true; ++holesTriggered; }; break;
278 case 4 : { remove_parts[Parts::kSct1] = true; ++holesTriggered; }; break;
279 case 5 : { remove_parts[Parts::kSct2] = true; ++holesTriggered; }; break;
280 case 6 : { remove_parts[Parts::kSct3] = true; ++holesTriggered; }; break;
281 case 7 : { remove_parts[Parts::kSct4] = true; ++holesTriggered; }; break;
282 case 8 : { remove_parts[Parts::kSct5] = true; ++holesTriggered; }; break;
283 case 9 : { remove_parts[Parts::kSct6] = true; ++holesTriggered; }; break;
284 case 10 : { remove_parts[Parts::kSct7] = true; ++holesTriggered; }; break;
285 case 11 : { remove_parts[Parts::kSct8] = true; ++holesTriggered; }; break;
286 default : break;
287 }
288 // make the side decision on the side
289 if (holeId > 2) {
290 double sideDecision = CLHEP::RandFlat::shoot(engine);
291 if ( sideDecision < 1./3. )
292 remove_parts[Parts::kSctSide0] = true;
293 else if ( sideDecision < 2./3. )
294 remove_parts[Parts::kSctSide1] = true;
295 else {
296 remove_parts[Parts::kSctSide0] = true;
297 remove_parts[Parts::kSctSide1] = true;
298 ++holesTriggered;
299 }
300 }
301 }
302 }
303 }
304
305 // hits, outliers
306 if (mesb != nullptr && mesb->associatedSurface().associatedDetectorElement() != nullptr) {
308 // the pixel case
309 if ( m_idHelper->is_pixel( surfaceID ) ) {
310 int layer = abs(m_pixelID->layer_disk( surfaceID ));
311 // check barrel / ec
312 bool isBarrel = m_pixelID->is_barrel( surfaceID );
313 // indicate how many pixel hits are per layer
314 pixelHitsPerLayer[layer]++;
315 ATH_MSG_VERBOSE( "Pixel hits on layer " << layer << " : " << pixelHitsPerLayer[layer] ) ;
316 // check for last layer
317 bool isLastLayer = (isBarrel && layer == maxPixelLayerBarrel) || (!isBarrel && layer == maxPixelLayerEndcap);
318 // only in the ignore track case
319 if (m_ignoreTrackEnds && isLastLayer){
320 ATH_MSG_VERBOSE( "This pixel hit is not removed, it is at the track end." ) ;
321 } else if ( !m_removeOverlapHitsOnly || pixelHitsPerLayer[layer] > 1) {
322 if ( !m_ignoreTrackEnds && layer == 0 && remove_parts[Parts::kPix0] ) {
323 ATH_MSG_DEBUG( "Removing PIXEL layer 0 hit" ) ;
324 printInfoTSoS( *iTsos );
325 nRemoved++;
326 continue;
327 } else if( layer == 1 && remove_parts[Parts::kPix1] ) {
328 ATH_MSG_DEBUG( "Removing PIXEL layer 1 hit" ) ;
329 printInfoTSoS( *iTsos );
330 nRemoved++;
331 continue;
332 } else if( layer == 2 && remove_parts[Parts::kPix2] ) {
333 ATH_MSG_DEBUG( "Removing PIXEL layer 2 hit" ) ;
334 printInfoTSoS( *iTsos );
335 nRemoved++;
336 continue;
337 }
338 }
339 } else if ( m_idHelper->is_sct( surfaceID ) ) {
340 int layer = abs(m_sctID->layer_disk( surfaceID ));
341 // check barrel / ec
342 bool isBarrel = m_sctID->is_barrel( surfaceID );
343 // counter for number of layers
344 sctHitsPerLayer[layer]++;
345 ATH_MSG_VERBOSE( "SCT hits on layer " << layer << " : " << sctHitsPerLayer[layer] ) ;
346 // steer the side to be removed
347 int side = m_sctID->side( surfaceID );
348 bool canRemoveSide = (side == 0) ? remove_parts[Parts::kSctSide0] : remove_parts[Parts::kSctSide1];
349 // check for last layer
350 bool isLastLayer = (isBarrel && layer == maxSctLayerBarrel) || (!isBarrel && layer == maxSctLayerEndcap);
351 // only in the ignore track case
352 if (m_ignoreTrackEnds && isLastLayer){
353 ATH_MSG_VERBOSE( "This SCT hit is not removed, it is at the track end." ) ;
354 } else if ( layer == 0 && remove_parts[Parts::kSct0] && canRemoveSide ) {
355 ATH_MSG_DEBUG( "Removing SCT layer 0 hit" ) ;
356 printInfoTSoS( *iTsos );
357 nRemoved++;
358 continue;
359 } else if ( layer == 1 && remove_parts[Parts::kSct1] && canRemoveSide ) {
360 ATH_MSG_DEBUG( "Removing SCT layer 1 hit" ) ;
361 printInfoTSoS( *iTsos );
362 nRemoved++;
363 continue;
364 } else if ( layer == 2 && remove_parts[Parts::kSct2] && canRemoveSide ) {
365 ATH_MSG_DEBUG( "Removing SCT layer 2 hit" ) ;
366 printInfoTSoS( *iTsos );
367 nRemoved++;
368 continue;
369 } else if ( layer == 3 && remove_parts[Parts::kSct3] && canRemoveSide ) {
370 ATH_MSG_DEBUG( "Removing SCT layer 3 hit" ) ;
371 printInfoTSoS( *iTsos );
372 nRemoved++;
373 continue;
374 } else if ( layer == 4 && remove_parts[Parts::kSct4] && canRemoveSide ) {
375 ATH_MSG_DEBUG( "Removing SCT endcap layer 4 hit" ) ;
376 printInfoTSoS( *iTsos );
377 nRemoved++;
378 continue;
379 } else if ( layer == 5 && remove_parts[Parts::kSct5] && canRemoveSide ) {
380 ATH_MSG_DEBUG( "Removing SCT endcap layer 5 hit" ) ;
381 printInfoTSoS( *iTsos );
382 nRemoved++;
383 continue;
384 } else if ( layer == 6 && remove_parts[Parts::kSct6] && canRemoveSide ) {
385 ATH_MSG_DEBUG( "Removing SCT endcap layer 6 hit" ) ;
386 printInfoTSoS( *iTsos );
387 nRemoved++;
388 continue;
389 } else if ( layer == 7 && remove_parts[Parts::kSct7] && canRemoveSide ) {
390 ATH_MSG_DEBUG( "Removing SCT endcap layer 7 hit" ) ;
391 printInfoTSoS( *iTsos );
392 nRemoved++;
393 continue;
394 } else if ( layer == 8 && remove_parts[Parts::kSct8] && canRemoveSide ) {
395 ATH_MSG_DEBUG( "Removing SCT endcap layer 8 hit" ) ;
396 printInfoTSoS( *iTsos );
397 nRemoved++;
398 continue;
399 }
400
401 } // end SCT hit
402 } // end have identifier
403 } // end TSoS is of type measurement
404
405 const Trk::TrackStateOnSurface* newTsos = new Trk::TrackStateOnSurface(**iTsos);
406 vecTsos->push_back(newTsos);
407 } // end loop over all TSoS
408
409 ATH_MSG_DEBUG( "Removed total of " << nRemoved << " TSoS on track." ) ;
410
411 Trk::Track* newTrack = new Trk::Track(track.info(), std::move(vecTsos), nullptr );
412 ATH_MSG_VERBOSE( "Perform hole search on new track:" ) ;
413 // perform hole search
414 unsigned int newHoles = doHoleSearch( newTrack );
415 unsigned int foundHoles = abs(static_cast<int>(newHoles) - static_cast<int>(oldHoles));
416
417 if ( foundHoles == nRemoved )
418 ATH_MSG_DEBUG( "== OK : "<< nRemoved <<" generated holes out of which all were found" ) ;
419 else
420 ATH_MSG_DEBUG( "== PROBLEM : "<< nRemoved <<" generated holes out of which "<< newHoles - oldHoles << " were found" ) ;
421
422 // fill track statistics
423 // first, check size of vectors
424 {
425 std::lock_guard<std::mutex> lock(m_trackStatsMutex);
426 while (m_trackStats.size() < nRemoved+1) {
427 m_trackStats.emplace_back(0 );
428 }
429 while (m_trackStats[nRemoved].size() < foundHoles+1) {
430 m_trackStats[nRemoved].push_back( 0 );
431 }
432 ATH_MSG_DEBUG( "m_trackStats.size()= " << m_trackStats.size() );
433 // // increase counter
434 m_trackStats[nRemoved][foundHoles]++;
435 }
436
437 // posibly save new track into container and SG
439 newTrackCollection->push_back( newTrack );
440 } else {
441 delete newTrack; // TSOS are owned by track (so no need to delete them manually)
442 }
443
444 } // end loop over all input tracks
445 ATH_MSG_DEBUG( "Finished looping over all input tracks" ) ;
446
449 if (newTrackCollection_handle.record( std::move(newTrackCollection) ).isFailure()){
450 ATH_MSG_ERROR("Failed to record output collection " << m_trackCollectionOutputKey.key());
451 return StatusCode::FAILURE;
452 }
453 }
454 return StatusCode::SUCCESS;
455}
456
458 ATH_MSG_INFO( "HoleSearchValidation finalize()" ) ;
459
460 ATH_MSG_INFO( "Printing statistics for hole search validation:" ) ;
461 ATH_MSG_INFO( " # removed hits | # tracks / found holes | ... " ) ;
462 for ( unsigned int nRemoved = 0; nRemoved < m_trackStats.size(); ++nRemoved) {
463 unsigned int nTracks = 0;
464 for ( unsigned int holes = 0; holes < m_trackStats[nRemoved].size(); ++holes) nTracks += m_trackStats[nRemoved][holes];
465 if ( nTracks == 0) continue;
466 ATH_MSG_INFO( "Removed " << nRemoved << " hits from track -- found: " ) ;
467 for ( unsigned int holes = 0; holes < m_trackStats[nRemoved].size(); ++holes) {
468 ATH_MSG_INFO( " -- " << 100.0 * m_trackStats[nRemoved][holes]/float(nTracks)
469 << "% of tracks with " << holes << " holes (" << m_trackStats[nRemoved][holes] << " / " << float(nTracks) << ")") ;
470 }
471 }
472
473 return StatusCode::SUCCESS;
474}
475
476unsigned int HoleSearchValidation::doHoleSearch( const Trk::Track* track) const
477{
478 ATH_MSG_VERBOSE( "start hole search for track ( " << track << ")" ) ;
479 unsigned int nHoles(0);
480
481 std::unique_ptr<const Trk::TrackStates> holesOnTrack
482 (m_holeSearchTool->getHolesOnTrack(*track, track->info().particleHypothesis()));
483 // loop over holes
484 if (!holesOnTrack) {
485 ATH_MSG_WARNING( "HoleSearchTool returned NULL !" ) ;
486 return nHoles;
487 } else {
488 nHoles = holesOnTrack->size();
489 ATH_MSG_DEBUG( "found " << nHoles << " holes on track." ) ;
490 for (Trk::TrackStates::const_iterator it=holesOnTrack->begin();
491 it!=holesOnTrack->end(); ++it) {
492 if (!(*it)) {
493 ATH_MSG_WARNING( "TrackStateOnSurface from hole search tool == Null" ) ;
494 continue;
495 }
496 ATH_MSG_DEBUG( "Found hole:" ) ;
497 printInfoTSoS( *it );
498 } // end loop on holes
499 }
500 return nHoles;
501}
502
503
505{
506
507 ATH_MSG_VERBOSE( "Position : " << tsos->trackParameters()->position()
508 << " with R = " << sqrt(pow(tsos->trackParameters()->position().x(),2)
509 +pow(tsos->trackParameters()->position().y(),2)) );
510 Identifier surfaceID;
511 const Trk::MeasurementBase* mesb = tsos->measurementOnTrack();
512 // hits, outliers
513 if (mesb != nullptr && mesb->associatedSurface().associatedDetectorElement() != nullptr) {
515 if ( m_siliconID->is_barrel( surfaceID ) ) {
516 ATH_MSG_VERBOSE( " -- Barrel:");
517 } else {
518 ATH_MSG_VERBOSE( " -- Endcap:");
519 }
520 if ( m_idHelper->is_sct( surfaceID ) ) {
521 ATH_MSG_VERBOSE( " -> SCT layer = " << m_sctID->layer_disk( surfaceID )
522 << " side = " << m_sctID->side( surfaceID ) );
523 //ATH_MSG_VERBOSE( m_sctID->show_to_string(surfaceID) ) ;
524
525 }
526 if ( m_idHelper->is_pixel( surfaceID ) ) {
527 ATH_MSG_VERBOSE( " -> PIXEL layer = " << m_pixelID->layer_disk( surfaceID ) );
528 //ATH_MSG_VERBOSE( m_pixelID->show_to_string(surfaceID) ) ;
529 }
530 }
531
532}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
static Double_t sc
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
This is an Identifier helper class for both the Pixel and SCT subdetectors.
This is an Identifier helper class for the TRT subdetector.
constexpr int pow(int base, int exp) noexcept
A wrapper class for event-slot-local random engines.
Definition RNGWrapper.h:56
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:169
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:134
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
SG::WriteHandleKey< TrackCollection > m_trackCollectionOutputKey
jobOption: name of the TrackCollection
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Random number generator.
StatusCode finalize()
standard Athena-Algorithm method
StatusCode initialize()
standard Athena-Algorithm method
std::string m_randomEngineName
Name of the random number stream.
HoleSearchValidation(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
SG::ReadHandleKey< TrackCollection > m_trackCollectionKey
jobOption: name of the TrackCollection
const AtlasDetectorID * m_idHelper
StatusCode execute(const EventContext &ctx) const
standard Athena-Algorithm method
bool m_saveNewTracksInSG
jobOption: save new tracks to SG ?
~HoleSearchValidation()
Default Destructor.
void printInfoTSoS(const Trk::TrackStateOnSurface *tsos) const
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
unsigned int doHoleSearch(const Trk::Track *track) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
This class is the pure abstract base class for all fittable tracking measurements.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
const Amg::Vector3D & position() const
Access method for the position.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
represents the track state (measurement, material, fit parameters and quality) at a surface.
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
virtual Identifier identify() const =0
Identifier.
Primary Vertex Finder.
DataVector< const Trk::TrackStateOnSurface > TrackStates