ATLAS Offline Software
Loading...
Searching...
No Matches
SiSpacePointsSeedMaker_ATLxk.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
8// Header file for class SiSpacePointsSeedMaker_ATLxk
10// Version 1.0 3/10/2004 I.Gavrilenko
12
13#ifndef SiSpacePointsSeedMaker_ATLxk_H
14#define SiSpacePointsSeedMaker_ATLxk_H
15
18
25#include "GaudiKernel/ITHistSvc.h"
26#include "TFile.h"
27#include "TTree.h"
28
30// MagField cache
34
35
36#include <iosfwd>
37#include <list>
38#include <vector>
39
40class MsgStream;
41//class TFile;
42//class TTree;
43
44namespace InDet {
45
46 using EventData = SiSpacePointsSeedMakerEventData;
47
58
60 public extends<AthAlgTool, ISiSpacePointsSeedMaker>
61 {
63 // Public methods:
65
66 public:
67
71
72 SiSpacePointsSeedMaker_ATLxk(const std::string&, const std::string&, const IInterface*);
73 virtual ~SiSpacePointsSeedMaker_ATLxk() = default;
74 virtual StatusCode initialize() override;
75 virtual StatusCode finalize() override;
77
81
82 virtual void newEvent (const EventContext& ctx, EventData& data, int iteration) const override;
83 virtual void newRegion(const EventContext& ctx, EventData& data,
84 const std::vector<IdentifierHash>& vPixel, const std::vector<IdentifierHash>& vSCT) const override;
85 virtual void newRegion(const EventContext& ctx,SiSpacePointsSeedMakerEventData& data,
86 const std::vector<IdentifierHash>& vPixel, const std::vector<IdentifierHash>& vSCT,
87 const IRoiDescriptor& iRD) const override;
89
93
94
96 virtual void find2Sp(EventData& data, const std::list<Trk::Vertex>& lv) const override;
97
99 virtual void find3Sp(const EventContext& ctx, EventData& data, const std::list<Trk::Vertex>& lv) const override;
100
103 virtual void find3Sp(const EventContext& ctx, EventData& data, const std::list<Trk::Vertex>& lv, const double* zVertex) const override;
104
107 virtual void findVSp(const EventContext& ctx, EventData& data, const std::list<Trk::Vertex>& lv) const override;
109
114
115
123 virtual const SiSpacePointsSeed* next(const EventContext& ctx, EventData& data) const override;
125
131 virtual void writeNtuple(const SiSpacePointsSeed* seed, const Trk::Track* track, int seedType, long eventNumber) const override;
132
133 virtual bool getWriteNtupleBoolProperty() const override;
134
138
139 virtual MsgStream& dump(EventData& data, MsgStream& out) const override;
141
142 private:
147
148 enum Size {arraySizePhi=200,
157
160
162
163 SG::ReadHandleKey<SpacePointContainer> m_spacepointsPixel{this, "SpacePointsPixelName", "PixelSpacePoints", "Pixel space points container"};
164 SG::ReadHandleKey<SpacePointContainer> m_spacepointsSCT{this, "SpacePointsSCTName", "SCT_SpacePoints", "SCT space points container"};
165 SG::ReadHandleKey<SpacePointOverlapCollection> m_spacepointsOverlap{this, "SpacePointsOverlapName", "OverlapSpacePoints"};
166 SG::ReadHandleKey<Trk::PRDtoTrackMap> m_prdToTrackMap{this,"PRDtoTrackMap","","option PRD-to-track association"};
167 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
169 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj",
170 "Name of the Magnetic Field conditions object key"};
171
172
174
175 BooleanProperty m_pixel{this, "usePixel", true};
176 BooleanProperty m_sct{this, "useSCT", true};
177 BooleanProperty m_useOverlap{this, "useOverlapSpCollection", true};
178 IntegerProperty m_maxsize{this, "maxSize", 50000};
179 IntegerProperty m_maxsizeSP{this, "maxSizeSP", 5000};
183 IntegerProperty m_maxOneSizeSSS{this, "maxSeedsForSpacePointStrips", 5};
184 IntegerProperty m_maxOneSizePPP{this, "maxSeedsForSpacePointPixels", 5};
188 BooleanProperty m_alwaysKeepConfirmedPixelSeeds{this, "alwaysKeepConfirmedPixelSeeds", false};
189 BooleanProperty m_alwaysKeepConfirmedStripSeeds{this, "alwaysKeepConfirmedStripSeeds", false};
193 BooleanProperty m_optimisePhiBinning{this, "optimisePhiBinning", true};
194 FloatProperty m_etamax{this, "etaMax", 2.7};
195 FloatProperty m_r1minv{this, "minVRadius1", 0.};
196 FloatProperty m_r1maxv{this, "maxVRadius1", 60.};
197 FloatProperty m_r2minv{this, "minVRadius2", 70.};
198 FloatProperty m_r2maxv{this, "maxVRadius2", 200.};
199 FloatProperty m_drmax{this, "maxdRadius", 270.};
200 FloatProperty m_zmin{this, "minZ", -250.};
201 FloatProperty m_zmax{this, "maxZ", +250.};
202 FloatProperty m_dzver{this, "maxdZver", 5.};
203 FloatProperty m_dzdrver{this, "maxdZdRver", .02};
205
207
208 FloatProperty m_etamin{this, "etaMin", 0.};
209 FloatProperty m_r_rmax{this, "radMax", 600.};
210 FloatProperty m_binSizeR{this, "radStep", 2.};
211 FloatProperty m_drmin{this, "mindRadius", 5.};
212 FloatProperty m_maxdImpact{this, "maxdImpact", 10.};
213 FloatProperty m_maxdImpactSSS{this, "maxdImpactSSS", 50.};
217 FloatProperty m_dImpactCutSlopeUnconfirmedSSS{this, "dImpactCutSlopeUnconfirmedSSS", 1.0};
218 FloatProperty m_dImpactCutSlopeUnconfirmedPPP{this, "dImpactCutSlopeUnconfirmedPPP", 0.};
219 FloatProperty m_maxdImpactDecays{this, "maxdImpactForDecays", 20.};
220 FloatProperty m_ptmin{this, "pTmin", 500.};
221 FloatProperty m_fieldScale{this, "fieldScale", 1.};
223
225
226 BooleanProperty m_checketa{this, "checkEta", false};
228
234 FloatProperty m_seedScoreBonusPPP{this, "seedScoreBonusPPP", -200.};
235 FloatProperty m_seedScoreBonusSSS{this, "seedScoreBonusSSS", -400.};
236 FloatProperty m_seedScoreBonusConfirmationSeed{this, "seedScoreBonusConfirmationSeed", -200.};
238
240 FloatProperty m_maxScore{this, "maximumAcceptedSeedScore", 100.};
241
243
244 float m_drminv{20.};
246
248
249
250 float m_dzdrmin0{0.};
251 float m_dzdrmax0{0.};
252 float m_ipt{0.};
253 float m_ipt2{0.};
254 // static constexpr float m_COF{134*.05*9}; ///< appears to be an approximated term related to multiple-scattering of particles traversing the ID during the seed formation
255 static constexpr float m_COF{134*.05f*9};
256
259 int m_nBinsR{0};
260 int m_maxPhiBin{0};
265
266
279
282 static constexpr float m_radiusCutIBL{43.};
283
285 std::array<int,arraySizePhiZ> m_nNeighbourCellsBottom{};
286 std::array<int,arraySizePhiZ> m_nNeighbourCellsTop{};
287 std::array<std::array<int, arraySizeNeighbourBins>, arraySizePhiZ> m_neighbourCellsBottom{};
288 std::array<std::array<int, arraySizeNeighbourBins>, arraySizePhiZ> m_neighbourCellsTop{};
289
290 std::array<int,arraySizePhiZV> m_nNeighboursVertexPhiZ{};
291 std::array<std::array<int, arraySizeNeighbourBinsVertex>, arraySizePhiZV> m_neighboursVertexPhiZ{};
293
295 // Private methods
297
299
304
305 MsgStream& dumpConditions(EventData& data, MsgStream& out) const;
306 static MsgStream& dumpEvent (EventData& data, MsgStream& out) ;
307
310 void buildFrameWork();
311 /* updates the beam spot information stored in the event data
312 * object.
313 * @param[out] data: Event data, receives update to the x/y/zbeam members
314 **/
315 void buildBeamFrameWork(EventData& data) const;
316
330 static float azimuthalStep(const float pTmin,const float maxd0,const float Rmin,const float Rmax) ;
331
343
344 static void newSeed(EventData& data, SiSpacePointForSeed*& p1, SiSpacePointForSeed*& p2, float z) ;
345
359 SiSpacePointForSeed*& p3, float z, float quality) const;
360
371 (EventData& data, SiSpacePointForSeed*& SPb, SiSpacePointForSeed*& SP0, float Zob) const;
372
376 void fillSeeds(EventData& data) const;
377
383 void fillLists(EventData& data) const;
384 static void erase(EventData& data) ;
385 void production2Sp(EventData& data) const;
386
387
393 void production3Sp(EventData& data) const;
394
420 void production3Sp
421 (EventData& data,
422 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & iter_bottomCands,
423 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & iter_endBottomCands,
424 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & iter_topCands,
425 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & iter_endTopCands,
426 const int numberBottomCells, const int numberTopCells, int& nseed, const int zbin = -1) const;
427
430 (EventData& data,
431 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & rb,
432 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & rbe,
433 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & rt,
434 std::array<std::vector<InDet::SiSpacePointForSeed*>::iterator, arraySizeNeighbourBins> & rte,
435 const int numberBottomCells, const int numberTopCells, int& nseed) const;
436
444 bool newVertices(EventData& data, const std::list<Trk::Vertex>& lV) const;
449 void findNext(EventData& data) const;
450 bool isZCompatible(EventData& data, const float Zv, const float R, const float T) const;
451
459 static void convertToBeamFrameWork(EventData& data, const Trk::SpacePoint*const& sp, std::array<float,3> & r) ;
460
461 bool isUsed(const Trk::SpacePoint* sp, const Trk::PRDtoTrackMap &prd_to_track_map) const;
462
464
477 bool isConfirmedSeed(const InDet::SiSpacePointForSeed* bottomSP, const InDet::SiSpacePointForSeed* topSP, float quality) const;
478
480 Gaudi::Property<bool> m_writeNtuple {this, "WriteNtuple", false, "Flag to write Validation Ntuples"};
481
483
485
486 mutable std::mutex m_mutex;
487
488 mutable std::string m_treeName ATLAS_THREAD_SAFE;
489 mutable TString m_treeFolder ATLAS_THREAD_SAFE;
490
491 mutable float m_d0 ATLAS_THREAD_SAFE = 0;
492 mutable float m_z0 ATLAS_THREAD_SAFE = 0;
493 mutable float m_pt ATLAS_THREAD_SAFE = 0;
494 mutable float m_eta ATLAS_THREAD_SAFE = 0;
495 mutable double m_x1 ATLAS_THREAD_SAFE = 0;
496 mutable double m_x2 ATLAS_THREAD_SAFE = 0;
497 mutable double m_x3 ATLAS_THREAD_SAFE = 0;
498 mutable double m_y1 ATLAS_THREAD_SAFE = 0;
499 mutable double m_y2 ATLAS_THREAD_SAFE = 0;
500 mutable double m_y3 ATLAS_THREAD_SAFE = 0;
501 mutable double m_z1 ATLAS_THREAD_SAFE = 0;
502 mutable double m_z2 ATLAS_THREAD_SAFE = 0;
503 mutable double m_z3 ATLAS_THREAD_SAFE = 0;
504 mutable double m_r1 ATLAS_THREAD_SAFE = 0;
505 mutable double m_r2 ATLAS_THREAD_SAFE = 0;
506 mutable double m_r3 ATLAS_THREAD_SAFE = 0;
507 mutable float m_quality ATLAS_THREAD_SAFE = 0;
508 mutable int m_type ATLAS_THREAD_SAFE = 0;
509 mutable double m_dzdr_t ATLAS_THREAD_SAFE = 0;
510 mutable double m_dzdr_b ATLAS_THREAD_SAFE = 0;
511 mutable bool m_givesTrack ATLAS_THREAD_SAFE = 0;
512 mutable float m_trackPt ATLAS_THREAD_SAFE = 0;
513 mutable float m_trackEta ATLAS_THREAD_SAFE = 0;
514 mutable long m_eventNumber ATLAS_THREAD_SAFE = 0;
515 };
516
517} // end of name space
518
520// Object-function for curvature seeds comparison
522
524public:
525 bool operator ()
526 (const std::pair<float,InDet::SiSpacePointForSeed*>& i1,
527 const std::pair<float,InDet::SiSpacePointForSeed*>& i2)
528 {
529 return i1.first < i2.first;
530 }
531};
532
533namespace InDet {
534
535 inline
537 {
538 const Trk::PrepRawData* d = sp->clusterList().first;
539 if (!d || !prd_to_track_map.isUsed(*d)) return false;
540 d = sp->clusterList().second;
541 if (!d || prd_to_track_map.isUsed(*d)) return true;
542 return false;
543 }
544}
545
546#endif // SiSpacePointsSeedMaker_ATLxk_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t sp
#define z
Describes the API of the Region of Ineterest geometry.
InDet::SiSpacePointsSeedMakerEventData holds event dependent data used by ISiSpacePointsSeedMaker.
FloatProperty m_maxScore
Maximum score to accept.
virtual bool getWriteNtupleBoolProperty() const override
static void newSeed(EventData &data, SiSpacePointForSeed *&p1, SiSpacePointForSeed *&p2, float z)
SG::ReadHandleKey< SpacePointContainer > m_spacepointsSCT
virtual void find3Sp(const EventContext &ctx, EventData &data, const std::list< Trk::Vertex > &lv) const override
with three space points with or without vertex constraint
void newOneSeed(EventData &data, SiSpacePointForSeed *&p1, SiSpacePointForSeed *&p2, SiSpacePointForSeed *&p3, float z, float quality) const
This inserts a seed into the set of saved seeds.
std::array< std::array< int, arraySizeNeighbourBinsVertex >, arraySizePhiZV > m_neighboursVertexPhiZ
virtual void newRegion(const EventContext &ctx, EventData &data, const std::vector< IdentifierHash > &vPixel, const std::vector< IdentifierHash > &vSCT) const override
Initialize tool for new region.
void fillSeeds(EventData &data) const
fills the seeds from the mapOneSeeds_Pro member into the l_seeds_Pro member of the data object,...
SiSpacePointsSeedMaker_ATLxk(const std::string &, const std::string &, const IInterface *)
Constructor.
virtual void find2Sp(EventData &data, const std::list< Trk::Vertex > &lv) const override
With two space points with or without vertex constraint.
float m_seedScoreThresholdPPPConfirmationSeed
Seed score thresholds defined based on the modifiers defined as configurables above.
SG::ReadHandleKey< SpacePointContainer > m_spacepointsPixel
SiSpacePointsSeedMaker_ATLxk & operator=(const SiSpacePointsSeedMaker_ATLxk &)=delete
int m_maxBinPhiVertex
number of bins in phi for vertices
void buildFrameWork()
prepare several data members with cached cut values, conversion factors, binnings,...
BooleanProperty m_optimisePhiBinning
This flag will make the buildFrameWork method determine an optimal phi binning of the search regions ...
bool newVertices(EventData &data, const std::list< Trk::Vertex > &lV) const
This method updates the EventData based on the passed list of vertices.
SiSpacePointsSeedMaker_ATLxk(const SiSpacePointsSeedMaker_ATLxk &)=delete
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
std::array< int, arraySizePhiZ > m_nNeighbourCellsBottom
arrays associating bins to each other for SP formation
FloatProperty m_dImpactCutSlopeUnconfirmedSSS
these flags allow to dynamically tighten the d0 cut on non-confirmed seeds based on the penalty score...
void fillLists(EventData &data) const
this method populates the data object's "histograms" (implemented as nested vectors).
MsgStream & dumpConditions(EventData &data, MsgStream &out) const
Dumps conditions information into the MsgStream.
void production3SpTrigger(EventData &data, std::array< std::vector< InDet::SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &rb, std::array< std::vector< InDet::SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &rbe, std::array< std::vector< InDet::SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &rt, std::array< std::vector< InDet::SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &rte, const int numberBottomCells, const int numberTopCells, int &nseed) const
as above, but for the trigger
void findNext(EventData &data) const
This method is called within next() when we are out of vertices.
static void convertToBeamFrameWork(EventData &data, const Trk::SpacePoint *const &sp, std::array< float, 3 > &r)
This method popualtes the r array with the space point's coordinates relative to the beam spot.
SiSpacePointForSeed * newSpacePoint(EventData &data, const Trk::SpacePoint *const &sp) const
Create a SiSpacePointForSeed from the space point.
static constexpr float m_radiusCutIBL
We detect IBL hits via the seed radial location.
virtual void findVSp(const EventContext &ctx, EventData &data, const std::list< Trk::Vertex > &lv) const override
with variable number space points with or without vertex constraint Variable means (2,...
float m_seedScoreThresholdSSSConfirmationSeed
max (score is assigned negative sign) score for SSS seeds with confirmation seed requirement.
FloatProperty m_seedScoreBonusPPP
Scoring modifiers applied when ranking seeds.
bool isConfirmedSeed(const InDet::SiSpacePointForSeed *bottomSP, const InDet::SiSpacePointForSeed *topSP, float quality) const
Helper method to determine if a seed is 'confirmed' - this means that a second seed exists with compa...
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Read handle for conditions object to get the field cache.
float m_inverseBinSizePhiVertex
as above but for vertex
std::array< int, arraySizePhiZV > m_nNeighboursVertexPhiZ
SG::ReadHandleKey< SpacePointOverlapCollection > m_spacepointsOverlap
virtual void newEvent(const EventContext &ctx, EventData &data, int iteration) const override
Initialize tool for new event.
float m_inverseBinSizePhi
cache the inverse bin size in phi which we use - needed to evaluate phi bin locations
BooleanProperty m_alwaysKeepConfirmedPixelSeeds
This flag will lead to all confirmed seeds (seeds where a second compatible seed with a different top...
std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > m_neighbourCellsBottom
mapping of neighbour cells in the 2D phi-z binning to consider for the "bottom SP" search for central...
bool isUsed(const Trk::SpacePoint *sp, const Trk::PRDtoTrackMap &prd_to_track_map) const
int m_nBinsR
number of bins in the radial coordinate
virtual StatusCode initialize() override
Initialisation.
IntegerProperty m_maxOneSizeSSS
maximum number of seeds to keep per central space point.
virtual ~SiSpacePointsSeedMaker_ATLxk()=default
void buildBeamFrameWork(EventData &data) const
Initiate beam frame work for seed generator.
float m_ipt2
inverse square of 90% of the pt min cut
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
virtual StatusCode finalize() override
Finalize.
static constexpr float m_COF
appears to be an approximated term related to multiple-scattering of particles traversing the ID duri...
void newOneSeedWithCurvaturesComparison(EventData &data, SiSpacePointForSeed *&SPb, SiSpacePointForSeed *&SP0, float Zob) const
This creates all possible seeds with the passed central and bottom SP, using all top SP candidates wh...
virtual const SiSpacePointsSeed * next(const EventContext &ctx, EventData &data) const override
This method will update the data.seedOutput member to be the next seed pointed at by the data....
std::array< int, arraySizePhiZ > m_nNeighbourCellsTop
number of neighbouring phi-z bins to consider when looking for "top SP" candidates for each phi-z bin
bool isZCompatible(EventData &data, const float Zv, const float R, const float T) const
std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > m_neighbourCellsTop
mapping of neighbour cells in the 2D phi-z binning to consider for the "top SP" search for central SP...
Gaudi::Property< bool > m_writeNtuple
Flag to write validation ntuples. Turned off by default.
float m_ipt
inverse of 90% of the ptmin cut
Size
enum for array sizes Note that this stores the maximum capacities, the actual binnings do not always ...
@ arraySizePhiZ
capacity for the 2D phi-z arrays
@ arraySizeNeighbourBins
array size to store neighbouring phi-z-regions in the seed finding
@ arraySizePhiZV
array size in phi-Z 2D for the vertexing
@ arraySizePhiV
array size in phi for vertexing
void production3Sp(EventData &data) const
Top-level method for 3-SP seed production.
static MsgStream & dumpEvent(EventData &data, MsgStream &out)
Dumps event information into the MsgStream.
float m_dzdrmin0
conversion factors and cached cut values
virtual void newRegion(const EventContext &ctx, SiSpacePointsSeedMakerEventData &data, const std::vector< IdentifierHash > &vPixel, const std::vector< IdentifierHash > &vSCT, const IRoiDescriptor &iRD) const override
static float azimuthalStep(const float pTmin, const float maxd0, const float Rmin, const float Rmax)
Determine the expected azimuthal trajectory displacement in phi in presence of the magnetic field for...
virtual void writeNtuple(const SiSpacePointsSeed *seed, const Trk::Track *track, int seedType, long eventNumber) const override
This method is called by the SiSPSeededTrackFinder algorithm to fill ntuples for seeds seen by the al...
SiSpacePointsSeedMakerEventData EventData
Property holding a SG store/key/clid from which a ReadHandle is made.
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
int r
Definition globals.cxx:22
Primary Vertex Finder.
-event-from-file