ATLAS Offline Software
SeedingAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSTRKSEEDING_SEEDINGALG_H
6 #define ACTSTRKSEEDING_SEEDINGALG_H
7 
8 // Base Class
10 
11 // Gaudi includes
12 #include "GaudiKernel/ToolHandle.h"
13 
14 // Tools
19 
20 // Athena
27 
28 // Handle Keys
33 
35 
36 namespace ActsTrk {
37 
38  class SeedingAlg :
39  public AthReentrantAlgorithm {
40 
41  public:
42  SeedingAlg(const std::string &name,
43  ISvcLocator *pSvcLocator);
44  virtual ~SeedingAlg() = default;
45 
46 
47  virtual StatusCode initialize() override;
48  virtual StatusCode finalize() override;
49  virtual StatusCode execute(const EventContext& ctx) const override;
50 
51  private:
52  // Tool Handles
53  ToolHandle< ActsTrk::ISeedingTool > m_seedsTool {this, "SeedTool", "","Seed Tool"};
54  ToolHandle< ActsTrk::ITrackParamsEstimationTool > m_paramEstimationTool {this, "TrackParamsEstimationTool", "", "Track Param Estimation from Seeds"};
55  PublicToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool {this, "TrackingGeometryTool", ""};
56  ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool{this, "ATLASConverterTool", ""};
57  ToolHandle< GenericMonitoringTool > m_monTool {this, "MonTool", "", "Monitoring tool"};
58 
59  // Handle Keys
60  SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
61  SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
62  "Name of the Magnetic Field conditions object key"};
63  SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_detEleCollKey {this, "DetectorElements", "", "Key of input SiDetectorElementCollection"};
64 
65  SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey {this,"InputSpacePoints",{},"Input Space Points"};
66  SG::WriteHandleKey< ActsTrk::SeedContainer > m_seedKey {this,"OutputSeeds","","Output Seeds"};
68 
69  Gaudi::Property< bool > m_fastTracking {this, "useFastTracking", false};
70  bool skipSpacePoint(float x, float y, float z) const;
71 
72  public:
73  enum EStat {
77  kNStat
78  };
79  private:
80  mutable std::array<std::atomic<unsigned int>, kNStat> m_stat ATLAS_THREAD_SAFE {};
81  };
82 
83  inline bool SeedingAlg::skipSpacePoint(float x, float y, float z) const {
84  float R = std::hypotf(x,y);
85  // At small R, we remove space points beyond |z|=200
86  if (std::abs(z) > 200. && R < 50.)
87  return true;
88  // We also remove space points beyond eta=4. if their z is larger
89  // than the max seed z0 (150.)
90  float cotTheta = 27.2899; // (4.0 eta) --> 27.2899 = 1/tan(2*arctan(exp(-4)))
91  if (std::abs(z) - 150. > cotTheta * R)
92  return true;
93  return false;
94  }
95 
96 } // namespace
97 
98 #endif
ReadHandleKeyArray.h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
ActsTrk::SeedingAlg
Definition: SeedingAlg.h:39
ActsTrk::SeedingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SeedingAlg.cxx:68
ActsTrk::SeedingAlg::finalize
virtual StatusCode finalize() override
Definition: SeedingAlg.cxx:58
TrackParameters.h
AtlasFieldCacheCondObj.h
ActsTrk::SeedingAlg::~SeedingAlg
virtual ~SeedingAlg()=default
ActsTrk::SeedingAlg::m_trackingGeometryTool
PublicToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: SeedingAlg.h:55
ISeedingTool.h
ActsTrk::SeedingAlg::kNStat
@ kNStat
Definition: SeedingAlg.h:77
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
ActsTrk::SeedingAlg::kNSeedsWithoutParam
@ kNSeedsWithoutParam
Definition: SeedingAlg.h:76
ActsTrk::SeedingAlg::m_seedKey
SG::WriteHandleKey< ActsTrk::SeedContainer > m_seedKey
Definition: SeedingAlg.h:66
x
#define x
SpacePointContainer.h
ActsTrk::SeedingAlg::m_seedsTool
ToolHandle< ActsTrk::ISeedingTool > m_seedsTool
Definition: SeedingAlg.h:53
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ActsTrk::SeedingAlg::m_actsTrackParamsKey
SG::WriteHandleKey< ActsTrk::BoundTrackParametersContainer > m_actsTrackParamsKey
Definition: SeedingAlg.h:67
ActsTrk::SeedingAlg::EStat
EStat
Definition: SeedingAlg.h:73
ActsTrk::SeedingAlg::m_fastTracking
Gaudi::Property< bool > m_fastTracking
Definition: SeedingAlg.h:69
GenericMonitoringTool.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
z
#define z
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::SeedingAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: SeedingAlg.h:57
AtlasFieldCache.h
ActsTrk::SeedingAlg::initialize
virtual StatusCode initialize() override
Definition: SeedingAlg.cxx:32
ActsTrk::SeedingAlg::kNSpacepoints
@ kNSpacepoints
Definition: SeedingAlg.h:74
ActsTrk::SeedingAlg::m_paramEstimationTool
ToolHandle< ActsTrk::ITrackParamsEstimationTool > m_paramEstimationTool
Definition: SeedingAlg.h:54
ActsTrk::SeedingAlg::skipSpacePoint
bool skipSpacePoint(float x, float y, float z) const
Definition: SeedingAlg.h:83
ReadCondHandleKey.h
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
ActsTrk::SeedingAlg::m_detEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_detEleCollKey
Definition: SeedingAlg.h:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::SeedingAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: SeedingAlg.h:60
ActsTrk::SeedingAlg::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned int >, kNStat > m_stat ATLAS_THREAD_SAFE
Definition: SeedingAlg.h:80
SiDetectorElementCollection.h
ActsTrk::SeedingAlg::SeedingAlg
SeedingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SeedingAlg.cxx:27
ActsTrk::SeedingAlg::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Definition: SeedingAlg.h:61
SG::ReadCondHandleKey< InDet::BeamSpotData >
ActsTrk::SeedingAlg::kNSeeds
@ kNSeeds
Definition: SeedingAlg.h:75
ActsTrk::SeedingAlg::m_spacePointKey
SG::ReadHandleKeyArray< xAOD::SpacePointContainer > m_spacePointKey
Definition: SeedingAlg.h:65
y
#define y
ITrackParamsEstimationTool.h
TRT::Track::cotTheta
@ cotTheta
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:65
IActsToTrkConverterTool.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
BeamSpotData.h
ActsTrk::SeedingAlg::m_ATLASConverterTool
ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool
Definition: SeedingAlg.h:56
IActsTrackingGeometryTool.h