Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
DerivationFramework::BPhysVertexTrackBase Class Reference

#include <BPhysVertexTrackBase.h>

Inheritance diagram for DerivationFramework::BPhysVertexTrackBase:
Collaboration diagram for DerivationFramework::BPhysVertexTrackBase:

Classes

class  BaseItem
 
class  TrackTypeCounter
 

Public Types

enum  track_type {
  ASSOCPV, PVTYPE0, PVTYPE1, PVTYPE2,
  PVTYPE3, NONE, NULLVP, CAPVRFN3U0,
  CAPVNRN3U0, CAPVRF3DU0, CAPVNR3DU0, CAPVRFN3U1,
  CAPVNRN3U1, CAPVRF3DU1, CAPVNR3DU1, CAPVRFN3U2,
  CAPVNRN3U2, CAPVRF3DU2, CAPVNR3DU2, CAPVRFNNU3,
  CAPVNRNNU3, CAPVRFNNU4, CAPVNRNNU4, CAPVRFNNU5,
  CAPVNRNNU5, CAPVRFNNU6, CAPVNRNNU6, CAPVRFNNU7,
  CAPVNRNNU7, CAPVRFNNU8, CAPVNRNNU8, CAPVRFNNU9,
  CAPVNRNNU9
}
 

Public Member Functions

 BPhysVertexTrackBase (const std::string &t, const std::string &n, const IInterface *p)
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode addBranches () const override
 

Static Public Member Functions

static const std::string tts (track_type type)
 
static uint64_t ttb (track_type type)
 
static uint64_t ttall ()
 
static uint64_t ttallMin ()
 
static uint64_t rttor (const std::vector< uint64_t > &vtypes)
 
static std::string wrapLines (const std::string &lines, const std::string &prefix)
 
static std::string trackToString (const xAOD::TrackParticle *track)
 

Static Public Attributes

static const int n_track_types = 33
 
static const std::string track_type_str []
 
static const uint64_t track_type_bit []
 

Protected Types

typedef std::map< std::string, int > StringIntMap_t
 

Protected Member Functions

virtual StatusCode initializeHook ()
 
virtual StatusCode finalizeHook ()
 
virtual StatusCode addBranchesHook () const
 
virtual StatusCode addBranchesVCSetupHook (size_t ivc) const
 
virtual StatusCode addBranchesSVLoopHook (const xAOD::Vertex *vtx) const
 
virtual StatusCode calcValuesHook (const xAOD::Vertex *vtx, const unsigned int ipv, const unsigned int its, const unsigned int itt) const
 
virtual bool fastFillHook (const xAOD::Vertex *vtx, const int ipv) const
 
StatusCode calculateValues (const xAOD::Vertex *vtx) const
 
virtual std::string buildPvAssocCacheName (const xAOD::Vertex *vtx, const int ipv) const
 
virtual void initPvAssocTypeVec ()
 
TrackBag findAllTracksInDecay (xAOD::BPhysHelper &vtx) const
 
void findAllTracksInDecay (xAOD::BPhysHelper &vtx, TrackBag &tracks) const
 
MuonBag findAllMuonsInDecay (xAOD::BPhysHelper &vtx) const
 
void findAllMuonsInDecay (xAOD::BPhysHelper &vtx, MuonBag &muons) const
 
TrackBag findAllMuonIdTracksInDecay (xAOD::BPhysHelper &vtx, MuonBag &muons) const
 
std::vector< TVector3 > findMuonRefTrackMomenta (xAOD::BPhysHelper &vtx, MuonBag &muons) const
 
TrackBag selectTracks (const xAOD::TrackParticleContainer *inpTracks, xAOD::BPhysHelper &cand, const unsigned int ipv, const unsigned int its, const unsigned int itt) const
 
TrackBag selectTracks (const xAOD::TrackParticleContainer *inpTracks, const TrackBag &exclTracks, xAOD::BPhysHelper &cand, const unsigned int ipv, const unsigned int its, const unsigned int itt) const
 
uint64_t detTrackTypes (const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV) const
 
double getTrackCandPVLogChi2 (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doDCAin3D=false, int chi2DefToUse=0) const
 
std::vector< double > getTrackLogChi2DCA (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doDCAin3D=false, int chi2DefToUse=0) const
 
std::string buildBranchBaseName (unsigned int its, unsigned int ipv, unsigned int itt, const std::string &preSuffix="") const
 
std::pair< const xAOD::Vertex *, double > findMinChi2PV (const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV, const std::vector< uint64_t > &pvtypes, const int minNTracksInPV, const bool useRefittedPvs, const bool doDCAin3D, const int chi2DefToUse) const
 
const xAOD::VertexfindAssocPV (const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV, const std::vector< uint64_t > &pvtypes, const int minNTracksInPV, const bool useRefittedPvs) const
 

Protected Attributes

std::vector< std::string > m_branchPrefixes
 
std::string m_branchBaseName
 
std::string m_branchSuffix
 
std::vector< std::string > m_vertexContainerNames
 
std::string m_trackParticleContainerName
 
ToolHandleArray< TrkSelToolm_trackSelectionTools
 
ToolHandle< Reco::ITrackToVertexm_trackToVertexTool
 
ToolHandle< CP::ITrackVertexAssociationToolm_tvaTool
 
std::string m_pvContainerName
 
std::vector< std::string > m_refPVContainerNames
 
int m_doVertexType {}
 
std::vector< uint64_t > m_useTrackTypes
 
bool m_incPrecVerticesInDecay {}
 
int m_minNTracksInPV {}
 
std::vector< uint64_t > m_pvTypesToConsider
 
int m_debugTrackTypes {}
 
std::vector< uint64_t > m_debugTracksInEvents
 
bool m_tvaToolHasWpLoose {}
 
const xAOD::TrackParticleContainerm_tracks {}
 
const xAOD::TrackParticleAuxContainerm_tracksAux {}
 
const xAOD::VertexContainerm_pvtxContainer {}
 
const xAOD::VertexContainerm_svtxContainer {}
 
const xAOD::VertexAuxContainerm_svtxAuxContainer {}
 
const xAOD::VertexContainerm_refPVContainer {}
 
const xAOD::VertexAuxContainerm_refPVAuxContainer {}
 
std::vector< xAOD::BPhysHelper::pv_typem_pvAssocTypes
 
unsigned int m_nEvtsSeen {}
 
const xAOD::EventInfom_eventInfo {}
 
StringIntMap_t m_pvAssocResMap
 
uint64_t m_trackTypesUsed {}
 
std::unique_ptr< TrackTypeCounterm_mttc
 
unsigned int m_runNumber {}
 
uint64_t m_evtNumber {}
 
bool m_debugTracksInThisEvent {}
 

Static Private Attributes

static uint64_t s_track_type_all_cached = 0x0
 

Detailed Description

Definition at line 56 of file BPhysVertexTrackBase.h.

Member Typedef Documentation

◆ StringIntMap_t

typedef std::map<std::string, int> DerivationFramework::BPhysVertexTrackBase::StringIntMap_t
protected

Definition at line 288 of file BPhysVertexTrackBase.h.

Member Enumeration Documentation

◆ track_type

Enumerator
ASSOCPV 
PVTYPE0 
PVTYPE1 
PVTYPE2 
PVTYPE3 
NONE 
NULLVP 
CAPVRFN3U0 
CAPVNRN3U0 
CAPVRF3DU0 
CAPVNR3DU0 
CAPVRFN3U1 
CAPVNRN3U1 
CAPVRF3DU1 
CAPVNR3DU1 
CAPVRFN3U2 
CAPVNRN3U2 
CAPVRF3DU2 
CAPVNR3DU2 
CAPVRFNNU3 
CAPVNRNNU3 
CAPVRFNNU4 
CAPVNRNNU4 
CAPVRFNNU5 
CAPVNRNNU5 
CAPVRFNNU6 
CAPVNRNNU6 
CAPVRFNNU7 
CAPVNRNNU7 
CAPVRFNNU8 
CAPVNRNNU8 
CAPVRFNNU9 
CAPVNRNNU9 

Definition at line 114 of file BPhysVertexTrackBase.h.

Constructor & Destructor Documentation

◆ BPhysVertexTrackBase()

DerivationFramework::BPhysVertexTrackBase::BPhysVertexTrackBase ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 367 of file BPhysVertexTrackBase.cxx.

