ATLAS Offline Software
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 
9 namespace 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,
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,
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 
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SVForIPTool.h
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
Analysis::SVForIPTool::getDirectionFromSecondaryVertexInfo
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.
Definition: SVForIPTool.cxx:19
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
GeoPrimitivesHelpers.h
xAODType::BTag
@ BTag
The object is a b-tagging object.
Definition: ObjectType.h:60
AthAlgTool
Definition: AthAlgTool.h:26
Analysis::SVForIPTool::getTrkFromV0FromSecondaryVertexInfo
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.
Definition: SVForIPTool.cxx:43
Analysis::SVForIPTool::SVForIPTool
SVForIPTool(const std::string &name, const std::string &n, const IInterface *p)
Definition: SVForIPTool.cxx:12