ATLAS Offline Software
Loading...
Searching...
No Matches
SiSpacePointsSeedMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSTRKSEEDINGTOOL_SISPACEPOINTSSEEDMAKER_H
6#define ACTSTRKSEEDINGTOOL_SISPACEPOINTSSEEDMAKER_H
7
10
11#include "GaudiKernel/ToolHandle.h"
13
16
17
20
23
26
28#include "TrkSpacePoint/SpacePoint.h" //used in an inline function in the header
29#include <span>
30//for validation
31
32
33class TTree;
34class ITHistSvc;
35
36namespace InDet{
38}
39
40namespace ActsTrk {
41 class SpacePoint;
42
43 static constexpr float s_toTesla = 0.299785832;
44
46 public extends<AthAlgTool, InDet::ISiSpacePointsSeedMaker> {
47 private:
48 enum SeedStrategy : short {PPP, SSS};
49
50 public:
51 SiSpacePointsSeedMaker(const std::string &t, const std::string &n, const IInterface *p);
52 virtual ~SiSpacePointsSeedMaker() override = default;
53
54 virtual StatusCode initialize() override;
55
56 // Interface
57 virtual void
58 newEvent(const EventContext& ctx,
60 int iteration=-1) const override;
61
62 virtual void
63 find3Sp(const EventContext& ctx,
65 const std::list<Trk::Vertex>& lv) const override;
66
67 virtual const InDet::SiSpacePointsSeed*
68 next(const EventContext& ctx,
70
71 virtual void
73 const Trk::Track* track,
74 int seedType,
75 long eventNumber) const override;
76
77 virtual bool
78 getWriteNtupleBoolProperty() const override;
79
80 virtual MsgStream&
82 MsgStream& out) const override;
83
84 // ===================================================================== //
85 // WE DO NOT NEED THESE FOR NOW
86 // ===================================================================== //
87
88 virtual void
89 newRegion(const EventContext&,
91 const std::vector<IdentifierHash>&,
92 const std::vector<IdentifierHash>&) const override;
93
94 virtual void
95 newRegion(const EventContext&,
97 const std::vector<IdentifierHash>&,
98 const std::vector<IdentifierHash>&,
99 const IRoiDescriptor&) const override
100 {
101 ATH_MSG_ERROR("Method `newRegion` is not implemented.");
102 }
103
104 virtual void
106 const std::list<Trk::Vertex>&) const override
107 {
108 ATH_MSG_ERROR("Method `findfind2Sp` is not implemented.");
109 }
110
113 virtual void
114 find3Sp(const EventContext&,
116 const std::list<Trk::Vertex>&,
117 const double*) const override
118 {
119 ATH_MSG_ERROR("Method `find3Sp` is not implemented.");
120 }
121
124 virtual void
125 findVSp(const EventContext&,
127 const std::list<Trk::Vertex>&) const override
128 {
129 ATH_MSG_ERROR("Method `findVSp` is not implemented.");
130 }
131
132 // ===================================================================== //
133 // ===================================================================== //
134
135 private:
136 MsgStream&
138 MsgStream& out) const;
139
140 static MsgStream&
142 MsgStream& out);
143
144
145 private:
146 void buildBeamFrameWork(const EventContext& ctx,
148 void
150 const xAOD::SpacePoint* sp) const;
151
152 static void pixInform(const Trk::SpacePoint* sp,
153 float* r) ;
155 const Trk::SpacePoint* sp,
156 std::span<float,15> r) ;
157
158 bool convertPixelSeed(const EventContext& ctx,
160 const ActsTrk::SeedContainer& seedPtrs) const;
161
162 bool convertStripSeed(const EventContext& ctx,
164 const ActsTrk::SeedContainer& seedPtrs) const;
165
166 // Retrieve
167 StatusCode retrievePixel(const EventContext& ctx,
169 const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const;
170 StatusCode retrieveStrip(const EventContext& ctx,
172 const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const;
173 StatusCode retrieveOverlap(const EventContext& ctx,
175 const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const;
176
177 StatusCode retrievePixel(const EventContext& ctx,
179 const std::vector<IdentifierHash>& ids,
180 const Trk::PRDtoTrackMap* prd_to_track_map_cptr = nullptr) const;
181
182 StatusCode retrieveStrip(const EventContext& ctx,
184 const std::vector<IdentifierHash>& ids,
185 const Trk::PRDtoTrackMap* prd_to_track_map_cptr = nullptr) const;
186 StatusCode retrieveOverlap(const EventContext& ctx,
188 const std::vector<IdentifierHash>& ids,
189 const Trk::PRDtoTrackMap* prd_to_track_map_cptr) const;
190
191 // Validation
192 StatusCode InitTree();
193
194 private:
195 bool isUsed(const Trk::SpacePoint*, const Trk::PRDtoTrackMap &prd_to_track_map) const;
196 bool isUsed(const xAOD::SpacePoint*, const Trk::PRDtoTrackMap &prd_to_track_map) const;
197
198 private:
199 ToolHandle< ActsTrk::ISeedingTool > m_seedsToolPixel {this, "SeedToolPixel", "","Seed Tool for Pixel detector"};
200 ToolHandle< ActsTrk::ISeedingTool > m_seedsToolStrip {this, "SeedToolStrip", "","Seed Tool for Strip detector"};
201
202 SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap {this, "PRDtoTrackMap", "", "option PRD-to-track association"};
203
204 SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsPixel {this, "ActsSpacePointsPixelName", "", "Pixel space points container"};
205 SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsStrip {this, "ActsSpacePointsStripName", "", "Strip space points container"};
206 SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsOverlap {this, "ActsSpacePointsOverlapName", "", "Strip overlap space points container"};
207
208 SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
209 SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
210 "Name of the Magnetic Field conditions object key"};
211
212 SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey {this, "PixelDetectorElements", "ITkPixelDetectorElementCollection",
213 "Key of input SiDetectorElementCollection"};
214 SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey {this, "StripDetectorElements", "ITkStripDetectorElementCollection",
215 "Key of input SiDetectorElementCollection"};
216
217 Gaudi::Property< bool > m_pixel {this, "usePixel", true};
218 Gaudi::Property< bool > m_strip {this, "useStrip", true };
219 Gaudi::Property< bool > m_useOverlap {this, "useOverlapSpCollection", true};
220 Gaudi::Property< bool > m_fastTracking {this, "useFastTracking", false};
221 Gaudi::Property< bool > m_doSeedConversion {this, "doSeedConversion", true, "Convert ActsTrk::Seed into ITk::SiSpacePointsProSeed"};
222 Gaudi::Property< bool > m_useClusters {this, "useClustersForSeedConversion", false};
223
224 private:
225 // Validation
226 Gaudi::Property< bool > m_writeNtuple {this, "WriteNtuple", false};
227
228 mutable std::mutex m_mutex;
229
231 TTree* m_outputTree = nullptr;
232
233 mutable std::string m_treeName ATLAS_THREAD_SAFE = "";
234 mutable std::string m_treeFolder ATLAS_THREAD_SAFE = "/valNtuples/";
235
236 mutable float m_d0 ATLAS_THREAD_SAFE = 0;
237 mutable float m_z0 ATLAS_THREAD_SAFE = 0;
238 mutable float m_pt ATLAS_THREAD_SAFE = 0;
239 mutable float m_eta ATLAS_THREAD_SAFE = 0;
240 mutable double m_x1 ATLAS_THREAD_SAFE = 0;
241 mutable double m_x2 ATLAS_THREAD_SAFE = 0;
242 mutable double m_x3 ATLAS_THREAD_SAFE = 0;
243 mutable double m_y1 ATLAS_THREAD_SAFE = 0;
244 mutable double m_y2 ATLAS_THREAD_SAFE = 0;
245 mutable double m_y3 ATLAS_THREAD_SAFE = 0;
246 mutable double m_z1 ATLAS_THREAD_SAFE = 0;
247 mutable double m_z2 ATLAS_THREAD_SAFE = 0;
248 mutable double m_z3 ATLAS_THREAD_SAFE = 0;
249 mutable double m_r1 ATLAS_THREAD_SAFE = 0;
250 mutable double m_r2 ATLAS_THREAD_SAFE = 0;
251 mutable double m_r3 ATLAS_THREAD_SAFE = 0;
252 mutable float m_quality ATLAS_THREAD_SAFE = 0;
253 mutable int m_type ATLAS_THREAD_SAFE = 0;
254 mutable double m_dzdr_t ATLAS_THREAD_SAFE = 0;
255 mutable double m_dzdr_b ATLAS_THREAD_SAFE = 0;
256 mutable bool m_givesTrack ATLAS_THREAD_SAFE = false;
257 mutable float m_trackPt ATLAS_THREAD_SAFE = 0;
258 mutable float m_trackEta ATLAS_THREAD_SAFE = 0;
259 mutable long m_eventNumber ATLAS_THREAD_SAFE = 0;
260 };
261
263 // Inline Method
265
266 inline bool
268 const Trk::PRDtoTrackMap &prd_to_track_map) const
269 {
270 const Trk::PrepRawData* d = sp->clusterList().first;
271 if (!d || !prd_to_track_map.isUsed(*d)) return false;
272
273 d = sp->clusterList().second;
274 if (!d || prd_to_track_map.isUsed(*d)) return true;
275
276 return false;
277 }
278
279 inline bool
281 {
282 static const SG::AuxElement::ConstAccessor< ElementLink< ::SpacePointCollection > > pixelLinkAcc("pixelSpacePointLink");
283 static const SG::AuxElement::ConstAccessor< ElementLink< ::SpacePointCollection > > stripLinkAcc("sctSpacePointLink");
284 static const SG::AuxElement::ConstAccessor< ElementLink< ::SpacePointOverlapCollection > > stripOverlapLinkacc("stripOverlapSpacePointLink");
285
286 const Trk::SpacePoint *indetSp = nullptr;
287 if ( pixelLinkAcc.isAvailable(*sp) ) {
288 const ElementLink< ::SpacePointCollection > link = pixelLinkAcc( *sp );
289 indetSp = *link;
290 }
291 else if ( stripLinkAcc.isAvailable(*sp) ) {
292 const ElementLink< ::SpacePointCollection > link = stripLinkAcc( *sp );
293 indetSp = *link;
294 } else if ( stripOverlapLinkacc.isAvailable(*sp) ) {
295 const ElementLink< ::SpacePointOverlapCollection > link = stripOverlapLinkacc( *sp );
296 indetSp = *link;
297 } else {
298 return false;
299 }
300
301 return isUsed(indetSp, prd_to_track_map);
302 }
303
304}
305
306#endif
#define ATH_MSG_ERROR(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t sp
bool convertStripSeed(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const ActsTrk::SeedContainer &seedPtrs) const
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
virtual const InDet::SiSpacePointsSeed * next(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data) const override
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
virtual void findVSp(const EventContext &, InDet::SiSpacePointsSeedMakerEventData &, const std::list< Trk::Vertex > &) const override
with variable number space points with or without vertex constraint Variable means (2,...
StatusCode retrieveStrip(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const Trk::PRDtoTrackMap *prd_to_track_map_cptr) const
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsOverlap
virtual void find3Sp(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const std::list< Trk::Vertex > &lv) const override
ServiceHandle< ITHistSvc > m_thistSvc
StatusCode retrievePixel(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const Trk::PRDtoTrackMap *prd_to_track_map_cptr) const
SiSpacePointsSeedMaker(const std::string &t, const std::string &n, const IInterface *p)
static void stripInform(InDet::SiSpacePointsSeedMakerEventData &data, const Trk::SpacePoint *sp, std::span< float, 15 > r)
virtual bool getWriteNtupleBoolProperty() const override
bool convertPixelSeed(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const ActsTrk::SeedContainer &seedPtrs) const
void buildBeamFrameWork(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data) const
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
virtual void find2Sp(InDet::SiSpacePointsSeedMakerEventData &, const std::list< Trk::Vertex > &) const override
void newSpacePoint(InDet::SiSpacePointsSeedMakerEventData &data, const xAOD::SpacePoint *sp) const
Gaudi::Property< bool > m_doSeedConversion
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsStrip
virtual void find3Sp(const EventContext &, InDet::SiSpacePointsSeedMakerEventData &, const std::list< Trk::Vertex > &, const double *) const override
with three space points with or without vertex constraint with information about min and max Z of the...
virtual void newEvent(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, int iteration=-1) const override
MsgStream & dumpConditions(InDet::SiSpacePointsSeedMakerEventData &data, MsgStream &out) const
virtual void newRegion(const EventContext &, InDet::SiSpacePointsSeedMakerEventData &, const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &) const override
SG::ReadHandleKey< xAOD::SpacePointContainer > m_actsSpacepointsPixel
virtual void writeNtuple(const InDet::SiSpacePointsSeed *seed, const Trk::Track *track, int seedType, long eventNumber) const override
static MsgStream & dumpEvent(InDet::SiSpacePointsSeedMakerEventData &data, MsgStream &out)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
ToolHandle< ActsTrk::ISeedingTool > m_seedsToolStrip
static void pixInform(const Trk::SpacePoint *sp, float *r)
virtual StatusCode initialize() override
bool isUsed(const Trk::SpacePoint *, const Trk::PRDtoTrackMap &prd_to_track_map) const
virtual ~SiSpacePointsSeedMaker() override=default
StatusCode retrieveOverlap(const EventContext &ctx, InDet::SiSpacePointsSeedMakerEventData &data, const Trk::PRDtoTrackMap *prd_to_track_map_cptr) const
ToolHandle< ActsTrk::ISeedingTool > m_seedsToolPixel
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
virtual void newRegion(const EventContext &, InDet::SiSpacePointsSeedMakerEventData &, const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &, const IRoiDescriptor &) const override
Describes the API of the Region of Ineterest geometry.
InDet::SiSpacePointsSeedMakerEventData holds event dependent data used by ISiSpacePointsSeedMaker.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
int r
Definition globals.cxx:22
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
static constexpr float s_toTesla
Primary Vertex Finder.
-event-from-file