370  : base_class(t,n,p), m_trackToVertexTool("Reco::TrackToVertex"),
371  m_tvaTool("CP::TrackVertexAssociationTool"),
372  m_tvaToolHasWpLoose(false),
373  m_tracks(NULL), m_tracksAux(NULL), m_nEvtsSeen(0), m_eventInfo(nullptr),
375  m_debugTracksInThisEvent(false) {
376 
377 
378  // Declare branch prefix
379  declareProperty("BranchPrefixes", m_branchPrefixes);
380  declareProperty("BranchBaseName", m_branchBaseName = "iso");
381  declareProperty("BranchSuffix" , m_branchSuffix = "" );
382 
383  // Necessary containers
384  declareProperty("VertexContainerNames" , m_vertexContainerNames);
385  declareProperty("TrackParticleContainerName",
387  declareProperty("TrackToVertexTool" , m_trackToVertexTool);
388  declareProperty("TrackSelectionTools" , m_trackSelectionTools);
389  declareProperty("TVATool" , m_tvaTool);
390  declareProperty("PVContainerName", m_pvContainerName = "PrimaryVertices");
391  declareProperty("RefPVContainerNames" , m_refPVContainerNames);
392  declareProperty("DoVertexType" , m_doVertexType = 8);
393  declareProperty("UseTrackTypes" , m_useTrackTypes = {7});
394  declareProperty("IncPrecVerticesInDecay", m_incPrecVerticesInDecay = true);
395  declareProperty("MinNTracksInPV" , m_minNTracksInPV = 0);
396  declareProperty("PVTypesToConsider" , m_pvTypesToConsider = {1,3});
397  declareProperty("DebugTrackTypes" , m_debugTrackTypes=0);
398  declareProperty("DebugTracksInEvents" , m_debugTracksInEvents = {});
399  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::BPhysVertexTrackBase::addBranches ( ) const
overridevirtual

Definition at line 476 of file BPhysVertexTrackBase.cxx.

476  {
477 
478  ATH_MSG_DEBUG("BPhysVertexTrackBase::addBranches() -- begin");
479 
480  // counter
481  m_nEvtsSeen++;
482 
483  // run and event numbers
484  CHECK(evtStore()->retrieve(m_eventInfo));
487 
488  // debug tracks in current event?
490  m_debugTracksInEvents.end(),
491  m_evtNumber)
492  != m_debugTracksInEvents.end());
493 
494  // retrieve primary vertices container
495  m_pvtxContainer = NULL;
497  ATH_MSG_DEBUG("Found PV collection with key " << m_pvContainerName);
498 
499 
500  // retrieve ID track container
501  m_tracks = NULL;
502  m_tracksAux = NULL;
504  if (evtStore()->contains<xAOD::
506  CHECK(evtStore()->retrieve(m_tracksAux,
508  } else {
509  ATH_MSG_DEBUG("No aux track collection with key "
510  << m_trackParticleContainerName+"Aux.");
511  }
512  ATH_MSG_DEBUG("Found track collection with key "
514 
515  // Loop over all vertex containers
516  for (size_t i=0; i<m_vertexContainerNames.size(); ++i) {
517  // vertex container and its auxilliary store
518  const xAOD::VertexContainer* svtxContainer = NULL;
519  const xAOD::VertexAuxContainer* svtxAuxContainer = NULL;
520  // refitted primary vertex container and its auxilliary store
521  const xAOD::VertexContainer* refPVContainer = NULL;
522  const xAOD::VertexAuxContainer* refPVAuxContainer = NULL;
523 
524  // retrieve from StoreGate
525  CHECK(evtStore()->retrieve(svtxContainer, m_vertexContainerNames[i]));
526  CHECK(evtStore()->retrieve(svtxAuxContainer,
527  m_vertexContainerNames[i]+"Aux."));
528  ATH_MSG_DEBUG("Found SV collection with key "
530  CHECK(evtStore()->retrieve(refPVContainer ,
532  CHECK(evtStore()->retrieve(refPVAuxContainer,
533  m_refPVContainerNames[i]+"Aux."));
534  ATH_MSG_DEBUG("Found refitted PV collection with key "
536 
537  // vertex container depending setup in derived class
539 
540  // loop over secondary vertices
542  svtxContainer->begin(); vtxItr!=svtxContainer->end();
543  ++vtxItr) {
544 
545  CHECK(addBranchesSVLoopHook(*vtxItr));
546 
547  } // end of loop over vertices
548  } // end of loop over vertex container names
549 
550  ATH_MSG_DEBUG("BPhysVertexTrackBase::addBranches() -- end");
551 
552  // nothing to do here
553  return addBranchesHook();
554  }

◆ addBranchesHook()

StatusCode DerivationFramework::BPhysVertexTrackBase::addBranchesHook ( ) const
protectedvirtual

Definition at line 573 of file BPhysVertexTrackBase.cxx.

573  {
574 
575  return StatusCode::SUCCESS;
576  }

◆ addBranchesSVLoopHook()

StatusCode DerivationFramework::BPhysVertexTrackBase::addBranchesSVLoopHook ( const xAOD::Vertex vtx) const
protectedvirtual

Definition at line 594 of file BPhysVertexTrackBase.cxx.

594  {
595 
596  // just to avoid a compiler warning
597  ATH_MSG_DEBUG("addBranchesSVLoopHook: Vertex " << vtx);
598 
599  return StatusCode::SUCCESS;
600  }

◆ addBranchesVCSetupHook()

StatusCode DerivationFramework::BPhysVertexTrackBase::addBranchesVCSetupHook ( size_t  ivc) const
protectedvirtual

Definition at line 581 of file BPhysVertexTrackBase.cxx.

581  {
582 
583  // just to avoid a compiler warning
584  ATH_MSG_DEBUG("addBranchesVCSetupHook: Vertex container index " << ivc
585  << " for collection " << m_vertexContainerNames[ivc]
586  << " with prefix " << m_branchPrefixes[ivc]);
587 
588  return StatusCode::SUCCESS;
589  }

◆ buildBranchBaseName()

std::string DerivationFramework::BPhysVertexTrackBase::buildBranchBaseName ( unsigned int  its,
unsigned int  ipv,
unsigned int  itt,
const std::string &  preSuffix = "" 
) const
protected

Definition at line 1310 of file BPhysVertexTrackBase.cxx.

1314  {
1315 
1316  ATH_MSG_DEBUG("BPhysVertexTrackBase::buildBranchBaseName -- begin");
1317 
1318  std::string tsName = m_trackSelectionTools[its].name();
1319  std::string pvAssoc = xAOD::BPhysHelper::pv_type_str[m_pvAssocTypes[ipv]];
1320 
1321  // need to get part of tsname after last underscore
1322  std::size_t ipos = tsName.find_last_of("_");
1323  if ( ipos != std::string::npos ) tsName = tsName.substr(ipos+1);
1324 
1325  // format it nicely
1326  std::string f = std::format("T{:010d}_{}_{}{}{}",
1327  m_useTrackTypes[itt], tsName, pvAssoc,
1328  (preSuffix.length() > 0 ? "_" + preSuffix : ""),
1329  (m_branchSuffix.length() > 0 ? "_" + m_branchSuffix : ""));
1330 
1331  ATH_MSG_DEBUG("BPhysVertexBaseTrackBase::buildBranchBaseName: " << f);
1332  return f;
1333  }

◆ buildPvAssocCacheName()

std::string DerivationFramework::BPhysVertexTrackBase::buildPvAssocCacheName ( const xAOD::Vertex vtx,
const int  ipv 
) const
protectedvirtual

Definition at line 671 of file BPhysVertexTrackBase.cxx.

672  {
673  xAOD::BPhysHelper cand(vtx);
674  std::string f = std::format("SV_{:p}_RPV_{:p}", static_cast<const void*>(cand.vtx()), static_cast<const void*>(cand.pv(m_pvAssocTypes[ipv])));
675 
676  return f;
677  }

◆ calculateValues()

StatusCode DerivationFramework::BPhysVertexTrackBase::calculateValues ( const xAOD::Vertex vtx) const
protected

Definition at line 637 of file BPhysVertexTrackBase.cxx.

637  {
638 
639  ATH_MSG_DEBUG("BPhysVertexTrackBase::calculateValues -- begin");
640 
641  unsigned int nPvAssocs = m_pvAssocTypes.size();
642  unsigned int nTrackSels = m_trackSelectionTools.size();
643  unsigned int nTrackTypes = m_useTrackTypes.size();
644 
645  m_pvAssocResMap.clear();
646 
647  const xAOD::BPhysHelper cand(vtx);
648  for (unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
649  if ( ipv == 0 || ! fastFillHook(vtx, ipv) ) {
650  for (unsigned int its = 0; its < nTrackSels; ++its) {
651  for (unsigned int itt = 0; itt < nTrackTypes; ++itt) {
652  ATH_MSG_DEBUG("Calling calcValuesHook with ipv: " << ipv
653  << ", its: " << its << ", itt: " << itt);
654  CHECK(calcValuesHook(vtx, ipv, its, itt));
655  } // for itt
656  } // for its
657  // cache result index -- only needed once per ipv value
658  m_pvAssocResMap[buildPvAssocCacheName(vtx, ipv)] = ipv;
659  ATH_MSG_DEBUG("calculateValues: cache index: "
660  << buildPvAssocCacheName(vtx, ipv)
661  << " -- cached ipv: " << ipv);
662  } // if !fastFillHook()
663  } // for ipv
664 
665  return StatusCode::SUCCESS;
666  }

◆ calcValuesHook()

StatusCode DerivationFramework::BPhysVertexTrackBase::calcValuesHook ( const xAOD::Vertex vtx,
const unsigned int  ipv,
const unsigned int  its,
const unsigned int  itt 
) const
protectedvirtual

Definition at line 606 of file BPhysVertexTrackBase.cxx.

609  {
610 
611  // just to avoid a compiler warning
612  ATH_MSG_DEBUG("calcIsolationOpti: vtx: " << vtx << ", ipv: " << ipv
613  << ", its: " << its << ", itt: " << itt);
614 
615  return StatusCode::SUCCESS;
616  }

◆ detTrackTypes()

uint64_t DerivationFramework::BPhysVertexTrackBase::detTrackTypes ( const xAOD::TrackParticle track,
const xAOD::Vertex candPV,
const xAOD::Vertex candRefPV 
) const
protected

Definition at line 1000 of file BPhysVertexTrackBase.cxx.

1002  {
1003  int bits = 0x0;
1004 
1005  // PVTYPE0 - PVTYPE3, NONE
1006  ATH_MSG_ERROR("BPhysVertexTrackBase::detTrackTypes must be adjusted due to changes in TrackParticle");
1007 
1008  // ASOCPV
1009  if ( candPV != NULL ) {
1010  bool found(false);
1011  for (size_t i=0; i<candPV->nTrackParticles(); ++i) {
1012  if ( track == candPV->trackParticle(i) ) {
1013  found = true;
1014  break;
1015  }
1016  }
1017  if ( found ) bits |= track_type_bit[ASSOCPV];
1018  //
1019  // CLOSEAPV
1020  for (unsigned int i=7; i<n_track_types; ++i) {
1021  if ( (track_type_bit[i] & m_trackTypesUsed) > 0x0 ) {
1022  bool useRefittedPvs = ( i%2 == 1 );
1023  bool doDCAin3D = ( (i-7)%4 > 1 );
1024  int chi2DefToUse = (i-7)/4;
1025  // adjustment above bit 20
1026  if ( i > 20 ) {
1027  doDCAin3D = true;
1028  chi2DefToUse = (i-13)/2;
1029  }
1030  const xAOD::Vertex* minChi2PV(nullptr);
1031  if ( chi2DefToUse == 5 ) {
1032  minChi2PV =
1033  findAssocPV(track, candPV, candRefPV, m_pvTypesToConsider,
1034  m_minNTracksInPV, useRefittedPvs);
1035  } else {
1036  minChi2PV =
1037  findMinChi2PV(track, candPV, candRefPV, m_pvTypesToConsider,
1038  m_minNTracksInPV, useRefittedPvs,
1039  doDCAin3D, chi2DefToUse).first;
1040  } // if chi2DefToUse
1041  if ( candPV == minChi2PV
1042  || (candRefPV != nullptr && candRefPV == minChi2PV) ) {
1043  bits |= track_type_bit[i];
1044  }
1045  } // if m_trackTypesUsed
1046  } // for i
1047 
1048  } // if candPV != NULL
1049 
1050  return bits;
1051  }

◆ fastFillHook()

bool DerivationFramework::BPhysVertexTrackBase::fastFillHook ( const xAOD::Vertex vtx,
const int  ipv 
) const
protectedvirtual

Definition at line 621 of file BPhysVertexTrackBase.cxx.

622  {
623 
624  // just to avoid a compiler warning
625  ATH_MSG_DEBUG("fastIsoFill: vtx: " << vtx << ", ipv: " << ipv);
626 
627  return false;
628  }

◆ finalize()

StatusCode DerivationFramework::BPhysVertexTrackBase::finalize ( )
overridevirtual

Definition at line 463 of file BPhysVertexTrackBase.cxx.

463  {
464 
465  ATH_MSG_DEBUG("BPhysVertexTrackBase::finalize()");
466 
467  // dump track type counters to log
468  if ( m_debugTrackTypes > 0 ) {
469  ATH_MSG_INFO("Track type counters:\n" << m_mttc->countsToString());
470  }
471 
472  // everything all right
473  return finalizeHook();
474  }

◆ finalizeHook()

StatusCode DerivationFramework::BPhysVertexTrackBase::finalizeHook ( )
protectedvirtual

Definition at line 566 of file BPhysVertexTrackBase.cxx.

566  {
567 
568  return StatusCode::SUCCESS;
569  }

◆ findAllMuonIdTracksInDecay()

TrackBag DerivationFramework::BPhysVertexTrackBase::findAllMuonIdTracksInDecay ( xAOD::BPhysHelper vtx,
MuonBag muons 
) const
protected

Definition at line 1130 of file BPhysVertexTrackBase.cxx.

1131  {
1132 
1133  TrackBag tracks;
1134  muons = findAllMuonsInDecay(vtx);
1135 
1136  for (MuonBag::const_iterator muItr = muons.begin(); muItr != muons.end();
1137  ++muItr) {
1138  const xAOD::TrackParticle* track =
1139  (*muItr)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1140  tracks.push_back(track);
1141  } // for
1142 
1143  return tracks;
1144  }

◆ findAllMuonsInDecay() [1/2]

MuonBag DerivationFramework::BPhysVertexTrackBase::findAllMuonsInDecay ( xAOD::BPhysHelper vtx) const
protected

Definition at line 1092 of file BPhysVertexTrackBase.cxx.

1093  {
1094 
1095  MuonBag muons;
1096  findAllMuonsInDecay(vtx, muons);
1097 
1098  return muons;
1099  }

◆ findAllMuonsInDecay() [2/2]

void DerivationFramework::BPhysVertexTrackBase::findAllMuonsInDecay ( xAOD::BPhysHelper vtx,
MuonBag muons 
) const
protected

Definition at line 1106 of file BPhysVertexTrackBase.cxx.

1108  {
1109 
1110  for (int i=0; i < vtx.nMuons(); ++i) {
1111  if ( std::find(muons.begin(),muons.end(),vtx.muon(i)) == muons.end() ) {
1112  muons.push_back(vtx.muon(i));
1113  } // if
1114  } // for
1115  // loop over preceeding vertices
1116  if ( m_incPrecVerticesInDecay ) {
1117  for (int ivtx = 0; ivtx < vtx.nPrecedingVertices(); ++ivtx) {
1118  xAOD::BPhysHelper precVtx(vtx.precedingVertex(ivtx));
1119  findAllMuonsInDecay(precVtx, muons);
1120  } // for
1121  } // if
1122  }

◆ findAllTracksInDecay() [1/2]

TrackBag DerivationFramework::BPhysVertexTrackBase::findAllTracksInDecay ( xAOD::BPhysHelper vtx) const
protected

Definition at line 1056 of file BPhysVertexTrackBase.cxx.

1057  {
1058 
1059  TrackBag tracks;
1060  findAllTracksInDecay(vtx, tracks);
1061 
1062  return tracks;
1063  }

◆ findAllTracksInDecay() [2/2]

void DerivationFramework::BPhysVertexTrackBase::findAllTracksInDecay ( xAOD::BPhysHelper vtx,
TrackBag tracks 
) const
protected

Definition at line 1070 of file BPhysVertexTrackBase.cxx.

1072  {
1073 
1074  for (unsigned int i=0; i < vtx.vtx()->nTrackParticles(); ++i) {
1075  const xAOD::TrackParticle* track = vtx.vtx()->trackParticle(i);
1076  if ( std::find(tracks.begin(),tracks.end(),track) == tracks.end() ) {
1077  tracks.push_back(track);
1078  } // if
1079  } // for
1080  // loop over preceeding vertices
1081  if ( m_incPrecVerticesInDecay ) {
1082  for (int ivtx = 0; ivtx < vtx.nPrecedingVertices(); ++ivtx) {
1083  xAOD::BPhysHelper precVtx(vtx.precedingVertex(ivtx));
1084  findAllTracksInDecay(precVtx, tracks);
1085  } // if
1086  } // for
1087  }

◆ findAssocPV()

const xAOD::Vertex * DerivationFramework::BPhysVertexTrackBase::findAssocPV ( const xAOD::TrackParticle track,
const xAOD::Vertex candPV,
const xAOD::Vertex candRefPV,
const std::vector< uint64_t > &  pvtypes,
const int  minNTracksInPV,
const bool  useRefittedPvs 
) const
protected

Definition at line 1410 of file BPhysVertexTrackBase.cxx.

1415  {
1416 
1417  // select PVs to be considered/replace candPV by candRefPV if requested
1418  std::vector<const xAOD::Vertex*> vpvtx;
1419  for (auto pvtx: *m_pvtxContainer) {
1420  if ( pvtx != nullptr ) {
1421  if ( std::find(pvtypes.begin(),pvtypes.end(),pvtx->vertexType())
1422  != pvtypes.end() ) {
1423  const xAOD::Vertex* cvtx = pvtx;
1424  // replace by refitted PV if associated PV matches orignal PV
1425  if ( useRefittedPvs && pvtx == candPV ) {
1426  if ( candRefPV != nullptr ) {
1427  cvtx = candRefPV;
1428  } else {
1429  ATH_MSG_WARNING("BPhysVertexTrackBase::findAssocPV:"
1430  << " candRefPV == NULL!");
1431  continue;
1432  }
1433  } // if pvtx == candPV
1434  if ( (int)cvtx->nTrackParticles() >= minNTracksInPV ) {
1435  vpvtx.push_back(cvtx);
1436  } // if minNTracksInPV
1437  } // if pvTypes in pvtypes vector
1438  } // if pvtx != nullptr
1439  } // for pvtx
1440 
1441  const xAOD::Vertex* assocPV(NULL);
1442  if ( useRefittedPvs && m_tvaToolHasWpLoose ) {
1443  // check whether track is in refitted PV - if so accept
1444  // Need to do this here as the TrackVertexAssociationTool
1445  // with WP 'Loose' only checks the track->vertex() pointer
1446  // which always points to the original PV.
1447  for (const auto &tp : candRefPV->trackParticleLinks()) {
1448  if ( *tp == track ) {
1449  // track is part of refitted PV -- accept it
1450  assocPV = candRefPV;
1451  break;
1452  }
1453  } // for tp
1454  // if not matching use the TrackVertexAssociationTool (other PVs etc)
1455  if ( assocPV == nullptr ) {
1456  assocPV = m_tvaTool->getUniqueMatchVertex(*track, vpvtx);
1457  }
1458  } else {
1459  assocPV = m_tvaTool->getUniqueMatchVertex(*track, vpvtx);
1460  } // if useRefittedPvs && m_tvaToolHasWpLoose
1461  if ( assocPV == nullptr ) {
1462  ATH_MSG_WARNING("BPhysVertexTrackBase::findAssocPV:"
1463  << " assocPV == NULL for track!"
1464  << " len(vpvtx) = " << vpvtx.size()
1465  << " useRefittedPvs = " << useRefittedPvs
1466  << " minNTracksInPV = " << minNTracksInPV);
1467  }
1468 
1469  return assocPV;
1470  }

◆ findMinChi2PV()

std::pair< const xAOD::Vertex *, double > DerivationFramework::BPhysVertexTrackBase::findMinChi2PV ( const xAOD::TrackParticle track,
const xAOD::Vertex candPV,
const xAOD::Vertex candRefPV,
const std::vector< uint64_t > &  pvtypes,
const int  minNTracksInPV,
const bool  useRefittedPvs,
const bool  doDCAin3D,
const int  chi2DefToUse 
) const
protected

Definition at line 1358 of file BPhysVertexTrackBase.cxx.

1365  {
1366 
1367  double minChi2 = std::numeric_limits<double>::max();
1368  const xAOD::Vertex* minChi2PV(nullptr);
1369 
1370  for (auto pvtx: *m_pvtxContainer) {
1371  if ( pvtx != nullptr ) {
1372  if ( std::find(pvtypes.begin(),pvtypes.end(),pvtx->vertexType())
1373  != pvtypes.end() ) {
1374  const xAOD::Vertex* cvtx = pvtx;
1375  // replace by refitted PV if associated PV matches orignal PV
1376  if ( useRefittedPvs && pvtx == candPV ) {
1377  if ( candRefPV != nullptr ) {
1378  cvtx = candRefPV;
1379  } else {
1380  ATH_MSG_WARNING(" BPhysVertexTrackBase::findMinChi2PV:"
1381  << " candRefPV == NULL!");
1382  continue;
1383  }
1384  } // if pvtx == candPV
1385  if ( (int)cvtx->nTrackParticles() >= minNTracksInPV ) {
1386  double chi2 = getTrackLogChi2DCA(track, cvtx, doDCAin3D,
1387  chi2DefToUse)[4];
1388  if ( chi2 < minChi2 ) {
1389  minChi2 = chi2;
1390  minChi2PV = cvtx;
1391  } // if chi2 < minChi2
1392  } // if minNTracksInPV
1393  } // if pvTypes in pvtypes vector
1394  } // if pvtx != nullptr
1395  } // for pvtx
1396 
1397  return std::make_pair(minChi2PV, minChi2);
1398  }

◆ findMuonRefTrackMomenta()

std::vector< TVector3 > DerivationFramework::BPhysVertexTrackBase::findMuonRefTrackMomenta ( xAOD::BPhysHelper vtx,
MuonBag muons 
) const
protected

Definition at line 1151 of file BPhysVertexTrackBase.cxx.

1152  {
1153 
1154  std::vector<TVector3> refMuTracks;
1155 
1156  // quick solution if nRefTrks == nMuons:
1157  if ( vtx.nRefTrks() == vtx.nMuons() && !m_incPrecVerticesInDecay ) {
1158  muons = vtx.muons();
1159  for ( auto refMuTrack : vtx.refTrks() ) {
1160  refMuTracks.push_back(refMuTrack);
1161  }
1162  } else {
1163  TrackBag muonIdTracks = findAllMuonIdTracksInDecay(vtx, muons);
1164  if ( vtx.nRefTrks() == (int)vtx.vtx()->nTrackParticles() ) {
1165  for (int i=0; i<vtx.nRefTrks(); ++i) {
1166  const xAOD::TrackParticle* otp =
1167  (const xAOD::TrackParticle*)vtx.refTrkOrigin(i);
1168  if ( otp != NULL ) {
1169  if ( std::find(muonIdTracks.begin(), muonIdTracks.end(), otp)
1170  != muonIdTracks.end() ) {
1171  refMuTracks.push_back(vtx.refTrk(i));
1172  }
1173  } else {
1174  ATH_MSG_WARNING("BPhysVertexTrackBase::findMuonRefTrackMomenta():"
1175  " refTrkOrigin == NULL for refTrk # "
1176  << i << " !");
1177  }
1178  } // for
1179  } else {
1180  ATH_MSG_WARNING("BPhysVertexTrackBase::findMuonRefTrackMomenta():"
1181  " size mismatch #refTrks = " << vtx.nRefTrks()
1182  << "#trackParticles = " << vtx.vtx()->nTrackParticles()
1183  << " !");
1184  } // if nRefTracks == nTrackParticles
1185  // loop over preceeding vertices -- only if not all refMuTrks found yet
1186  if ( m_incPrecVerticesInDecay && muons.size() > refMuTracks.size() ) {
1187  for (int ivtx = 0; ivtx < vtx.nPrecedingVertices(); ++ivtx) {
1188  xAOD::BPhysHelper precVtx(vtx.precedingVertex(ivtx));
1189  std::vector<TVector3> precRefMuTracks =
1190  findMuonRefTrackMomenta(precVtx, muons);
1191  // append only if not yet contained in
1192  for ( auto precRefMuTrack : precRefMuTracks ) {
1193  if ( std::find(refMuTracks.begin(), refMuTracks.end(),
1194  precRefMuTrack) == refMuTracks.end() ) {
1195  refMuTracks.push_back(precRefMuTrack);
1196  } // if
1197  } // for
1198  } // for ivtx
1199  } // if
1200  } // if (shortcut)
1201 
1202  // debug output
1203  if ( msgLvl( MSG::DEBUG ) ) {
1204  ATH_MSG_DEBUG("BPhysVertexTrackBase::findMuonRefTrackMomenta():"
1205  << " #muons: " << muons.size()
1206  << " #refMuTrks: " << refMuTracks.size());
1207  TString str = Form(">> refMuTracks(%d):\n", (int)refMuTracks.size());
1208  for (unsigned int i=0; i < refMuTracks.size(); ++i) {
1209  str += Form("(%10.4f,%10.4f,%10.4f) ",
1210  refMuTracks[i].x(), refMuTracks[i].y(),
1211  refMuTracks[i].z());
1212  }
1213  ATH_MSG_DEBUG(str.Data());
1214  }
1215 
1216  return refMuTracks;
1217  }

◆ getTrackCandPVLogChi2()

double DerivationFramework::BPhysVertexTrackBase::getTrackCandPVLogChi2 ( const xAOD::TrackParticle track,
const xAOD::Vertex vtx,
bool  doDCAin3D = false,
int  chi2DefToUse = 0 
) const
protected

Definition at line 683 of file BPhysVertexTrackBase.cxx.

688  {
689 
690  return getTrackLogChi2DCA(track, vtx, doDCAin3D, chi2DefToUse)[4];
691  }

◆ getTrackLogChi2DCA()

std::vector< double > DerivationFramework::BPhysVertexTrackBase::getTrackLogChi2DCA ( const xAOD::TrackParticle track,
const xAOD::Vertex vtx,
bool  doDCAin3D = false,
int  chi2DefToUse = 0 
) const
protected

Definition at line 721 of file BPhysVertexTrackBase.cxx.

724  {
725  // presets
726  std::vector<double> res = {-999., -99., -999., -99., -100., -100., -1.,
727  -99., -99., -999.};
728 
729  const Amg::Vector3D pos = vtx->position();
730  const AmgSymMatrix(3) poscov = vtx->covariancePosition();
731  auto ctx = Gaudi::Hive::currentContext();
732  if ( track != NULL ) {
733  if ( chi2DefToUse < 2 || (chi2DefToUse > 5 && chi2DefToUse < 8) ) {
734  // use track perigee method
735  std::unique_ptr<const Trk::Perigee>
736  trkPerigee(m_trackToVertexTool->perigeeAtVertex(ctx, *track, pos));
737  if ( trkPerigee != NULL ) {
738  res[0] = trkPerigee->parameters()[Trk::d0];
739  res[2] = trkPerigee->parameters()[Trk::z0];
740  const AmgSymMatrix(5)* locError = trkPerigee->covariance();
741  if ( locError != NULL ) {
742  // uncertainties from track
743  res[1] = Amg::error(*locError, Trk::d0);
744  res[3] = Amg::error(*locError, Trk::z0);
745  if ( chi2DefToUse == 1 ) {
746  // add uncertainties from vertex
747  Amg::Vector3D perppt(trkPerigee->momentum().y()/trkPerigee->pT(),
748  -trkPerigee->momentum().x()/trkPerigee->pT(),
749  0.);
750  double vtxD0Err2 = perppt.transpose()*poscov*perppt;
751  res[1] = sqrt( pow(res[1], 2.) + vtxD0Err2 );
752  res[3] = sqrt( pow(res[3], 2.) + poscov(2,2) );
753  }
754  if ( chi2DefToUse < 2 ) {
755  if ( fabs(res[1]) > 0. && fabs(res[3]) > 0. ) {
756  res[4] = log( pow(res[0]/res[1], 2.)
757  + pow(res[2]/res[3], 2.) );
758  res[6] = 2.; // ok
759  } else {
760  ATH_MSG_WARNING("BPhysVertexTrackBase::getTrackLogChi2DCA():"
761  << " d0 = " << res[0] << ", d0Err = "
762  << res[1] << ", z0 = " << res[2]
763  << ", z0Err = " << res[3]);
764  }
765  }
766  // chi2DefToUse 6 or 7
767  if ( chi2DefToUse > 5 && chi2DefToUse < 8 ) {
768  double phi0 = trkPerigee->parameters()[Trk::phi0];
769  double doca = sqrt(pow(res[0],2.) + pow(res[2], 2.));
770  res[9] = phi0;
771  if ( doca > 0. ) {
772  if ( chi2DefToUse == 6 ) {
773  AmgMatrix(5,3) dmat = AmgMatrix(5,3)::Zero();
774  dmat(0,0) = -sin(phi0);
775  dmat(0,1) = cos(phi0);
776  dmat(1,2) = 1.;
777  dmat(2,0) = -res[0]*cos(phi0);
778  dmat(2,1) = -res[0]*sin(phi0);
779  AmgSymMatrix(3) mCovTrk3D = dmat.transpose()*(*locError)*dmat;
780  Amg::Vector3D dvec(-res[0]*sin(phi0), res[0]*cos(phi0),
781  res[2]); // (x,y,z)
782  Amg::Vector3D duvec = dvec.unit();
783  // log(chi2) = log( docavec^T * V^-1 * docavec )
784  res[4] = log( dvec.transpose() * (poscov+mCovTrk3D).inverse()
785  * dvec );
786  res[7] = duvec.transpose()*poscov*duvec;
787  res[8] = duvec.transpose()*mCovTrk3D*duvec;
788  res[6] = 3.; // ok
789  }
790  if ( chi2DefToUse == 7 ) {
791  AmgMatrix(3,2) dmat = AmgMatrix(3,2)::Zero();
792  dmat(0,0) = -sin(phi0);
793  dmat(1,0) = cos(phi0);
794  dmat(2,0) = 0.;
795  dmat(0,1) = 0.;
796  dmat(1,1) = 0.;
797  dmat(2,1) = 1.;
798  AmgSymMatrix(2) mCovVtx2D = dmat.transpose()*poscov*dmat;
799  AmgSymMatrix(2) mCovTrk2D = AmgSymMatrix(2)::Zero();
800  mCovTrk2D(0,0) = (*locError)(Trk::d0,Trk::d0);
801  mCovTrk2D(0,1) = (*locError)(Trk::d0,Trk::z0);
802  mCovTrk2D(1,0) = (*locError)(Trk::d0,Trk::z0);
803  mCovTrk2D(1,1) = (*locError)(Trk::z0,Trk::z0);
804  Amg::Vector2D dvec(res[0], res[2]); // (d0, z0)
805  Amg::Vector2D duvec = dvec.unit();
806  // log(chi2) = log( (d0, z0) * V^-1 * (d0, z0)^T )
807  res[4] = log( dvec.transpose()*(mCovVtx2D+mCovTrk2D).inverse()
808  * dvec );
809  res[7] = duvec.transpose()*mCovVtx2D*duvec;
810  res[8] = duvec.transpose()*mCovTrk2D*duvec;
811  res[6] = 4.; // ok
812  }
813  } else {
814  ATH_MSG_WARNING("BPhysVertexTrackBase::getTrackLogChi2DCA():"
815  << " doca == 0 !");
816  }
817  } // if chi2DefToUse > 5 && chi2DefToUse < 8
818  res[5] = doDCAin3D ?
819  sqrt( pow(res[0], 2.) + pow(res[2], 2.) ) : res[0];
820  res[6] += 1.; // ok
821  } else {
822  ATH_MSG_WARNING("BPhysVertexTrackBase::getTrackLogChi2DCA():"
823  " locError pointer is NULL!");
824  }
825  } else {
826  ATH_MSG_WARNING("BPhysVertexTrackBase::getTrackLogChi2DCA():"
827  " trkPerigee pointer is NULL!");
828  } // if trkPerigee
829 
830  } else if ( chi2DefToUse == 2
831  || (chi2DefToUse > 7 && chi2DefToUse < 10 )) {
832  // simple extrapolation method
833  // (directly taken from NtupleMaker for comparisons)
834 
835  // SV position and covariance matrix
836  TVector3 SV_def(vtx->x(), vtx->y(), vtx->z());
837  const AmgSymMatrix(3)& SV_cov = poscov;
838 
839  // chi2 track to SV
840  double px = ( track->p4() ).Px();
841  double py = ( track->p4() ).Py();
842  double pt = ( track->p4() ).Pt();
843  double d0 = track->d0();
844  double d0Err2 = track->definingParametersCovMatrixVec()[0];
845  double z0 = track->z0();
846  double z0Err2 = track->definingParametersCovMatrixVec()[2];
847  double theta = track->theta();
848  double d0z0Cov = track->definingParametersCovMatrixVec()[1];
849  double phi = track->phi();
850 
851  TVector3 trk_origin( track->vx(), track->vy(), track->vz() );
852  TVector3 SV = SV_def - trk_origin;
853 
854  // calc. error in direction perpendicular to pT (still x-y plane)
855  double upx = py/pt;
856  double upy = -px/pt;
857  double d0toSV = d0 + (SV[0]*upx + SV[1]*upy);
858  double d0toSVErr2 = upx*SV_cov(0, 0)*upx + 2*upx*SV_cov(1, 0)*upy
859  + upy*SV_cov(1, 1)*upy + d0Err2;
860 
861  upx = px/pt;
862  upy = py/pt;
863  double cot_theta = cos(theta)/sin(theta);
864  double z0corr = (SV[0]*upx + SV[1]*upy)*cot_theta;
865  double z0toSV = z0 + z0corr - SV[2];
866  double z0toSVErr2 = SV_cov(2, 2) + z0Err2;
867 
868  double docaSV = sqrt( pow(d0toSV, 2) + pow(z0toSV, 2) );
869 
870  double chi2testSV(999.);
871  if ( chi2DefToUse == 2 ) {
872  if (d0toSVErr2 !=0 && z0toSVErr2 != 0)
873  chi2testSV = log(pow( d0toSV, 2)/d0toSVErr2
874  + pow( z0toSV, 2)/z0toSVErr2);
875  // set results
876  res = {d0toSV, sqrt(d0toSVErr2), z0toSV, sqrt(z0toSVErr2),
877  chi2testSV, (doDCAin3D ? docaSV : d0toSV), 4,
878  -99., -99., -999.};
879  }
880  if ( chi2DefToUse > 7 && chi2DefToUse < 10 ) {
881  if ( docaSV > 0. ) {
882  if ( chi2DefToUse == 8 ) {
883  AmgMatrix(5,3) dmat = AmgMatrix(5,3)::Zero();
884  dmat(0,0) = -sin(phi);
885  dmat(0,1) = cos(phi);
886  dmat(1,2) = 1.;
887  dmat(2,0) = -d0toSV*cos(phi);
888  dmat(2,1) = -d0toSV*sin(phi);
889  const AmgSymMatrix(5) mCovTrk5D =
890  track->definingParametersCovMatrix();
891  AmgSymMatrix(3) mCovTrk3D = dmat.transpose()*mCovTrk5D*dmat;
892  Amg::Vector3D dvec(-d0toSV*sin(phi), d0toSV*cos(phi),
893  z0toSV); // (x,y,z)
894  Amg::Vector3D duvec = dvec.unit();
895  // log(chi2) = log( docavec^T * V^-1 * docavec )
896  double chi2testSV = log( dvec.transpose()
897  * (poscov+mCovTrk3D).inverse()
898  * dvec );
899  double vtx3DErr2 = duvec.transpose()*poscov*duvec;
900  double trk3DErr2 = duvec.transpose()*mCovTrk3D*duvec;
901  // set results
902  res = {d0toSV, sqrt(d0Err2), z0toSV, sqrt(z0Err2),
903  chi2testSV, (doDCAin3D ? docaSV : d0toSV), 5,
904  vtx3DErr2, trk3DErr2, phi};
905  }
906  if ( chi2DefToUse == 9 ) {
907  AmgMatrix(3,2) dmat = AmgMatrix(3,2)::Zero();
908  dmat(0,0) = -sin(phi);
909  dmat(1,0) = cos(phi);
910  dmat(2,0) = 0.;
911  dmat(0,1) = 0.;
912  dmat(1,1) = 0.;
913  dmat(2,1) = 1.;
914  AmgSymMatrix(2) mCovVtx2D = dmat.transpose()*SV_cov*dmat;
915  AmgSymMatrix(2) mCovTrk2D = AmgSymMatrix(2)::Zero();
916  mCovTrk2D(0,0) = d0Err2;
917  mCovTrk2D(0,1) = d0z0Cov;
918  mCovTrk2D(1,0) = d0z0Cov;
919  mCovTrk2D(1,1) = z0Err2;
920  Amg::Vector2D dvec(d0toSV, z0toSV);
921  Amg::Vector2D duvec = dvec.unit();
922  // log(chi2) = log( (d0, z0) * V^-1 * (d0, z0)^T )
923  chi2testSV = log( dvec.transpose()*(mCovVtx2D+mCovTrk2D).inverse()
924  * dvec );
925  double vtx2DErr2 = duvec.transpose()*mCovVtx2D*duvec;
926  double trk2DErr2 = duvec.transpose()*mCovTrk2D*duvec;
927 
928  if ( vtx2DErr2 < 0. || trk2DErr2 < 0. ) {
929  ATH_MSG_WARNING("BPhysVertexTrackBase::"
930  "getTrackLogChi2DCA(): "
931  << "vtx2DErr2 = " << vtx2DErr2
932  << " trk2DErr2 = " << trk2DErr2
933  << " chi2testSV = " << chi2testSV);
934  ATH_MSG_WARNING("dvec = " << dvec);
935  ATH_MSG_WARNING("mCovVtx2D = " << mCovVtx2D);
936  ATH_MSG_WARNING("mCovTrk2D = " << mCovTrk2D);
937  ATH_MSG_WARNING("dmat = " << dmat);
938  ATH_MSG_WARNING("SV_cov = " << SV_cov);
939  ATH_MSG_WARNING("det(mCovVtx2D) = " << mCovVtx2D.determinant());
940  ATH_MSG_WARNING("det(mCovTrk2D) = " << mCovTrk2D.determinant());
941  ATH_MSG_WARNING("det(SV_cov) = " << SV_cov.determinant());
942  ATH_MSG_WARNING("d0toSV = " << d0toSV
943  << " z0toSV = " << z0toSV
944  << " phi = " << phi
945  << " docaSV = " << docaSV);
946  }
947 
948  // set results
949  res = {d0toSV, sqrt(d0Err2), z0toSV, sqrt(z0Err2),
950  chi2testSV, (doDCAin3D ? docaSV : d0toSV), 6,
951  vtx2DErr2, trk2DErr2, phi};
952  }
953  } else {
954  ATH_MSG_WARNING("BPhysVertexTrackBase::getTrackLogChi2DCA():"
955  << " docaSV == 0 !");
956  }
957  } // if chi2DefToUse > 7 && chi2DefToUse < 10
958 
959  } else if ( chi2DefToUse > 2 && chi2DefToUse < 5 ) {
960  // CalcLogChi2toPV method using xAOD::TrackingHelpers
961  // (simply taken from NtupleMaker for comparisons)
962  // N.B. z0significance method of the helper doesn't include pv_z0
963  // uncertainty
964  double d0sign(0.);
965  if (chi2DefToUse == 4) {
966  d0sign =
971  );
972  } else {
974  }
975  // trk z0 is expressed relative to the beamspot position along z-axis
976  // (trk->vz())
977  // DCA always in 3D
978  double z0toPV = track->z0() + track->vz() - vtx->z();
979  double z0Err2 = track->definingParametersCovMatrixVec()[2];
980  if (chi2DefToUse == 4) z0Err2+= vtx->covariancePosition()(2,2);
981  double z0sign = z0toPV / sqrt( z0Err2 );
982  double chi2 = log( pow(d0sign, 2.) + pow(z0sign, 2.) );
983  // set results
984  res = {-999., -99., z0toPV, sqrt(z0Err2), chi2, -100., 4, -99., -99.,
985  -999.};
986 
987  } // if chi2DefToUse
988  } else {
989  ATH_MSG_WARNING("BPhysVertexTrackBase::getTrackLogChi2DCA():"
990  " track pointer is NULL!");
991  res[6] = -2.;
992  } // if track != NULL
993  return res;
994  }

◆ initialize()

StatusCode DerivationFramework::BPhysVertexTrackBase::initialize ( )
overridevirtual

Definition at line 401 of file BPhysVertexTrackBase.cxx.

401  {
402 
403  ATH_MSG_DEBUG("BPhysVertexTrackBase::initialize() -- begin");
404 
405  if ( m_vertexContainerNames.size() == 0 ) {
406  ATH_MSG_ERROR("No vertex container names provided!");
407  }
408  if ( m_refPVContainerNames.size() == 0 ) {
409  ATH_MSG_ERROR("No refitted PV container names provided!");
410  }
411  if ( m_trackParticleContainerName == "" ) {
412  ATH_MSG_ERROR("No track particle container name provided!");
413  }
414  if ( m_pvContainerName == "" ) {
415  ATH_MSG_ERROR("No PV container name provided!");
416  }
417  if ( m_vertexContainerNames.size() != m_refPVContainerNames.size() ) {
418  ATH_MSG_ERROR("Size mismatch of VertexContainerNames ("
419  << m_vertexContainerNames.size()
420  << ") and RefPVContainerNames ("
421  << m_refPVContainerNames.size() << ") lists!");
422  }
423 
424  if ( m_vertexContainerNames.size() != m_branchPrefixes.size() ) {
425  ATH_MSG_ERROR("Size mismatch of VertexContainerNames ("
426  << m_vertexContainerNames.size()
427  << ") and BranchPrefixes ("
428  << m_branchPrefixes.size() << ") lists!");
429  }
430 
431  // TrackToVertexTool
432  ATH_CHECK(m_trackToVertexTool.retrieve());
433 
434  // TrackSelectionTools
435  for (auto selTool : m_trackSelectionTools ) {
436  ATH_CHECK(selTool.retrieve());
437  }
438 
439  // TrackVertexAssociationTool
440  ATH_CHECK(m_tvaTool.retrieve());
441  // take note of working point
442  // const std::string tvaWp("Loose");
443  const std::string tvaWp =
444  dynamic_cast<CP::TrackVertexAssociationTool*>(m_tvaTool.get())->getProperty("WorkingPoint").toString();
445  m_tvaToolHasWpLoose = (tvaWp == "Loose");
446 
447  // initialize PV-to-SV association type vector
449 
450  // initialize track type request pattern
452 
453  // initialize track type counters
454  if ( m_debugTrackTypes > 0 ) {
455  m_mttc = std::make_unique<TrackTypeCounter>(*this, name());
456  }
457 
458  ATH_MSG_DEBUG("BPhysVertexTrackBase::initialize() -- end");
459 
460  return initializeHook();
461  }

◆ initializeHook()

StatusCode DerivationFramework::BPhysVertexTrackBase::initializeHook ( )
protectedvirtual

Definition at line 559 of file BPhysVertexTrackBase.cxx.

559  {
560 
561  return StatusCode::SUCCESS;
562  }

◆ initPvAssocTypeVec()

void DerivationFramework::BPhysVertexTrackBase::initPvAssocTypeVec ( )
protectedvirtual

Definition at line 1339 of file BPhysVertexTrackBase.cxx.

1339  {
1340 
1341  m_pvAssocTypes.clear();
1342  for (unsigned int i=0; i<xAOD::BPhysHelper::n_pv_types; ++i) {
1343  if ( (m_doVertexType & (1 << i)) > 0 )
1345  }
1346  }

◆ rttor()

uint64_t DerivationFramework::BPhysVertexTrackBase::rttor ( const std::vector< uint64_t > &  vtypes)
static

Definition at line 327 of file BPhysVertexTrackBase.cxx.

327  {
328  // or of requested track types
329  uint64_t ttor(0);
330  for (size_t i=0; i<vtypes.size(); ++i) {
331  ttor |= vtypes[i];
332  }
333  return ttor;
334  }

◆ selectTracks() [1/2]

TrackBag DerivationFramework::BPhysVertexTrackBase::selectTracks ( const xAOD::TrackParticleContainer inpTracks,
const TrackBag exclTracks,
xAOD::BPhysHelper cand,
const unsigned int  ipv,
const unsigned int  its,
const unsigned int  itt 
) const
protected

Definition at line 1240 of file BPhysVertexTrackBase.cxx.

1247  {
1248 
1249  const xAOD::Vertex* candRefPV = cand.pv(m_pvAssocTypes[ipv]);
1250  const xAOD::Vertex* candPV = cand.origPv(m_pvAssocTypes[ipv]);
1251 
1252  ATH_MSG_DEBUG("selectTracks: Found " << exclTracks.size()
1253  << " " << exclTracks
1254  << " for decay candidate " << cand.vtx()
1255  << "; candPV: " << candPV << " candRefPV: " << candRefPV);
1256 
1257  std::string bname(buildBranchBaseName(its, ipv, itt));
1258 
1259  // tracks to be considered
1260  TrackBag tracks;
1262  inpTracks->begin(); trkItr != inpTracks->end(); ++trkItr) {
1263  const xAOD::TrackParticle* track = *trkItr;
1264  uint64_t trackTypesForTrack(0x0);
1265  // debug track types (before any cuts)
1266  if ( m_debugTrackTypes > 0 ) {
1267  trackTypesForTrack = detTrackTypes(track, candPV, candRefPV);
1268  m_mttc->addToCounter(trackTypesForTrack, itt, bname, "all");
1269  }
1270  // track selection check
1271  if ( ! m_trackSelectionTools[its]->accept(*track, candRefPV) ) continue;
1272  // debug track types (after track selection cuts)
1273  if ( m_debugTrackTypes > 0 ) {
1274  m_mttc->addToCounter(trackTypesForTrack, itt, bname, "ats");
1275  }
1276 
1277  // calcluation of track type bits not necessary if all bits requested
1278  if ( ! ((unsigned int)m_useTrackTypes[itt] == ttall() ||
1279  (unsigned int)m_useTrackTypes[itt] == ttallMin()) ) {
1280  // track type check -- determination if not in debugging mode
1281  // delayed for execution speed reasons
1282  if ( trackTypesForTrack == 0x0 ) {
1283  trackTypesForTrack = detTrackTypes(track, candPV, candRefPV);
1284  }
1285  if ( (trackTypesForTrack & m_useTrackTypes[itt]) == 0x0 ) {
1286  continue;
1287  }
1288  }
1289  // debug track types (after track type cuts)
1290  if ( m_debugTrackTypes > 0 ) {
1291  m_mttc->addToCounter(trackTypesForTrack, itt, bname, "att");
1292  }
1293  // track not in list of tracks to exclude
1294  if ( std::find(exclTracks.begin(), exclTracks.end(), track)
1295  != exclTracks.end() ) continue;
1296  // debug track types (after all cuts)
1297  if ( m_debugTrackTypes > 0 ) {
1298  m_mttc->addToCounter(trackTypesForTrack, itt, bname, "fin");
1299  }
1300  // tracks that survived so far
1301  tracks.push_back(track);
1302  } // for
1303 
1304  return tracks;
1305  }

◆ selectTracks() [2/2]

TrackBag DerivationFramework::BPhysVertexTrackBase::selectTracks ( const xAOD::TrackParticleContainer inpTracks,
xAOD::BPhysHelper cand,
const unsigned int  ipv,
const unsigned int  its,
const unsigned int  itt 
) const
protected

Definition at line 1224 of file BPhysVertexTrackBase.cxx.

1230  {
1231 
1232  return selectTracks(inpTracks, findAllTracksInDecay(cand), cand,
1233  ipv, its, itt);
1234  }

◆ trackToString()

std::string DerivationFramework::BPhysVertexTrackBase::trackToString ( const xAOD::TrackParticle track)
static

Definition at line 338 of file BPhysVertexTrackBase.cxx.

338  {
339  std::string str;
340  if (track != nullptr) {
341  std::string str = std::format("p({:10.4f},{:10.4f},{:10.4f})\n"
342  "d:({:10.5f},{:10.5f},{:10.5f},{:10.5f},{:10.6f})",
343  (track->p4()).Px(), (track->p4()).Py(), (track->p4()).Pz(),
344  track->d0(), track->z0(), track->phi0(), track->theta(),
345  track->qOverP());
346  } // if track
347  return str;
348  }

◆ ttall()

uint64_t DerivationFramework::BPhysVertexTrackBase::ttall ( )
static

Definition at line 318 of file BPhysVertexTrackBase.cxx.

318  {
319  if ( s_track_type_all_cached == 0x0 ) {
320  for (unsigned int i=0; i<n_track_types; ++i) {
322  }
323  }
325  }

◆ ttallMin()

uint64_t DerivationFramework::BPhysVertexTrackBase::ttallMin ( )
static

Definition at line 313 of file BPhysVertexTrackBase.cxx.

313  {
314  // only bits 0 - 6
315  return 127;
316  }

◆ ttb()

uint64_t DerivationFramework::BPhysVertexTrackBase::ttb ( BPhysVertexTrackBase::track_type  type)
static

Definition at line 309 of file BPhysVertexTrackBase.cxx.

309  {
310  return track_type_bit[type];
311  }

◆ tts()

const std::string DerivationFramework::BPhysVertexTrackBase::tts ( BPhysVertexTrackBase::track_type  type)
static

Definition at line 305 of file BPhysVertexTrackBase.cxx.

305  {
306  return track_type_str[type];
307  }

◆ wrapLines()

std::string DerivationFramework::BPhysVertexTrackBase::wrapLines ( const std::string &  lines,
const std::string &  prefix 
)
static

Definition at line 353 of file BPhysVertexTrackBase.cxx.

354  {
355 
356  std::string ostr;
357  std::istringstream stream(lines);
358  std::string line;
359  while ( std::getline(stream, line) ) {
360  if ( !ostr.empty() ) ostr += "\n";
361  ostr += prefix + line;
362  }
363  return ostr;
364  }

Member Data Documentation

◆ m_branchBaseName

std::string DerivationFramework::BPhysVertexTrackBase::m_branchBaseName
protected

Definition at line 246 of file BPhysVertexTrackBase.h.

◆ m_branchPrefixes

std::vector<std::string> DerivationFramework::BPhysVertexTrackBase::m_branchPrefixes
protected

Definition at line 245 of file BPhysVertexTrackBase.h.

◆ m_branchSuffix

std::string DerivationFramework::BPhysVertexTrackBase::m_branchSuffix
protected

Definition at line 247 of file BPhysVertexTrackBase.h.

◆ m_debugTracksInEvents

std::vector<uint64_t> DerivationFramework::BPhysVertexTrackBase::m_debugTracksInEvents
protected

Definition at line 265 of file BPhysVertexTrackBase.h.

◆ m_debugTracksInThisEvent

bool DerivationFramework::BPhysVertexTrackBase::m_debugTracksInThisEvent {}
mutableprotected

Definition at line 302 of file BPhysVertexTrackBase.h.

◆ m_debugTrackTypes

int DerivationFramework::BPhysVertexTrackBase::m_debugTrackTypes {}
protected

Definition at line 264 of file BPhysVertexTrackBase.h.

◆ m_doVertexType

int DerivationFramework::BPhysVertexTrackBase::m_doVertexType {}
protected

Definition at line 259 of file BPhysVertexTrackBase.h.

◆ m_eventInfo

const xAOD::EventInfo* DerivationFramework::BPhysVertexTrackBase::m_eventInfo {}
mutableprotected

Definition at line 285 of file BPhysVertexTrackBase.h.

◆ m_evtNumber

uint64_t DerivationFramework::BPhysVertexTrackBase::m_evtNumber {}
mutableprotected

Definition at line 299 of file BPhysVertexTrackBase.h.

◆ m_incPrecVerticesInDecay

bool DerivationFramework::BPhysVertexTrackBase::m_incPrecVerticesInDecay {}
protected

Definition at line 261 of file BPhysVertexTrackBase.h.

◆ m_minNTracksInPV

int DerivationFramework::BPhysVertexTrackBase::m_minNTracksInPV {}
protected

Definition at line 262 of file BPhysVertexTrackBase.h.

◆ m_mttc

std::unique_ptr<TrackTypeCounter> DerivationFramework::BPhysVertexTrackBase::m_mttc
protected

Definition at line 295 of file BPhysVertexTrackBase.h.

◆ m_nEvtsSeen

unsigned int DerivationFramework::BPhysVertexTrackBase::m_nEvtsSeen {}
mutableprotected

Definition at line 282 of file BPhysVertexTrackBase.h.

◆ m_pvAssocResMap

StringIntMap_t DerivationFramework::BPhysVertexTrackBase::m_pvAssocResMap
mutableprotected

Definition at line 289 of file BPhysVertexTrackBase.h.

◆ m_pvAssocTypes

std::vector<xAOD::BPhysHelper::pv_type> DerivationFramework::BPhysVertexTrackBase::m_pvAssocTypes
protected

Definition at line 280 of file BPhysVertexTrackBase.h.

◆ m_pvContainerName

std::string DerivationFramework::BPhysVertexTrackBase::m_pvContainerName
protected

Definition at line 256 of file BPhysVertexTrackBase.h.

◆ m_pvtxContainer

const xAOD::VertexContainer* DerivationFramework::BPhysVertexTrackBase::m_pvtxContainer {}
mutableprotected

Definition at line 273 of file BPhysVertexTrackBase.h.

◆ m_pvTypesToConsider

std::vector<uint64_t> DerivationFramework::BPhysVertexTrackBase::m_pvTypesToConsider
protected

Definition at line 263 of file BPhysVertexTrackBase.h.

◆ m_refPVAuxContainer

const xAOD::VertexAuxContainer* DerivationFramework::BPhysVertexTrackBase::m_refPVAuxContainer {}
mutableprotected

Definition at line 277 of file BPhysVertexTrackBase.h.

◆ m_refPVContainer

const xAOD::VertexContainer* DerivationFramework::BPhysVertexTrackBase::m_refPVContainer {}
mutableprotected

Definition at line 276 of file BPhysVertexTrackBase.h.

◆ m_refPVContainerNames

std::vector<std::string> DerivationFramework::BPhysVertexTrackBase::m_refPVContainerNames
protected

Definition at line 257 of file BPhysVertexTrackBase.h.

◆ m_runNumber

unsigned int DerivationFramework::BPhysVertexTrackBase::m_runNumber {}
mutableprotected

Definition at line 298 of file BPhysVertexTrackBase.h.

◆ m_svtxAuxContainer

const xAOD::VertexAuxContainer* DerivationFramework::BPhysVertexTrackBase::m_svtxAuxContainer {}
mutableprotected

Definition at line 275 of file BPhysVertexTrackBase.h.

◆ m_svtxContainer

const xAOD::VertexContainer* DerivationFramework::BPhysVertexTrackBase::m_svtxContainer {}
mutableprotected

Definition at line 274 of file BPhysVertexTrackBase.h.

◆ m_trackParticleContainerName

std::string DerivationFramework::BPhysVertexTrackBase::m_trackParticleContainerName
protected

Definition at line 249 of file BPhysVertexTrackBase.h.

◆ m_tracks

const xAOD::TrackParticleContainer* DerivationFramework::BPhysVertexTrackBase::m_tracks {}
mutableprotected

Definition at line 271 of file BPhysVertexTrackBase.h.

◆ m_tracksAux

const xAOD::TrackParticleAuxContainer* DerivationFramework::BPhysVertexTrackBase::m_tracksAux {}
mutableprotected

Definition at line 272 of file BPhysVertexTrackBase.h.

◆ m_trackSelectionTools

ToolHandleArray<TrkSelTool> DerivationFramework::BPhysVertexTrackBase::m_trackSelectionTools
protected

Definition at line 250 of file BPhysVertexTrackBase.h.

◆ m_trackToVertexTool

ToolHandle<Reco::ITrackToVertex> DerivationFramework::BPhysVertexTrackBase::m_trackToVertexTool
protected

Definition at line 252 of file BPhysVertexTrackBase.h.

◆ m_trackTypesUsed

uint64_t DerivationFramework::BPhysVertexTrackBase::m_trackTypesUsed {}
protected

Definition at line 292 of file BPhysVertexTrackBase.h.

◆ m_tvaTool

ToolHandle<CP::ITrackVertexAssociationTool> DerivationFramework::BPhysVertexTrackBase::m_tvaTool
protected

Definition at line 254 of file BPhysVertexTrackBase.h.

◆ m_tvaToolHasWpLoose

bool DerivationFramework::BPhysVertexTrackBase::m_tvaToolHasWpLoose {}
protected

Definition at line 268 of file BPhysVertexTrackBase.h.

◆ m_useTrackTypes

std::vector<uint64_t> DerivationFramework::BPhysVertexTrackBase::m_useTrackTypes
protected

Definition at line 260 of file BPhysVertexTrackBase.h.

◆ m_vertexContainerNames

std::vector<std::string> DerivationFramework::BPhysVertexTrackBase::m_vertexContainerNames
protected

Definition at line 248 of file BPhysVertexTrackBase.h.

◆ n_track_types

const int DerivationFramework::BPhysVertexTrackBase::n_track_types = 33
static

Definition at line 123 of file BPhysVertexTrackBase.h.

◆ s_track_type_all_cached

uint64_t DerivationFramework::BPhysVertexTrackBase::s_track_type_all_cached = 0x0
staticprivate

Definition at line 127 of file BPhysVertexTrackBase.h.

◆ track_type_bit

const uint64_t DerivationFramework::BPhysVertexTrackBase::track_type_bit
static
Initial value:
=
{0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40,
0x80, 0x100, 0x200, 0x400,
0x800, 0x1000, 0x2000, 0x4000,
0x8000, 0x10000, 0x20000, 0x40000,
0x80000, 0x100000, 0x200000, 0x400000,
0x800000, 0x1000000, 0x2000000, 0x4000000,
0x8000000, 0x10000000, 0x20000000, 0x40000000,
0x80000000, 0x100000000}

Definition at line 125 of file BPhysVertexTrackBase.h.

◆ track_type_str

const std::string DerivationFramework::BPhysVertexTrackBase::track_type_str
static
Initial value:
=
{"ASSOCPV", "PVTYPE0", "PVTYPE1", "PVTYPE2", "PVTYPE3", "NONE", "NULLVP",
"CAPVRFN3U0", "CAPVNRN3U0", "CAPVRF3DU0", "CAPVNR3DU0",
"CAPVRFN3U1", "CAPVNRN3U1", "CAPVRF3DU1", "CAPVNR3DU1",
"CAPVRFN3U2", "CAPVNRN3U2", "CAPVRF3DU2", "CAPVNR3DU2",
"CAPVRFNNU3", "CAPVNRNNU3", "CAPVRFNNU4", "CAPVNRNNU4",
"CAPVRFNNU5", "CAPVNRNNU5", "CAPVRFNNU6", "CAPVNRNNU6",
"CAPVRFNNU7", "CAPVNRNNU7", "CAPVRFNNU8", "CAPVNRNNU8",
"CAPVRFNNU9", "CAPVNRNNU9"}

Definition at line 124 of file BPhysVertexTrackBase.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU6
@ CAPVRFNNU6
Definition: BPhysVertexTrackBase.h:120
xAOD::Vertex_v1::x
float x() const
Returns the x position.
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU9
@ CAPVNRNNU9
Definition: BPhysVertexTrackBase.h:122
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU7
@ CAPVRFNNU7
Definition: BPhysVertexTrackBase.h:121
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
DerivationFramework::BPhysVertexTrackBase::track_type_str
static const std::string track_type_str[]
Definition: BPhysVertexTrackBase.h:124
xAOD::BPhysHelper::nMuons
int nMuons()
: Methods providing access to the linked muons
Definition: BPhysHelper.cxx:441
DerivationFramework::BPhysVertexTrackBase::addBranchesHook
virtual StatusCode addBranchesHook() const
Definition: BPhysVertexTrackBase.cxx:573
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
xAOD::BPhysHelper
Definition: BPhysHelper.h:71
test_pyathena.px
px
Definition: test_pyathena.py:18
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
xAOD::BPhysHelper::pv_type_str
static const std::string pv_type_str[]
Definition: BPhysHelper.h:605
DerivationFramework::BPhysVertexTrackBase::m_pvtxContainer
const xAOD::VertexContainer * m_pvtxContainer
Definition: BPhysVertexTrackBase.h:273
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU4
@ CAPVRFNNU4
Definition: BPhysVertexTrackBase.h:119
DerivationFramework::BPhysVertexTrackBase::m_pvAssocTypes
std::vector< xAOD::BPhysHelper::pv_type > m_pvAssocTypes
Definition: BPhysVertexTrackBase.h:280
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
xAOD::BPhysHelper::nRefTrks
int nRefTrks()
Returns number of stored refitted track momenta.
Definition: BPhysHelper.cxx:115
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DerivationFramework::BPhysVertexTrackBase::m_pvContainerName
std::string m_pvContainerName
Definition: BPhysVertexTrackBase.h:256
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
collListGuids.line
string line
Definition: collListGuids.py:77
DerivationFramework::BPhysVertexTrackBase::NULLVP
@ NULLVP
Definition: BPhysVertexTrackBase.h:115
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CP::TrackVertexAssociationTool
General track-vertex association tool.
Definition: InnerDetector/InDetRecTools/TrackVertexAssociationTool/TrackVertexAssociationTool/TrackVertexAssociationTool.h:53
xAOD::Vertex_v1::trackParticleLinks
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
DerivationFramework::BPhysVertexTrackBase::m_pvAssocResMap
StringIntMap_t m_pvAssocResMap
Definition: BPhysVertexTrackBase.h:289
DerivationFramework::BPhysVertexTrackBase::CAPVRFN3U2
@ CAPVRFN3U2
Definition: BPhysVertexTrackBase.h:118
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
DerivationFramework::BPhysVertexTrackBase::findAllMuonsInDecay
MuonBag findAllMuonsInDecay(xAOD::BPhysHelper &vtx) const
Definition: BPhysVertexTrackBase.cxx:1092
xAOD::TrackParticleAuxContainer
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.
Definition: TrackParticleAuxContainer.h:19
xAOD::TrackingHelpers::d0significance
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
Definition: TrackParticlexAODHelpers.cxx:42
DerivationFramework::BPhysVertexTrackBase::m_nEvtsSeen
unsigned int m_nEvtsSeen
Definition: BPhysVertexTrackBase.h:282
test_pyathena.pt
pt
Definition: test_pyathena.py:11
ParticleTest.tp
tp
Definition: ParticleTest.py:25
xAOD::BPhysHelper::muon
const xAOD::Muon * muon(const size_t index)
Returns pointer to the i-th linked muon.
Definition: BPhysHelper.cxx:452
DerivationFramework::BPhysVertexTrackBase::finalizeHook
virtual StatusCode finalizeHook()
Definition: BPhysVertexTrackBase.cxx:566
DerivationFramework::BPhysVertexTrackBase::m_runNumber
unsigned int m_runNumber
Definition: BPhysVertexTrackBase.h:298
DerivationFramework::BPhysVertexTrackBase::detTrackTypes
uint64_t detTrackTypes(const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV) const
Definition: BPhysVertexTrackBase.cxx:1000
Trk::z0
@ z0
Definition: ParamDefs.h:64
xAOD::EventInfo_v1::beamPosSigmaX
float beamPosSigmaX() const
The width of the beam spot in the X direction.
DerivationFramework::BPhysVertexTrackBase::m_evtNumber
uint64_t m_evtNumber
Definition: BPhysVertexTrackBase.h:299
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
DerivationFramework::BPhysVertexTrackBase::CAPVRF3DU1
@ CAPVRF3DU1
Definition: BPhysVertexTrackBase.h:117
DerivationFramework::BPhysVertexTrackBase::m_useTrackTypes
std::vector< uint64_t > m_useTrackTypes
Definition: BPhysVertexTrackBase.h:260
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
DerivationFramework::BPhysVertexTrackBase::PVTYPE1
@ PVTYPE1
Definition: BPhysVertexTrackBase.h:114
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
DerivationFramework::BPhysVertexTrackBase::findMinChi2PV
std::pair< const xAOD::Vertex *, double > findMinChi2PV(const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV, const std::vector< uint64_t > &pvtypes, const int minNTracksInPV, const bool useRefittedPvs, const bool doDCAin3D, const int chi2DefToUse) const
Definition: BPhysVertexTrackBase.cxx:1358
x
#define x
DerivationFramework::BPhysVertexTrackBase::m_trackTypesUsed
uint64_t m_trackTypesUsed
Definition: BPhysVertexTrackBase.h:292
DerivationFramework::BPhysVertexTrackBase::ASSOCPV
@ ASSOCPV
Definition: BPhysVertexTrackBase.h:114
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU7
@ CAPVNRNNU7
Definition: BPhysVertexTrackBase.h:121
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AmgMatrix
#define AmgMatrix(rows, cols)
Definition: EventPrimitives.h:49
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU9
@ CAPVRFNNU9
Definition: BPhysVertexTrackBase.h:122
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
DerivationFramework::BPhysVertexTrackBase::buildBranchBaseName
std::string buildBranchBaseName(unsigned int its, unsigned int ipv, unsigned int itt, const std::string &preSuffix="") const
Definition: BPhysVertexTrackBase.cxx:1310
DerivationFramework::BPhysVertexTrackBase::CAPVNR3DU0
@ CAPVNR3DU0
Definition: BPhysVertexTrackBase.h:116
DerivationFramework::BPhysVertexTrackBase::ttall
static uint64_t ttall()
Definition: BPhysVertexTrackBase.cxx:318
DerivationFramework::BPhysVertexTrackBase::m_branchPrefixes
std::vector< std::string > m_branchPrefixes
Definition: BPhysVertexTrackBase.h:245
DerivationFramework::BPhysVertexTrackBase::calcValuesHook
virtual StatusCode calcValuesHook(const xAOD::Vertex *vtx, const unsigned int ipv, const unsigned int its, const unsigned int itt) const
Definition: BPhysVertexTrackBase.cxx:606
DerivationFramework::BPhysVertexTrackBase::CAPVNRN3U2
@ CAPVNRN3U2
Definition: BPhysVertexTrackBase.h:118
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU4
@ CAPVNRNNU4
Definition: BPhysVertexTrackBase.h:119
DerivationFramework::BPhysVertexTrackBase::PVTYPE2
@ PVTYPE2
Definition: BPhysVertexTrackBase.h:114
xAOD::BPhysHelper::pv_type
pv_type
: Enum type of the PV
Definition: BPhysHelper.h:475
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCondBlobAlgs_fillNoiseFromASCII.lines
lines
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:104
DerivationFramework::BPhysVertexTrackBase::m_mttc
std::unique_ptr< TrackTypeCounter > m_mttc
Definition: BPhysVertexTrackBase.h:295
DerivationFramework::BPhysVertexTrackBase::m_pvTypesToConsider
std::vector< uint64_t > m_pvTypesToConsider
Definition: BPhysVertexTrackBase.h:263
DerivationFramework::BPhysVertexTrackBase::addBranchesVCSetupHook
virtual StatusCode addBranchesVCSetupHook(size_t ivc) const
Definition: BPhysVertexTrackBase.cxx:581
DerivationFramework::BPhysVertexTrackBase::m_tracks
const xAOD::TrackParticleContainer * m_tracks
Definition: BPhysVertexTrackBase.h:271
DerivationFramework::BPhysVertexTrackBase::m_branchSuffix
std::string m_branchSuffix
Definition: BPhysVertexTrackBase.h:247
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
DerivationFramework::BPhysVertexTrackBase::CAPVNRN3U0
@ CAPVNRN3U0
Definition: BPhysVertexTrackBase.h:116
DerivationFramework::BPhysVertexTrackBase::m_tvaTool
ToolHandle< CP::ITrackVertexAssociationTool > m_tvaTool
Definition: BPhysVertexTrackBase.h:254
DerivationFramework::BPhysVertexTrackBase::buildPvAssocCacheName
virtual std::string buildPvAssocCacheName(const xAOD::Vertex *vtx, const int ipv) const
Definition: BPhysVertexTrackBase.cxx:671
xAOD::BPhysHelper::precedingVertex
const xAOD::Vertex * precedingVertex(const size_t index)
Returns pointer to a preceding vertex.
Definition: BPhysHelper.cxx:613
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
DerivationFramework::BPhysVertexTrackBase::m_branchBaseName
std::string m_branchBaseName
Definition: BPhysVertexTrackBase.h:246
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:11
TestMuonSF::getProperty
T getProperty(const asg::IAsgTool *interface_tool, const std::string &prop_name)
Definition: MuonSFTestHelper.cxx:17
DerivationFramework::BPhysVertexTrackBase::m_tracksAux
const xAOD::TrackParticleAuxContainer * m_tracksAux
Definition: BPhysVertexTrackBase.h:272
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
DerivationFramework::BPhysVertexTrackBase::CAPVRFN3U0
@ CAPVRFN3U0
Definition: BPhysVertexTrackBase.h:116
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
DerivationFramework::BPhysVertexTrackBase::findAllTracksInDecay
TrackBag findAllTracksInDecay(xAOD::BPhysHelper &vtx) const
Definition: BPhysVertexTrackBase.cxx:1056
DerivationFramework::BPhysVertexTrackBase::CAPVNR3DU2
@ CAPVNR3DU2
Definition: BPhysVertexTrackBase.h:118
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::BPhysVertexTrackBase::findMuonRefTrackMomenta
std::vector< TVector3 > findMuonRefTrackMomenta(xAOD::BPhysHelper &vtx, MuonBag &muons) const
Definition: BPhysVertexTrackBase.cxx:1151
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
hist_file_dump.f
f
Definition: hist_file_dump.py:141
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
DerivationFramework::TrackBag
std::vector< const xAOD::TrackParticle * > TrackBag
Definition: BPhysVertexTrackBase.h:52
xAOD::Vertex_v1::z
float z() const
Returns the z position.
xAOD::BPhysHelper::origPv
const xAOD::Vertex * origPv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
original PV
Definition: BPhysHelper.cxx:807
DerivationFramework::BPhysVertexTrackBase::CAPVRFN3U1
@ CAPVRFN3U1
Definition: BPhysVertexTrackBase.h:117
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::BPhysVertexTrackBase::fastFillHook
virtual bool fastFillHook(const xAOD::Vertex *vtx, const int ipv) const
Definition: BPhysVertexTrackBase.cxx:621
DerivationFramework::BPhysVertexTrackBase::addBranchesSVLoopHook
virtual StatusCode addBranchesSVLoopHook(const xAOD::Vertex *vtx) const
Definition: BPhysVertexTrackBase.cxx:594
xAOD::BPhysHelper::refTrkOrigin
const xAOD::IParticle * refTrkOrigin(const size_t index) const
: Returns the original track (charged or neutral) corresponding to the i-th refitted track
Definition: BPhysHelper.cxx:171
xAOD::EventInfo_v1::beamPosSigmaY
float beamPosSigmaY() const
The width of the beam spot in the Y direction.
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU3
@ CAPVNRNNU3
Definition: BPhysVertexTrackBase.h:119
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU5
@ CAPVRFNNU5
Definition: BPhysVertexTrackBase.h:120
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg::py
@ py
Definition: GeoPrimitives.h:39
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU3
@ CAPVRFNNU3
Definition: BPhysVertexTrackBase.h:119
Trk::d0
@ d0
Definition: ParamDefs.h:63
DerivationFramework::BPhysVertexTrackBase::getTrackLogChi2DCA
std::vector< double > getTrackLogChi2DCA(const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doDCAin3D=false, int chi2DefToUse=0) const
Definition: BPhysVertexTrackBase.cxx:721
xAOD::BPhysHelper::vtx
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
Definition: BPhysHelper.h:108
DerivationFramework::BPhysVertexTrackBase::m_debugTracksInEvents
std::vector< uint64_t > m_debugTracksInEvents
Definition: BPhysVertexTrackBase.h:265
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
DerivationFramework::BPhysVertexTrackBase::m_trackParticleContainerName
std::string m_trackParticleContainerName
Definition: BPhysVertexTrackBase.h:249
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU8
@ CAPVNRNNU8
Definition: BPhysVertexTrackBase.h:121
DerivationFramework::BPhysVertexTrackBase::track_type_bit
static const uint64_t track_type_bit[]
Definition: BPhysVertexTrackBase.h:125
DerivationFramework::BPhysVertexTrackBase::m_tvaToolHasWpLoose
bool m_tvaToolHasWpLoose
Definition: BPhysVertexTrackBase.h:268
checkTriggerxAOD.found
found
Definition: checkTriggerxAOD.py:328
DerivationFramework::BPhysVertexTrackBase::m_trackSelectionTools
ToolHandleArray< TrkSelTool > m_trackSelectionTools
Definition: BPhysVertexTrackBase.h:250
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
DerivationFramework::BPhysVertexTrackBase::CAPVRF3DU0
@ CAPVRF3DU0
Definition: BPhysVertexTrackBase.h:116
DerivationFramework::BPhysVertexTrackBase::m_refPVContainerNames
std::vector< std::string > m_refPVContainerNames
Definition: BPhysVertexTrackBase.h:257
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
DerivationFramework::BPhysVertexTrackBase::selectTracks
TrackBag selectTracks(const xAOD::TrackParticleContainer *inpTracks, xAOD::BPhysHelper &cand, const unsigned int ipv, const unsigned int its, const unsigned int itt) const
Definition: BPhysVertexTrackBase.cxx:1224
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DerivationFramework::BPhysVertexTrackBase::NONE
@ NONE
Definition: BPhysVertexTrackBase.h:114
DerivationFramework::BPhysVertexTrackBase::m_incPrecVerticesInDecay
bool m_incPrecVerticesInDecay
Definition: BPhysVertexTrackBase.h:261
DerivationFramework::BPhysVertexTrackBase::findAllMuonIdTracksInDecay
TrackBag findAllMuonIdTracksInDecay(xAOD::BPhysHelper &vtx, MuonBag &muons) const
Definition: BPhysVertexTrackBase.cxx:1130
DerivationFramework::BPhysVertexTrackBase::findAssocPV
const xAOD::Vertex * findAssocPV(const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV, const std::vector< uint64_t > &pvtypes, const int minNTracksInPV, const bool useRefittedPvs) const
Definition: BPhysVertexTrackBase.cxx:1410
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
xAOD::EventInfo_v1::beamPosSigmaXY
float beamPosSigmaXY() const
The beam spot shape's X-Y correlation.
DerivationFramework::BPhysVertexTrackBase::ttallMin
static uint64_t ttallMin()
Definition: BPhysVertexTrackBase.cxx:313
y
#define y
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::BPhysHelper::refTrk
TVector3 refTrk(const size_t index)
Returns i-th refitted track 3-momentum.
Definition: BPhysHelper.cxx:126
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU5
@ CAPVNRNNU5
Definition: BPhysVertexTrackBase.h:120
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DerivationFramework::BPhysVertexTrackBase::PVTYPE0
@ PVTYPE0
Definition: BPhysVertexTrackBase.h:114
DerivationFramework::BPhysVertexTrackBase::m_vertexContainerNames
std::vector< std::string > m_vertexContainerNames
Definition: BPhysVertexTrackBase.h:248
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
DEBUG
#define DEBUG
Definition: page_access.h:11
xAOD::BPhysHelper::nPrecedingVertices
int nPrecedingVertices()
: Links to preceding vertices
Definition: BPhysHelper.cxx:601
DerivationFramework::BPhysVertexTrackBase::m_debugTrackTypes
int m_debugTrackTypes
Definition: BPhysVertexTrackBase.h:264
xAOD::Vertex_v1::y
float y() const
Returns the y position.
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DerivationFramework::BPhysVertexTrackBase::m_doVertexType
int m_doVertexType
Definition: BPhysVertexTrackBase.h:259
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
xAOD::BPhysHelper::pv
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
Definition: BPhysHelper.cxx:796
xAOD::BPhysHelper::refTrks
const std::vector< TVector3 > & refTrks()
Returns refitted track momenta.
Definition: BPhysHelper.cxx:142
DerivationFramework::BPhysVertexTrackBase::m_debugTracksInThisEvent
bool m_debugTracksInThisEvent
Definition: BPhysVertexTrackBase.h:302
DerivationFramework::BPhysVertexTrackBase::initPvAssocTypeVec
virtual void initPvAssocTypeVec()
Definition: BPhysVertexTrackBase.cxx:1339
Gaudi
=============================================================================
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:273
DerivationFramework::MuonBag
std::vector< const xAOD::Muon * > MuonBag
Definition: BPhysVertexTrackBase.h:53
str
Definition: BTagTrackIpAccessor.cxx:11
xAOD::BPhysHelper::n_pv_types
static const unsigned int n_pv_types
Definition: BPhysHelper.h:613
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
DerivationFramework::BPhysVertexTrackBase::CAPVNRNNU6
@ CAPVNRNNU6
Definition: BPhysVertexTrackBase.h:120
xAOD::BPhysHelper::muons
const std::vector< const xAOD::Muon * > & muons()
Returns linked muons.
Definition: BPhysHelper.cxx:468
DerivationFramework::BPhysVertexTrackBase::s_track_type_all_cached
static uint64_t s_track_type_all_cached
Definition: BPhysVertexTrackBase.h:127
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
DerivationFramework::BPhysVertexTrackBase::initializeHook
virtual StatusCode initializeHook()
Definition: BPhysVertexTrackBase.cxx:559
DerivationFramework::BPhysVertexTrackBase::CAPVNR3DU1
@ CAPVNR3DU1
Definition: BPhysVertexTrackBase.h:117
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
DerivationFramework::BPhysVertexTrackBase::m_minNTracksInPV
int m_minNTracksInPV
Definition: BPhysVertexTrackBase.h:262
DerivationFramework::BPhysVertexTrackBase::PVTYPE3
@ PVTYPE3
Definition: BPhysVertexTrackBase.h:114
DerivationFramework::BPhysVertexTrackBase::n_track_types
static const int n_track_types
Definition: BPhysVertexTrackBase.h:123
DerivationFramework::BPhysVertexTrackBase::rttor
static uint64_t rttor(const std::vector< uint64_t > &vtypes)
Definition: BPhysVertexTrackBase.cxx:327
DerivationFramework::BPhysVertexTrackBase::CAPVNRN3U1
@ CAPVNRN3U1
Definition: BPhysVertexTrackBase.h:117
DerivationFramework::BPhysVertexTrackBase::m_eventInfo
const xAOD::EventInfo * m_eventInfo
Definition: BPhysVertexTrackBase.h:285
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
DerivationFramework::BPhysVertexTrackBase::CAPVRFNNU8
@ CAPVRFNNU8
Definition: BPhysVertexTrackBase.h:121
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
DerivationFramework::BPhysVertexTrackBase::CAPVRF3DU2
@ CAPVRF3DU2
Definition: BPhysVertexTrackBase.h:118
DerivationFramework::BPhysVertexTrackBase::m_trackToVertexTool
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Definition: BPhysVertexTrackBase.h:252