ATLAS Offline Software
Mode3dFromFsmw1dFinder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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 
14 typedef std::pair< std::pair<double, std::pair<int,int> >, double> IndexedWeighted ;
15 typedef std::vector< std::pair<int, int > > VecIndices ;
16 typedef std::vector< VecIndices > VeVecIndices ;
17 //typedef std::vector< std::vector< int > > VeVecIndices ;
18 
19 namespace Trk
20 {
21 
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:
102  class Mode3dFromFsmw1dInfo;
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 
143  struct CompareWeight {
145  {
146  return aa.second > bb.second ;
147  }
148  } ;
149 
150  // working horse for 1dMode
151  std::vector< std::pair< int, int> >
152  getFsmw1dMode( 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 
182  double m_minXYdist2Z ;
183 
184  double m_fraction ;
185  double m_minXYbeam ;
186  bool m_broaden ;
187 
188  class Mode3dFromFsmw1dInfo final: public IMode3dInfo
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:
224  std::vector<int> m_UsedCrossingPointsIndices;
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
grepfile.info
info
Definition: grepfile.py:38
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::AcceptedCrossingPointsIndices
virtual const std::vector< int > & AcceptedCrossingPointsIndices() const override
Definition: Mode3dFromFsmw1dFinder.cxx:1187
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::perigeesAtSeed
virtual int perigeesAtSeed(std::vector< const Trk::TrackParameters * > &perigees, const std::vector< const Trk::TrackParameters * > &perigeeList) const override final
Definition: Mode3dFromFsmw1dFinder.cxx:1204
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_idxphi
VeVecIndices m_idxphi
Definition: Mode3dFromFsmw1dFinder.h:219
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_correZ
double m_correZ
Definition: Mode3dFromFsmw1dFinder.h:227
Trk::Mode3dFromFsmw1dFinder::m_minXYdist2Z
double m_minXYdist2Z
Definition: Mode3dFromFsmw1dFinder.h:182
Trk::Mode3dFromFsmw1dFinder::CompareWeight::operator()
int operator()(const Trk::PositionAndWeight &aa, const Trk::PositionAndWeight &bb)
Definition: Mode3dFromFsmw1dFinder.h:144
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_z_stk
std::vector< float > m_z_stk
Definition: Mode3dFromFsmw1dFinder.h:232
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
Trk::Mode3dFromFsmw1dFinder::m_minXYbeam
double m_minXYbeam
Definition: Mode3dFromFsmw1dFinder.h:185
Trk::Mode3dFromFsmw1dFinder::doModeSearch
int doModeSearch(VeVecIndices *idxs, const std::vector< IndexedWeighted > &position, int expectMax) const
Definition: Mode3dFromFsmw1dFinder.cxx:395
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::pushPoint
void pushPoint(float phi, float r, float z, float w)
Definition: Mode3dFromFsmw1dFinder.cxx:1257
Trk::Mode3dFromFsmw1dFinder::VecIndicesCompare
Definition: Mode3dFromFsmw1dFinder.h:134
Trk::Mode3dFromFsmw1dFinder::getMode
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)
Definition: Mode3dFromFsmw1dFinder.cxx:46
Trk::Mode3dFromFsmw1dFinder::m_minModeDistZ
int m_minModeDistZ
Definition: Mode3dFromFsmw1dFinder.h:181
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_UsedCrossingPointsIndices
std::vector< int > m_UsedCrossingPointsIndices
Definition: Mode3dFromFsmw1dFinder.h:224
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo
Definition: Mode3dFromFsmw1dFinder.h:189
Trk::Mode3dFromFsmw1dFinder::Mode2Seed
Amg::Vector3D Mode2Seed(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const VeVecIndices &) const
Definition: Mode3dFromFsmw1dFinder.cxx:889
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::Modes1d
virtual unsigned int Modes1d(std::vector< float > &, std::vector< float > &, std::vector< float > &, std::vector< float > &) const override final
Definition: Mode3dFromFsmw1dFinder.cxx:1140
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::pushIndex
void pushIndex(int idx)
Definition: Mode3dFromFsmw1dFinder.cxx:1231
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_phi_stk
std::vector< float > m_phi_stk
Definition: Mode3dFromFsmw1dFinder.h:230
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_idxZ
VeVecIndices m_idxZ
Definition: Mode3dFromFsmw1dFinder.h:221
Trk::PositionAndWeight
std::pair< Amg::Vector3D, double > PositionAndWeight
Definition: SeedFinderParamDefs.h:17
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::getCorrelationDistance
virtual void getCorrelationDistance(double &cXY, double &cZ) const override
Definition: Mode3dFromFsmw1dFinder.cxx:1195
Trk::Mode3dFromFsmw1dFinder::m_broaden
bool m_broaden
Definition: Mode3dFromFsmw1dFinder.h:186
IndexedWeighted
std::pair< std::pair< double, std::pair< int, int > >, double > IndexedWeighted
Definition: Mode3dFromFsmw1dFinder.h:14
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Trk::Mode3dFromFsmw1dFinder::CompareWeight
Definition: Mode3dFromFsmw1dFinder.h:143
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_wght_stk
std::vector< float > m_wght_stk
Definition: Mode3dFromFsmw1dFinder.h:233
Trk::Mode3dFromFsmw1dFinder::m_fraction
double m_fraction
Definition: Mode3dFromFsmw1dFinder.h:184
beamspotman.n
n
Definition: beamspotman.py:731
AthAlgTool.h
Trk::Mode3dFromFsmw1dFinder::m_minModeDistPhi
int m_minModeDistPhi
Definition: Mode3dFromFsmw1dFinder.h:179
Trk::Mode3dFromFsmw1dFinder::Compare1dPosition::operator()
int operator()(const Amg::Vector3D &aa, Amg::Vector3D &bb) const
Definition: Mode3dFromFsmw1dFinder.h:127
Trk::IMode3dInfo
Auxillary interface for getting back additional data.
Definition: IMode3dFinder.h:31
Trk::Mode3dFromFsmw1dFinder::CheckCorrelation
VeVecIndices CheckCorrelation(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const VeVecIndices &, const VeVecIndices &, int zin=0) const
Definition: Mode3dFromFsmw1dFinder.cxx:497
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_radi_stk
std::vector< float > m_radi_stk
Definition: Mode3dFromFsmw1dFinder.h:231
VecIndices
std::vector< std::pair< int, int > > VecIndices
Definition: Mode3dFromFsmw1dFinder.h:15
Trk::Mode3dFromFsmw1dFinder::getClosestPair
Amg::Vector3D getClosestPair(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const double vx, const double vy) const
Definition: Mode3dFromFsmw1dFinder.cxx:796
Trk::Mode3dFromFsmw1dFinder::VecIndicesCompare::operator()
int operator()(std::vector< std::pair< int, int > > &aa, std::vector< std::pair< int, int > > &bb) const
Definition: Mode3dFromFsmw1dFinder.h:135
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::pushIndices
void pushIndices(const std::vector< std::pair< int, int >> &modes)
Definition: Mode3dFromFsmw1dFinder.cxx:1247
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::setCorre
void setCorre(int zin, double corre)
Definition: Mode3dFromFsmw1dFinder.cxx:1267
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dFinder
Mode3dFromFsmw1dFinder(const std::string &t, const std::string &n, const IInterface *p)
Definition: Mode3dFromFsmw1dFinder.cxx:16
Trk::Mode3dFromFsmw1dFinder::m_minModeDistR
int m_minModeDistR
Definition: Mode3dFromFsmw1dFinder.h:180
Trk::Mode3dFromFsmw1dFinder
Definition: Mode3dFromFsmw1dFinder.h:32
Trk::Mode3dFromFsmw1dFinder::getFsmw1dMode
std::vector< std::pair< int, int > > getFsmw1dMode(std::vector< IndexedWeighted > &, int) const
Definition: Mode3dFromFsmw1dFinder.cxx:669
Trk::Mode3dFromFsmw1dFinder::Compare1dPosition
Definition: Mode3dFromFsmw1dFinder.h:126
IMode3dFinder.h
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_idxradi
VeVecIndices m_idxradi
Definition: Mode3dFromFsmw1dFinder.h:220
Trk::phi
@ phi
Definition: ParamDefs.h:75
VeVecIndices
std::vector< VecIndices > VeVecIndices
Definition: Mode3dFromFsmw1dFinder.h:16
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_trkidx
std::vector< std::pair< int, int > > m_trkidx
Definition: Mode3dFromFsmw1dFinder.h:235
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::setTrkidx
virtual void setTrkidx(std::vector< std::pair< int, int > > &&trkidx) override final
Definition: Mode3dFromFsmw1dFinder.cxx:1239
Trk::Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dInfo::m_correXY
double m_correXY
Definition: Mode3dFromFsmw1dFinder.h:226
test_AnalysisBaseEventLoopJob.aa
aa
Definition: test_AnalysisBaseEventLoopJob.py:37
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97