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