ATLAS Offline Software
SiSPSeededTrackFinderRoI.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
8 #ifndef SiSPSeededTrackFinderRoI_H
9 #define SiSPSeededTrackFinderRoI_H
10 
12 #include "GaudiKernel/ToolHandle.h"
13 #include "StoreGate/DataHandle.h"
14 
21 
28 
31 
32 #include <string>
33 #include <atomic>
34 
35 namespace InDet {
36 
37  // Class-algorithm for track finding in Pixels and SCT
38  // initiated by space points seeds filtering in a given
39  // RoI within the z axis
40  //
42  {
43 
45  // Public methods:
47 
48  public:
49 
51  // @name Standard Algotithm methods
53 
54  SiSPSeededTrackFinderRoI(const std::string &name, ISvcLocator *pSvcLocator);
55  virtual ~SiSPSeededTrackFinderRoI() = default;
56  virtual StatusCode initialize() override;
57  virtual StatusCode execute(const EventContext& ctx) const override;
58  virtual StatusCode finalize() override;
60 
61 
62  protected:
63 
65  // @name Flags to configure SiSPSeededTrackFinderRoI
67 
68 
69  BooleanProperty m_useRoIWidth{this, "useRoIWidth", true, "Use width of RoI along z-axis"};
70  IntegerProperty m_maxNumberSeeds{this, "maxNumberSeeds", 3000000, "Max. number used seeds"};
71  IntegerProperty m_nfreeCut{this, "FreeClustersCut", 1, "Min number free clusters"};
72  BooleanProperty m_doRandomSpot{this, "doRandomSpot", false, "Low-pT tracking setting the RoI in a random position"};
73 
74  StringProperty m_fieldmode{this, "MagneticFieldMode", "MapSolenoid"};
76 
78  // @name Input/Output Handles
80 
81  SG::WriteHandleKey<TrackCollection> m_outputTracksKey{this, "TracksLocation", "SiSPSeededTracksRoI", "Output track collection"};
82  SG::WriteHandleKey<xAOD::VertexContainer> m_vxOutputKey{this, "VxOutputName", "LowPtRoIVertices", "Output Vertex collection with per-event RoI information"};
83 
85  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
86  SG::ReadHandleKey<xAOD::EventInfo> m_evtKey{this, "EventInfoKey", "EventInfo"};
88 
90  // @name Algorithm Tools
92 
93 
94  ToolHandle<ISiSpacePointsSeedMaker> m_seedsmaker{this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"};
95  ToolHandle<ISiTrackMaker> m_trackmaker{this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"};
96  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};
97 
98  ToolHandle<IZWindowRoISeedTool> m_ZWindowRoISeedTool{this, "ZWindowRoISeedTool", "InDet::ZWindowRoISeedTool", "Tool to determin per-event RoI"};
99  ToolHandle<IZWindowRoISeedTool> m_RandomRoISeedTool{this, "RandomRoISeedTool", "InDet::RandomRoISeedTool", "Tool to run using additional RoIs randomly chosen away from the main one if doRandomSpot is set"};
100 
101  ServiceHandle<IInDetEtaDependentCutsSvc> m_etaDependentCutsSvc{this, "EtaDependentCutsSvc", "", "if enable, further require eta-dependent selections on track candidates"};
103 
105  // Protected settings
108 
109 
111  // Protected methods
113 
120  void filterSharedTracks(std::multimap<double,Trk::Track*>&) const;
121 
122  void magneticFieldInit();
123 
128  bool passEtaDepCuts(const Trk::Track* track,
129  int nClusters,
130  int nFreeClusters,
131  int nPixels) const;
132 
134  // @name Statistics and Debug Information
136 
137 
140 
143  class Counter_t : public std::array<std::atomic_int, kNCounter>
144  {
145  public:
147  for (unsigned int idx=0; idx <kNCounter; ++idx) {
148  (*this)[idx] += counter[idx];
149  }
150  return *this;
151  }
152  };
153 
154  mutable Counter_t m_counterTotal ATLAS_THREAD_SAFE {};
155 
156  mutable std::atomic_int m_neventsTotal{0};
157  mutable std::atomic_int m_problemsTotal{0};
158 
159  MsgStream& dump(MSG::Level lvl, const SiSPSeededTrackFinderRoI::Counter_t*) const;
160  MsgStream& dumptools(MsgStream& out) const;
161  MsgStream& dumpevent(MsgStream& out, const SiSPSeededTrackFinderRoI::Counter_t& counter) const;
162 
164 
165  };
166 
167 }
168 
169 #endif // SiSPSeededTrackFinderRoI_H
InDet::SiSPSeededTrackFinderRoI::m_fieldmode
StringProperty m_fieldmode
Definition: SiSPSeededTrackFinderRoI.h:74
InDet::SiSPSeededTrackFinderRoI::m_etaDependentCutsSvc
ServiceHandle< IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
Definition: SiSPSeededTrackFinderRoI.h:101
PRDtoTrackMap.h
InDet::SiSPSeededTrackFinderRoI::m_trackmaker
ToolHandle< ISiTrackMaker > m_trackmaker
Definition: SiSPSeededTrackFinderRoI.h:95
InDet::SiSPSeededTrackFinderRoI::m_ZWindowRoISeedTool
ToolHandle< IZWindowRoISeedTool > m_ZWindowRoISeedTool
Definition: SiSPSeededTrackFinderRoI.h:98
InDet::SiSPSeededTrackFinderRoI::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: SiSPSeededTrackFinderRoI.h:84
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
PerigeeSurface.h
InDet::SiSPSeededTrackFinderRoI::dumptools
MsgStream & dumptools(MsgStream &out) const
Definition: SiSPSeededTrackFinderRoI.cxx:342
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::SiSPSeededTrackFinderRoI::m_doRandomSpot
BooleanProperty m_doRandomSpot
Definition: SiSPSeededTrackFinderRoI.h:72
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::SiSPSeededTrackFinderRoI::kNCounter
@ kNCounter
Definition: SiSPSeededTrackFinderRoI.h:139
InDet::SiSPSeededTrackFinderRoI
Definition: SiSPSeededTrackFinderRoI.h:42
InDet::SiSPSeededTrackFinderRoI::m_useRoIWidth
BooleanProperty m_useRoIWidth
Definition: SiSPSeededTrackFinderRoI.h:69
InDet::SiSPSeededTrackFinderRoI::finalize
virtual StatusCode finalize() override
Definition: SiSPSeededTrackFinderRoI.cxx:317
ISiZvertexMaker.h
InDet::SiSPSeededTrackFinderRoI::m_seedsmaker
ToolHandle< ISiSpacePointsSeedMaker > m_seedsmaker
Definition: SiSPSeededTrackFinderRoI.h:94
SG::ReadHandleKey< Trk::PRDtoTrackMap >
InDet::SiSPSeededTrackFinderRoI::dumpevent
MsgStream & dumpevent(MsgStream &out, const SiSPSeededTrackFinderRoI::Counter_t &counter) const
Definition: SiSPSeededTrackFinderRoI.cxx:371
DataHandle.h
InDet::SiSPSeededTrackFinderRoI::m_vxOutputKey
SG::WriteHandleKey< xAOD::VertexContainer > m_vxOutputKey
Definition: SiSPSeededTrackFinderRoI.h:82
InDet::SiSPSeededTrackFinderRoI::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SiSPSeededTrackFinderRoI.cxx:129
InDet::SiSPSeededTrackFinderRoI::dump
MsgStream & dump(MSG::Level lvl, const SiSPSeededTrackFinderRoI::Counter_t *) const
Definition: SiSPSeededTrackFinderRoI.cxx:328
InDet::SiSPSeededTrackFinderRoI::m_outputTracksKey
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
Definition: SiSPSeededTrackFinderRoI.h:81
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MagneticFieldProperties.h
InDet::SiSPSeededTrackFinderRoI::passEtaDepCuts
bool passEtaDepCuts(const Trk::Track *track, int nClusters, int nFreeClusters, int nPixels) const
apply eta-dependent selections
Definition: SiSPSeededTrackFinderRoI.cxx:483
InDet::SiSPSeededTrackFinderRoI::m_problemsTotal
std::atomic_int m_problemsTotal
Number events with number seeds > maxNumber.
Definition: SiSPSeededTrackFinderRoI.h:157
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
InDet::SiSPSeededTrackFinderRoI::m_neventsTotal
std::atomic_int m_neventsTotal
Number events.
Definition: SiSPSeededTrackFinderRoI.h:156
InDet::SiSPSeededTrackFinderRoI::initialize
virtual StatusCode initialize() override
Definition: SiSPSeededTrackFinderRoI.cxx:76
InDet::SiSPSeededTrackFinderRoI::Counter_t
Definition: SiSPSeededTrackFinderRoI.h:144
InDet::SiSPSeededTrackFinderRoI::m_evtKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
Definition: SiSPSeededTrackFinderRoI.h:86
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrackCollection.h
InDet::SiSPSeededTrackFinderRoI::magneticFieldInit
void magneticFieldInit()
Definition: SiSPSeededTrackFinderRoI.cxx:472
InDet::SiSPSeededTrackFinderRoI::kNTracks
@ kNTracks
Definition: SiSPSeededTrackFinderRoI.h:139
AthReentrantAlgorithm.h
lumiFormat.array
array
Definition: lumiFormat.py:91
ISiSpacePointsSeedMaker.h
InDet::SiSPSeededTrackFinderRoI::kNSeeds
@ kNSeeds
Definition: SiSPSeededTrackFinderRoI.h:139
ISiTrackMaker.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::SiSPSeededTrackFinderRoI::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: SiSPSeededTrackFinderRoI.h:96
InDet::SiSPSeededTrackFinderRoI::Counter_t::operator+=
Counter_t & operator+=(const Counter_t &counter)
Definition: SiSPSeededTrackFinderRoI.h:146
EventInfo.h
InDet::SiSPSeededTrackFinderRoI::m_nfreeCut
IntegerProperty m_nfreeCut
Definition: SiSPSeededTrackFinderRoI.h:71
SG::ReadCondHandleKey< InDet::BeamSpotData >
InDet::SiSPSeededTrackFinderRoI::m_RandomRoISeedTool
ToolHandle< IZWindowRoISeedTool > m_RandomRoISeedTool
Definition: SiSPSeededTrackFinderRoI.h:99
VertexContainer.h
InDet::SiSPSeededTrackFinderRoI::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: SiSPSeededTrackFinderRoI.h:85
IExtendedTrackSummaryTool.h
InDet::SiSPSeededTrackFinderRoI::ATLAS_THREAD_SAFE
Counter_t m_counterTotal ATLAS_THREAD_SAFE
Definition: SiSPSeededTrackFinderRoI.h:154
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
InDet::SiSPSeededTrackFinderRoI::ECounter
ECounter
enums for Counter_t
Definition: SiSPSeededTrackFinderRoI.h:139
InDet::SiSPSeededTrackFinderRoI::m_fieldprop
Trk::MagneticFieldProperties m_fieldprop
Definition: SiSPSeededTrackFinderRoI.h:107
InDet::SiSPSeededTrackFinderRoI::m_maxNumberSeeds
IntegerProperty m_maxNumberSeeds
Definition: SiSPSeededTrackFinderRoI.h:70
BeamSpotData.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
test_pyathena.counter
counter
Definition: test_pyathena.py:15
IInDetEtaDependentCutsSvc.h
IPatternParametersPropagator.h
InDet::SiSPSeededTrackFinderRoI::~SiSPSeededTrackFinderRoI
virtual ~SiSPSeededTrackFinderRoI()=default
IZWindowRoISeedTool.h
InDet::SiSPSeededTrackFinderRoI::SiSPSeededTrackFinderRoI
SiSPSeededTrackFinderRoI(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SiSPSeededTrackFinderRoI.cxx:68
InDet::SiSPSeededTrackFinderRoI::filterSharedTracks
void filterSharedTracks(std::multimap< double, Trk::Track * > &) const
cleans up the collection of quality filtered tracks.
Definition: SiSPSeededTrackFinderRoI.cxx:399
ServiceHandle
Definition: ClusterMakerTool.h:37