ATLAS Offline Software
Loading...
Searching...
No Matches
SVForIPTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
9namespace Analysis {
10
11
12 SVForIPTool::SVForIPTool(const std::string& name,
13 const std::string& n, const IInterface* p):
14 AthAlgTool(name, n,p)
15 {
16 declareInterface<SVForIPTool>(this);
17 }
18
20 bool & canUseSvxDirection,
21 xAOD::BTagging* BTag,
22 const std::string & secVxFinderName,
23 const xAOD::Vertex & priVtx) const
24 {
25 std::vector< ElementLink< xAOD::VertexContainer > > myVertices;
26 BTag->variable<std::vector<ElementLink<xAOD::VertexContainer> > >(secVxFinderName, "vertices", myVertices);
27
28 if (myVertices.empty()) {
29 ATH_MSG_DEBUG(" No secondary vertex found for getting the B flight direction (for the IP sign calculation)");
30 } else {
31 if (myVertices[0].isValid()) {
32 canUseSvxDirection=true;
33 SvxDirection=(*myVertices[0])->position()-priVtx.position();
34 ATH_MSG_VERBOSE(" Get direction from InDetVKalVertex: phi: " << SvxDirection.phi() <<
35 " theta: " << SvxDirection.theta() );
36 } else {
37 ATH_MSG_WARNING("SVX info seems usable, but no SVX available !!!");
38 }
39 }
40 }
41
42
43 void SVForIPTool::getTrkFromV0FromSecondaryVertexInfo(std::vector<const xAOD::TrackParticle*> & TrkFromV0,
44 xAOD::BTagging* BTag,
45 const std::string & secVxFinderName) const
46 {
47 std::vector<ElementLink<xAOD::TrackParticleContainer> > TrkFromV0_ELs;
48 BTag->variable<std::vector<ElementLink<xAOD::TrackParticleContainer> > >(secVxFinderName, "badTracksIP", TrkFromV0_ELs);
49 for (const auto& link : TrkFromV0_ELs) {
50 if (link.isValid()) TrkFromV0.push_back(*link);
51 }
52 }
53
54}//end namespace
55
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
void getTrkFromV0FromSecondaryVertexInfo(std::vector< const xAOD::TrackParticle * > &TrkFromV0, xAOD::BTagging *BTag, const std::string &secVxFinderName) const
Method to get the tracks from V0 from the secondary vertex info.
SVForIPTool(const std::string &name, const std::string &n, const IInterface *p)
void getDirectionFromSecondaryVertexInfo(Amg::Vector3D &SvxDirection, bool &canUseSvxDirection, xAOD::BTagging *BTag, const std::string &secVxFinderName, const xAOD::Vertex &priVtx) const
Method to get the B flight direction from the secondary vertex info.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const Amg::Vector3D & position() const
Returns the 3-pos.
Eigen::Matrix< double, 3, 1 > Vector3D
The namespace of all packages in PhysicsAnalysis/JetTagging.
BTagging_v1 BTagging
Definition of the current "BTagging version".
Definition BTagging.h:17
Vertex_v1 Vertex
Define the latest version of the vertex class.