ATLAS Offline Software
InDetIterativeSecVtxFinderTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
19 //implemented using as template the InDetPriVxFinderTool class of A. Wildauer and F. Akesson
20 
21 #ifndef INDETPRIVXFINDERTOOL_INDETITERATIVESECVXFINDERTOOL_H
22 #define INDETPRIVXFINDERTOOL_INDETITERATIVESECVXFINDERTOOL_H
23 
32 #include "GaudiKernel/ToolHandle.h"
33 #include "GaudiKernel/ServiceHandle.h"
34 #include "TrkTrack/TrackCollection.h" // type def ...
35 #include "TrkParticleBase/TrackParticleBaseCollection.h" // type def ...
37 // we may save out some private stuff
38 #include "xAODTracking/VertexFwd.h"
42 #include <vector>
43 
44 
45 class TTree;
46 
47 namespace Trk
48 {
49 
50  class Track;
51  class TrackParticleBase;
52  class ITrackLink;
53  class IVertexSeedFinder;
54  class IImpactPoint3dEstimator;
55  class IVertexLinearizedTrackFactory;
56 }
57 //
58 //
59 namespace InDet
60 {
61  class IInDetTrackSelectionTool;
62 
63 // InnerDetector/InDetValidation/InDetVertexSplitter/InDetVertexSplitterHist
64 // InnerDetector/InDetDigitization/FastSiDigitization/SiSmearedDigitizationTool
65 // Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/share/ImagingSeedTuningAlg_jobOptions.py
66  class ATLAS_NOT_THREAD_SAFE InDetIterativeSecVtxFinderTool : public extends<AthAlgTool, ISecVertexFinder>
67  {
68 
69 public:
70 
74  using extends::extends;
75  InDetIterativeSecVtxFinderTool(const std::string& t, const std::string& n, const IInterface* p);
76 
81  virtual ~InDetIterativeSecVtxFinderTool() = default;
82 
83  StatusCode initialize() override;
84  StatusCode finalize() override;
85 
86  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
87  findVertex(const TrackCollection* trackTES) override;
88  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
89  findVertex(const Trk::TrackParticleBaseCollection* trackTES) override;
90 
97  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
98  findVertex(const xAOD::TrackParticleContainer* trackParticles) override;
99  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
100  findVertex( const std::vector<const xAOD::IParticle*> & inputTracks) override;
101 
102  void setPriVtxPosition( double , double , double ) override;
103 
104  int getModes1d( std::vector<int> *, std::vector<int> *, std::vector<int> * ) const ;
105 
106  private:
107 
108 
109  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
110  findVertex( const std::vector<Trk::ITrackLink*> & trackVector) ;
111 
112  bool passHitsFilter( const Trk::TrackParameters* , float vtxR, float absvz ) const;
113 
114  bool V0kine( const std::vector<Amg::Vector3D>&, const Amg::Vector3D &position , float & , float & ) const;
115 
116 
117  const std::vector<Amg::Vector3D> getVertexMomenta( xAOD::Vertex * myxAODVertex ) const ;
118 // double MomentumDirection( int, const Amg::Vector3D & ) const ;
119 
120 
121  static double VrtVrtDist( xAOD::Vertex * v1, xAOD::Vertex * v2 ) ;
122 
123  float removeTracksInBadSeed( xAOD::Vertex * myxAODVertex, std::vector<const Trk::TrackParameters*> & ) const ;
124 
125  void FillXcheckdefauls() ;
126 
127 
129  mutable std::vector< Amg::Vector3D > m_TrkAtVtxMomenta ;
130 
131 // watch below for possible update from InDetIterativePriVxFinderTool
132 
133  void removeCompatibleTracks(xAOD::Vertex * myxAODVertex,
134  std::vector<const Trk::TrackParameters*> & perigeesToFit,
135  std::vector<Trk::ITrackLink*> & seedTracks) const;
136 
137  void removeAllFrom(std::vector<const Trk::TrackParameters*> & perigeesToFit,
138  std::vector<Trk::ITrackLink*> & seedTracks) const;
139 
140 // double compatibility(const Trk::TrackParameters& measPerigee,
141 // const xAOD::Vertex & vertex ) const;
142  double compatibility(const Trk::TrackParameters& measPerigee,
143  const AmgSymMatrix(3) &covariancePosition , const Amg::Vector3D &position ) const ;
144  void countTracksAndNdf(xAOD::Vertex * myxAODVertex,
145  float & ndf, int & ntracks) const;
146 
147 
148 
149  ToolHandle< Trk::AdaptiveVertexFitter > m_iVertexFitter{this, "VertexFitterTool", "Trk::AdaptiveVertexFitter","Vertex Fitter"};
150  ToolHandle< InDet::IInDetTrackSelectionTool > m_trkFilter{this, "BaseTrackSelector", "InDet::InDetTrackSelection", "base track selector"};
151  ToolHandle< InDet::IInDetTrackSelectionTool > m_SVtrkFilter{this, "SecVtxTrackSelector", "InDet::InDetSecVtxTrackSelection", "SV track selector"};
152  ToolHandle< Trk::IVertexSeedFinder > m_SeedFinder{this, "SeedFinder", "Trk::IndexedCrossDistancesSeedFinder", "seed finder"};
153  ToolHandle< Trk::IImpactPoint3dEstimator > m_ImpactPoint3dEstimator{this, "ImpactPoint3dEstimator", "Trk::ImpactPoint3dEstimator", "impact point estimator"};
154  ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinearizedTrackFactory{this, "LinearizedTrackFactory", "Trk::FullLinearizedTrackFactory", "linearized track factory"};
155 
156 
157  Gaudi::Property<int> m_filterLevel{this,"VertexFilterLevel",0,""} ;
158  Gaudi::Property<double> m_significanceCutSeeding{this, "significanceCutSeeding", 9., ""};
159  Gaudi::Property<double> m_maximumChi2cutForSeeding{this, "maxCompatibilityCutSeeding",18., ""};
160  Gaudi::Property<double> m_minWghtAtVtx{this, "minTrackWeightAtVtx",0.02, ""};
161  Gaudi::Property<double> m_maxVertices{this, "maxVertices",20, ""};
162  Gaudi::Property<double> m_CutHitsFilter{this, "TrackInnerOuterFraction",0.95, ""};
163  Gaudi::Property<float> m_privtxRef{this, "MomentumProjectionOnDirection",-999.9,""};
164  Gaudi::Property<float> m_minVtxDist{this, "SeedsMinimumDistance",0.1,""};
165  Gaudi::Property<bool> m_createSplitVertices{this, "createSplitVertices", false, ""};
166  Gaudi::Property<int> m_splitVerticesTrkInvFraction{this, "splitVerticesTrkInvFraction",2,""};
167 
168  Gaudi::Property<bool> m_reassignTracksAfterFirstFit{this, "reassignTracksAfterFirstFit", true, ""};
169 
170  Gaudi::Property<bool> m_doMaxTracksCut{this, "doMaxTracksCut", false, ""};
171  Gaudi::Property<unsigned int> m_maxTracks{this, "MaxTracks", 5000,""};
172 
173  void SGError(const std::string& errService);
174 
175  virtual void printParameterSettings();
176 
177  TTree* m_OTree{} ;
178 
179  long int m_evtNum{} ;
180  int m_iterations{} ;
181 
182  std::vector<int> *m_leastmodes{} ;
183  std::vector< std::vector < float > > * m_sdFsmwX{};
184  std::vector< std::vector < float > > * m_sdFsmwY{};
185  std::vector< std::vector < float > > * m_sdFsmwZ{};
186  std::vector< std::vector < float > > * m_sdcrsWght{};
187 
188  std::vector<int> * m_nperiseed{} ;
189  std::vector < float > *m_seedX{} ;
190  std::vector < float > *m_seedY{} ;
191  std::vector < float > *m_seedZ{} ;
192  std::vector < float > *m_seedXYdist{} ;
193  std::vector < float > *m_seedZdist{} ;
194  std::vector < int > *m_seedac{} ;
195 
196  mutable float m_v0mass{}, m_v0ee{}, m_dir{}, m_ndf{}, m_hif{} ;
197  mutable int m_ntracks{} ;
198  mutable std::vector< Amg::VectorX > m_trkdefiPars ;
199 
200  };//end of class definitions
201 }//end of namespace definitions
202 #endif
203 
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
InDet::InDetIterativeSecVtxFinderTool::m_trkdefiPars
std::vector< Amg::VectorX > m_trkdefiPars
Definition: InDetIterativeSecVtxFinderTool.h:198
IVertexSeedFinder.h
TrackParticleBaseCollection.h
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
VertexContainerFwd.h
m_dir
TDirectory & m_dir
The directory we need to return to.
Definition: OutputStreamData.cxx:41
TrackParameters.h
InDet::InDetIterativeSecVtxFinderTool::~InDetIterativeSecVtxFinderTool
virtual ~InDetIterativeSecVtxFinderTool()=default
Destructor.
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
IImpactPoint3dEstimator.h
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
initialize
void initialize()
Definition: run_EoverP.cxx:894
InDet::InDetIterativeSecVtxFinderTool::getModes1d
int getModes1d(std::vector< int > *, std::vector< int > *, std::vector< int > *) const
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
IVertexFinder.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
python.TrigInDetConfig.inputTracks
inputTracks
Definition: TrigInDetConfig.py:183
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
TrackCollection.h
Trk::ParametersBase
Definition: ParametersBase.h:55
DataVector< Trk::Track >
IInDetTrackSelectionTool.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::InDetIterativeSecVtxFinderTool
Definition: InDetIterativeSecVtxFinderTool.h:67
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
VertexFwd.h
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
TrackParticleFwd.h
InDet::InDetIterativeSecVtxFinderTool::m_TrkAtVtxMomenta
std::vector< Amg::Vector3D > m_TrkAtVtxMomenta
Definition: InDetIterativeSecVtxFinderTool.h:129
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
IInDetIterativeSecVtxFinderTool.h
InDet::InDetIterativeSecVtxFinderTool::m_privtx
Amg::Vector3D m_privtx
Definition: InDetIterativeSecVtxFinderTool.h:128
checker_macros.h
Define macros for attributes used to control the static checker.
AdaptiveVertexFitter.h
TrackParticleContainerFwd.h