ATLAS Offline Software
SiSpacePointsSeedMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/EventContext.h"
7 
8 #include "Acts/Definitions/Units.hpp"
9 #include "Acts/MagneticField/MagneticFieldContext.hpp"
11 
15 
21 //for validation
22 #include "TrkTrack/Track.h"
25 #include "GaudiKernel/ITHistSvc.h"
27 
28 #include "TTree.h"
29 
30 #include <cmath>
31 
32 
33 namespace ActsTrk {
34 
35  SiSpacePointsSeedMaker::SiSpacePointsSeedMaker(const std::string &t, const std::string &n, const IInterface *p)
36  : base_class(t, n, p),
37  m_thistSvc("THistSvc", n)
38  {}
39 
41  {
42  ATH_MSG_DEBUG( "Initializing " << name() << "..." );
43 
44  ATH_MSG_DEBUG( "Properties Summary:" );
45  ATH_MSG_DEBUG( " " << m_pixel );
46  ATH_MSG_DEBUG( " " << m_strip );
47  ATH_MSG_DEBUG( " " << m_useOverlap );
48  ATH_MSG_DEBUG( " " << m_writeNtuple );
49  ATH_MSG_DEBUG( " " << m_fastTracking );
50 
51  if (not m_pixel and not m_strip) {
52  ATH_MSG_ERROR("Activate seeding on at least one between Pixel and Strip space point collections!");
53  return StatusCode::FAILURE;
54  }
55 
59 
60  ATH_CHECK( m_seedsToolPixel.retrieve(EnableTool{m_pixel}) );
61  ATH_CHECK( m_seedsToolStrip.retrieve(EnableTool{m_strip}) );
62 
64 
67 
70 
71  // Validation
72  if (m_writeNtuple)
73  ATH_CHECK( InitTree() );
74 
75  return StatusCode::SUCCESS;
76  }
77 
78  // ===================================================================== //
79 
82  {
83  ATH_CHECK( m_thistSvc.retrieve() );
84  std::string tree_name = std::string("SeedTree_") + name();
85  std::replace( tree_name.begin(), tree_name.end(), '.', '_' );
86 
87  m_outputTree = new TTree( tree_name.c_str() , "ActsSeedMakerValTool");
88 
89  m_outputTree->Branch("eventNumber", &m_eventNumber,"eventNumber/L");
90  m_outputTree->Branch("d0", &m_d0);
91  m_outputTree->Branch("z0", &m_z0);
92  m_outputTree->Branch("pt", &m_pt);
93  m_outputTree->Branch("eta", &m_eta);
94  m_outputTree->Branch("x1", &m_x1);
95  m_outputTree->Branch("x2", &m_x2);
96  m_outputTree->Branch("x3", &m_x3);
97  m_outputTree->Branch("y1", &m_y1);
98  m_outputTree->Branch("y2", &m_y2);
99  m_outputTree->Branch("y3", &m_y3);
100  m_outputTree->Branch("z1", &m_z1);
101  m_outputTree->Branch("z2", &m_z2);
102  m_outputTree->Branch("z3", &m_z3);
103  m_outputTree->Branch("r1", &m_r1);
104  m_outputTree->Branch("r2", &m_r2);
105  m_outputTree->Branch("r3", &m_r3);
106  m_outputTree->Branch("quality", &m_quality);
107  m_outputTree->Branch("seedType", &m_type);
108  m_outputTree->Branch("givesTrack", &m_givesTrack);
109  m_outputTree->Branch("dzdr_b", &m_dzdr_b);
110  m_outputTree->Branch("dzdr_t", &m_dzdr_t);
111  m_outputTree->Branch("track_pt", &m_trackPt);
112  m_outputTree->Branch("track_eta", &m_trackEta);
113 
114  std::string full_tree_name = "/" + m_treeFolder + "/" + tree_name;
115  ATH_CHECK( m_thistSvc->regTree( full_tree_name.c_str(), m_outputTree ) );
116 
117  return StatusCode::SUCCESS;
118  }
119 
120  void
122  const xAOD::SpacePoint* sp) const
123  {
124 
125  data.v_ActsSpacePointForSeed.emplace_back(sp);
126  data.ns++;
127  data.nsaz++;
128  }
129 
131  float * ATH_RESTRICT r)
132  {
133  const InDet::SiCluster *cl = static_cast<const InDet::SiCluster *>(sp->clusterList().first);
134  const InDetDD::SiDetectorElement *de = cl->detectorElement();
135  const Amg::Transform3D &Tp = de->surface().transform();
136  r[3] = static_cast<float>(Tp(0, 2));
137  r[4] = static_cast<float>(Tp(1, 2));
138  r[5] = static_cast<float>(Tp(2, 2));
139  }
140 
141 
143  const Trk::SpacePoint* sp,
144  std::span<float,15> r)
145  {
146  const InDet::SiCluster *c0 = static_cast<const InDet::SiCluster *>(sp->clusterList().first);
147  const InDet::SiCluster *c1 = static_cast<const InDet::SiCluster *>(sp->clusterList().second);
148  const InDetDD::SiDetectorElement *d0 = c0->detectorElement();
149  const InDetDD::SiDetectorElement *d1 = c1->detectorElement();
150 
151  Amg::Vector2D lc0 = c0->localPosition();
152  Amg::Vector2D lc1 = c1->localPosition();
153 
154  std::pair<Amg::Vector3D, Amg::Vector3D> e0 =
155  (d0->endsOfStrip(InDetDD::SiLocalPosition(lc0.y(), lc0.x(), 0.)));
156  std::pair<Amg::Vector3D, Amg::Vector3D> e1 =
157  (d1->endsOfStrip(InDetDD::SiLocalPosition(lc1.y(), lc1.x(), 0.)));
158 
159  Amg::Vector3D s0(.5 * (e0.first + e0.second));
160  Amg::Vector3D s1(.5 * (e1.first + e1.second));
161 
162  Amg::Vector3D b0(.5 * (e0.second - e0.first));
163  Amg::Vector3D b1(.5 * (e1.second - e1.first));
164  Amg::Vector3D d02(s0 - s1);
165 
166  // b0
167  r[3] = static_cast<float>(b0[0]);
168  r[4] = static_cast<float>(b0[1]);
169  r[5] = static_cast<float>(b0[2]);
170 
171  // b1
172  r[6] = static_cast<float>(b1[0]);
173  r[7] = static_cast<float>(b1[1]);
174  r[8] = static_cast<float>(b1[2]);
175 
176  // r0-r2
177  r[9] = static_cast<float>(d02[0]);
178  r[10] = static_cast<float>(d02[1]);
179  r[11] = static_cast<float>(d02[2]);
180 
181  // r0
182  r[12] = static_cast<float>(s0[0]) - data.xbeam[0];
183  r[13] = static_cast<float>(s0[1]) - data.ybeam[0];
184  r[14] = static_cast<float>(s0[2]) - data.zbeam[0];
185  }
186 
187  StatusCode
188  SiSpacePointsSeedMaker::retrievePixel(const EventContext& ctx,
190  const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const
191  {
192  // get the xAOD::SpacePointContainer and loop on entries to check which space point
193  // you want to use for seeding
194  ATH_MSG_DEBUG("Retrieving pixel space point collection " << m_actsSpacepointsPixel.key());
196  if (not inputSpacePointContainer.isValid()){
197  ATH_MSG_FATAL("xAOD::SpacePointContainer with key " << m_actsSpacepointsPixel.key() << " is not available...");
198  return StatusCode::FAILURE;
199  }
200  const xAOD::SpacePointContainer* inputSpacePointCollection = inputSpacePointContainer.cptr();
201  // TODO: here you need to write some lines to implement the
202  // check on the used PDRs in previous tracking passes
203  for (const xAOD::SpacePoint * sp : *inputSpacePointCollection) {
204  if (prd_to_track_map_cptr != nullptr and isUsed(sp, *prd_to_track_map_cptr)) continue;
205  newSpacePoint(data, sp);
206  }
207 
208  return StatusCode::SUCCESS;
209  }
210 
211  StatusCode
212  SiSpacePointsSeedMaker::retrievePixel(const EventContext& ctx,
214  const std::vector<IdentifierHash>& ids,
215  const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const
216  {
217  if (ids.empty()) return StatusCode::SUCCESS;
218 
219  ATH_MSG_DEBUG("Retrieving pixel space point collection " << m_actsSpacepointsPixel.key());
221  if (not inputSpacePointContainer.isValid()){
222  ATH_MSG_FATAL("xAOD::SpacePointContainer with key " << m_actsSpacepointsPixel.key() << " is not available...");
223  return StatusCode::FAILURE;
224  }
225  const xAOD::SpacePointContainer *inputCollection = inputSpacePointContainer.cptr();
226 
227  ATH_MSG_DEBUG("Retrieving SiDetectorElementCollection with key `" << m_pixelDetEleCollKey.key() << "`");
229  ATH_CHECK(detEleHandle.isValid());
230  const InDetDD::SiDetectorElementCollection* detElements = detEleHandle.cptr();
231 
233  accessor ( *inputCollection,
234  [] (const xAOD::SpacePoint& coll) -> IdentifierHash
235  { return coll.elementIdList()[0]; },
236  detElements->size());
237 
238  for (const IdentifierHash id : ids) {
239  if (not accessor.isIdentifierPresent(id)) {
240  continue;
241  }
242 
243  const auto& ranges = accessor.rangesForIdentifierDirect(id);
244  for (auto [firstElement, lastElement] : ranges) {
245  for (; firstElement != lastElement; ++firstElement) {
246  const xAOD::SpacePoint *sp = *firstElement;
247  if (prd_to_track_map_cptr != nullptr and isUsed(sp, *prd_to_track_map_cptr)) continue;
248  newSpacePoint(data, sp);
249  }
250  }
251  }
252 
253  return StatusCode::SUCCESS;
254  }
255 
256  StatusCode
257  SiSpacePointsSeedMaker::retrieveStrip(const EventContext& ctx,
259  const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const
260  {
261  // get the xAOD::SpacePointContainer and loop on entries to check which space point
262  // you want to use for seeding
263  ATH_MSG_DEBUG("Retrieving strip space point collection " << m_actsSpacepointsStrip.key());
265  if (!inputSpacePointContainer.isValid()){
266  ATH_MSG_FATAL("xAOD::SpacePointContainer with key " << m_actsSpacepointsStrip.key() << " is not available...");
267  return StatusCode::FAILURE;
268  }
269  const xAOD::SpacePointContainer* inputSpacePointCollection = inputSpacePointContainer.cptr();
270  // TODO: here you need to write some lines to implement the
271  // check on the used PDRs in previous tracking passes
272  for (const xAOD::SpacePoint * sp : *inputSpacePointCollection) {
273  if (prd_to_track_map_cptr != nullptr and isUsed(sp, *prd_to_track_map_cptr)) continue;
274  newSpacePoint(data, sp);
275  }
276 
277  return StatusCode::SUCCESS;
278  }
279 
280  StatusCode
281  SiSpacePointsSeedMaker::retrieveStrip(const EventContext& ctx,
283  const std::vector<IdentifierHash>& ids,
284  const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const
285 
286  {
287  if (ids.empty()) return StatusCode::SUCCESS;
288 
289  ATH_MSG_DEBUG("Retrieving strip space point collection " << m_actsSpacepointsStrip.key());
291  if (not inputSpacePointContainer.isValid()){
292  ATH_MSG_FATAL("xAOD::SpacePointContainer with key " << m_actsSpacepointsStrip.key() << " is not available...");
293  return StatusCode::FAILURE;
294  }
295  const xAOD::SpacePointContainer *inputCollection = inputSpacePointContainer.cptr();
296 
297  ATH_MSG_DEBUG("Retrieving SiDetectorElementCollection with key `" << m_stripDetEleCollKey.key() << "`");
299  ATH_CHECK(detEleHandle.isValid());
300  const InDetDD::SiDetectorElementCollection* detElements = detEleHandle.cptr();
301 
303  accessor ( *inputCollection,
304  [] (const xAOD::SpacePoint& coll) -> IdentifierHash
305  { return coll.elementIdList()[0]; },
306  detElements->size());
307 
308  for (const IdentifierHash id : ids) {
309  if (not accessor.isIdentifierPresent(id)) {
310  continue;
311  }
312 
313  const auto& ranges = accessor.rangesForIdentifierDirect(id);
314  for (auto [firstElement, lastElement] : ranges) {
315  for (; firstElement != lastElement; ++firstElement) {
316  const xAOD::SpacePoint *sp = *firstElement;
317  if (prd_to_track_map_cptr != nullptr and isUsed(sp, *prd_to_track_map_cptr)) continue;
318  newSpacePoint(data, sp);
319  }
320  }
321  }
322 
323  return StatusCode::SUCCESS;
324  }
325 
326 
327  StatusCode
330  const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const
331  {
332  // get the xAOD::SpacePointContainer and loop on entries to check which space point
333  // you want to use for seeding
334  ATH_MSG_DEBUG("Retrieving strip overlap space point collection " << m_actsSpacepointsOverlap.key());
336  if (!inputSpacePointContainer.isValid()){
337  ATH_MSG_FATAL("xAOD::SpacePointContainer with key " << m_actsSpacepointsOverlap.key() << " is not available...");
338  return StatusCode::FAILURE;
339  }
340  const xAOD::SpacePointContainer* inputSpacePointCollection = inputSpacePointContainer.cptr();
341  // TODO: here you need to write some lines to implement the
342  // check on the used PDRs in previous tracking passes
343  for (const xAOD::SpacePoint * sp : *inputSpacePointCollection) {
344  if (prd_to_track_map_cptr != nullptr and isUsed(sp, *prd_to_track_map_cptr)) continue;
345  newSpacePoint(data, sp);
346  }
347 
348  return StatusCode::SUCCESS;
349  }
350 
351  StatusCode
354  const std::vector<IdentifierHash>& ids,
355  const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const
356  {
357  if (ids.empty()) return StatusCode::SUCCESS;
358 
359  ATH_MSG_DEBUG("Retrieving strip overlap space point collection " << m_actsSpacepointsOverlap.key());
361  if (not inputSpacePointContainer.isValid()){
362  ATH_MSG_FATAL("xAOD::SpacePointContainer with key " << m_actsSpacepointsOverlap.key() << " is not available...");
363  return StatusCode::FAILURE;
364  }
365  const xAOD::SpacePointContainer *inputCollection = inputSpacePointContainer.cptr();
366 
367  ATH_MSG_DEBUG("Retrieving SiDetectorElementCollection with key `" << m_stripDetEleCollKey.key() << "`");
369  ATH_CHECK(detEleHandle.isValid());
370  const InDetDD::SiDetectorElementCollection* detElements = detEleHandle.cptr();
371 
373  accessor ( *inputCollection,
374  [] (const xAOD::SpacePoint& coll) -> IdentifierHash
375  { return coll.elementIdList()[0]; },
376  detElements->size());
377 
378  for (const IdentifierHash id : ids) {
379  if (not accessor.isIdentifierPresent(id)) {
380  continue;
381  }
382 
383  const auto& ranges = accessor.rangesForIdentifierDirect(id);
384  for (auto [firstElement, lastElement] : ranges) {
385  for (; firstElement != lastElement; ++firstElement) {
386  const xAOD::SpacePoint *sp = *firstElement;
387  if (prd_to_track_map_cptr != nullptr and isUsed(sp, *prd_to_track_map_cptr)) continue;
388  newSpacePoint(data, sp);
389  }
390  }
391  }
392 
393  return StatusCode::SUCCESS;
394  }
395 
396  void
399  {
401 
402  const Amg::Vector3D &cb = beamSpotHandle->beamPos();
403  double tx = std::tan(beamSpotHandle->beamTilt(0));
404  double ty = std::tan(beamSpotHandle->beamTilt(1));
405 
406  double phi = std::atan2(ty, tx);
407  double theta = std::acos(1. / std::sqrt(1. + tx * tx + ty * ty));
408  double sinTheta = std::sin(theta);
409  double cosTheta = std::cos(theta);
410  double sinPhi = std::sin(phi);
411  double cosPhi = std::cos(phi);
412 
413  data.xbeam[0] = static_cast<float>(cb.x());
414  data.xbeam[1] = static_cast<float>(cosTheta * cosPhi * cosPhi + sinPhi * sinPhi);
415  data.xbeam[2] = static_cast<float>(cosTheta * sinPhi * cosPhi - sinPhi * cosPhi);
416  data.xbeam[3] = -static_cast<float>(sinTheta * cosPhi);
417 
418  data.ybeam[0] = static_cast<float>(cb.y());
419  data.ybeam[1] = static_cast<float>(cosTheta * cosPhi * sinPhi - sinPhi * cosPhi);
420  data.ybeam[2] = static_cast<float>(cosTheta * sinPhi * sinPhi + cosPhi * cosPhi);
421  data.ybeam[3] = -static_cast<float>(sinTheta * sinPhi);
422 
423  data.zbeam[0] = static_cast<float>(cb.z());
424  data.zbeam[1] = static_cast<float>(sinTheta * cosPhi);
425  data.zbeam[2] = static_cast<float>(sinTheta * sinPhi);
426  data.zbeam[3] = static_cast<float>(cosTheta);
427 
428  // Acts Seed Tool requires both MagneticFieldContext and BeamSpotData
429  // we need to retrieve them both from StoreGate
430  // Read the b-field information
432  if ( not readHandle.isValid() ) {
433  throw std::runtime_error("Error while retrieving Atlas Field Cache Cond DB");
434  }
435  const AtlasFieldCacheCondObj* fieldCondObj{ *readHandle };
436  if (fieldCondObj == nullptr) {
437  throw std::runtime_error("Failed to retrieve AtlasFieldCacheCondObj with key " + m_fieldCondObjInputKey.key());
438  }
439 
440  // Get the magnetic field
441  // Using ACTS classes in order to be sure we are consistent
442  Acts::MagneticFieldContext magFieldContext(fieldCondObj);
443 
444  // Beam Spot Position
445  Acts::Vector3 beamPos( data.xbeam[0] * Acts::UnitConstants::mm,
446  data.ybeam[0] * Acts::UnitConstants::mm,
447  0. );
448 
449  // Magnetic Field
450  ATLASMagneticFieldWrapper magneticField;
451  Acts::MagneticFieldProvider::Cache magFieldCache = magneticField.makeCache( magFieldContext );
452  Acts::Vector3 bField = *magneticField.getField( beamPos,
453  magFieldCache );
454 
455  data.bField[0] = bField[0];
456  data.bField[1] = bField[1];
457  data.bField[2] = bField[2];
458 
459  data.K = 2. * s_toTesla / (300. * bField[2]);
460 
461  }
462 
463 
464  // ===================================================================== //
465  // Interface Methods
466  // ===================================================================== //
467 
468  void
469  SiSpacePointsSeedMaker::newRegion(const EventContext& ctx,
471  const std::vector<IdentifierHash>& vPixel,
472  const std::vector<IdentifierHash>& vStrip) const
473  {
474  ATH_MSG_DEBUG("Calling " << name() << "::newRegion");
475  if (!m_pixel && !m_strip)
476  return;
477 
479  data.i_ITkSpacePointForSeed = data.l_ITkSpacePointForSeed.begin();
480  data.v_ActsSpacePointForSeed.clear();
481 
483  data.i_ITkSeed = data.i_ITkSeeds.begin();
484 
485  buildBeamFrameWork(ctx, data);
486 
487  data.ns = 0;
488  data.nsaz = 0;
489  data.nsazv = 0;
490 
491  const Trk::PRDtoTrackMap *prd_to_track_map_cptr = nullptr;
492  if ( not m_prdToTrackMap.empty() ) {
494  if ( not prd_handle.isValid() ) {
495  ATH_MSG_ERROR("Failed to read PRD to track association map: " << m_prdToTrackMap.key());
496  }
497  prd_to_track_map_cptr = prd_handle.get();
498  }
499  if (prd_to_track_map_cptr != nullptr) {
500  ATH_MSG_DEBUG("Retrieved prd map with name " << m_prdToTrackMap.key());
501  }
502 
503  if ( not retrievePixel(ctx, data, vPixel, prd_to_track_map_cptr).isSuccess() ) {
504  ATH_MSG_ERROR("Error while retrieving Pixel space points with key " << m_actsSpacepointsPixel.key());
505  }
506 
507  if ( not retrieveStrip(ctx, data, vStrip, prd_to_track_map_cptr).isSuccess() ) {
508  ATH_MSG_ERROR("Error while retrieving Strip space points with key " << m_actsSpacepointsStrip.key());
509  }
510 
511  if ( m_useOverlap and not retrieveOverlap(ctx, data, prd_to_track_map_cptr).isSuccess() ) {
512  ATH_MSG_ERROR("Error while retrieving Strip Overlap space points with key " << m_actsSpacepointsOverlap.key());
513  }
514 
515  data.initialized = true;
516  }
517 
518 
519 
520  void
521  SiSpacePointsSeedMaker::newEvent(const EventContext& ctx,
523  int iteration) const
524  {
525  // Store iteration into data for use in other methods
526  data.iteration = iteration;
527  if (iteration < 0)
528  data.iteration = 0;
529 
530  // At the beginning of each iteration
531  // clearing list of space points to be used for seeding
533  data.i_ITkSpacePointForSeed = data.l_ITkSpacePointForSeed.begin();
534  data.v_ActsSpacePointForSeed.clear();
535 
536 
537  // clearing list of produced seeds
539  data.i_ITkSeed = data.i_ITkSeeds.begin();
540 
541  // First iteration:
542  // -- event-specific configuration, i.e. beamspot and magnetic field
543  // -- for default case: producing SSS
544  // -- for fast tracking: producing PPP
545  // Second iteration:
546  // -- for default case: producing PPP
547  // -- no additional iteration is foreseen for fast tracking case
548 
549  bool isPixel = (m_fastTracking or data.iteration == 1) and m_pixel;
550  bool isStrip = not m_fastTracking and data.iteration == 0 and m_strip;
551 
552  // The Acts Seed tool requires beamspot information for the space points already here
553  if (data.iteration == 0)
554  buildBeamFrameWork(ctx, data);
555 
556  // initialising the number of space points as well
557  data.ns = 0;
558  data.nsaz = 0;
559  data.nsazv = 0;
560 
561  // Retrieve the Trk::PRDtoTrackMap
562  const Trk::PRDtoTrackMap *prd_to_track_map_cptr = nullptr;
563  if ( not m_prdToTrackMap.empty() ) {
565  if ( not prd_handle.isValid() ) {
566  ATH_MSG_ERROR("Failed to read PRD to track association map: " << m_prdToTrackMap.key());
567  }
568  prd_to_track_map_cptr = prd_handle.get();
569  }
570 
571  // Only retrieving the collections needed for the seed formation,
572  // depending on the tool configuration and iteration
573 
574  // Retrieve Pixels
575  if (isPixel and not retrievePixel(ctx, data, prd_to_track_map_cptr).isSuccess() ) {
576  ATH_MSG_ERROR("Error while retrieving Pixel space points with key " << m_actsSpacepointsPixel.key());
577  }
578 
579  // Retrieve Strips
580  if (isStrip and not retrieveStrip(ctx, data, prd_to_track_map_cptr).isSuccess() ) {
581  ATH_MSG_ERROR("Error while retrieving Strip space points with key " << m_actsSpacepointsStrip.key());
582  }
583 
584  // Retrieve Overlaps, will go into Strip collection
585  if ((isStrip and m_useOverlap) and not retrieveOverlap(ctx, data, prd_to_track_map_cptr).isSuccess() ) {
586  ATH_MSG_ERROR("Error while retrieving Strip Overlap space points with key " << m_actsSpacepointsOverlap.key());
587  }
588 
589  data.initialized = true;
590  }
591 
592  void
593  SiSpacePointsSeedMaker::find3Sp(const EventContext& ctx,
595  const std::list<Trk::Vertex>& /*lv*/) const
596  {
597  // Fast return if no sps are collected
598  if ( data.v_ActsSpacePointForSeed.empty() )
599  return;
600 
601  // select the ACTS seeding tool to call, if for PPP or SSS
602  bool isPixel = (m_fastTracking or data.iteration == 1) and m_pixel;
603 
604  // this is use for a fast retrieval of the space points later
605  std::vector<ITk::SiSpacePointForSeed*> sp_storage;
606 
607  // We can now run the Acts Seeding
608  std::unique_ptr< ActsTrk::SeedContainer > seedPtrs = std::make_unique< ActsTrk::SeedContainer >();
609  //cppcheck-suppress unreadVariable
610  std::string combinationType = isPixel ? "PPP" : "SSS";
611  ATH_MSG_DEBUG("Running Seed Finding (" << combinationType << ") ...");
612 
613  // Beam Spot Position
614  Acts::Vector3 beamPos( data.xbeam[0] * Acts::UnitConstants::mm,
615  data.ybeam[0] * Acts::UnitConstants::mm,
616  data.zbeam[0] * Acts::UnitConstants::mm);
617 
618  Acts::Vector3 bField( data.bField[0], data.bField[1], data.bField[2] );
619 
620 
621  ActsTrk::SpacePointCollector backEnd(data.v_ActsSpacePointForSeed);
622 
623  Acts::SpacePointContainerConfig spConfig;
624  spConfig.useDetailedDoubleMeasurementInfo = not isPixel;
625  // Options
626  Acts::SpacePointContainerOptions spOptions;
627  spOptions.beamPos = Acts::Vector2(beamPos.x(), beamPos.y());
628 
629  Acts::SpacePointContainer<decltype(backEnd), Acts::detail::RefHolder> collect(spConfig, spOptions, backEnd);
630 
631 
632  StatusCode sc;
633 
634  if (isPixel)
635  sc = m_seedsToolPixel->createSeeds( ctx,
636  collect,
637  beamPos,
638  bField,
639  *seedPtrs.get() );
640  else {
641  sc = m_seedsToolStrip->createSeeds( ctx,
642  collect,
643  beamPos,
644  bField,
645  *seedPtrs.get() );
646  }
647 
648  if (sc == StatusCode::FAILURE) {
649  ATH_MSG_ERROR("Error during seed production (" << combinationType << ")");
650  return;
651  }
652 
653  ATH_MSG_DEBUG(" \\__ Created " << seedPtrs->size() << " seeds");
654  data.nsazv = seedPtrs->size();
655 
656  // Store seeds to data
657  // We need now to convert the output to Athena object once again (i.e. ITk::SiSpacePointForSeed)
658  // The seeds will be stored in data.i_ITkSeeds (both PPP and SSS seeds)
659  if (m_doSeedConversion) {
660 
661  if (isPixel) {
662  if (not convertPixelSeed(ctx, data, *seedPtrs.get())) {
663  ATH_MSG_FATAL("Error in pixel seed conversion");
664  return;
665  }
666  } else {
667  if (not convertStripSeed(ctx, data, *seedPtrs.get())) {
668  ATH_MSG_FATAL("Error in strip seed conversion");
669  return;
670  }
671  }
672  }
673 
674  data.i_ITkSeed = data.i_ITkSeeds.begin();
675  data.nprint = 1;
676  dump(data, msg(MSG::DEBUG));
677  }
678 
680  SiSpacePointsSeedMaker::next(const EventContext& /*ctx*/,
682  {
683 
684  do {
685  if (data.i_ITkSeed == data.i_ITkSeeds.end())
686  return nullptr;
687 
688  // iterate until we find a valid seed satisfying certain quality cuts in set3
689  } while (!(*data.i_ITkSeed++).set3(data.seedOutput, 1./(1000. * data.K)));
690 
692  return &data.seedOutput;
693 
694  }
695 
696  void
698  const Trk::Track* track,
699  int seedType,
700  long eventNumber) const
701  {
702  if (not m_writeNtuple) return;
703 
704  std::lock_guard<std::mutex> lock(m_mutex);
705 
706  if(track != nullptr) {
707  m_trackPt = (track->trackParameters()->front()->pT())/1000.f;
708  m_trackEta = std::abs(track->trackParameters()->front()->eta());
709  }
710  else {
711  m_trackPt = -1.;
712  m_trackEta = -1.;
713  }
714  m_d0 = seed->d0();
715  m_z0 = seed->zVertex();
716  m_eta = seed->eta();
717  m_x1 = seed->x1();
718  m_x2 = seed->x2();
719  m_x3 = seed->x3();
720  m_y1 = seed->y1();
721  m_y2 = seed->y2();
722  m_y3 = seed->y3();
723  m_z1 = seed->z1();
724  m_z2 = seed->z2();
725  m_z3 = seed->z3();
726  m_r1 = seed->r1();
727  m_r2 = seed->r2();
728  m_r3 = seed->r3();
729  m_type = seedType;
730  m_dzdr_b = seed->dzdr_b();
731  m_dzdr_t = seed->dzdr_t();
732  m_pt = seed->pt();
733  m_givesTrack = !(track == nullptr);
734  m_eventNumber = eventNumber;
735 
736  // Ok: protected by mutex.
737  TTree* outputTree ATLAS_THREAD_SAFE = m_outputTree;
738  outputTree->Fill();
739  }
740 
741  bool
743  { return m_writeNtuple; }
744 
745  MsgStream&
747  MsgStream& out) const
748  {
749  if (data.nprint)
750  return dumpEvent(data, out);
751  return dumpConditions(data, out);
752  }
753 
754 
756  // Dumps conditions information into the MsgStream
758 
760  {
761  std::string s2, s3, s4, s5;
762 
763  int n = 42-m_actsSpacepointsPixel.key().size();
764  s2.append(n,' ');
765  s2.append("|");
766  n = 42-m_actsSpacepointsStrip.key().size();
767  s3.append(n,' ');
768  s3.append("|");
769  n = 42-m_actsSpacepointsOverlap.key().size();
770  s4.append(n,' ');
771  s4.append("|");
772  n = 42-m_beamSpotKey.key().size();
773  s5.append(n,' ');
774  s5.append("|");
775 
776  out<<"|---------------------------------------------------------------------|"
777  <<endmsg;
778  out<<"| Pixel space points | "<<m_actsSpacepointsPixel.key() <<s2
779  <<endmsg;
780  out<<"| Strip space points | "<<m_actsSpacepointsStrip.key()<<s3
781  <<endmsg;
782  out<<"| Overlap space points | "<<m_actsSpacepointsOverlap.key()<<s4
783  <<endmsg;
784  out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5
785  <<endmsg;
786  out<<"| usePixel | "
787  <<std::setw(12)<<m_pixel
788  <<" |"<<endmsg;
789  out<<"| useStrip | "
790  <<std::setw(12)<<m_strip
791  <<" |"<<endmsg;
792  out<<"| useStripOverlap | "
793  <<std::setw(12)<<m_useOverlap
794  <<" |"<<endmsg;
795  out<<"|---------------------------------------------------------------------|"
796  <<endmsg;
797  out<<"| Beam X center | "
798  <<std::setw(12)<<std::setprecision(5)<<data.xbeam[0]
799  <<" |"<<endmsg;
800  out<<"| Beam Y center | "
801  <<std::setw(12)<<std::setprecision(5)<<data.ybeam[0]
802  <<" |"<<endmsg;
803  out<<"| Beam Z center | "
804  <<std::setw(12)<<std::setprecision(5)<<data.zbeam[0]
805  <<" |"<<endmsg;
806  out<<"| Beam X-axis direction | "
807  <<std::setw(12)<<std::setprecision(5)<<data.xbeam[1]
808  <<std::setw(12)<<std::setprecision(5)<<data.xbeam[2]
809  <<std::setw(12)<<std::setprecision(5)<<data.xbeam[3]
810  <<" |"<<endmsg;
811  out<<"| Beam Y-axis direction | "
812  <<std::setw(12)<<std::setprecision(5)<<data.ybeam[1]
813  <<std::setw(12)<<std::setprecision(5)<<data.ybeam[2]
814  <<std::setw(12)<<std::setprecision(5)<<data.ybeam[3]
815  <<" |"<<endmsg;
816  out<<"| Beam Z-axis direction | "
817  <<std::setw(12)<<std::setprecision(5)<<data.zbeam[1]
818  <<std::setw(12)<<std::setprecision(5)<<data.zbeam[2]
819  <<std::setw(12)<<std::setprecision(5)<<data.zbeam[3]
820  <<" |"<<endmsg;
821  out<<"|---------------------------------------------------------------------|"
822  <<endmsg;
823  return out;
824 
825  }
826 
828  // Dumps event information into the MsgStream
830 
832  MsgStream &out)
833  {
834  out<<"|---------------------------------------------------------------------|"
835  <<endmsg;
836  out<<"| ns | "
837  <<std::setw(12)<<data.ns
838  <<" |"<<endmsg;
839  out<<"| nsaz | "
840  <<std::setw(12)<<data.nsaz
841  <<" |"<<endmsg;
842  out<<"| seeds | "
843  <<std::setw(12)<< data.nsazv
844  <<" |"<<endmsg;
845  out<<"|---------------------------------------------------------------------|"
846  <<endmsg;
847  return out;
848 
849  }
850 
851  bool
852  SiSpacePointsSeedMaker::convertStripSeed(const EventContext& /*ctx*/,
854  const ActsTrk::SeedContainer& seedPtrs) const {
855  // If the read handle key for clusters is not empty, that means the xAOD->InDet Cluster link is available
856  // Else we can use xAOD->Trk Space Point link
857  // If none of these is available, we have a JO misconfguration!
858  static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("sctSpacePointLink");
859  static const SG::AuxElement::Accessor< ElementLink< ::SpacePointOverlapCollection > > overlaplinkAcc("stripOverlapSpacePointLink");
860  static const SG::AuxElement::Accessor< ElementLink< InDet::SCT_ClusterCollection > > stripLinkAcc("sctClusterLink");
861 
862  if (m_useClusters) {
863  data.v_StripSpacePointForSeed.clear();
864  }
865 
866  std::array<const Trk::SpacePoint*, 3> spacePoints {};
867  std::array<ITk::SiSpacePointForSeed*, 3> stripSpacePointsForSeeds {};
868 
869  for (const ActsTrk::Seed seedProxy : seedPtrs) {
870  const ActsTrk::Seed* seed = &seedProxy; // keep old-style seed as pointer
871  // Retrieve/make space points
872  if (not m_useClusters) {
873  // Get the space point from the element link
874  if (not linkAcc.isAvailable(*seed->sp()[0]) and
875  not overlaplinkAcc.isAvailable(*seed->sp()[0])) {
876  ATH_MSG_FATAL("no sctSpacePointLink/stripOverlapSpacePointLink for bottom sp!");
877  return false;
878  }
879  if (not linkAcc.isAvailable(*seed->sp()[1]) and
880  not overlaplinkAcc.isAvailable(*seed->sp()[1])) {
881  ATH_MSG_FATAL("no sctSpacePointLink/stripOverlapSpacePointLink for middle sp!");
882  return false;
883  }
884  if (not linkAcc.isAvailable(*seed->sp()[2]) and
885  not overlaplinkAcc.isAvailable(*seed->sp()[2])) {
886  ATH_MSG_FATAL("no sctSpacePointLink/stripOverlapSpacePointLink for top sp!");
887  return false;
888  }
889 
890  for (std::size_t nsp(0ul); nsp < 3ul; ++nsp) {
891  spacePoints[nsp] = linkAcc.isAvailable(*seed->sp()[nsp])
892  ? *linkAcc(*seed->sp()[nsp])
893  : *overlaplinkAcc(*seed->sp()[nsp]);
894  }
895  }
896  else {
897  // Get the clusters from the xAOD::Clusters and then make the space points
898  const auto& bottom_idx = seed->sp()[0]->measurements();
899  const auto& medium_idx = seed->sp()[1]->measurements();
900  const auto& top_idx = seed->sp()[2]->measurements();
901 
902  std::array<const xAOD::StripCluster*, 6> strip_cluster {
903  reinterpret_cast<const xAOD::StripCluster*>(bottom_idx[0]),
904  reinterpret_cast<const xAOD::StripCluster*>(bottom_idx[1]),
905  reinterpret_cast<const xAOD::StripCluster*>(medium_idx[0]),
906  reinterpret_cast<const xAOD::StripCluster*>(medium_idx[1]),
907  reinterpret_cast<const xAOD::StripCluster*>(top_idx[0]),
908  reinterpret_cast<const xAOD::StripCluster*>(top_idx[1])
909  };
910 
911  if (not stripLinkAcc.isAvailable(*strip_cluster[0]) or
912  not stripLinkAcc.isAvailable(*strip_cluster[1])){
913  ATH_MSG_FATAL("no sctClusterLink for clusters associated to bottom sp!");
914  return false;
915  }
916  if (not stripLinkAcc.isAvailable(*strip_cluster[2]) or
917  not stripLinkAcc.isAvailable(*strip_cluster[3])){
918  ATH_MSG_FATAL("no sctClusterLink for clusters associated to middle sp!");
919  return false;
920  }
921  if (not stripLinkAcc.isAvailable(*strip_cluster[4]) or
922  not stripLinkAcc.isAvailable(*strip_cluster[5])){
923  ATH_MSG_FATAL("no sctClusterLink for clusters associated to top sp!");
924  return false;
925  }
926 
927  std::pair<std::size_t, std::size_t> key_b = std::make_pair(strip_cluster[0]->index(), strip_cluster[1]->index());
928  std::pair<std::size_t, std::size_t> key_m = std::make_pair(strip_cluster[2]->index(), strip_cluster[3]->index());
929  std::pair<std::size_t, std::size_t> key_t = std::make_pair(strip_cluster[4]->index(), strip_cluster[5]->index());
930 
931  std::unique_ptr<InDet::SCT_SpacePoint>& ptr_b = data.v_StripSpacePointForSeed[key_b];
932  if (!ptr_b) {
933  ptr_b = std::make_unique<InDet::SCT_SpacePoint>(std::make_pair<IdentifierHash, IdentifierHash>(strip_cluster[0]->identifierHash(), strip_cluster[1]->identifierHash()),
934  Amg::Vector3D(seed->sp()[0]->x(), seed->sp()[0]->y(), seed->sp()[0]->z()),
935  std::make_pair<const Trk::PrepRawData*, const Trk::PrepRawData*>(*(stripLinkAcc(*strip_cluster[0])), *(stripLinkAcc(*strip_cluster[1]))));
936  }
937  std::unique_ptr<InDet::SCT_SpacePoint>& ptr_m = data.v_StripSpacePointForSeed[key_m];
938  if (!ptr_m) {
939  ptr_m = std::make_unique<InDet::SCT_SpacePoint>(std::make_pair<IdentifierHash, IdentifierHash>(strip_cluster[2]->identifierHash(), strip_cluster[3]->identifierHash()),
940  Amg::Vector3D(seed->sp()[1]->x(), seed->sp()[1]->y(), seed->sp()[1]->z()),
941  std::make_pair<const Trk::PrepRawData*, const Trk::PrepRawData*>(*(stripLinkAcc(*strip_cluster[2])), *(stripLinkAcc(*strip_cluster[3]))));
942  }
943  std::unique_ptr<InDet::SCT_SpacePoint>& ptr_t = data.v_StripSpacePointForSeed[key_t];
944  if (!ptr_t) {
945  ptr_t = std::make_unique<InDet::SCT_SpacePoint>(std::make_pair<IdentifierHash, IdentifierHash>(strip_cluster[4]->identifierHash(), strip_cluster[5]->identifierHash()),
946  Amg::Vector3D(seed->sp()[2]->x(), seed->sp()[2]->y(), seed->sp()[2]->z()),
947  std::make_pair<const Trk::PrepRawData*, const Trk::PrepRawData*>(*(stripLinkAcc(*strip_cluster[4])), *(stripLinkAcc(*strip_cluster[5]))));
948  }
949 
950  spacePoints = {
951  data.v_StripSpacePointForSeed[key_b].get(),
952  data.v_StripSpacePointForSeed[key_m].get(),
953  data.v_StripSpacePointForSeed[key_t].get()
954  };
955 
956  }
957 
958  for (unsigned int index = 0; index<3; index++) {
959  std::array<float, 15> r;
960  r[0] = seed->sp()[index]->x();
961  r[1] = seed->sp()[index]->y();
962  r[2] = seed->sp()[index]->z();
964  stripSpacePointsForSeeds[index] = new ITk::SiSpacePointForSeed(spacePoints[index], r);
965  stripSpacePointsForSeeds[index]->setQuality(-seed->seedQuality());
966  }
967 
968  data.i_ITkSeeds.emplace_back(stripSpacePointsForSeeds[0], stripSpacePointsForSeeds[1],
969  stripSpacePointsForSeeds[2], seed->z());
970  data.i_ITkSeeds.back().setQuality(-seed->seedQuality());
971  }
972 
973  return true;
974  }
975 
976  bool
977  SiSpacePointsSeedMaker::convertPixelSeed(const EventContext& /*ctx*/,
979  const ActsTrk::SeedContainer& seedPtrs) const {
980  // If the read handle key for clusters is not empty, that means the xAOD->InDet Cluster link is available
981  // Else we can use xAOD->Trk Space Point link
982  // If none of these is available, we have a JO misconfguration!
983  static const SG::AuxElement::Accessor< ElementLink< InDet::PixelClusterCollection > > pixelLinkAcc("pixelClusterLink");
984  static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("pixelSpacePointLink");
985 
986  if (m_useClusters) {
987  data.v_PixelSpacePointForSeed.clear();
988  }
989 
990  data.v_PixelSiSpacePointForSeed.clear();
991  data.v_PixelSiSpacePointForSeed.reserve(data.ns);
992  std::unordered_map<std::size_t, std::size_t> bridge_idx_sispacepoints;
993 
994  std::array<const Trk::SpacePoint*, 3> spacePoints {nullptr, nullptr, nullptr};
995  std::array<ITk::SiSpacePointForSeed*, 3> pixelSpacePointsForSeeds {nullptr, nullptr, nullptr};
996 
997  for (const ActsTrk::Seed seedProxy : seedPtrs) {
998  const ActsTrk::Seed* seed = &seedProxy; // keep old-style seed as pointer
999  std::array<std::size_t, 3> indexes {
1000  seed->sp()[0]->index(),
1001  seed->sp()[1]->index(),
1002  seed->sp()[2]->index()
1003  };
1004 
1005  const auto [bottom_idx, medium_idx, top_idx] = indexes;
1006  std::size_t max_index = std::max(bottom_idx, std::max(medium_idx, top_idx));
1007  if (data.v_PixelSpacePointForSeed.size() < max_index + 1) {
1008  data.v_PixelSpacePointForSeed.resize( max_index + 1 );
1009  }
1010 
1011  // Retrieve/make the space points!
1012  if (not m_useClusters) {
1013  // Get the Space Point from the element link
1014  if (not linkAcc.isAvailable(*seed->sp()[0])){
1015  ATH_MSG_FATAL("no pixelSpacePointLink for bottom sp!");
1016  return false;
1017  }
1018  if (not linkAcc.isAvailable(*seed->sp()[1])){
1019  ATH_MSG_FATAL("no pixelSpacePointLink for middle sp!");
1020  return false;
1021  }
1022  if (not linkAcc.isAvailable(*seed->sp()[2])){
1023  ATH_MSG_FATAL("no pixelSpacePointLink for top sp!");
1024  return false;
1025  }
1026 
1027  spacePoints = {
1028  *linkAcc(*seed->sp()[0]),
1029  *linkAcc(*seed->sp()[1]),
1030  *linkAcc(*seed->sp()[2])
1031  };
1032  }
1033  else {
1034  // Get the clusters from the xAOD::Clusters and then make the space points
1035  const xAOD::PixelCluster* bottom_cluster = reinterpret_cast<const xAOD::PixelCluster*>(seed->sp()[0]->measurements()[0]);
1036  const xAOD::PixelCluster* medium_cluster = reinterpret_cast<const xAOD::PixelCluster*>(seed->sp()[1]->measurements()[0]);
1037  const xAOD::PixelCluster* top_cluster = reinterpret_cast<const xAOD::PixelCluster*>(seed->sp()[2]->measurements()[0]);
1038 
1039  if (not pixelLinkAcc.isAvailable(*bottom_cluster)) {
1040  ATH_MSG_FATAL("no pixelClusterLink for cluster associated to bottom sp!");
1041  return false;
1042  }
1043  if (not pixelLinkAcc.isAvailable(*medium_cluster)) {
1044  ATH_MSG_FATAL("no pixelClusterLink for cluster associated to middle sp!");
1045  return false;
1046  }
1047  if (not pixelLinkAcc.isAvailable(*top_cluster)) {
1048  ATH_MSG_FATAL("no pixelClusterLink for cluster associated to top sp!");
1049  return false;
1050  }
1051 
1052  if (not data.v_PixelSpacePointForSeed[bottom_idx])
1053  data.v_PixelSpacePointForSeed[bottom_idx] = std::make_unique<InDet::PixelSpacePoint>(bottom_cluster->identifierHash(), *(pixelLinkAcc(*bottom_cluster)));
1054  if (not data.v_PixelSpacePointForSeed[medium_idx])
1055  data.v_PixelSpacePointForSeed[medium_idx] = std::make_unique<InDet::PixelSpacePoint>(medium_cluster->identifierHash(), *(pixelLinkAcc(*medium_cluster)));
1056  if (not data.v_PixelSpacePointForSeed[top_idx])
1057  data.v_PixelSpacePointForSeed[top_idx] = std::make_unique<InDet::PixelSpacePoint>(top_cluster->identifierHash(), *(pixelLinkAcc(*top_cluster)));
1058 
1059  spacePoints = {
1060  data.v_PixelSpacePointForSeed[bottom_idx].get(),
1061  data.v_PixelSpacePointForSeed[medium_idx].get(),
1062  data.v_PixelSpacePointForSeed[top_idx].get()
1063  };
1064 
1065  }
1066 
1067  for (int index = 0; index<3; ++index) {
1068  std::size_t sp_idx = indexes[index];
1069 
1070  // Try add an element.
1071  // If already there just return the old value
1072  // If not present, we add a new element to it
1073  auto [itr, outcome] = bridge_idx_sispacepoints.try_emplace(sp_idx, data.v_PixelSiSpacePointForSeed.size());
1074  std::size_t mapped_idx = itr->second;
1075  // We added a new element
1076  if (outcome) {
1077  std::array<float, 15> r;
1078  r[0] = seed->sp()[index]->x();
1079  r[1] = seed->sp()[index]->y();
1080  r[2] = seed->sp()[index]->z();
1081  pixInform(spacePoints[index], r.data());
1082  data.v_PixelSiSpacePointForSeed.emplace_back( spacePoints[index], r );
1083 
1084  }
1085  data.v_PixelSiSpacePointForSeed[mapped_idx].setQuality(-seed->seedQuality());
1086  pixelSpacePointsForSeeds[index] = &data.v_PixelSiSpacePointForSeed[mapped_idx];
1087  }
1088 
1089  data.i_ITkSeeds.emplace_back(pixelSpacePointsForSeeds[0],
1090  pixelSpacePointsForSeeds[1],
1091  pixelSpacePointsForSeeds[2],
1092  seed->z());
1093  data.i_ITkSeeds.back().setQuality(-seed->seedQuality());
1094  }
1095 
1096  return true;
1097  }
1098 
1099 }
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
ActsTrk::SiSpacePointsSeedMaker::initialize
virtual StatusCode initialize() override
Definition: SiSpacePointsSeedMaker.cxx:40
SiSpacePointsSeedMakerEventData.h
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:310
ActsTrk::SpacePointCollector
Definition: SpacePointCollector.h:20
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
beamspotman.r
def r
Definition: beamspotman.py:672
xAOD::UncalibratedMeasurement_v1::identifierHash
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
trigbs_pickEvents.ranges
ranges
Definition: trigbs_pickEvents.py:60
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ActsTrk::SiSpacePointsSeedMaker::m_seedsToolPixel
ToolHandle< ActsTrk::ISeedingTool > m_seedsToolPixel
Definition: SiSpacePointsSeedMaker.h:199
ActsTrk::SiSpacePointsSeedMaker::newSpacePoint
void newSpacePoint(InDet::SiSpacePointsSeedMakerEventData &data, const xAOD::SpacePoint *sp) const
Definition: SiSpacePointsSeedMaker.cxx:121
ActsTrk::SiSpacePointsSeedMaker::m_useOverlap
Gaudi::Property< bool > m_useOverlap
Definition: SiSpacePointsSeedMaker.h:219
ActsTrk::SeedContainer
Definition: SeedContainer.h:18
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ActsTrk::SiSpacePointsSeedMaker::pixInform
static void pixInform(const Trk::SpacePoint *sp, float *r)
ATLASMagneticFieldWrapper
Definition: ATLASMagneticFieldWrapper.h:15
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
TrackParameters.h
ActsTrk::SiSpacePointsSeedMaker::next
virtual const InDet::SiSpacePointsSeed * next(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data) const override
Definition: SiSpacePointsSeedMaker.cxx:680
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ContainerAccessor
Definition: ContainerAccessor.h:25
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:27
SG::ReadCondHandle
Definition: ReadCondHandle.h:40
InDet::SiSpacePointsSeedMakerEventData
Definition: SiSpacePointsSeedMakerEventData.h:49
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
xAOD::SpacePoint_v1::elementIdList
const std::vector< DetectorIDHashType > & elementIdList() const
Returns the IdentifierHash of the spacepoint (corresponds to the detector element IdentifierHash)
Definition: SpacePoint_v1.cxx:14
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
ActsTrk::SiSpacePointsSeedMaker::m_mutex
std::mutex m_mutex
Definition: SiSpacePointsSeedMaker.h:228
InDet::SiSpacePointsSeedMakerEventData::clearPoolList
static void clearPoolList(std::list< T, SG::ArenaPoolSTLAllocator< T >> &poolList)
Definition: SiSpacePointsSeedMakerEventData.h:219
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
ActsTrk::SiSpacePointsSeedMaker::m_doSeedConversion
Gaudi::Property< bool > m_doSeedConversion
Definition: SiSpacePointsSeedMaker.h:221
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
SiSpacePointsSeedMaker.h
ITkSiSpacePointForSeed.h
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
ActsTrk::SiSpacePointsSeedMaker::m_writeNtuple
Gaudi::Property< bool > m_writeNtuple
Definition: SiSpacePointsSeedMaker.h:226
extractSporadic.c1
c1
Definition: extractSporadic.py:133
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:70
InDetDD::SolidStateDetectorElementBase::surface
Trk::Surface & surface()
Element Surface.
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
ActsTrk::SiSpacePointsSeedMaker::m_outputTree
TTree * m_outputTree
Definition: SiSpacePointsSeedMaker.h:231
ATLASMagneticFieldWrapper.h
dq_defect_virtual_defect_validation.d1
d1
Definition: dq_defect_virtual_defect_validation.py:79
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
ActsTrk::SiSpacePointsSeedMaker::m_actsSpacepointsStrip
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsStrip
Definition: SiSpacePointsSeedMaker.h:205
ReadCellNoiseFromCoolCompare.s4
s4
Definition: ReadCellNoiseFromCoolCompare.py:381
python.RatesEmulationExample.lock
lock
Definition: RatesEmulationExample.py:148
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ActsTrk::SiSpacePointsSeedMaker::convertPixelSeed
bool convertPixelSeed(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const ActsTrk::SeedContainer &seedPtrs) const
Definition: SiSpacePointsSeedMaker.cxx:977
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
ActsTrk::SiSpacePointsSeedMaker::m_pixel
Gaudi::Property< bool > m_pixel
Definition: SiSpacePointsSeedMaker.h:217
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
ActsTrk::SiSpacePointsSeedMaker::newRegion
virtual void newRegion(const EventContext &, InDet::SiSpacePointsSeedMakerEventData &, const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &) const override
Definition: SiSpacePointsSeedMaker.cxx:469
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ATLASMagneticFieldWrapper::makeCache
MagneticFieldProvider::Cache makeCache(const Acts::MagneticFieldContext &mctx) const override
Definition: ATLASMagneticFieldWrapper.h:34
ActsTrk::SiSpacePointsSeedMaker::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: SiSpacePointsSeedMaker.h:208
ATH_RESTRICT
#define ATH_RESTRICT
Definition: restrict.h:31
ActsTrk::SiSpacePointsSeedMaker::m_strip
Gaudi::Property< bool > m_strip
Definition: SiSpacePointsSeedMaker.h:218
Track.h
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
ActsTrk::SiSpacePointsSeedMaker::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: SiSpacePointsSeedMaker.h:202
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
hotSpotInTAG.c0
c0
Definition: hotSpotInTAG.py:191
ActsTrk::SiSpacePointsSeedMaker::newEvent
virtual void newEvent(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, int iteration=-1) const override
Definition: SiSpacePointsSeedMaker.cxx:521
ActsTrk::SiSpacePointsSeedMaker::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Definition: SiSpacePointsSeedMaker.h:209
SCT_ClusterCollection.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ActsTrk::SiSpacePointsSeedMaker::retrieveStrip
StatusCode retrieveStrip(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const Trk::PRDtoTrackMap *prd_to_track_map_cptr) const
Definition: SiSpacePointsSeedMaker.cxx:257
InDet::SiSpacePointsSeed
Definition: SiSpacePointsSeed.h:30
ActsTrk::SiSpacePointsSeedMaker::m_fastTracking
Gaudi::Property< bool > m_fastTracking
Definition: SiSpacePointsSeedMaker.h:220
beamspotman.n
n
Definition: beamspotman.py:727
PixelSpacePoint.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ActsTrk::SiSpacePointsSeedMaker::m_seedsToolStrip
ToolHandle< ActsTrk::ISeedingTool > m_seedsToolStrip
Definition: SiSpacePointsSeedMaker.h:200
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
ActsTrk::SiSpacePointsSeedMaker::find3Sp
virtual void find3Sp(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const std::list< Trk::Vertex > &lv) const override
Definition: SiSpacePointsSeedMaker.cxx:593
ActsTrk::SiSpacePointsSeedMaker::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: SiSpacePointsSeedMaker.h:230
AtlasFieldCache.h
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
ActsTrk::SiSpacePointsSeedMaker::buildBeamFrameWork
void buildBeamFrameWork(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data) const
Definition: SiSpacePointsSeedMaker.cxx:397
xAOD::StripCluster_v1
Definition: StripCluster_v1.h:17
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:140
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
detail::ul
unsigned long ul
Definition: PrimitiveHelpers.h:47
SCT_SpacePoint.h
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
PixelClusterCollection.h
F600IntegrationConfig.spacePoints
spacePoints
Definition: F600IntegrationConfig.py:122
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ActsTrk::SiSpacePointsSeedMaker::m_actsSpacepointsPixel
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsPixel
Definition: SiSpacePointsSeedMaker.h:204
ActsTrk::SiSpacePointsSeedMaker::m_useClusters
Gaudi::Property< bool > m_useClusters
Definition: SiSpacePointsSeedMaker.h:222
ActsTrk::SiSpacePointsSeedMaker::retrieveOverlap
StatusCode retrieveOverlap(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const Trk::PRDtoTrackMap *prd_to_track_map_cptr) const
Definition: SiSpacePointsSeedMaker.cxx:328
ActsTrk::SiSpacePointsSeedMaker::dumpConditions
MsgStream & dumpConditions(InDet::SiSpacePointsSeedMakerEventData &data, MsgStream &out) const
Definition: SiSpacePointsSeedMaker.cxx:759
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
ReadCellNoiseFromCoolCompare.s3
s3
Definition: ReadCellNoiseFromCoolCompare.py:380
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
SiCluster.h
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SiDetectorElement.h
xAOD::JetAttributeAccessor::accessor
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
Definition: JetAccessorMap.h:26
ActsTrk::SiSpacePointsSeedMaker::InitTree
StatusCode InitTree()
Definition: SiSpacePointsSeedMaker.cxx:81
DeMoScan.index
string index
Definition: DeMoScan.py:362
xAOD::PixelCluster_v1
Definition: PixelCluster_v1.h:17
xAOD::SpacePointContainer
SpacePointContainer_v1 SpacePointContainer
Define the version of the space point container.
Definition: Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/SpacePointContainer.h:14
ATLASMagneticFieldWrapper::getField
Acts::Result< Acts::Vector3 > getField(const Acts::Vector3 &position, Acts::MagneticFieldProvider::Cache &gcache) const override
Definition: ATLASMagneticFieldWrapper.h:39
ActsTrk::Seed
Definition: SeedContainer.h:94
DEBUG
#define DEBUG
Definition: page_access.h:11
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
ActsTrk::SiSpacePointsSeedMaker::getWriteNtupleBoolProperty
virtual bool getWriteNtupleBoolProperty() const override
Definition: SiSpacePointsSeedMaker.cxx:742
ActsTrk::SiSpacePointsSeedMaker::isUsed
bool isUsed(const Trk::SpacePoint *, const Trk::PRDtoTrackMap &prd_to_track_map) const
Definition: SiSpacePointsSeedMaker.h:267
Trig::FeatureAccessImpl::collect
void collect(const HLT::TriggerElement *te, std::vector< Trig::Feature< T > > &data, const std::string &label, unsigned int condition, const std::string &teName, const HLT::TrigNavStructure *navstructure)
actual feature acceess implementation It has (thanks to the ClassTraits) functionality to flatten con...
Definition: FeatureCollectAthena.h:299
ActsTrk::SiSpacePointsSeedMaker::m_stripDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
Definition: SiSpacePointsSeedMaker.h:214
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MdtCalibInput.h:31
ActsTrk::SiSpacePointsSeedMaker::dump
virtual MsgStream & dump(InDet::SiSpacePointsSeedMakerEventData &data, MsgStream &out) const override
Definition: SiSpacePointsSeedMaker.cxx:746
ActsTrk::SiSpacePointsSeedMaker::SiSpacePointsSeedMaker
SiSpacePointsSeedMaker(const std::string &t, const std::string &n, const IInterface *p)
Definition: SiSpacePointsSeedMaker.cxx:35
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
ActsTrk::SiSpacePointsSeedMaker::stripInform
static void stripInform(InDet::SiSpacePointsSeedMakerEventData &data, const Trk::SpacePoint *sp, std::span< float, 15 > r)
Definition: SiSpacePointsSeedMaker.cxx:142
egammaEnergyPositionAllSamples::e0
double e0(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in pre-sampler
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
ActsTrk::SiSpacePointsSeedMaker::dumpEvent
static MsgStream & dumpEvent(InDet::SiSpacePointsSeedMakerEventData &data, MsgStream &out)
Definition: SiSpacePointsSeedMaker.cxx:831
checker_macros.h
Define macros for attributes used to control the static checker.
ActsTrk::SiSpacePointsSeedMaker::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: SiSpacePointsSeedMaker.h:212
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:25
ActsTrk::SiSpacePointsSeedMaker::ATLAS_THREAD_SAFE
std::string m_treeName ATLAS_THREAD_SAFE
Definition: SiSpacePointsSeedMaker.h:233
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TileDCSDataPlotter.tx
tx
Definition: TileDCSDataPlotter.py:880
ActsTrk::SiSpacePointsSeedMaker::convertStripSeed
bool convertStripSeed(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const ActsTrk::SeedContainer &seedPtrs) const
Definition: SiSpacePointsSeedMaker.cxx:852
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
ActsTrk::SiSpacePointsSeedMaker::retrievePixel
StatusCode retrievePixel(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const Trk::PRDtoTrackMap *prd_to_track_map_cptr) const
Definition: SiSpacePointsSeedMaker.cxx:188
ActsTrk::SiSpacePointsSeedMaker::m_actsSpacepointsOverlap
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsOverlap
Definition: SiSpacePointsSeedMaker.h:206
ITk::SiSpacePointForSeed
Definition: ITkSiSpacePointForSeed.h:34
ActsTrk::SiSpacePointsSeedMaker::writeNtuple
virtual void writeNtuple(const InDet::SiSpacePointsSeed *seed, const Trk::Track *track, int seedType, long eventNumber) const override
Definition: SiSpacePointsSeedMaker.cxx:697
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67