ATLAS Offline Software
Loading...
Searching...
No Matches
Mode3dFromFsmw1dFinder.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4//Author: Lianyou Shan <lianyou.shan@cern.ch>
5#ifndef TRKVERTEXSEEDFINDERUTILS_MODE3DTOFSMW1DFINDER_H
6#define TRKVERTEXSEEDFINDERUTILS_MODE3DTOFSMW1DFINDER_H
7
8
9#include "GaudiKernel/ToolHandle.h"
12
13
14typedef std::pair< std::pair<double, std::pair<int,int> >, double> IndexedWeighted ;
15typedef std::vector< std::pair<int, int > > VecIndices ;
16typedef std::vector< VecIndices > VeVecIndices ;
17//typedef std::vector< std::vector< int > > VeVecIndices ;
18
19namespace Trk
20{
21
30
31 class Mode3dFromFsmw1dFinder final : public extends<AthAlgTool, IMode3dFinder>
32 {
33 public:
34 // Standard Athena constructor.
35 Mode3dFromFsmw1dFinder(const std::string& t,
36 const std::string& n,
37 const IInterface* p);
38
39
47 virtual Amg::Vector3D
48 getMode (const double vx,
49 const double vy,
50 const std::vector<Trk::PositionAndWeight>& points) const override final;
51
52
63 virtual Amg::Vector3D
64 getMode (const double vx,
65 const double vy,
66 const std::vector<Trk::PositionAndWeight>& points,
67 std::unique_ptr<IMode3dInfo>& info) const override final;
68
69
77 virtual Amg::Vector3D
78 getMode (const double vx,
79 const double vy,
80 const std::vector<Amg::Vector3D>& points) const override final;
81
82
93 virtual Amg::Vector3D
94 getMode (const double vx,
95 const double vy,
96 const std::vector<Amg::Vector3D>& points,
97 std::unique_ptr<IMode3dInfo>& info) const override final;
98
99
100
101 private:
103
104
107 const double vx,
108 const double vy,
109 const std::vector<Trk::PositionAndWeight> & VectorOfPoints) const;
110
111
112 // solve the overlap among different searches
113 int doModeSearch( VeVecIndices * idxs,
114 const std::vector< IndexedWeighted > & position,
115 int expectMax ) const ;
116
117
118 // correlation by indices of crossing points
120 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
121 const VeVecIndices &,
122 const VeVecIndices & ,
123 int zin = 0 ) const ;
124
125
127 int operator () ( const Amg::Vector3D & aa, Amg::Vector3D & bb ) const
128 {
129 return aa.x() < bb.x() ;
130 } ;
131 } ;
132
133
135 int operator () ( std::vector< std::pair< int,int> > &aa,
136 std::vector< std::pair< int,int> > &bb ) const
137 {
138 return aa[0].second < bb[0].second ;
139 }
140 } ;
141
142
145 {
146 return aa.second > bb.second ;
147 }
148 } ;
149
150 // working horse for 1dMode
151 std::vector< std::pair< int, int> >
152 getFsmw1dMode( const std::vector<IndexedWeighted> &, int ) const ;
153
154
156 getClosestPair (Mode3dFromFsmw1dInfo& info,
157 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
158 const double vx, const double vy) const;
159
160
162 Mode2Seed( Mode3dFromFsmw1dInfo& info,
163 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
164 const VeVecIndices & ) const;
165
166
168 Mode2Seed( Mode3dFromFsmw1dInfo& info,
169 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
170 const VeVecIndices &, const VeVecIndices & ) const;
171
172
174 Mode2Seed( Mode3dFromFsmw1dInfo& info,
175 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
176 const VeVecIndices &, const VeVecIndices &, const VeVecIndices & ) const;
177
178
183
184 double m_fraction ;
185 double m_minXYbeam ;
187
189 {
190 public:
191 // Passing some middle result to outside world, useless unless to monitor the tool
192 virtual unsigned int
193 Modes1d(std::vector<float> &, std::vector<float> &,
194 std::vector<float> &, std::vector<float> &) const override final;
195
196
197 virtual const std::vector<int>&
198 AcceptedCrossingPointsIndices() const override;
199
200
201 virtual void
202 getCorrelationDistance( double &cXY, double &cZ ) const override;
203
204
205 virtual int
206 perigeesAtSeed (std::vector<const Trk::TrackParameters*>& perigees ,
207 const std::vector<const Trk::TrackParameters*> & perigeeList) const override final;
208
209
210 virtual void
211 setTrkidx (std::vector< std::pair <int, int> >&& trkidx) override final;
212
213
214 void pushIndex (int idx);
215 void pushIndices (const std::vector< std::pair<int,int>>& modes);
216 void pushPoint (float phi, float r, float z, float w);
217 void setCorre (int zin, double corre);
218
222
223 private:
225
226 double m_correXY = -9.9;
227 double m_correZ = -9.9;
228
229 // stacks to store the phi-radius-z before sorting for Ntuple making
230 std::vector< float > m_phi_stk ;
231 std::vector< float > m_radi_stk ;
232 std::vector< float > m_z_stk ;
233 std::vector< float > m_wght_stk ;
234
235 std::vector< std::pair <int, int> > m_trkidx ;
236 };
237
238 };
239}
240#endif
std::pair< std::pair< double, std::pair< int, int > >, double > IndexedWeighted
std::vector< VecIndices > VeVecIndices
std::vector< std::pair< int, int > > VecIndices
Auxillary interface for getting back additional data.
virtual unsigned int Modes1d(std::vector< float > &, std::vector< float > &, std::vector< float > &, std::vector< float > &) const override final
void pushPoint(float phi, float r, float z, float w)
virtual void setTrkidx(std::vector< std::pair< int, int > > &&trkidx) override final
void pushIndices(const std::vector< std::pair< int, int > > &modes)
virtual void getCorrelationDistance(double &cXY, double &cZ) const override
virtual const std::vector< int > & AcceptedCrossingPointsIndices() const override
virtual int perigeesAtSeed(std::vector< const Trk::TrackParameters * > &perigees, const std::vector< const Trk::TrackParameters * > &perigeeList) const override final
std::vector< std::pair< int, int > > getFsmw1dMode(const std::vector< IndexedWeighted > &, int) const
VeVecIndices CheckCorrelation(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const VeVecIndices &, const VeVecIndices &, int zin=0) const
int doModeSearch(VeVecIndices *idxs, const std::vector< IndexedWeighted > &position, int expectMax) const
Mode3dFromFsmw1dFinder(const std::string &t, const std::string &n, const IInterface *p)
virtual Amg::Vector3D getMode(const double vx, const double vy, const std::vector< Trk::PositionAndWeight > &points) const override final
Obtain the 3d-mode (position) from a list of positions (distribution in space)
Amg::Vector3D getClosestPair(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const double vx, const double vy) const
Amg::Vector3D Mode2Seed(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const VeVecIndices &) const
int r
Definition globals.cxx:22
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::pair< Amg::Vector3D, double > PositionAndWeight
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ phi
Definition ParamDefs.h:75
int operator()(const Amg::Vector3D &aa, Amg::Vector3D &bb) const
int operator()(const Trk::PositionAndWeight &aa, const Trk::PositionAndWeight &bb)
int operator()(std::vector< std::pair< int, int > > &aa, std::vector< std::pair< int, int > > &bb) const