ATLAS Offline Software
BPhysPVTools.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DERIVATIONFRAMEWORK_PVTOOLS_H
6 #define DERIVATIONFRAMEWORK_PVTOOLS_H
7 
8 #include "GaudiKernel/ToolHandle.h"
10 #include "xAODBPhys/BPhysHelper.h"
11 #include <vector>
13 
14 // Author: Adam Barton <abarton@SPAMMENOTTtttcern.ch>
15 namespace Trk {
16  class V0Tools;
17 }
18 namespace Analysis{
19  class PrimaryVertexRefitter;
20 }
21 
22 
23 namespace DerivationFramework {
24 
25  class BPhysPVTools : public AthMessaging {
26 
27  private:
30 
33 
34  bool m_3dCalc;
35 
36  public:
37 
38  BPhysPVTools(const Trk::V0Tools *v0Tools);
39  BPhysPVTools(const Trk::V0Tools *v0Tools, const xAOD::EventInfo*);
40  void SetSave3d(bool v) { m_3dCalc =v; }
41  StatusCode FillCandExistingVertices(xAOD::VertexContainer* vtxContainer, const xAOD::VertexContainer* pvContainer, int DoVertexType);
42 
43  void FillBPhysHelperNULL(xAOD::BPhysHelper &vtx, const xAOD::VertexContainer* PvContainer,
44  xAOD::BPhysHelper::pv_type pvtype, bool do3d = false) const;
45 
46  StatusCode FillCandwithRefittedVertices(xAOD::VertexContainer* vtxContainer, const xAOD::VertexContainer* pvContainer,xAOD::VertexContainer* refPvContainer, const Analysis::PrimaryVertexRefitter* , size_t in_PV_max, int DoVertexType);
47 
48  void DecorateWithNULL(xAOD::VertexContainer* vtxContainer,const xAOD::VertexContainer* pvContainer, int DoVertexType) const;
49 
50  void DecorateWithDummyVertex(xAOD::VertexContainer* vtxContainer, const xAOD::VertexContainer* pvContainer, const xAOD::Vertex* Dummy, int DoVertexType, bool SetOrignal) const;
51 
53  void FillBPhysHelper(xAOD::BPhysHelper &vtx, const xAOD::Vertex* refPV,const xAOD::VertexContainer* refPvContainer,
54  xAOD::BPhysHelper::pv_type pvtype, int) const;
55 
57  size_t FindLowZIndex(const xAOD::BPhysHelper &Obj,
58  const std::vector<const xAOD::Vertex*> &PVlist,
59  const size_t PV_minNTracks=0) const;
61  size_t FindLowA0Index(const xAOD::BPhysHelper &Obj,
62  const std::vector<const xAOD::Vertex*> &PVlist,
63  const size_t PV_minNTracks=0) const;
64 
65  size_t FindHighPtIndex(const std::vector<const xAOD::Vertex*> &PVlist) const;
66 
71  static std::vector<const xAOD::Vertex*> GetGoodPV(const xAOD::VertexContainer* pvContainer);
72 
79  void SetMinNTracksInPV(size_t PV_minNTracks);
80 
85  [[nodiscard]] Amg::Vector3D GetBeamSpot() const;
86 
90  const std::vector<const xAOD::Vertex*> &PVlist,
91  const size_t PV_minNTracks=0) const;
95  const xAOD::Vertex* vertex) const;
99 
100  static void PrepareVertexLinks(xAOD::Vertex* theResult,
101  const xAOD::TrackParticleContainer* importedTrackCollection);
102  }; // class BPhysPVTools
103 
104 } // namespace DerivationFramework
105 
106 
107 #endif // DERIVATIONFRAMEWORK_PVTOOLS_H
DerivationFramework::BPhysPVTools::DocaExtrapToBeamSpot
Amg::Vector3D DocaExtrapToBeamSpot(xAOD::BPhysHelper &obj) const
Point of DOCA w.r.t.
Definition: BPhysPVTools.cxx:513
xAOD::BPhysHelper
Definition: BPhysHelper.h:71
DerivationFramework::BPhysPVTools::DecorateWithDummyVertex
void DecorateWithDummyVertex(xAOD::VertexContainer *vtxContainer, const xAOD::VertexContainer *pvContainer, const xAOD::Vertex *Dummy, int DoVertexType, bool SetOrignal) const
Definition: BPhysPVTools.cxx:102
DerivationFramework::BPhysPVTools::m_EvtData
const xAOD::EventInfo * m_EvtData
Definition: BPhysPVTools.h:29
DerivationFramework::BPhysPVTools::FillCandwithRefittedVertices
StatusCode FillCandwithRefittedVertices(xAOD::VertexContainer *vtxContainer, const xAOD::VertexContainer *pvContainer, xAOD::VertexContainer *refPvContainer, const Analysis::PrimaryVertexRefitter *, size_t in_PV_max, int DoVertexType)
Definition: BPhysPVTools.cxx:241
DerivationFramework::BPhysPVTools::GetGoodPV
static std::vector< const xAOD::Vertex * > GetGoodPV(const xAOD::VertexContainer *pvContainer)
Static method call with DerivationFramework::BPhysDerHelpers::GetGoodPV Returns a std::vector contain...
Definition: BPhysPVTools.cxx:444
DerivationFramework::BPhysPVTools::FillCandExistingVertices
StatusCode FillCandExistingVertices(xAOD::VertexContainer *vtxContainer, const xAOD::VertexContainer *pvContainer, int DoVertexType)
Definition: BPhysPVTools.cxx:173
DerivationFramework::BPhysPVTools
Definition: BPhysPVTools.h:25
DerivationFramework::BPhysPVTools::FillBPhysHelperNULL
void FillBPhysHelperNULL(xAOD::BPhysHelper &vtx, const xAOD::VertexContainer *PvContainer, xAOD::BPhysHelper::pv_type pvtype, bool do3d=false) const
Definition: BPhysPVTools.cxx:57
DerivationFramework::BPhysPVTools::m_v0Tools
const Trk::V0Tools * m_v0Tools
Definition: BPhysPVTools.h:28
DerivationFramework::BPhysPVTools::FillBPhysHelper
void FillBPhysHelper(xAOD::BPhysHelper &vtx, const xAOD::Vertex *refPV, const xAOD::VertexContainer *refPvContainer, xAOD::BPhysHelper::pv_type pvtype, int) const
Fills the BPhysHelper object with the standard parameters.
Definition: BPhysPVTools.cxx:32
DerivationFramework::BPhysPVTools::FindLowZ0BAIndex
size_t FindLowZ0BAIndex(xAOD::BPhysHelper &obj, const std::vector< const xAOD::Vertex * > &PVlist, const size_t PV_minNTracks=0) const
Find the index for the PV with the lowest distance in z of the SV's DOCA point w.r....
Definition: BPhysPVTools.cxx:483
DerivationFramework::BPhysPVTools::BPhysPVTools
BPhysPVTools(const Trk::V0Tools *v0Tools)
Definition: BPhysPVTools.cxx:18
DerivationFramework::BPhysPVTools::FindLowZIndex
size_t FindLowZIndex(const xAOD::BPhysHelper &Obj, const std::vector< const xAOD::Vertex * > &PVlist, const size_t PV_minNTracks=0) const
Returns the index integer of the vertex with the lowest Z in relation to the given vertex.
Definition: BPhysPVTools.cxx:80
xAOD::BPhysHelper::pv_type
pv_type
: Enum type of the PV
Definition: BPhysHelper.h:475
Analysis::PrimaryVertexRefitter
Definition: PrimaryVertexRefitter.h:26
DerivationFramework::BPhysPVTools::m_3dCalc
bool m_3dCalc
Definition: BPhysPVTools.h:34
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
DerivationFramework::BPhysPVTools::PrepareVertexLinks
static void PrepareVertexLinks(xAOD::Vertex *theResult, const xAOD::TrackParticleContainer *importedTrackCollection)
Definition: BPhysPVTools.cxx:530
DerivationFramework::BPhysPVTools::SetMinNTracksInPV
void SetMinNTracksInPV(size_t PV_minNTracks)
Set the minimum number of tracks required for primary vertices to be considered for primary vertex as...
Definition: BPhysPVTools.cxx:464
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::BPhysPVTools::DistInZtoDOCA
double DistInZtoDOCA(xAOD::BPhysHelper &obj, const xAOD::Vertex *vertex) const
Calculate the distance along z axis between the PV and SV's DOCA point w.r.t.
Definition: BPhysPVTools.cxx:503
DerivationFramework::BPhysPVTools::FindLowA0Index
size_t FindLowA0Index(const xAOD::BPhysHelper &Obj, const std::vector< const xAOD::Vertex * > &PVlist, const size_t PV_minNTracks=0) const
Returns the index integer of the vertex with the lowest A0 in relation to the given vertex.
Definition: BPhysPVTools.cxx:422
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
DerivationFramework::BPhysPVTools::GetBeamSpot
Amg::Vector3D GetBeamSpot() const
Get the current beamspot position either from cache or from BeamCondSvc.
Definition: BPhysPVTools.cxx:472
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
V0Tools
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
BPhysHelper.h
: B-physics xAOD helpers.
python.PyAthena.v
v
Definition: PyAthena.py:154
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Trk::V0Tools
Definition: V0Tools.h:36
AthMessaging.h
DerivationFramework::BPhysPVTools::SetSave3d
void SetSave3d(bool v)
Definition: BPhysPVTools.h:40
DerivationFramework::BPhysPVTools::m_PV_minNTracks
size_t m_PV_minNTracks
minimum number of tracks required in PVs considered
Definition: BPhysPVTools.h:32
python.PyAthena.obj
obj
Definition: PyAthena.py:132
DerivationFramework::BPhysPVTools::DecorateWithNULL
void DecorateWithNULL(xAOD::VertexContainer *vtxContainer, const xAOD::VertexContainer *pvContainer, int DoVertexType) const
Definition: BPhysPVTools.cxx:141
DerivationFramework::BPhysPVTools::FindHighPtIndex
size_t FindHighPtIndex(const std::vector< const xAOD::Vertex * > &PVlist) const
Definition: BPhysPVTools.cxx:413