ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
InDet::InDetVKalVxInJetTool Class Reference

#include <InDetVKalVxInJetTool.h>

Inheritance diagram for InDet::InDetVKalVxInJetTool:
Collaboration diagram for InDet::InDetVKalVxInJetTool:

Classes

struct  DevTuple
 
struct  Hists
 
struct  Vrt2Tr
 
struct  WrkVrt
 

Public Member Functions

 InDetVKalVxInJetTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~InDetVKalVxInJetTool ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
Trk::VxSecVertexInfofindSecVertex (const xAOD::Vertex &primaryVertex, const TLorentzVector &jetMomentum, const std::vector< const xAOD::IParticle * > &inputTracks) const
 
template<class Track >
double fitCommonVrt (std::vector< const Track * > &listSecondTracks, std::vector< float > &trkRank, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &inpMass, Amg::Vector3D &fitVertex, std::vector< double > &errorMatrix, TLorentzVector &Momentum, std::vector< std::vector< double > > &TrkAtVrt) const
 
template<class Track >
int select2TrVrt (std::vector< const Track * > &selectedTracks, std::vector< const Track * > &tracksForFit, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &inpMass, int &nRefPVTrk, std::vector< const Track * > &trkFromV0, std::vector< const Track * > &listSecondTracks, compatibilityGraph_t &compatibilityGraph, float evtWgt) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
virtual std::vector< std::string > trackDecorationNames () const
 Return a list of the names of track decorations created by this tool, in order to allow them to be locked when the calling algorithm completes. More...
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

using compatibilityGraph_t = boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS >
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

xAOD::VertexgetVrtSec (const std::vector< const xAOD::TrackParticle * > &inpTrk, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &results, std::vector< const xAOD::TrackParticle * > &selSecTrk, std::vector< const xAOD::TrackParticle * > &trkFromV0, int &nRefPVTrk, compatibilityGraph_t &compatibilityGraph) const
 
std::vector< xAOD::Vertex * > getVrtSecMulti (workVectorArrxAOD *, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &results, compatibilityGraph_t &compatibilityGraph) const
 
void removeTrackFromVertex (std::vector< WrkVrt > *wrkVrtSet, std::vector< std::deque< long int > > *trkInVrt, long int &selectedTrack, long int &selectedVertex) const
 
void printWrkSet (const std::vector< WrkVrt > *WrkSet, const std::string &name) const
 
StatusCode cutTrk (const std::unordered_map< std::string, double > &TrkVarDouble, const std::unordered_map< std::string, int > &TrkVarInt, float evtWgt=1.) const
 
TLorentzVector totalMom (const std::vector< const Trk::Perigee * > &inpTrk) const
 
TLorentzVector momAtVrt (const std::vector< double > &inpTrk) const
 
bool insideMatLayer (float, float) const
 
void fillVrtNTup (std::vector< Vrt2Tr > &all2TrVrt) const
 
void fillNVrtNTup (std::vector< WrkVrt > &vrtSet, std::vector< std::vector< float > > &trkScore, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir) const
 
TLorentzVector getBDir (const xAOD::TrackParticle *trk1, const xAOD::TrackParticle *trk2, const xAOD::Vertex &primVrt, Amg::Vector3D &V1, Amg::Vector3D &V2) const
 
double minVrtVrtDist (std::vector< WrkVrt > *WrkVrtSet, int &V1, int &V2) const
 
double vrtVrtDist (const xAOD::Vertex &primVrt, const Amg::Vector3D &SecVrt, const std::vector< double > &VrtErr, double &Signif) const
 
double vrtVrtDist2D (const xAOD::Vertex &primVrt, const Amg::Vector3D &SecVrt, const std::vector< double > &VrtErr, double &Signif) const
 
double vrtVrtDist (const xAOD::Vertex &primVrt, const Amg::Vector3D &SecVrt, const std::vector< double > &SecVrtErr, const TLorentzVector &JetDir) const
 
double vrtVrtDist (const Amg::Vector3D &Vrt1, const std::vector< double > &VrtErr1, const Amg::Vector3D &Vrt2, const std::vector< double > &VrtErr2) const
 
template<class Particle >
void disassembleVertex (std::vector< WrkVrt > *WrkVrtSet, int iv, std::vector< const Particle * > AllTracks, Trk::IVKalState &istate) const
 
double rankBTrk (double TrkPt, double JetPt, double Signif) const
 
std::vector< const Trk::Perigee * > GetPerigeeVector (const std::vector< const Trk::TrackParticleBase * > &) const
 
template<class Trk >
double fitCommonVrt (std::vector< const Trk * > &listSecondTracks, std::vector< float > &trkRank, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &inpMass, Amg::Vector3D &fitVertex, std::vector< double > &errorMatrix, TLorentzVector &momentum, std::vector< std::vector< double > > &trkAtVrt) const
 
template<class Trk >
void removeEntryInList (std::vector< const Trk * > &, std::vector< float > &, int) const
 
template<class Trk >
void removeDoubleEntries (std::vector< const Trk * > &) const
 
template<class Particle >
StatusCode refitVertex (std::vector< WrkVrt > *WrkVrtSet, int selectedVertex, std::vector< const Particle * > &selectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
 
template<class Particle >
double refitVertex (WrkVrt &Vrt, std::vector< const Particle * > &SelectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
 
template<class Particle >
double mergeAndRefitVertices (std::vector< WrkVrt > *WrkVrtSet, int V1, int V2, WrkVrt &newvrt, std::vector< const Particle * > &AllTrackList, Trk::IVKalState &istate) const
 
template<class Particle >
void mergeAndRefitOverlapVertices (std::vector< WrkVrt > *WrkVrtSet, int V1, int V2, std::vector< const Particle * > &AllTrackLis, Trk::IVKalState &istate) const
 
template<class Particle >
double improveVertexChi2 (std::vector< WrkVrt > *WrkVrtSet, int V, std::vector< const Particle * > &AllTracks, Trk::IVKalState &istate, bool ifCovV0) const
 
int selGoodTrkParticle (const std::vector< const xAOD::TrackParticle * > &inpPart, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< const xAOD::TrackParticle * > &selPart, float evtWgt=1.) const
 
template<class Trk >
int select2TrVrt (std::vector< const Trk * > &SelectedTracks, std::vector< const Trk * > &TracksForFit, const xAOD::Vertex &primVrt, const TLorentzVector &JetDir, std::vector< double > &InpMass, int &nRefPVTrk, std::vector< const Trk * > &TrkFromV0, std::vector< const Trk * > &ListSecondTracks, compatibilityGraph_t &compatibilityGraph, float evtWgt=1) const
 
StatusCode VKalVrtFitFastBase (const std::vector< const xAOD::TrackParticle * > &listPart, Amg::Vector3D &Vertex, Trk::IVKalState &istate) const
 
template<class Track >
bool check2TrVertexInPixel (const Track *p1, const Track *p2, Amg::Vector3D &, std::vector< double > &) const
 
template<class Track >
bool check1TrVertexInPixel (const Track *p1, Amg::Vector3D &, std::vector< double > &) const
 
void getPixelLayers (const xAOD::TrackParticle *Part, int &blHit, int &l1Hit, int &l2Hit, int &nLay) const
 
void getPixelProblems (const xAOD::TrackParticle *Part, int &splshIBL, int &splshBL) const
 
StatusCode VKalVrtFitBase (const std::vector< const xAOD::TrackParticle * > &listPart, Amg::Vector3D &Vertex, TLorentzVector &Momentum, long int &Charge, std::vector< double > &ErrorMatrix, std::vector< double > &Chi2PerTrk, std::vector< std::vector< double > > &TrkAtVrt, double &Chi2, Trk::IVKalState &istate, bool ifCovV0) const
 
StatusCode GetTrkFitWeights (std::vector< double > &wgt, const Trk::IVKalState &istate) const
 
HistsgetHists () const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static int notFromBC (int PDGID)
 
static const xAOD::TruthParticlegetPreviousParent (const xAOD::TruthParticle *child, int &ParentPDG)
 
static int getIdHF (const xAOD::TrackParticle *TP)
 
static int getG4Inter (const xAOD::TrackParticle *TP)
 
static int getMCPileup (const xAOD::TrackParticle *TP)
 
static void trackClassification (std::vector< WrkVrt > *wrkVrtSet, std::vector< std::deque< long int > > *trkInVrt)
 
static double MaxOfShared (std::vector< WrkVrt > *WrkVrtSet, std::vector< std::deque< long int > > *trkInVrt, long int &selectedTrack, long int &selectedVertex)
 
static double coneDist (const AmgVector(5) &, const TLorentzVector &)
 
static double massV0 (std::vector< std::vector< double > > &trkAtVrt, double massP, double massPi)
 
static int findMax (std::vector< double > &chi2PerTrk, std::vector< float > &rank)
 
static TLorentzVector totalMom (const std::vector< const xAOD::TrackParticle * > &inpTrk)
 
static double pTvsDir (const Amg::Vector3D &Dir, const std::vector< double > &inpTrk)
 
static double vrtRadiusError (const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr)
 
static int nTrkCommon (std::vector< WrkVrt > *WrkVrtSet, int V1, int V2)
 
static double minVrtVrtDistNext (std::vector< WrkVrt > *WrkVrtSet, int &V1, int &V2)
 
static bool isPart (std::deque< long int > test, std::deque< long int > base)
 
static void clean1TrVertexSet (std::vector< WrkVrt > *WrkVrtSet)
 
static double jetProjDist (Amg::Vector3D &SecVrt, const xAOD::Vertex &primVrt, const TLorentzVector &JetDir)
 
static double projSV_PV (const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Jet)
 
static const Trk::PerigeegetPerigee (const xAOD::TrackParticle *)
 
static Amg::MatrixX makeVrtCovMatrix (std::vector< double > &ErrorMatrix)
 
static void getPixelDiscs (const xAOD::TrackParticle *Part, int &d0Hit, int &d1Hit, int &d2Hit)
 

Private Attributes

std::unique_ptr< Histsm_h
 
IntegerProperty m_cutSctHits
 
IntegerProperty m_cutPixelHits
 
IntegerProperty m_cutSiHits
 
IntegerProperty m_cutBLayHits
 
IntegerProperty m_cutSharedHits
 
DoubleProperty m_cutPt {this, "CutPt", 700., "Track Pt selection cut"}
 
DoubleProperty m_cutZVrt {this, "CutZVrt", 15., "Track Z impact selection cut"}
 
DoubleProperty m_cutA0 {this, "CutA0", 5., "Track A0 selection cut"}
 
DoubleProperty m_cutChi2 {this, "CutChi2", 5., "Track Chi2 selection cut"}
 
DoubleProperty m_secTrkChi2Cut
 
DoubleProperty m_coneForTag
 
DoubleProperty m_sel2VrtChi2Cut
 
DoubleProperty m_sel2VrtSigCut
 
DoubleProperty m_trkSigCut
 
DoubleProperty m_a0TrkErrorCut
 
DoubleProperty m_zTrkErrorCut
 
DoubleProperty m_cutBVrtScore
 
DoubleProperty m_vrt2TrMassLimit
 
BooleanProperty m_useFrozenVersion
 
BooleanProperty m_fillHist
 
BooleanProperty m_existIBL
 
IntegerProperty m_RobustFit
 
double m_beampipeR = 0.
 
double m_rLayerB = 0.
 
double m_rLayer1 = 0.
 
double m_rLayer2 = 0.
 
double m_rLayer3 = 0.
 
BooleanProperty m_useVertexCleaningPix
 
BooleanProperty m_useVertexCleaningFMP
 
BooleanProperty m_rejectBadVertices
 
BooleanProperty m_multiVertex
 
BooleanProperty m_multiWithPrimary
 
BooleanProperty m_getNegativeTail
 
BooleanProperty m_getNegativeTag
 
BooleanProperty m_multiWithOneTrkVrt
 
DoubleProperty m_vertexMergeCut
 
DoubleProperty m_trackDetachCut
 
ToolHandle< Trk::IVertexFitterm_fitter {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool"}
 
Trk::TrkVKalVrtFitterm_fitSvc {}
 
ServiceHandle< IChronoStatSvc > m_timingProfile {this,"ChronoStatSvc","ChronoStatSvc"}
 
bool m_useTrackClassificator = true
 
ToolHandle< IInDetTrkInJetTypem_trackClassificator {this, "TrackClassTool", "InDet::InDetTrkInJetType"}
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "EventInfoName", "EventInfo"}
 
bool m_useEtaDependentCuts = false
 
ServiceHandle< InDet::IInDetEtaDependentCutsSvcm_etaDependentCutsSvc {this, "InDetEtaDependentCutsSvc", ""}
 service to get cut values depending on different variable More...
 
BooleanProperty m_useITkMaterialRejection
 
const BeamPipeDetectorManagerm_beamPipeMgr = nullptr
 
const InDetDD::PixelDetectorManagerm_pixelManager = nullptr
 
std::unique_ptr< TH2D > m_ITkPixMaterialMap
 
const double m_massPi = 139.5702
 
const double m_massP = 938.272
 
const double m_massE = 0.511
 
const double m_massK0 = 497.648
 
const double m_massLam =1115.683
 
const double m_massB =5279.400
 
float m_chiScale [11] {}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 100 of file InDetVKalVxInJetTool.h.

Member Typedef Documentation

◆ compatibilityGraph_t

using InDet::InDetVKalVxInJetTool::compatibilityGraph_t = boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>
private

Definition at line 362 of file InDetVKalVxInJetTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ InDetVKalVxInJetTool()

InDet::InDetVKalVxInJetTool::InDetVKalVxInJetTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 29 of file InDetVKalVxInJetTool.cxx.

31  :
33  {
34  declareInterface< ISecVertexInJetFinder >(this);
35  }

◆ ~InDetVKalVxInJetTool()

InDet::InDetVKalVxInJetTool::~InDetVKalVxInJetTool ( )
virtual

Definition at line 38 of file InDetVKalVxInJetTool.cxx.

38  {
39  ATH_MSG_DEBUG("InDetVKalVxInJetTool destructor called");
40  }

Member Function Documentation

◆ check1TrVertexInPixel()

template<class Track >
bool InDet::InDetVKalVxInJetTool::check1TrVertexInPixel ( const Track p1,
Amg::Vector3D FitVertex,
std::vector< double > &  VrtCov 
) const
private

Definition at line 606 of file InDetVKalVxInJetTool.h.

608  {
609  int blTrk=0, blP=0, l1Trk=0, l1P=0, l2Trk=0, nLays=0;
610  getPixelLayers( p1, blTrk , l1Trk, l2Trk, nLays );
611  getPixelProblems(p1, blP, l1P );
612  double radiusError=vrtRadiusError(FitVertex, VrtCov);
613  double xvt=FitVertex.x();
614  double yvt=FitVertex.y();
615  double R=std::hypot(xvt, yvt);
616  if(R < m_rLayerB-radiusError){ // Inside B-layer
617  if( blTrk<1 && l1Trk<1 ) return false;
618  if( nLays <2 ) return false; // Less than 2 layers on track 0
619  return true;
620  }else if(R > m_rLayerB+radiusError){ // Outside b-layer
621  if( blTrk>0 && blP==0 ) return false; // Good hit in b-layer is present
622  }
623 //
624 // L1 and L2 are considered only if vertex is in acceptance
625 //
626  if(std::abs(FitVertex.z())<400.){
627  if(R < m_rLayer1-radiusError) { // Inside 1st-layer
628  if( l1Trk<1 && l2Trk<1 ) return false; // Less than 1 hits on track 0
629  return true;
630  }else if(R > m_rLayer1+radiusError) { // Outside 1st-layer
631  if( l1Trk>0 && l1P==0 ) return false; // Good L1 hit is present
632  }
633 
634  if(R < m_rLayer2-radiusError) { // Inside 2nd-layer
635  if( l2Trk==0 ) return false; // At least one L2 hit must be present
636  }
637  } else {
638  int d0Trk=0, d1Trk=0, d2Trk=0;
639  getPixelDiscs( p1, d0Trk , d1Trk, d2Trk );
640  if( d0Trk+d1Trk+d2Trk ==0 )return false;
641  }
642  return true;
643  }

◆ check2TrVertexInPixel()

template<class Track >
bool InDet::InDetVKalVxInJetTool::check2TrVertexInPixel ( const Track p1,
const Track p2,
Amg::Vector3D fitVertex,
std::vector< double > &  vrtErr 
) const
private

Definition at line 921 of file BTagVrtSec.cxx.

924  {
925  int blTrk[2] = {0,0};
926  int l1Trk[2] = {0,0};
927  int l2Trk[2] = {0,0};
928  int nLays[2] = {0,0};
929  getPixelLayers( p1, blTrk[0] , l1Trk[0], l2Trk[0], nLays[0] );
930  getPixelLayers( p2, blTrk[1] , l1Trk[1], l2Trk[1], nLays[1] ); // Very close to PV. Both b-layer hits are mandatory.
931 
932  int blP[2] = {0,0};
933  int l1P[2] = {0,0};
934  getPixelProblems(p1, blP[0], l1P[0] );
935  getPixelProblems(p2, blP[1], l1P[1] );
936 
937  double xvt = fitVertex.x();
938  double yvt = fitVertex.y();
939  double radiusError = vrtRadiusError(fitVertex, vrtErr);
940  double R = std::hypot(xvt, yvt);
941 
942  if(R < m_rLayerB-radiusError) {
943  //----------------------------------------- Inside B-layer
944  if(blTrk[0]==0 && blTrk[1]==0) return false; // No b-layer hits at all, but all expected
945  if(blTrk[0]<1 && l1Trk[0]<1 ) return false;
946  if(blTrk[1]<1 && l1Trk[1]<1) return false;
947  if(nLays[0]<2) return false; // Less than 2 layers on track 0
948  if(nLays[1]<2) return false; // Less than 2 layers on track 1
949  return true;
950  } else if(R > m_rLayerB+radiusError){
951  //----------------------------------------- Outside b-layer
952  if(blTrk[0]>0 && blP[0]==0 && blTrk[1]>0 && blP[1]==0) return false; // Good hit in b-layer is present
953  }
954 
955  //
956  // L1 and L2 are considered only if vertex is in acceptance
957  //
958  if(std::abs(fitVertex.z())<400.){
959 
960  if(R < m_rLayer1-radiusError) {
961  //------------------------------------------ Inside 1st-layer
962  if( l1Trk[0]==0 && l1Trk[1]==0 ) return false; // No L1 hits at all
963  if( l1Trk[0]<1 && l2Trk[0]<1 ) return false; // Less than 1 hits on track 0
964  if( l1Trk[1]<1 && l2Trk[1]<1 ) return false; // Less than 1 hits on track 1
965  return true;
966  } else if(R > m_rLayer1+radiusError) {
967  //------------------------------------------- Outside 1st-layer
968  if( l1Trk[0]>0 && l1P[0]==0 && l1Trk[1]>0 && l1P[1]==0 ) return false; // Good L1 hit is present
969  }
970 
971  if(R < m_rLayer2-radiusError) {
972  //------------------------------------------- Inside 2nd-layer
973  if( (l2Trk[0]+l2Trk[1])==0 ) return false; // At least one L2 hit must be present
974  }
975 
976  } else {
977  int d0Trk[2] = {0,0};
978  int d1Trk[2] = {0,0};
979  int d2Trk[2] = {0,0};
980  getPixelDiscs( p1, d0Trk[0] , d1Trk[0], d2Trk[0] );
981  getPixelDiscs( p2, d0Trk[1] , d1Trk[1], d2Trk[1] );
982  if( d0Trk[0]+d1Trk[0]+d2Trk[0] ==0 ) return false;
983  if( d0Trk[1]+d1Trk[1]+d2Trk[1] ==0 ) return false;
984  }
985 
986  return true;
987  }

◆ clean1TrVertexSet()

void InDet::InDetVKalVxInJetTool::clean1TrVertexSet ( std::vector< WrkVrt > *  WrkVrtSet)
staticprivate

Definition at line 1026 of file BTagVrtSecMulti.cxx.

1027  {
1028  std::vector<int> countVT(wrkVrtSet->size(),0);
1029  std::vector<int> linkedVrt(wrkVrtSet->size(),0);
1030  //--- Mark as bad the 1track vertex if the detached track is NOT present in any remaining good vertex (>=2tr)
1031 
1032  for(unsigned int i1tv = 0; i1tv<wrkVrtSet->size(); i1tv++) {
1033  WrkVrt vrt1 = (*wrkVrtSet)[i1tv];
1034  if( vrt1.selTrk.size()!=1) continue;
1035  if(!vrt1.Good) continue;
1036  int Trk1 = vrt1.detachedTrack;
1037 
1038  int foundInGoodVrt = 0;
1039  for(unsigned int mtv=0; mtv<wrkVrtSet->size(); mtv++) { //cycle over good vertices with many tracks
1040  WrkVrt vrtm = (*wrkVrtSet)[mtv];
1041  if( vrtm.selTrk.size()<2) continue;
1042  if(!vrtm.Good) continue;
1043 
1044  if( std::find(vrtm.selTrk.begin(), vrtm.selTrk.end(), Trk1) != vrtm.selTrk.end()){
1045  foundInGoodVrt++;
1046  countVT[mtv]++;
1047  linkedVrt[i1tv] = mtv; //Linked vertex found
1048  }
1049  }
1050 
1051  if(!foundInGoodVrt) vrt1.Good=false; // Make the vertex bad
1052  }
1053 
1054  //---Select SINGLE 1tr-vertex from many pointing to one multi-track vertex
1055  for(int mtv = 0; mtv<static_cast<int>(wrkVrtSet->size()); mtv++) {
1056  WrkVrt vrtm = (*wrkVrtSet)[mtv];
1057  if(vrtm.selTrk.size()<2) continue;
1058  if(!vrtm.Good) continue;
1059  if(countVT[mtv] < 1) continue;
1060 
1061  double distM = 1.e9;
1062  int best1TVrt = -1;
1063  for(unsigned int i1tv = 0; i1tv<wrkVrtSet->size(); i1tv++) {
1064  WrkVrt vrt1 = (*wrkVrtSet)[i1tv];
1065  if(vrt1.selTrk.size()!=1) continue;
1066  if(!vrt1.Good) continue;
1067  if(linkedVrt[i1tv]!=mtv) continue;
1068 
1069  double dist = (vrtm.vertexMom+vrt1.vertexMom).M();
1070  if(dist < distM){
1071  distM = dist;
1072  best1TVrt = i1tv;
1073  }
1074  vrt1.Good=false;
1075  }
1076 
1077  if(best1TVrt>-1 && distM<c_vrtBCMassLimit) (*wrkVrtSet)[best1TVrt].Good=true;
1078  }
1079  }

◆ coneDist()

double InDet::InDetVKalVxInJetTool::coneDist ( const AmgVector(5) &  vectPerig,
const TLorentzVector &  jetDir 
)
staticprivate

Definition at line 276 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

278  {
279 
280  double etaTr = -std::log(std::tan(vectPerig[3]/2.));
281  double etaJet = jetDir.PseudoRapidity();
282  double adphi = std::abs(jetDir.Phi()-vectPerig[2]);
283  while(adphi> M_PI)adphi-=2.*M_PI;
284  return std::sqrt(adphi*adphi + (etaJet-etaTr)*(etaJet-etaTr));
285  }

◆ cutTrk()

StatusCode InDet::InDetVKalVxInJetTool::cutTrk ( const std::unordered_map< std::string, double > &  TrkVarDouble,
const std::unordered_map< std::string, int > &  TrkVarInt,
float  evtWgt = 1. 
) const
private

Definition at line 17 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/CutTrk.cxx.

21  {
22 
23  double eta = TrkVarDouble.at("eta");
24  double PInvVert = TrkVarDouble.at("PInvVert");
25  double ThetaVert = TrkVarDouble.at("ThetaVert");
26  double A0Vert = TrkVarDouble.at("A0Vert");
27  double ZVert = TrkVarDouble.at("ZVert");
28  double Chi2 = TrkVarDouble.at("Chi2");
29  double ConeDist = TrkVarDouble.at("ConeDist");
30  double CovTrkMtx11 = TrkVarDouble.at("CovTrkMtx11");
31  double CovTrkMtx22 = TrkVarDouble.at("CovTrkMtx22");
32  double trkP = TrkVarDouble.at("trkP");
33  double trkPErr = TrkVarDouble.at("trkPErr");
34 
35  int PixelHits = TrkVarInt.at("PixelHits");
36  int SctHits = TrkVarInt.at("SctHits");
37  int BLayHits = TrkVarInt.at("BLayHits");
38  int SharedHits = TrkVarInt.at("SharedHits");
39  int badHits = TrkVarInt.at("badHits");
40 
41  if ( CovTrkMtx11 > m_a0TrkErrorCut*m_a0TrkErrorCut ) return StatusCode::FAILURE;
42  if ( CovTrkMtx22 > m_zTrkErrorCut*m_zTrkErrorCut ) return StatusCode::FAILURE;
43  if ( ConeDist > m_coneForTag ) return StatusCode::FAILURE;
44  if(trkP>10000.){
45  if(m_fillHist){
46  Hists& h = getHists();
47  h.m_hb_trkPErr->Fill( trkPErr , evtWgt);
48  }
49  if(trkPErr>0.5) return StatusCode::FAILURE;
50  }
51 
52  double Pt = sin(ThetaVert)/std::abs(PInvVert);
53  //- Track quality
54 
55  double pT_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMinPtAtEta(eta) : m_cutPt.value();
56  if(Pt < pT_cut) return StatusCode::FAILURE;
57 
58  if(!m_multiWithPrimary){ //Must not be used for primary vertex search
59  double z0_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMaxZImpactAtEta(eta) : m_cutZVrt.value();
60  // Eta-dependent cuts with z0*sin(theta)
61  if(m_useEtaDependentCuts && std::abs(ZVert*sin(ThetaVert)) > z0_cut) return StatusCode::FAILURE;
62  //Otherwise cuts with z0
63  else if(!m_useEtaDependentCuts && std::abs(ZVert) > z0_cut) return StatusCode::FAILURE;
64  }
65 
66  double chi2_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMaxChi2AtEta(eta) : m_cutChi2.value();
67  if(Chi2 > chi2_cut) return StatusCode::FAILURE;
68 
69  double d0_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMaxPrimaryImpactAtEta(eta) : m_cutA0.value();
70  if(std::abs(A0Vert) > d0_cut) return StatusCode::FAILURE;
71 
72  int pix_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMinPixelHitsAtEta(eta) : m_cutPixelHits.value();
73  if(!m_useEtaDependentCuts && std::abs(eta)>2.){
74  if(badHits && PixelHits<=3) return StatusCode::FAILURE;
75  PixelHits--;
76  }
77  if(PixelHits < pix_cut) return StatusCode::FAILURE;
78 
79  int strip_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMinStripHitsAtEta(eta) : m_cutSctHits.value();
81  if(SctHits<3) return StatusCode::FAILURE;
82  if(std::abs(eta)>2. && m_existIBL) SctHits--;
83  if(std::abs(eta)>1.65) SctHits--;
84  }
85  if(SctHits < strip_cut) return StatusCode::FAILURE;
86 
87  int si_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMinSiHitsAtEta(eta) : m_cutSiHits.value();
88  if((PixelHits+SctHits) < si_cut) return StatusCode::FAILURE;
89 
90  int inpix_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMinInnermostPixelHitsAtEta(eta) : m_cutBLayHits.value();
91  if(BLayHits < inpix_cut) return StatusCode::FAILURE;
92 
93  int shared_cut = m_useEtaDependentCuts ? m_etaDependentCutsSvc->getMaxSharedAtEta(eta) : m_cutSharedHits.value();
94  if(SharedHits > shared_cut) return StatusCode::FAILURE;
95 
96  return StatusCode::SUCCESS;
97 
98  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ disassembleVertex()

template<class Particle >
void InDet::InDetVKalVxInJetTool::disassembleVertex ( std::vector< WrkVrt > *  WrkVrtSet,
int  iv,
std::vector< const Particle * >  AllTracks,
Trk::IVKalState istate 
) const
private

Definition at line 947 of file BTagVrtSecMulti.cxx.

951  {
952  WrkVrt newvrt;
953  newvrt.Good = true;
954  std::vector<const Particle*> ListBaseTracks;
955  int NTrk = (*wrkVrtSet)[iv].selTrk.size();
956  int SelT = -1;
957  if(NTrk<3) return;
958 
959  StatusCode sc;
960  //=== To get robust definition of most bad outlier
961  m_fitSvc->setRobustness(5, istate);
962  sc = refitVertex(wrkVrtSet, iv, AllTracks, istate, false);
963  if(sc.isFailure()){
964  (*wrkVrtSet)[iv].Good = false;
965  return;
966  }
967 
968  m_fitSvc->setRobustness(0, istate);
969  double Chi2Max=0.;
970  for(int i = 0; i<NTrk; i++){
971  if((*wrkVrtSet)[iv].chi2PerTrk[i]>Chi2Max) {
972  Chi2Max = (*wrkVrtSet)[iv].chi2PerTrk[i];
973  SelT = i;
974  }
975  }
976 
977  unsigned int NVrtCur = wrkVrtSet->size();
978  for(int i = 0; i<NTrk; i++){
979  if(i==SelT) continue;
980  ListBaseTracks.clear();
981  ListBaseTracks.push_back( AllTracks[(*wrkVrtSet)[iv].selTrk[i]] );
982  ListBaseTracks.push_back( AllTracks[(*wrkVrtSet)[iv].selTrk[SelT]] );
983  newvrt.selTrk.resize(2);
984  newvrt.selTrk[0] = (*wrkVrtSet)[iv].selTrk[i];
985  newvrt.selTrk[1] = (*wrkVrtSet)[iv].selTrk[SelT];
986 
987  sc = VKalVrtFitFastBase(ListBaseTracks,newvrt.vertex,istate);
988  if( sc.isFailure() ) continue;
989  if( newvrt.vertex.perp() > m_rLayer2*2. ) newvrt.vertex = Amg::Vector3D(0.,0.,0.);
990  m_fitSvc->setApproximateVertex(newvrt.vertex[0], newvrt.vertex[1], newvrt.vertex[2], istate);
991 
992  sc=VKalVrtFitBase(ListBaseTracks,
993  newvrt.vertex,
994  newvrt.vertexMom,
995  newvrt.vertexCharge,
996  newvrt.vertexCov,
997  newvrt.chi2PerTrk,
998  newvrt.trkAtVrt,
999  newvrt.chi2,
1000  istate, false);
1001  if(sc.isFailure() ) continue;
1002  if(newvrt.chi2>10.) continue; // Too bad 2-track vertex fit
1003 
1004  newvrt.chi2PerTrk[0] = newvrt.chi2PerTrk[1] = newvrt.chi2/2.;
1005  newvrt.nCloseVrt = 0;
1006  newvrt.dCloseVrt = 1000000.;
1007  newvrt.projectedVrt = 0.9999;
1008 
1009  if(wrkVrtSet->size()==NVrtCur){
1010  wrkVrtSet->push_back(newvrt);
1011  continue;
1012  } // just the first added vertex
1013 
1014  if( (*wrkVrtSet).at(NVrtCur).chi2<newvrt.chi2 ) continue; // previously added 2tr vertex was better
1015 
1016  wrkVrtSet->pop_back();
1017  wrkVrtSet->push_back(newvrt);
1018  } // end for(int i = 0; i<NTrk; i++)
1019 
1020  (*wrkVrtSet)[iv].selTrk.erase( (*wrkVrtSet)[iv].selTrk.begin() + SelT ); //remove track
1021  sc = refitVertex(wrkVrtSet, iv, AllTracks, istate, false);
1022  if( sc.isFailure() ) (*wrkVrtSet)[iv].Good = false;
1023  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillNVrtNTup()

void InDet::InDetVKalVxInJetTool::fillNVrtNTup ( std::vector< WrkVrt > &  vrtSet,
std::vector< std::vector< float > > &  trkScore,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir 
) const
private

Definition at line 550 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

553  {
554  if (!m_h) return;
555  Hists& h = getHists();
556  int ipnt=0;
557  TLorentzVector VertexMom;
558  for(auto & vrt : VrtSet) {
559  if(ipnt==DevTuple::maxNVrt)break;
560  h.m_curTup->NVrtDist2D[ipnt]=vrt.vertex.perp();
561  h.m_curTup->NVrtNT[ipnt]=vrt.selTrk.size();
562  h.m_curTup->NVrtTrkI[ipnt]=vrt.selTrk[0];
563  h.m_curTup->NVrtM[ipnt]=vrt.vertexMom.M();
564  h.m_curTup->NVrtChi2[ipnt]=vrt.chi2;
565  float maxW=0., sumW=0.;
566  for(auto trk : vrt.selTrk){ sumW+=trkScore[trk][0]; maxW=std::max(trkScore[trk][0], maxW);}
567  h.m_curTup->NVrtMaxW[ipnt]=maxW;
568  h.m_curTup->NVrtAveW[ipnt]=sumW/vrt.selTrk.size();
569  TLorentzVector SVPV(vrt.vertex.x()-PV.x(),vrt.vertex.y()-PV.y(),vrt.vertex.z()-PV.z(),1.);
570  h.m_curTup->NVrtDR[ipnt]=JetDir.DeltaR(SVPV);
571  VertexMom += vrt.vertexMom;
572  ipnt++; h.m_curTup->nNVrt=ipnt;
573  }
574  h.m_curTup->TotM=VertexMom.M();
575  }

◆ fillVrtNTup()

void InDet::InDetVKalVxInJetTool::fillVrtNTup ( std::vector< Vrt2Tr > &  all2TrVrt) const
private

Definition at line 524 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

526  {
527  if (!m_h) return;
528  Hists& h = getHists();
529  int ipnt=0;
530  Amg::Vector3D pf1,pf2;
531  for(auto & vrt : all2TrVrt) {
532  if(ipnt==DevTuple::maxNTrk)break;
533  h.m_curTup->VrtDist2D[ipnt]=vrt.fitVertex.perp();
534  h.m_curTup->VrtSig3D[ipnt]=vrt.signif3D;
535  h.m_curTup->VrtSig2D[ipnt]=vrt.signif2D;
536  h.m_curTup->itrk[ipnt]=vrt.i;
537  h.m_curTup->jtrk[ipnt]=vrt.j;
538  h.m_curTup->mass[ipnt]=vrt.momentum.M();
539  h.m_curTup->Chi2[ipnt]=vrt.chi2;
540  h.m_curTup->badVrt[ipnt]=vrt.badVrt;
541  h.m_curTup->VrtDR[ipnt]=vrt.dRSVPV;
542  h.m_curTup->VrtErrR[ipnt]= vrtRadiusError(vrt.fitVertex, vrt.errorMatrix);
543  Amg::setRThetaPhi(pf1, 1., vrt.trkAtVrt[0][1], vrt.trkAtVrt[0][0]);
544  Amg::setRThetaPhi(pf2, 1., vrt.trkAtVrt[1][1], vrt.trkAtVrt[1][0]);
545  h.m_curTup->VrtdRtt[ipnt]=Amg::deltaR(pf1,pf2);
546  ipnt++; h.m_curTup->nVrt=ipnt;
547  }
548  }

◆ finalize()

StatusCode InDet::InDetVKalVxInJetTool::finalize ( )

Definition at line 293 of file InDetVKalVxInJetTool.cxx.

294  {
295  if(m_timingProfile)m_timingProfile->chronoPrint("InDetVKalVxInJetTool");
296  ATH_MSG_DEBUG("InDetVKalVxInJetTool finalize()");
297  return StatusCode::SUCCESS;
298  }

◆ findMax()

int InDet::InDetVKalVxInJetTool::findMax ( std::vector< double > &  chi2PerTrk,
std::vector< float > &  rank 
)
staticprivate

Definition at line 318 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

320  {
321  double chi2Ref=0.;
322  int position=-1;
323  if( chi2PerTrk.empty() ) return position ;
324  for (int i=0; i< (int)chi2PerTrk.size(); i++){
325  if(chi2PerTrk[i]/std::max(rank[i],(float)0.1) > chi2Ref) { chi2Ref=chi2PerTrk[i]/std::max(rank[i],(float)0.1); position=i;}
326  }
327  return position;
328  }

◆ findSecVertex()

Trk::VxSecVertexInfo * InDet::InDetVKalVxInJetTool::findSecVertex ( const xAOD::Vertex primaryVertex,
const TLorentzVector &  jetMomentum,
const std::vector< const xAOD::IParticle * > &  inputTracks 
) const
virtual

Implements InDet::ISecVertexInJetFinder.

Definition at line 303 of file InDetVKalVxInJetTool.cxx.

306  {
307  if(m_timingProfile)m_timingProfile->chronoStart("InDetVKalVxInJetTool");
308  std::vector<double> Results;
309  std::vector<const xAOD::TrackParticle*> InpTrk;
310  std::vector<const xAOD::TrackParticle*> SelSecTrk;
311  std::vector< std::vector<const xAOD::TrackParticle*> > SelSecTrkPerVrt;
312  std::vector<const xAOD::TrackParticle*> xaodTrkFromV0;
313  std::vector<xAOD::Vertex*> listVrtSec(0);
314  double SecVtxMass = 0.;
315  double RatioE = 0.;
316  double EnergyJet = 0.;
317  int N2trVertices = 0 ;
318  int NBigImpTrk = 0 ;
319 
320  if(m_fillHist){
321  Hists& h = getHists();
322  if (h.m_curTup) {
323  h.m_curTup->nVrt=0;
324  h.m_curTup->nTrkInJet=0;
325  h.m_curTup->NTHF=0;
326  h.m_curTup->nNVrt=0;
327  h.m_curTup->TotM=0.; h.m_curTup->ewgt=1.;
328  }
329  }
330 
331  int pseudoVrt = 0;
332 
333  compatibilityGraph_t compatibilityGraph;
334 
335  InpTrk.clear(); InpTrk.reserve(IInpTrk.size());
336  std::vector<const xAOD::IParticle*>::const_iterator i_itrk;
337  for (i_itrk = IInpTrk.begin(); i_itrk < IInpTrk.end(); ++i_itrk) {
338  const xAOD::TrackParticle * tmp=dynamic_cast<const xAOD::TrackParticle *> ((*i_itrk));
339  if(tmp)InpTrk.push_back(tmp);
340  }
341 
342  if(m_multiVertex){
343  std::unique_ptr<workVectorArrxAOD> tmpVectxAOD= std::make_unique<workVectorArrxAOD>();
344  tmpVectxAOD->InpTrk.resize(InpTrk.size());
345  std::copy(InpTrk.begin(),InpTrk.end(), tmpVectxAOD->InpTrk.begin());
346  listVrtSec = getVrtSecMulti(tmpVectxAOD.get(),primVrt,jetDir,Results,compatibilityGraph);
347  SelSecTrkPerVrt.swap(tmpVectxAOD->FoundSecondTracks);
348  xaodTrkFromV0.swap(tmpVectxAOD->TrkFromV0);
349  }else{
350  int nRefPVTrk=0;
351  xAOD::Vertex* secVrt = getVrtSec( InpTrk,primVrt,jetDir,Results,SelSecTrk,xaodTrkFromV0, nRefPVTrk, compatibilityGraph);
352  if(secVrt != nullptr) listVrtSec.push_back(secVrt);
353  else if(m_fillHist) {
354  Hists& h = getHists();
355  h.m_pr_effVrt->Fill((float)nRefPVTrk,0.);
356  h.m_pr_effVrtEta->Fill( jetDir.Eta(),0.);
357  }
358  }
359  if(Results.size()<7) {
360  listVrtSec.clear();
361  }else{
362  SecVtxMass = Results[0];
363  RatioE = Results[1];
364  N2trVertices = (int)Results[2];
365  NBigImpTrk = (int)Results[3];
366  EnergyJet = Results[6];
367  if( Results[2]==0 && Results[4]==0 ) pseudoVrt=1;
368  }
369 
370  std::vector<const xAOD::IParticle*> iparTrkFromV0(0);
371  for(auto & i : xaodTrkFromV0)iparTrkFromV0.push_back(i);
372 
373  Trk::VxSecVKalVertexInfo* res=nullptr;
374  try{
375  if(pseudoVrt){
376  res = new Trk::VxSecVKalVertexInfo(listVrtSec[0], SecVtxMass, RatioE, NBigImpTrk, iparTrkFromV0 );
377  }else{
378  res = new Trk::VxSecVKalVertexInfo(listVrtSec, SecVtxMass, RatioE, N2trVertices, EnergyJet, iparTrkFromV0 );
379  if(Results.size()>8)res->setDstToMatLay(Results[7]);
380  } }
381  catch (std::bad_alloc& ba){
382  ATH_MSG_DEBUG("Trk::VxSecVKalVertexInfo allocation failure! "<< ba.what());
383  }
384 
385  if(m_fillHist){
386  Hists& h = getHists();
387  h.m_tuple->Fill();
388  };
389  if(m_timingProfile)m_timingProfile->chronoStop("InDetVKalVxInJetTool");
390  return res;
391  }

◆ fitCommonVrt() [1/2]

template<class Track >
double InDet::InDetVKalVxInJetTool::fitCommonVrt ( std::vector< const Track * > &  listSecondTracks,
std::vector< float > &  trkRank,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir,
std::vector< double > &  inpMass,
Amg::Vector3D fitVertex,
std::vector< double > &  errorMatrix,
TLorentzVector &  Momentum,
std::vector< std::vector< double > > &  TrkAtVrt 
) const

Definition at line 399 of file BTagVrtSec.cxx.

409  {
410  ATH_MSG_DEBUG("fitCommonVrt() called " <<listSecondTracks.size());
411  //preparation
412  StatusCode sc;
413 
414  //
415  // Start of fit
416  //
417  std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
418  m_fitSvc->setMassInputParticles( inpMass, *state ); // Use pions masses
419  sc = VKalVrtFitFastBase(listSecondTracks, fitVertex, *state); // Fast crude estimation
420  if(sc.isFailure() || fitVertex.perp() > m_rLayer2*2. ) { // No initial estimation
421  m_fitSvc->setApproximateVertex(primVrt.x(), primVrt.y(), primVrt.z(), *state); // Use primary vertex as starting point
422  } else {
423  m_fitSvc->setApproximateVertex(fitVertex.x(), fitVertex.y(), fitVertex.z(), *state); // Use fitted vertex as starting point
424  }
425 
426  //fit itself
427  int NTracksVrt = listSecondTracks.size();
428  double FitProb = 0.;
429  std::vector<double> trkFitWgt(0);
430  std::vector<double> Chi2PerTrk;
431  long int Charge;
432  double Chi2 = 0.;
433  int Outlier = 1;
434  Amg::Vector3D tmpVertex;
435 
436  for (int i = 0; i < NTracksVrt-1; i++) {
437 
439  else m_fitSvc->setRobustness(0, *state);
440  sc = VKalVrtFitBase(listSecondTracks, fitVertex, Momentum, Charge,
441  errorMatrix, Chi2PerTrk, TrkAtVrt, Chi2,
442  *state, true);
443  if(sc.isFailure() || Chi2 > 1000000.) return -10000.; // No fit
444 
445  if(m_RobustFit){
446  sc = GetTrkFitWeights(trkFitWgt, *state);
447  if(sc.isFailure()) return -10000.; // No weights
448  Outlier = std::min_element(trkFitWgt.begin(), trkFitWgt.end()) - trkFitWgt.begin();
449  } else {
450  Outlier = findMax(Chi2PerTrk, trkRank);
451  }
452 
453  FitProb = TMath::Prob(Chi2, 2*listSecondTracks.size()-3);
454  if(listSecondTracks.size()==2) break; // Only 2 tracks left
455 
456  double signif3Dproj = vrtVrtDist(primVrt, fitVertex, errorMatrix, jetDir);
457  if(signif3Dproj<0 && (!m_getNegativeTail) && (!m_getNegativeTag)){
458  double maxDst = -1.e12;
459  int maxT = -1;
460  double minChi2 = 1.e12;
461 
462  for(unsigned int it=0; it<listSecondTracks.size(); it++){
463  std::vector<const Track*> tmpList(listSecondTracks);
464  tmpList.erase(tmpList.begin()+it);
465  sc = VKalVrtFitBase(tmpList, tmpVertex, Momentum, Charge,
466  errorMatrix, Chi2PerTrk, TrkAtVrt, Chi2,
467  *state,true);
468  if(sc.isFailure()) continue;
469 
470  signif3Dproj=vrtVrtDist(primVrt, tmpVertex, errorMatrix, jetDir);
471  if(signif3Dproj>maxDst && maxDst<10.){
472  maxDst = signif3Dproj;
473  maxT = it;
474  minChi2 = Chi2;
475  }
476  else if(signif3Dproj>0. && maxDst>10. && Chi2<minChi2){
477  minChi2 = Chi2;
478  maxT = it;
479  }
480  }
481 
482  if(maxT>=0){
483  Outlier = maxT;
484  removeEntryInList(listSecondTracks,trkRank,Outlier);
485  m_fitSvc->setApproximateVertex(fitVertex.x(),fitVertex.y(),fitVertex.z(),*state);
486  ATH_MSG_DEBUG("Remove negative outlier="<< maxT<<" from "<<listSecondTracks.size()+1<<" tracks");
487  continue;
488  }
489  }
490 
491  if(FitProb > 0.001) {
492  if(Momentum.M() <c_vrtBCMassLimit) {
493  if( Chi2PerTrk[Outlier] < m_secTrkChi2Cut*m_chiScale[std::min(int(listSecondTracks.size()),10)] ) break; // Solution found
494  } else {
495  double minM = 1.e12;
496  int minT = -1;
497  double minChi2 = 1.e12;
498 
499  for(unsigned int it=0; it<listSecondTracks.size(); it++){
500  std::vector<const Track*> tmpList(listSecondTracks);
501  tmpList.erase(tmpList.begin()+it);
502  sc = VKalVrtFitBase(tmpList, tmpVertex, Momentum, Charge,
503  errorMatrix, Chi2PerTrk, TrkAtVrt, Chi2,
504  *state, true);
505  if(sc.isFailure()) continue;
506  if((projSV_PV(tmpVertex,primVrt,jetDir)<0. &&(!m_getNegativeTag)) || (projSV_PV(tmpVertex,primVrt,jetDir)>0. &&(m_getNegativeTag))) continue; // Drop negative direction
507 
508  if(m_useTrackClassificator) Chi2 += trkRank[it]; // Remove preferably non-HF-tracks
509 
510  if(Momentum.M()<minM && minM>c_vrtBCMassLimit){
511  minM = Momentum.M();
512  minT = it;
513  minChi2 = Chi2;
514  }
515  else if(Momentum.M()<c_vrtBCMassLimit && minM<c_vrtBCMassLimit && Chi2<minChi2){
516  minChi2 = Chi2;
517  minT = it;
518  }
519  }
520 
521  ATH_MSG_DEBUG("Big mass. Remove trk="<<minT<<" New mass="<<minM<<" New Chi2="<<minChi2);
522  if(minT>=0) Outlier = minT;
523  }
524  } // end if(FitProb > 0.001)
525 
526  ATH_MSG_DEBUG("SecVrt remove trk="<<Outlier<<" from "<< listSecondTracks.size()<<" tracks");
527  removeEntryInList(listSecondTracks,trkRank,Outlier);
528  m_fitSvc->setApproximateVertex(fitVertex.x(), fitVertex.y(), fitVertex.z(), *state); // Use as starting point
529 
530  } // end for (int i = 0; i < NTracksVrt-1; i++)
531 
532  ATH_MSG_DEBUG("SecVrt fit converged. Ntr="<< listSecondTracks.size()<<" Chi2="<<Chi2
533  <<" Chi2_trk="<<Chi2PerTrk[Outlier]<<" Prob="<<FitProb<<" M="<<Momentum.M()<<" Dir="<<projSV_PV(fitVertex,primVrt,jetDir));
534 
535  if( listSecondTracks.size()==2 ){
536  if( Momentum.M() > c_vrtBCMassLimit
537  || FitProb < 0.001
538  || Chi2PerTrk[Outlier] > m_secTrkChi2Cut) return -10000.;
539  }
540 
541  //
542  //-- To kill remnants of conversion
543  double Dist2D = std::sqrt(fitVertex.x()*fitVertex.x()+fitVertex.y()*fitVertex.y());
544  if( listSecondTracks.size()==2 && Dist2D > 20. && Charge==0 ) {
545  double mass_EE = massV0( TrkAtVrt,m_massE,m_massE);
546  if(mass_EE < 40.) return -40.;
547  }
548 
549  return Chi2;
550  }

◆ fitCommonVrt() [2/2]

template<class Trk >
double InDet::InDetVKalVxInJetTool::fitCommonVrt ( std::vector< const Trk * > &  listSecondTracks,
std::vector< float > &  trkRank,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir,
std::vector< double > &  inpMass,
Amg::Vector3D fitVertex,
std::vector< double > &  errorMatrix,
TLorentzVector &  momentum,
std::vector< std::vector< double > > &  trkAtVrt 
) const
private

◆ getBDir()

TLorentzVector InDet::InDetVKalVxInJetTool::getBDir ( const xAOD::TrackParticle trk1,
const xAOD::TrackParticle trk2,
const xAOD::Vertex primVrt,
Amg::Vector3D V1,
Amg::Vector3D V2 
) const
private

Definition at line 42 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

47  { // B hadron flight direction based on 2 separate tracks and PV. Calculated via plane-plane crossing
48  Amg::Vector3D PVRT(PrimVrt.x(),PrimVrt.y(),PrimVrt.z());
49 //----------------------------------------------------------------------------
50  Amg::Vector3D pnt1=trk1->perigeeParameters().position()-PVRT;
51  Amg::Vector3D mom1((trk1->p4()).Px(),(trk1->p4()).Py(),(trk1->p4()).Pz());
52  Amg::Vector3D pnt2=trk2->perigeeParameters().position()-PVRT;
53  Amg::Vector3D mom2((trk2->p4()).Px(),(trk2->p4()).Py(),(trk2->p4()).Pz());
54  pnt1.normalize(); pnt2.normalize(); mom1.normalize(); mom2.normalize();
55 //------------------------------------------------------------------------
56  const double dRLim=m_coneForTag;
57  Amg::Vector3D norm1=pnt1.cross(mom1);
58  Amg::Vector3D norm2=pnt2.cross(mom2);
59  Amg::Vector3D t=norm1.cross(norm2); t.normalize(); if(t.dot(mom1+mom2)<0.) t*=-1.;
60  double aveP=(trk1->p4()+trk2->p4()).P()/2.;
61  TLorentzVector tl; tl.SetXYZM(t.x()*aveP,t.y()*aveP,t.z()*aveP,139.57); //Crossing line of 2 planes
62  if( tl.DeltaR(trk1->p4()) >dRLim || tl.DeltaR(trk2->p4()) >dRLim ) {V1*=0.; V2*=0.; return tl;}//Too big dR between tracks and found "B line"
63 //------------------------------------------------------------------------
64  double X;
65  pnt1=trk1->perigeeParameters().position()-PVRT;
66  pnt2=trk2->perigeeParameters().position()-PVRT;
67  std::abs(mom1[1]*t[2]-mom1[2]*t[1])>std::abs(mom1[0]*t[2]-mom1[2]*t[0]) ? X=(t[1]*pnt1[2]-t[2]*pnt1[1])/(mom1[1]*t[2]-mom1[2]*t[1])
68  : X=(t[0]*pnt1[2]-t[2]*pnt1[0])/(mom1[0]*t[2]-mom1[2]*t[0]);
69  V1=pnt1+mom1*X; // First particle vertex
70  std::abs(mom2[1]*t[2]-mom2[2]*t[1])>std::abs(mom2[0]*t[2]-mom2[2]*t[0]) ? X=(t[1]*pnt2[2]-t[2]*pnt2[1])/(mom2[1]*t[2]-mom2[2]*t[1])
71  : X=(t[0]*pnt2[2]-t[2]*pnt2[0])/(mom2[0]*t[2]-mom2[2]*t[0]);
72  V2=pnt2+mom2*X; // Second particle vertex
73 //------------------------------------------------------------------------
74  if(V1.dot(t)<0. && V2.dot(t)<0.) {V1*=0.;V2*=0.;} // Check correctness of topology
75  else {V1+=PVRT; V2+=PVRT;} // Transform to detector frame
76 //------------------------------------------------------------------------
77  return tl;
78  }

◆ getG4Inter()

int InDet::InDetVKalVxInJetTool::getG4Inter ( const xAOD::TrackParticle TP)
staticprivate

Definition at line 629 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

629  {
630  static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer> > truthParticleLinkAcc ("truthParticleLink");
631  if( truthParticleLinkAcc.isAvailable (*TP) ) {
633  truthParticleLinkAcc (*TP);
634  if( tplink.isValid() && HepMC::is_simulation_particle(*tplink)) return 1;
635  }
636  return 0;
637  }

◆ getHists()

InDetVKalVxInJetTool::Hists & InDet::InDetVKalVxInJetTool::getHists ( ) const
private

Definition at line 395 of file InDetVKalVxInJetTool.cxx.

396  {
397  // We earlier checked that no more than one thread is being used.
398  Hists* h ATLAS_THREAD_SAFE = m_h.get();
399  return *h;
400  }

◆ getIdHF()

int InDet::InDetVKalVxInJetTool::getIdHF ( const xAOD::TrackParticle TP)
staticprivate

Definition at line 578 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

578  {
579  static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer> > truthParticleLinkAcc ("truthParticleLink");
580  if( truthParticleLinkAcc.isAvailable (*TP) ) {
582  truthParticleLinkAcc (*TP);
583  if( !tplink.isValid() ) return 0;
584  static const SG::ConstAccessor<float> truthMatchProbabilityAcc ("truthMatchProbability");
585  if( truthMatchProbabilityAcc (*TP ) < 0.5 ) return 0;
586  if (HepMC::is_simulation_particle(*tplink)) return 0;
587  if( (*tplink)->hasProdVtx()){
588  if( (*tplink)->prodVtx()->nIncomingParticles()==1){
589  int PDGID1=0, PDGID2=0, PDGID3=0, PDGID4=0;
590  const xAOD::TruthParticle * parTP1=getPreviousParent(*tplink, PDGID1);
591  const xAOD::TruthParticle * parTP2=nullptr ;
592  const xAOD::TruthParticle * parTP3=nullptr ;
593  int noBC1=notFromBC(PDGID1);
594  if(noBC1) parTP2 = getPreviousParent(parTP1, PDGID2);
595  int noBC2=notFromBC(PDGID2);
596  if(noBC2 && parTP2) parTP3 = getPreviousParent(parTP2, PDGID3);
597  int noBC3=notFromBC(PDGID3);
598  if(noBC3 && parTP3) getPreviousParent(parTP3, PDGID4);
599  int noBC4=notFromBC(PDGID4);
600  if(noBC1 && noBC2 && noBC3 && noBC4)return 0;
601  return 1; //This is a reconstructed track from B/C decays
602  } } }
603  return 0;
604  }

◆ getMCPileup()

int InDet::InDetVKalVxInJetTool::getMCPileup ( const xAOD::TrackParticle TP)
staticprivate

Definition at line 638 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

638  {
639  static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer> > truthParticleLinkAcc ("truthParticleLink");
640  if( truthParticleLinkAcc.isAvailable (*TP) ) {
642  truthParticleLinkAcc (*TP);
643  if( !tplink.isValid() ) return 1;
644  } else { return 1; }
645  return 0;
646  }

◆ getPerigee()

const Trk::Perigee * InDet::InDetVKalVxInJetTool::getPerigee ( const xAOD::TrackParticle i_ntrk)
staticprivate

Definition at line 401 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

402  {
403  return &(i_ntrk->perigeeParameters());
404  }

◆ GetPerigeeVector()

std::vector<const Trk::Perigee*> InDet::InDetVKalVxInJetTool::GetPerigeeVector ( const std::vector< const Trk::TrackParticleBase * > &  ) const
private

◆ getPixelDiscs()

void InDet::InDetVKalVxInJetTool::getPixelDiscs ( const xAOD::TrackParticle Part,
int &  d0Hit,
int &  d1Hit,
int &  d2Hit 
)
staticprivate

Definition at line 501 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

502  {
503  uint32_t HitPattern=Part->hitPattern();
504  d0Hit=0; if( HitPattern&((1<<Trk::pixelEndCap0)) ) d0Hit=1;
505  d1Hit=0; if( HitPattern&((1<<Trk::pixelEndCap1)) ) d1Hit=1;
506  d2Hit=0; if( HitPattern&((1<<Trk::pixelEndCap2)) ) d2Hit=1;
507  }

◆ getPixelLayers()

void InDet::InDetVKalVxInJetTool::getPixelLayers ( const xAOD::TrackParticle Part,
int &  blHit,
int &  l1Hit,
int &  l2Hit,
int &  nLay 
) const
private

Definition at line 441 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

442  {
443  blHit=l1Hit=l2Hit=nLays=0;
444  if(m_existIBL){ // 4-layer pixel detector
445  uint8_t IBLhit,BLhit,NPlay,IBLexp,BLexp;
446  if(!Part->summaryValue( IBLhit, xAOD::numberOfInnermostPixelLayerHits) ) IBLhit = 0;
447  if(!Part->summaryValue( BLhit, xAOD::numberOfNextToInnermostPixelLayerHits) ) BLhit = 0;
448  if(!Part->summaryValue( NPlay, xAOD::numberOfContribPixelLayers) ) NPlay = 0;
449  if(!Part->summaryValue( IBLexp, xAOD::expectInnermostPixelLayerHit) ) IBLexp = 0;
450  if(!Part->summaryValue( BLexp, xAOD::expectNextToInnermostPixelLayerHit) ) BLexp = 0;
451  blHit=IBLhit; if( IBLexp==0 ) blHit=-1;
452  l1Hit= BLhit; if( BLexp==0 ) l1Hit=-1;
453  nLays=NPlay;
454  //if((IBLhit+BLhit) == 0){ //no hits in IBL and BL VK OLD VERSION WITHOUT PATTERN AVAILABLE
455  // if(NPlay>=1) { l2Hit=1; } // at least one of remaining layers is fired
456  // if(NPlay==0) { l2Hit=0; }
457  //}else if( IBLhit*BLhit == 0){ // one hit in IBL and BL. Others are presumably also fired
458  // if(NPlay>=2) { l2Hit=1; }
459  // if(NPlay<=1) { l2Hit=0; } // no fired layer except for IBL/BL
460  //}
461  uint32_t HitPattern=Part->hitPattern();
462  l2Hit=0; if( HitPattern&((1<<Trk::pixelBarrel2)) ) l2Hit=1;
463  // bitH=HitPattern&((int)std::pow(2,Trk::pixelBarrel1));
464  } else { // 3-layer pixel detector
465  uint8_t BLhit,NPlay,NHoles,IBLhit;
466  if(!Part->summaryValue( BLhit, xAOD::numberOfBLayerHits) ) BLhit = 0;
467  if(!Part->summaryValue(IBLhit, xAOD::numberOfInnermostPixelLayerHits) ) IBLhit = 0; // Some safety
468  BLhit=BLhit>IBLhit ? BLhit : IBLhit; // Some safety
469  if(!Part->summaryValue( NPlay, xAOD::numberOfContribPixelLayers) ) NPlay = 0;
470  if(!Part->summaryValue(NHoles, xAOD::numberOfPixelHoles) ) NHoles = 0;
471  blHit=BLhit; //B-layer hit is fired. Presumable all other layers are also fired.
472  nLays=NPlay;
473  //if (BLhit==0) { //B-layer hit is absent.
474  // if(NPlay>=2) { l1Hit=l2Hit=1;}
475  // if(NPlay==0) { l1Hit=l2Hit=0;}
476  // if(NPlay==1) {
477  // if( NHoles==0) {l1Hit=0; l2Hit=1;}
478  // if( NHoles>=1) {l1Hit=1; l2Hit=0;}
479  // }
480  //}
481  uint32_t HitPattern=Part->hitPattern();
482  l1Hit=0; if( HitPattern&((1<<Trk::pixelBarrel1)) ) l1Hit=1;
483  l2Hit=0; if( HitPattern&((1<<Trk::pixelBarrel2)) ) l2Hit=1;
484  }
485 
486  }

◆ getPixelProblems()

void InDet::InDetVKalVxInJetTool::getPixelProblems ( const xAOD::TrackParticle Part,
int &  splshIBL,
int &  splshBL 
) const
private

Definition at line 487 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

488  {
489  splshIBL=splshBL=0;
490  if(m_existIBL){ // 4-layer pixel detector
491  uint8_t share,split;
492  //if(!Part->summaryValue( IBLout, xAOD::numberOfInnermostPixelLayerOutliers ) ) IBLout = 0;
493  if(!Part->summaryValue( share, xAOD::numberOfInnermostPixelLayerSharedHits ) ) share = 0;
494  if(!Part->summaryValue( split, xAOD::numberOfInnermostPixelLayerSplitHits ) ) split = 0;
495  splshIBL=share+split;
496  if(!Part->summaryValue( share, xAOD::numberOfNextToInnermostPixelLayerSharedHits ) ) share = 0;
498  splshBL=share+split;
499  }
500  }

◆ getPreviousParent()

const xAOD::TruthParticle * InDet::InDetVKalVxInJetTool::getPreviousParent ( const xAOD::TruthParticle child,
int &  ParentPDG 
)
staticprivate

Definition at line 617 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

617  {
618  ParentPDG=0;
619  if( child->hasProdVtx() ){
620  if( child->prodVtx()->nIncomingParticles()==1 ){
621  ParentPDG = abs((*(child->prodVtx()->incomingParticleLinks())[0])->pdgId());
622  return *(child->prodVtx()->incomingParticleLinks())[0];
623  }
624  }
625  return nullptr;
626  }

◆ GetTrkFitWeights()

StatusCode InDet::InDetVKalVxInJetTool::GetTrkFitWeights ( std::vector< double > &  wgt,
const Trk::IVKalState istate 
) const
private

Definition at line 435 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

437  {
438  return m_fitSvc->VKalGetTrkWeights(wgt, istate);
439  }

◆ getVrtSec()

xAOD::Vertex * InDet::InDetVKalVxInJetTool::getVrtSec ( const std::vector< const xAOD::TrackParticle * > &  inpTrk,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir,
std::vector< double > &  results,
std::vector< const xAOD::TrackParticle * > &  selSecTrk,
std::vector< const xAOD::TrackParticle * > &  trkFromV0,
int &  nRefPVTrk,
compatibilityGraph_t compatibilityGraph 
) const
private

Definition at line 69 of file BTagVrtSec.cxx.

78  {
79 
80  ATH_MSG_DEBUG("getVrtSec() called with xAOD::TrackParticle=" <<inpTrk.size());
81  if( inpTrk.size() < 2 ) { return nullptr;} // 0,1 track => nothing to do!
82 
83  std::vector<const xAOD::TrackParticle*> selectedTracks(0);
84  results.clear();
85  listSecondTracks.clear();
86  nRefPVTrk = 0;
87 
88  float evtWgt = 1.;
89  const EventContext & ctx = Gaudi::Hive::currentContext();
91  if (eventInfo.isValid()) {
92  if(eventInfo->hasBeamSpotWeight()) evtWgt *= eventInfo->beamSpotWeight();
93  } else ATH_MSG_DEBUG("No event info object found!");
94 
95  nRefPVTrk = selGoodTrkParticle( inpTrk, primVrt, jetDir, selectedTracks);
96  if(m_fillHist){
97  Hists& h = getHists();
98  h.m_hb_ntrkjet->Fill( static_cast<double>( selectedTracks.size() ), evtWgt);
99  h.m_pr_NSelTrkMean->Fill(jetDir.Pt(), static_cast<double>( selectedTracks.size() ));
100  }
101  long int NTracks = static_cast<int>( selectedTracks.size() );
102  if( NTracks < 2 ) { return nullptr;} // 0,1 selected track => nothing to do!
103 
104  ATH_MSG_DEBUG("Number of selected tracks inside jet= "<<NTracks);
105 
106  TLorentzVector MomentumJet = totalMom(selectedTracks);
107  if(m_fillHist){
108  Hists& h = getHists();
109  h.m_hb_jmom->Fill( MomentumJet.E(), evtWgt);
110  }
111 
112 
113  //--------------------------------------------------------------------------------------------
114  // Initial xAOD::TrackParticle list ready
115 
116  std::vector<const xAOD::TrackParticle*> tracksForFit;
117  std::vector<double> inpMass(NTracks,m_massPi);
118  int Vrt2TrackNumber = select2TrVrt(selectedTracks, tracksForFit, primVrt, jetDir, inpMass, nRefPVTrk,
119  trkFromV0, listSecondTracks,
120  compatibilityGraph, evtWgt);
121 
122  //
123  //--- Cleaning
124  //
125  if( trkFromV0.size() > 1) {
126  removeDoubleEntries(trkFromV0);
127  AnalysisUtils::Sort::pT(&trkFromV0);
128  }
129 
130  std::vector<const xAOD::TrackParticle*> saveSecondTracks(listSecondTracks);
131  removeDoubleEntries(listSecondTracks);
132  AnalysisUtils::Sort::pT (&listSecondTracks);
133  for(const auto *iv0 : trkFromV0){
134  auto itf = std::find(selectedTracks.begin(),selectedTracks.end(),iv0);
135  if(itf!=selectedTracks.end()) selectedTracks.erase(itf);
136  }
137 
138  ATH_MSG_DEBUG(" Found different xAOD tracks in pairs="<< listSecondTracks.size());
139  if(listSecondTracks.size() < 2 ) return nullptr;
140 
141  //--Ranking of selected tracks
142  std::vector<float> trkRank(0);
143  for(const auto *tk : listSecondTracks){
144  float rank = m_useTrackClassificator ?
145  m_trackClassificator->trkTypeWgts(tk, primVrt, jetDir)[0] :
146  std::count(saveSecondTracks.begin(), saveSecondTracks.end(), tk); // Number of 2tr vertices where each track is used
147  trkRank.push_back(rank);
148  }
149 
151  while( median(trkRank)<0.3 && trkRank.size()>3 ) {
152  int Smallest = std::min_element(trkRank.begin(),trkRank.end()) - trkRank.begin();
153  removeEntryInList(listSecondTracks,trkRank,Smallest);
154  }
155  }
156 
157  //
158  //-----------------------------------------------------------------------------------------------------
159  // Secondary track list is ready
160  // Now common vertex fit
161  //
162  std::vector<double> errorMatrix;
163  Amg::Vector3D fitVertex;
164  std::vector< std::vector<double> > TrkAtVrt;
165  TLorentzVector Momentum;
166 
167  double Chi2 = fitCommonVrt(listSecondTracks, trkRank, primVrt, jetDir, inpMass, fitVertex, errorMatrix, Momentum, TrkAtVrt);
168 
169  if( Chi2 < 0 && listSecondTracks.size()>2 ) { // Vertex not reconstructed. Try to remove one track with biggest pt.
170  double tpmax = 0.;
171  int ipmax = -1;
172  for(unsigned int it=0; it<listSecondTracks.size(); it++){
173  if(tpmax<listSecondTracks[it]->pt()){
174  tpmax = listSecondTracks[it]->pt();
175  ipmax = it;
176  }
177  }
178 
179  if(ipmax>=0) removeEntryInList(listSecondTracks,trkRank,ipmax);
180  Chi2 = fitCommonVrt(listSecondTracks, trkRank, primVrt, jetDir, inpMass, fitVertex, errorMatrix, Momentum, TrkAtVrt);
181  ATH_MSG_DEBUG("Second fitCommonVrt try="<< Chi2<<" Ntrk="<<listSecondTracks.size());
182  }
183  ATH_MSG_DEBUG("fitCommonVrt result="<< Chi2<<" Ntrk="<<listSecondTracks.size());
184 
185  if(Chi2 < 0) return nullptr;
186 
187  //
188  // Check jet tracks not in secondary vertex
189  std::map<double,const xAOD::TrackParticle*> AdditionalTracks;
190  std::vector<double> Impact, ImpactError;
191  double Signif3D = 0.;
192  vrtVrtDist(primVrt, fitVertex, errorMatrix, Signif3D);
193 
194  if(Signif3D>8.){
195 
196  int hitL1=0, nLays=0, hitIBL=0, hitBL=0;
197  for (const auto *i_ntrk : selectedTracks) {
198  if( find( listSecondTracks.begin(), listSecondTracks.end(), i_ntrk) != listSecondTracks.end() ) continue; // Track is used already
199 
201  std::vector<float> trkScore=m_trackClassificator->trkTypeWgts(i_ntrk, primVrt, jetDir);
202  if(trkScore[0] < 0.1) continue; //Remove very low track HF score
203  }
204 
205  double Signif3DS = m_fitSvc->VKalGetImpact(i_ntrk, fitVertex , 1, Impact, ImpactError);
206  if(Signif3DS > 10.) continue;
207 
208  getPixelLayers(i_ntrk , hitIBL , hitBL, hitL1, nLays);
209  if( hitIBL<=0 && hitBL<=0 ) continue; // No IBL and BL pixel hits => non-precise track
210 
211  double Signif3DP = m_fitSvc->VKalGetImpact(i_ntrk, primVrt.position(), 1, Impact, ImpactError);
212  if(Signif3DP<1.)continue;
213 
214  if(m_fillHist){
215  Hists& h = getHists();
216  h.m_hb_diffPS->Fill( Signif3DP-Signif3DS, evtWgt);
217  }
218 
219  if(Signif3DP-Signif3DS>4.0) AdditionalTracks[Signif3DP-Signif3DS] = i_ntrk;
220  }
221  }
222 
223  //
224  // Add found tracks and refit
225  //
226  if(!AdditionalTracks.empty()){
227  while (AdditionalTracks.size()>3) AdditionalTracks.erase(AdditionalTracks.begin());//Tracks are in increasing DIFF order.
228  for (auto atrk : AdditionalTracks) listSecondTracks.push_back(atrk.second); //3tracks with max DIFF are selected
229  trkRank.clear();
230  for(const auto *tk : listSecondTracks){
231  float rank = m_useTrackClassificator ? m_trackClassificator->trkTypeWgts(tk, primVrt, jetDir)[0] : 1;
232  trkRank.push_back( rank );
233  }
234  Chi2 = fitCommonVrt(listSecondTracks, trkRank, primVrt, jetDir, inpMass, fitVertex, errorMatrix, Momentum, TrkAtVrt);
235  ATH_MSG_DEBUG("Added track fitCommonVrt output="<< Chi2);
236  if(Chi2 < 0) return nullptr;
237  }
238 
239  //
240  // Saving of results
241  //
242  if( listSecondTracks.size()==2 ){ // If there are 2 only tracks
243  ATH_MSG_DEBUG("Start Ntr=2 vertex check");
244  int Charge = 0;
245  for (const auto *i_ntrk : listSecondTracks) Charge += static_cast<int>( i_ntrk->charge() );
246  vrtVrtDist(primVrt, fitVertex, errorMatrix, Signif3D);
247 
248  // Check track pixel hit patterns vs vertex position.
250  if(!check2TrVertexInPixel(listSecondTracks[0],listSecondTracks[1],fitVertex,errorMatrix)) return nullptr;
251  }
252 
253  // Check track first measured points vs vertex position.
255  float hitR1 = listSecondTracks[0]->radiusOfFirstHit();
256  float hitR2 = listSecondTracks[1]->radiusOfFirstHit();
257  float vrErr = vrtRadiusError(fitVertex, errorMatrix);
258  if(std::abs(hitR1-hitR2)>25.) return nullptr; // Hits in different pixel layers
259  if(fitVertex.perp()-std::min(hitR1,hitR2) > 2.*vrErr) return nullptr; // Vertex is behind hit in pixel
260  }
261 
262  //--------
263  //
264  if(m_fillHist){
265  Hists& h = getHists();
266  if(Charge){
267  h.m_hb_totmass2T1->Fill(Momentum.M(),evtWgt);
268  }
269  else{
270  h.m_hb_totmass2T0->Fill(Momentum.M(),evtWgt);
271  }
272  }
273 
274  if( !Charge && std::abs(Momentum.M()-m_massK0)<15. ) { // Final rejection of K0
275  trkFromV0.push_back(listSecondTracks[0]);
276  trkFromV0.push_back(listSecondTracks[1]);
277  if( trkFromV0.size() > 1) {
278  removeDoubleEntries(trkFromV0);
279  AnalysisUtils::Sort::pT (&trkFromV0);
280  }
281  return nullptr;
282  }
283  ATH_MSG_DEBUG("Ntr=2 vertex check passed");
284  }
285 
286 
287  double jetVrtDir = projSV_PV(fitVertex,primVrt,jetDir);
288  ATH_MSG_DEBUG("Combined SV neg.dir="<<jetVrtDir);
289  if(m_getNegativeTag){
290  if(jetVrtDir > 0.) return nullptr;
291  }
292  else if(!m_getNegativeTail){
293  if(jetVrtDir < 0.) return nullptr;
294  }
295 
296  double xvt = fitVertex.x();
297  double yvt = fitVertex.y();
298  double R = std::hypot(xvt, yvt);
299  std::vector<double> distMat = {39.9, // Maximum distance
300  std::abs(R-m_beampipeR),
301  std::abs(R-m_rLayerB),
302  std::abs(R-m_rLayer1),
303  std::abs(R-m_rLayer2)};
304  if(m_existIBL) distMat.push_back(std::abs(R-m_rLayer3)); // 4-layer pixel detector
305  double minDstMat = *(std::min_element(distMat.begin(), distMat.end()));
306 
307  vrtVrtDist(primVrt, fitVertex, errorMatrix, Signif3D);
308  if(jetVrtDir < 0) Signif3D = -Signif3D;
309 
310  results.push_back(Momentum.M()); //1st
311  double eRatio = Momentum.E()/MomentumJet.E();
312  results.push_back( eRatio<0.99999 ? eRatio : 0.99999 ); //2nd
313  results.push_back( static_cast<double>(Vrt2TrackNumber) ); //3rd
314  results.push_back( static_cast<double>(NTracks) ); //4th
315  results.push_back( static_cast<double>(listSecondTracks.size()) ); //5th
316  results.push_back( Signif3D ); //6th
317  results.push_back( MomentumJet.E() ); //7th
318  results.push_back( minDstMat ); //8th
319  double nRatio = Momentum.Et(jetDir.Vect())/std::sqrt(MomentumJet.Perp());
320  nRatio /= (nRatio+4.);
321  results.push_back( nRatio ); //9th New transverse energy ration
322  results.push_back( (Momentum.M()-2.*m_massPi) * eRatio/m_massB ); //10th "Product" variable
323  results.push_back( (Momentum.Pt()/Momentum.M()) * (m_massB/jetDir.Pt()) ); //11th "Boost" variable
324 
325  if(m_fillHist){
326  // Find highest track Pt with respect to jet direction
327  double trackPt, trackPtMax = 0.;
328  for (unsigned int tr=0; tr<listSecondTracks.size(); tr++) {
329  if(listSecondTracks[tr]->pt()/jetDir.Pt() > 0.5) continue;
330  trackPt = pTvsDir(Amg::Vector3D(jetDir.X(),jetDir.Y(),jetDir.Z()) , TrkAtVrt[tr]);
331  if(trackPt>trackPtMax) trackPtMax = trackPt;
332  }
333 
334  Hists& h = getHists();
335  h.m_hb_rNdc->Fill( fitVertex.perp(), evtWgt );
336  h.m_hb_trkPtMax->Fill( trackPtMax, evtWgt );
337  h.m_hb_mom->Fill( MomentumJet.E(), evtWgt );
338  h.m_hb_totmass->Fill( results[0], evtWgt );
339  h.m_hb_ratio->Fill( results[1], evtWgt );
340  h.m_hb_nvrt2->Fill( results[2], evtWgt );
341  h.m_hb_sig3DTot->Fill( Signif3D, evtWgt );
342  h.m_hb_dstToMat->Fill( minDstMat, evtWgt );
343  h.m_pr_effVrt->Fill( static_cast<float>(nRefPVTrk), 1. );
344  h.m_pr_effVrtEta->Fill( jetDir.Eta(), 1. );
345 
346  float R = jetDir.DeltaR(TLorentzVector(fitVertex.x()-primVrt.x(), fitVertex.y()-primVrt.y(),
347  fitVertex.z()-primVrt.z(), 1.e4));
348  h.m_hb_deltaRSVPV->Fill( R, evtWgt );
349 
350  if(h.m_curTup){
351  h.m_curTup->TotM = Momentum.M();
352  if(!m_multiVertex){
353  h.m_curTup->nNVrt = 1;
354  h.m_curTup->NVrtNT[0] = listSecondTracks.size();
355  h.m_curTup->NVrtDist2D[0] = fitVertex.perp();
356  h.m_curTup->NVrtSig3D[0] = Signif3D;
357  h.m_curTup->NVrtM[0] = Momentum.M();
358  h.m_curTup->NVrtChi2[0] = Chi2;
359  h.m_curTup->NVrtMaxW[0] = eRatio;
360  h.m_curTup->NVrtDR[0] = R;
361  }
362  }
363  }
364 
365  //-------------------------------------------------------------------------------------
366  //Return xAOD::Vertex
367  xAOD::Vertex * tmpVertex = new (std::nothrow) xAOD::Vertex();
368  if(!tmpVertex) return nullptr;
369  tmpVertex->makePrivateStore();
370  tmpVertex->setPosition(fitVertex);
371 
372  std::vector<float> floatErrMtx;
373  floatErrMtx.resize(errorMatrix.size());
374  for(unsigned int i=0; i<errorMatrix.size(); i++) floatErrMtx[i] = errorMatrix[i];
375 
376  tmpVertex->setCovariance(floatErrMtx);
377  tmpVertex->setFitQuality(Chi2, static_cast<float>(listSecondTracks.size()*2.-3.));
378 
379  for (const auto *i_ntrk : listSecondTracks){
381  TEL.setElement(i_ntrk);
382  const xAOD::TrackParticleContainer* cont = (const xAOD::TrackParticleContainer* ) (i_ntrk->container() );
383  TEL.setStorableObject(*cont);
384  tmpVertex->addTrackAtVertex(TEL,1.);
385  }
386  return tmpVertex;
387 
388  }

◆ getVrtSecMulti()

std::vector< xAOD::Vertex * > InDet::InDetVKalVxInJetTool::getVrtSecMulti ( workVectorArrxAOD xAODwrk,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir,
std::vector< double > &  results,
compatibilityGraph_t compatibilityGraph 
) const
private

Definition at line 41 of file BTagVrtSecMulti.cxx.

46 {
47 
48  const double probVrtMergeLimit = 0.01;
49 
50  int inpNPart = 0;
51  if (xAODwrk) {
52  inpNPart = xAODwrk->InpTrk.size();
53  xAODwrk->FoundSecondTracks.clear(); // Input clearing for failure return
54  results.clear(); // Input clearing for failure return
55  }
56  ATH_MSG_DEBUG( "InDet getVrtSecMulti() called with NPart=" << inpNPart );
57 
58  std::vector<xAOD::Vertex*> finalVertices(0);
59 
60  if (inpNPart < 2) {
61  return finalVertices;
62  } // 0,1 track => nothing to do!
63 
64  float evtWgt = 1.;
65  const EventContext & ctx = Gaudi::Hive::currentContext();
67  if (eventInfo.isValid()) {
68  if(eventInfo->hasBeamSpotWeight()) evtWgt *= eventInfo->beamSpotWeight();
69  } else ATH_MSG_DEBUG("No event info object found!");
70 
71 
72  long int nTracks = 0;
73  TLorentzVector momentumJet;
74  int nRefPVTrk = 0;
75  if (xAODwrk) {
76  nRefPVTrk = selGoodTrkParticle(xAODwrk->InpTrk, primVrt, jetDir, xAODwrk->listJetTracks,evtWgt);
77  while (!xAODwrk->listJetTracks.empty() &&
78  xAODwrk->listJetTracks[0]->pt() / jetDir.Pt() > 1.){
79  xAODwrk->listJetTracks.erase(xAODwrk->listJetTracks.begin());
80  }
81  nTracks = xAODwrk->listJetTracks.size();
82  momentumJet = totalMom(xAODwrk->listJetTracks);
83  }
84 
85  if (nTracks < 2) {
86  return finalVertices;
87  } // 0,1 selected track => nothing to do!
88 
89 
90  ATH_MSG_DEBUG("Number of selected tracks inside jet= " << nTracks);
91 
92  if (m_fillHist) {
93  Hists& h = getHists();
94  h.m_hb_jmom->Fill(momentumJet.Perp(), evtWgt);
95  h.m_hb_ntrkjet->Fill(static_cast<double>(nTracks), evtWgt);
96  }
97 
98  //
99  // InpTrk[] - input track list
100  // listJetTracks[] - list of good tracks in jet for vertex search
101  //------------------------------------------------------------
102  // Initial track list ready
103  // Find 2track vertices
104  //
105 
106  std::vector<double> inpMass(nTracks, m_massPi);
107  double vrt2TrackNumber = 0;
108 
109  if (xAODwrk) {
110  select2TrVrt(xAODwrk->listJetTracks,
111  xAODwrk->TracksForFit,
112  primVrt,
113  jetDir,
114  inpMass,
115  nRefPVTrk,
116  xAODwrk->TrkFromV0,
117  xAODwrk->listSecondTracks,
118  compatibilityGraph);
119  if (xAODwrk->TrkFromV0.size() > 1) {
120  removeDoubleEntries(xAODwrk->TrkFromV0);
121  AnalysisUtils::Sort::pT(&(xAODwrk->TrkFromV0));
122  }
123  vrt2TrackNumber = xAODwrk->listSecondTracks.size()/2.0;
124  removeDoubleEntries(xAODwrk->listSecondTracks);
125  AnalysisUtils::Sort::pT(&(xAODwrk->listSecondTracks));
126  }
127 
128 
129  ATH_MSG_DEBUG(" Found different tracks in pairs=" << vrt2TrackNumber);
130 
131  //
132  // listSecondTracks[] - list of all tracks which participate in some
133  // 2-track vertex TrkFromV0[] - "bad" tracks from any
134  // V0/material/conversion m_Incomp[] - main vector of pointers for
135  // multivertex search
136  //-----------------------------------------------------------------------------------------------------
137  // Secondary track list is ready
138  // Creation of initial vertex set
139  //
140 
141  std::unique_ptr<std::vector<WrkVrt>> wrkVrtSet = std::make_unique<std::vector<WrkVrt>>();
142  WrkVrt newvrt;
143  newvrt.Good = true;
144  std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
145  StatusCode sc;
146 
147  //================================================== Boost version (don't
148  //forget to uncomment addEdge in select2TrVrt()
149  std::vector<std::vector<int>> allCliques;
150  bron_kerbosch_all_cliques(compatibilityGraph, clique_visitor(allCliques));
151 
152  for (const auto& clique : allCliques) {
153 
154  newvrt.selTrk.clear();
155  if (xAODwrk) xAODwrk->tmpListTracks.clear();
156 
157  for (int i_trk : clique){
158  newvrt.selTrk.push_back(i_trk);
159  if(xAODwrk) xAODwrk->tmpListTracks.push_back(xAODwrk->listJetTracks.at(i_trk));
160  }
161 
162  if (xAODwrk) sc = VKalVrtFitFastBase(xAODwrk->tmpListTracks, newvrt.vertex, *state);
163  if (sc.isFailure() ||
164  newvrt.vertex.perp() > m_rLayer2 * 2.) {
165  // No initial estimation
166  m_fitSvc->setApproximateVertex(primVrt.x(),
167  primVrt.y(),
168  primVrt.z(),
169  *state); // Use as starting point
170  if (m_multiWithPrimary)
171  m_fitSvc->setApproximateVertex(0., 0., 0., *state);
172  } else {
173  Amg::Vector3D vDist = newvrt.vertex - primVrt.position();
174  double jetVrtDir = jetDir.Px() * vDist.x() + jetDir.Py() * vDist.y() +
175  jetDir.Pz() * vDist.z();
176  if (m_multiWithPrimary) jetVrtDir = std::abs(jetVrtDir); // Always positive when primary vertex is seeked for
177  if (jetVrtDir > 0.) {
178  // Good initial estimation
179  m_fitSvc->setApproximateVertex(newvrt.vertex.x(),
180  newvrt.vertex.y(),
181  newvrt.vertex.z(),
182  *state); //Use as starting point
183  } else {
184  m_fitSvc->setApproximateVertex(primVrt.x(), primVrt.y(), primVrt.z(), *state);
185  }
186  }
187 
188  sc = StatusCode::FAILURE;
189  if (xAODwrk) {
190  sc = VKalVrtFitBase(xAODwrk->tmpListTracks,
191  newvrt.vertex,
192  newvrt.vertexMom,
193  newvrt.vertexCharge,
194  newvrt.vertexCov,
195  newvrt.chi2PerTrk,
196  newvrt.trkAtVrt,
197  newvrt.chi2,
198  *state,
199  false);
200  }
201  if (sc.isFailure()) continue; // Bad fit - goto next solution
202 
203  if (clique.size() == 2 && newvrt.chi2 > 10.) continue; // Bad 2track vertex
204 
205  if (newvrt.chi2PerTrk.size() == 2){
206  newvrt.chi2PerTrk[0] = newvrt.chi2PerTrk[1] = newvrt.chi2 / 2.;
207  }
208  newvrt.Good = true;
209  newvrt.nCloseVrt = 0;
210  newvrt.dCloseVrt = 1000000.;
211  newvrt.projectedVrt =
212  jetProjDist(newvrt.vertex, primVrt, jetDir); // 3D SV-PV distance
213  wrkVrtSet->push_back(newvrt);
214  }
215 
216  //
217  //========= Initial cleaning of solutions
218  //-Remove worst track from vertices with very bad Chi2
219  bool disassembled = false;
220 
221  do {
222  disassembled = false;
223  int NSoluI = (*wrkVrtSet).size();
224  for (int iv = 0; iv < NSoluI; iv++) {
225  WrkVrt vrt = (*wrkVrtSet)[iv];
226  if (!vrt.Good || vrt.selTrk.size() == 2) continue;
227  if (TMath::Prob(vrt.chi2, 2 * vrt.selTrk.size() - 3) < 1.e-3) {
228  if (xAODwrk) disassembleVertex(wrkVrtSet.get(), iv, xAODwrk->listJetTracks, *state);
229  disassembled = true;
230  }
231  }
232  }while(disassembled);
233 
234  //-Remove vertices fully contained in other vertices
235  while( (*wrkVrtSet).size()>1 ){
236  int tmpN = (*wrkVrtSet).size();
237 
238  int iv = 0;
239  for(; iv<tmpN-1; iv++){
240  WrkVrt vert_i = (*wrkVrtSet)[iv];
241  if(!vert_i.Good ) continue;
242  int ntrk_i = (*wrkVrtSet)[iv].selTrk.size();
243 
244  int jv = iv+1;
245  for(; jv<tmpN; jv++){
246  WrkVrt vert_j = (*wrkVrtSet)[jv];
247  if(!vert_j.Good ) continue;
248  int ntrk_j = (*wrkVrtSet)[jv].selTrk.size();
249 
250  int nTCom = nTrkCommon(wrkVrtSet.get(), iv, jv);
251  if(nTCom==ntrk_i){
252  (*wrkVrtSet).erase((*wrkVrtSet).begin()+iv);
253  break;
254  }
255  else if(nTCom==ntrk_j){
256  (*wrkVrtSet).erase((*wrkVrtSet).begin()+jv);
257  break;
258  }
259  }
260  if(jv!=tmpN) break; // One vertex is erased. Restart check
261 
262  }
263  if(iv==tmpN-1) break; // No vertex deleted
264 
265  } // end while( (*wrkVrtSet).size()>1 )
266 
267 
268  //
269  //- Try to merge all vertices with common tracks
270  std::multimap<int,std::pair<int,int>> vrtWithCommonTrk;
271  std::multimap<int,std::pair<int,int>>::reverse_iterator icvrt;
272  do{
273  int NSoluI = (*wrkVrtSet).size();
274  vrtWithCommonTrk.clear();
275  for(int iv = 0; iv<NSoluI-1; iv++ ){
276  for(int jv = iv+1; jv<NSoluI; jv++){
277  if(!(*wrkVrtSet)[iv].Good || !(*wrkVrtSet)[jv].Good) continue;
278  int nTCom=nTrkCommon(wrkVrtSet.get(), iv, jv);
279  if(!nTCom)continue;
280  vrtWithCommonTrk.emplace(nTCom,std::make_pair(iv,jv));
281  }
282  }
283 
284  for(icvrt = vrtWithCommonTrk.rbegin(); icvrt!=vrtWithCommonTrk.rend(); ++icvrt){
285  int nTCom = (*icvrt).first;
286  int iv = (*icvrt).second.first;
287  int jv = (*icvrt).second.second;
288  int nTrkI = (*wrkVrtSet)[iv].selTrk.size();
289  int nTrkJ = (*wrkVrtSet)[jv].selTrk.size();
290  double probV = -1.;
291  if (xAODwrk) {
292  probV = mergeAndRefitVertices(wrkVrtSet.get(), iv, jv, newvrt, xAODwrk->listJetTracks, *state);
293  }
294 
295  if(probV<probVrtMergeLimit){
296  if(nTrkI==2 || nTrkJ==2 || nTCom<2) {
297  continue;
298  }
299  if(nTCom>nTrkI-nTCom || nTCom>nTrkJ-nTCom){
300  //2 and more common tracks for NTr>=3 vertices. Merge anyway.
301  if(xAODwrk) mergeAndRefitOverlapVertices( wrkVrtSet.get(), iv, jv, xAODwrk->listJetTracks, *state);
302  break; //Vertex list is changed. Restart merging from scratch.
303  }
304  continue; //Continue merging loop
305  }
306 
307  newvrt.Good = true;
308  (*wrkVrtSet).push_back(newvrt);
309  (*wrkVrtSet)[iv].Good = false;
310  (*wrkVrtSet)[jv].Good = false;
311  break; //Merging successful. Break merging loop and remake list of connected vertices
312  } // end for(icvrt)
313 
314  } while( icvrt != vrtWithCommonTrk.rend() );
315 
316 
317  if(m_fillHist){
318  int cvgood=0;
319  for(const auto& vrt : (*wrkVrtSet)){
320  if(vrt.Good) cvgood++;
321  }
322  Hists& h = getHists();
323  h.m_hb_rawVrtN->Fill( static_cast<float>(cvgood), evtWgt);
324  }
325 
326  //-Remove all bad vertices from the working set
327  for(auto &tmpV : (*wrkVrtSet) ) {
328  if(tmpV.vertex.perp()>m_rLayer3+10.) tmpV.Good = false; //Vertices outside Pixel detector
329  TLorentzVector SVPV(tmpV.vertex.x()-primVrt.x(),
330  tmpV.vertex.y()-primVrt.y(),
331  tmpV.vertex.z()-primVrt.z(), 1.);
332  if(jetDir.DeltaR(SVPV)>m_coneForTag) tmpV.Good = false; // SV is outside of the jet cone
333  }
334 
335  unsigned int tmpV = 0;
336  while( tmpV<(*wrkVrtSet).size() ){
337  if( !(*wrkVrtSet)[tmpV].Good ) (*wrkVrtSet).erase((*wrkVrtSet).begin()+tmpV);
338  else tmpV++;
339  }
340 
341  if((*wrkVrtSet).empty()){ // No vertices at all
342  return finalVertices;
343  }
344 
345  std::vector< std::vector<float> > trkScore(0);
346  if(xAODwrk && m_useTrackClassificator){
347  for(auto &trk : xAODwrk->listJetTracks) trkScore.push_back(m_trackClassificator->trkTypeWgts(trk, primVrt, jetDir));
348  }
349 
350  for(auto &tmpV : (*wrkVrtSet) ) tmpV.projectedVrt=jetProjDist(tmpV.vertex, primVrt, jetDir); //Setup ProjectedVrt
351 
352  //----------------------------------------------------------------------------
353  // Here we have the overlapping solutions.
354  // Vertices may have only 1 common track.
355  // Now solution cleaning
356 
357  std::unique_ptr<std::vector< std::deque<long int> > > trkInVrt = std::make_unique<std::vector<std::deque<long int>>>(nTracks);
358  trackClassification(wrkVrtSet.get(), trkInVrt.get());
359 
360  double foundMaxT;
361  long int selectedTrack, selectedVertex;
362  int foundV1, foundV2;
363 
364  state = m_fitSvc->makeState();
365  while( ( foundMaxT = MaxOfShared(wrkVrtSet.get(), trkInVrt.get(), selectedTrack, selectedVertex) ) > 0) {
366 
367  double foundMinVrtDst = 1000000.;
368  if(foundMaxT<m_trackDetachCut) foundMinVrtDst = minVrtVrtDist(wrkVrtSet.get(), foundV1, foundV2);
369 
370  //Choice of action
371  if( foundMaxT<m_trackDetachCut && foundMinVrtDst<m_vertexMergeCut
372  && nTrkCommon(wrkVrtSet.get(), foundV1, foundV2) ){
373 
374  bool vrtMerged=false; //to check whether something is really merged
375  while(foundMinVrtDst<m_vertexMergeCut){
376  if(foundV1<foundV2) std::swap(foundV1, foundV2); // Always drop vertex with smallest number
377 
378  double probV = 0.;
379  if (xAODwrk) probV = mergeAndRefitVertices(wrkVrtSet.get(), foundV1, foundV2, newvrt, xAODwrk->listJetTracks, *state);
380 
381  if(probV>probVrtMergeLimit && newvrt.vertexMom.M()<c_vrtBCMassLimit){
382  // Good merged vertex found
383  double tstDst = jetProjDist(newvrt.vertex, primVrt, jetDir);
384  if(tstDst>0.){
385  // only positive vertex directions are accepted as merging result
386  std::swap((*wrkVrtSet)[foundV1], newvrt);
387  (*wrkVrtSet)[foundV1].projectedVrt = tstDst;
388  (*wrkVrtSet)[foundV2].Good = false; //Drop vertex
389  (*wrkVrtSet)[foundV2].selTrk.clear(); //Clean dropped vertex
390  vrtMerged=true;
391  }
392  }
393 
394  (*wrkVrtSet)[foundV1].nCloseVrt = -1;
395  (*wrkVrtSet)[foundV1].dCloseVrt = 1000000.; //For minVrtVrtDistNext optimisation(!)
396  (*wrkVrtSet)[foundV2].nCloseVrt = -1;
397  (*wrkVrtSet)[foundV2].dCloseVrt = 1000000.; //Exclude given pair
398  foundMinVrtDst = minVrtVrtDistNext(wrkVrtSet.get(), foundV1, foundV2); //Check other vertices
399 
400  } // end while(foundMinVrtDst<m_vertexMergeCut)
401 
402  if(vrtMerged){
403  trkInVrt->resize(nTracks);
404  trackClassification(wrkVrtSet.get(), trkInVrt.get());
405  continue; // Something was merged => goto next cycle. Otherwise break the found track-vertex link
406  }
407 
408  } // end choice of action
409 
410  removeTrackFromVertex(wrkVrtSet.get(), trkInVrt.get(), selectedTrack, selectedVertex);
411 
412  sc = StatusCode::FAILURE;
413  if(xAODwrk) sc = refitVertex( wrkVrtSet.get(), selectedVertex, xAODwrk->listJetTracks, *state, false);
414 
415  (*wrkVrtSet)[selectedVertex].projectedVrt = jetProjDist((*wrkVrtSet)[selectedVertex].vertex, primVrt, jetDir);
416 
417  if( sc.isFailure() ) (*wrkVrtSet)[selectedVertex].Good = false; //bad vertex
418  if( (*wrkVrtSet)[selectedVertex].projectedVrt<0.
419  && (*wrkVrtSet)[selectedVertex].selTrk.size()==2 ){
420  (*wrkVrtSet)[selectedVertex].Good = false; // 2track vertex migrates behind PV - drop it.
421  }
422 
423  } // end while( (foundMaxT = MaxOfShared)>0 )
424 
425 
426  //
427  // Final check/merge for close vertices
428  //
429  double minDistVV = minVrtVrtDist( wrkVrtSet.get(), foundV1, foundV2); //recalculate VV distances
430  while ( minDistVV < m_vertexMergeCut) {
431  if(foundV1<foundV2) std::swap(foundV1, foundV2);
432 
433  double probV = 0.;
434  if(xAODwrk) probV = mergeAndRefitVertices(wrkVrtSet.get(), foundV1, foundV2, newvrt, xAODwrk->listJetTracks, *state);
435 
436  if(probV>probVrtMergeLimit && newvrt.vertexMom.M()<c_vrtBCMassLimit){
437  // Good merged vertex found
438  double tstDst = jetProjDist(newvrt.vertex, primVrt, jetDir);
439  if(tstDst>0.){
440  // only positive vertex directions are accepted as merging result
441  std::swap((*wrkVrtSet)[foundV1],newvrt);
442  (*wrkVrtSet)[foundV1].projectedVrt = tstDst;
443  (*wrkVrtSet)[foundV2].Good = false; //Drop vertex
444  (*wrkVrtSet)[foundV2].selTrk.clear(); //Clean dropped vertex
445  }
446  }
447 
448  (*wrkVrtSet)[foundV1].nCloseVrt = -1;
449  (*wrkVrtSet)[foundV1].dCloseVrt = 1000000.; //For minVrtVrtDistNext optimisation(!)
450  (*wrkVrtSet)[foundV2].nCloseVrt = -1;
451  (*wrkVrtSet)[foundV2].dCloseVrt = 1000000.; //Exclude given pair
452  minDistVV = minVrtVrtDistNext(wrkVrtSet.get(), foundV1, foundV2);
453  }
454 
455  //
456  // Try to improve vertices with big Chi2 if something went wrong. Just precaution.
457  for(unsigned int iv=0; iv<wrkVrtSet->size(); iv++) {
458  WrkVrt vert_i = (*wrkVrtSet)[iv];
459  if(!vert_i.Good) continue; //don't work on vertex which is already bad
460  if( vert_i.selTrk.size()<3 ) continue;
461 
462  double tmpProb = TMath::Prob( vert_i.chi2, 2*vert_i.selTrk.size()-3 ); //Chi2 of the original vertex
463  if(tmpProb<0.001){
464  if(xAODwrk) tmpProb = improveVertexChi2(wrkVrtSet.get(), iv, xAODwrk->listJetTracks, *state, false);
465  if(tmpProb<0.001) vert_i.Good = false;
466  vert_i.projectedVrt = jetProjDist(vert_i.vertex, primVrt, jetDir);
467  }
468  }
469 
470  // Final vertex selection/cleaning
471  state = m_fitSvc->makeState();
472 
473  //--------- Start with 1-track vertices
474  //=First check if the track was detached from a multitrack vertex. If so - reattach.
475  for(auto &ntrVrt : (*wrkVrtSet)){
476  if(!ntrVrt.Good || ntrVrt.selTrk.size()<=1) continue;
477 
478  for(auto &onetVrt : (*wrkVrtSet)){
479  if(!onetVrt.Good || onetVrt.selTrk.size()!=1) continue;
480 
481  if(ntrVrt.detachedTrack==onetVrt.selTrk[0]){
482  WrkVrt newV(ntrVrt);
483  newV.selTrk.push_back(ntrVrt.detachedTrack);
484  double vProb = 0.;
485  if(xAODwrk) vProb = refitVertex(newV, xAODwrk->listJetTracks, *state, true);
486  if(vProb>probVrtMergeLimit){
487  onetVrt.Good=false;
488  ntrVrt=newV;
489  ntrVrt.detachedTrack=-1;
490  }
491  break;
492  }
493  }
494  }
495 
496  //=Recheck if the track was detached from a 2track vertex. If so - reattach.
497  for(auto &iVrt : (*wrkVrtSet)){
498  if(!iVrt.Good || iVrt.selTrk.size()!=1) continue;
499 
500  for(auto &jVrt : (*wrkVrtSet)){
501  if(!jVrt.Good || jVrt.selTrk.size()!=1) continue;
502 
503  if(iVrt.detachedTrack==jVrt.selTrk[0]){
504  WrkVrt newV(iVrt);
505  newV.selTrk.push_back(iVrt.detachedTrack);
506  double vProb = 0.;
507  if(xAODwrk) vProb = refitVertex(newV, xAODwrk->listJetTracks, *state, true);
508  if(vProb>probVrtMergeLimit){
509  jVrt.Good = false;
510  iVrt = newV;
511  iVrt.detachedTrack = -1;
512  }
513  break;
514  }
515  }
516 
517  }
518 
519 
520  for(auto &ntrVrt : (*wrkVrtSet)){
521  if(!ntrVrt.Good || ntrVrt.selTrk.size()<=1) continue;
522 
523  for(auto tr : ntrVrt.selTrk){
524  for(auto &onetVrt : (*wrkVrtSet)){
525  if(!onetVrt.Good || onetVrt.selTrk.size()!=1) continue;
526 
527  if(onetVrt.detachedTrack==tr){
528  WrkVrt newV(ntrVrt);
529  newV.selTrk.push_back(onetVrt.selTrk[0]);
530  double vProb = 0.;
531  if(xAODwrk) vProb = refitVertex( newV, xAODwrk->listJetTracks, *state, true);
532  if(vProb>probVrtMergeLimit){
533  onetVrt.Good = false;
534  ntrVrt = newV;
535  }
536  }
537 
538  }
539  }
540 
541  } // end for(auto &ntrVrt : (*wrkVrtSet))
542 
543 
544  for(auto & curVrt : (*wrkVrtSet) ) {
545  if(!curVrt.Good ) continue; //don't work on vertex which is already bad
546  if( std::abs(curVrt.vertex.z())>650. ){
547  curVrt.Good = false;
548  continue;
549  } //vertex outside Pixel det. For ALL vertices
550  if(curVrt.selTrk.size() != 1) continue;
551 
552  curVrt.Good = false; // Make them bad by default
553 
555  // 1track vertices left unassigned from good 2tr vertices
556  double Signif3D = 0.;
557  vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, Signif3D); //VK non-projected Signif3D is worse
558  double tmpProb = TMath::Prob(curVrt.chi2, 1); //Chi2 of the original 2tr vertex
559 
560  bool trkGood = false;
561  if(xAODwrk) trkGood = check1TrVertexInPixel(xAODwrk->listJetTracks[curVrt.selTrk[0]], curVrt.vertex, curVrt.vertexCov);
562 
563  if(trkGood && tmpProb>0.01){
564  // accept only good tracks coming from good 2tr vertex
565  std::vector<double> Impact,ImpactError;
566  double Signif3DP = 0;
567  if(xAODwrk) Signif3DP = m_fitSvc->VKalGetImpact(xAODwrk->listJetTracks[curVrt.selTrk[0]], primVrt.position(), 1, Impact, ImpactError, *state);
568 
569  if(m_fillHist && curVrt.vertex.perp()>20.){
570  Hists& h = getHists();
571  h.m_hb_diffPS->Fill(Signif3DP, evtWgt);
572  }
573 
574  if(Signif3DP>2.*m_trkSigCut && Signif3D>m_sel2VrtSigCut) curVrt.Good = true; // accept only tracks which are far from primary vertex
575  }
576 
577  }
578 
579  } // end for(auto & curVrt : (*wrkVrtSet) )
580 
581 
582  for(auto& curVrt : (*wrkVrtSet)){
583  if(!curVrt.Good ) continue; //don't work on vertex which is already bad
584  int nth = curVrt.selTrk.size();
585  if(nth==1) continue; // 1track vertices are treated already
586 
587  double Signif3D = 0.;
588  vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, Signif3D); //VK non-projected Signif3D is worse
589  if(xAODwrk) xAODwrk->tmpListTracks.resize(nth);
590 
591  for(int i = 0; i < nth; i++) {
592  if(xAODwrk) xAODwrk->tmpListTracks[i] = xAODwrk->listJetTracks[curVrt.selTrk[i]];
593  }
594  curVrt.Good = false; // Make all vertices bad for futher selection
595 
596  if(nth <= 1) continue; // Definitely bad vertices
597  if(curVrt.projectedVrt<0.) continue; // Remove vertices behind primary one
598 
599  if(TMath::Prob( curVrt.chi2, 2*nth-3)<0.001) continue; // Bad Chi2 of refitted vertex
600 
601  if(nth==2 && xAODwrk){
602  // Check track pixel hit patterns vs vertex position.
604  if(!check2TrVertexInPixel(xAODwrk->tmpListTracks[0],xAODwrk->tmpListTracks[1],curVrt.vertex,curVrt.vertexCov))continue;
605  }
606 
607  // Check track first measured points vs vertex position.
609  float ihitR = xAODwrk->tmpListTracks[0]->radiusOfFirstHit();
610  float jhitR = xAODwrk->tmpListTracks[1]->radiusOfFirstHit();
611  float vrErr = vrtRadiusError(curVrt.vertex, curVrt.vertexCov);
612  if(std::abs(ihitR-jhitR)>25.) continue; // Hits in different pixel layers
613  if(curVrt.vertex.perp()-std::min(ihitR,jhitR) > 2.*vrErr) continue; // Vertex is behind hit in pixel
614  }
615 
616  }
617 
618  //--- Check interactions on pixel layers
619  if(m_fillHist && nth==2){
620  Hists& h = getHists();
621  h.m_hb_r2d->Fill(curVrt.vertex.perp(), evtWgt);
622  }
623 
625  double xvt = curVrt.vertex.x();
626  double yvt = curVrt.vertex.y();
627  double zvt = curVrt.vertex.z();
628  double Rvt = std::hypot(xvt,yvt);
629  int bin = m_ITkPixMaterialMap->FindBin(zvt,Rvt);
630  if(m_ITkPixMaterialMap->GetBinContent(bin)>0) continue;
631  }
632 
633  if(m_fillHist && nth==2){
634  Hists& h = getHists();
635  h.m_hb_r2d->Fill(curVrt.vertex.perp(), evtWgt);
636  }
637 
638  //--- Check V0s and conversions
639  if(nth==2 && curVrt.vertexCharge==0 && curVrt.detachedTrack<0){
640  double mass_PiPi = curVrt.vertexMom.M();
641  double mass_PPi = massV0(curVrt.trkAtVrt,m_massP,m_massPi);
642  double mass_EE = massV0(curVrt.trkAtVrt,m_massE,m_massE);
643  if(m_fillHist){
644  Hists& h = getHists();
645  h.m_hb_massPiPi->Fill(mass_PiPi, evtWgt);
646  h.m_hb_massPPi ->Fill(mass_PPi, evtWgt);
647  if(curVrt.vertex.perp()>20.) h.m_hb_massEE->Fill(mass_EE, evtWgt);
648  }
649 
650  if(std::abs(mass_PiPi-m_massK0) < 22.) continue;
651  if(std::abs(mass_PPi-m_massLam) < 8.) continue;
652  if(mass_EE < 60. && curVrt.vertex.perp() > 20.) continue;
653  }
654 
655  if(m_fillHist){
656  Hists& h = getHists();
657  h.m_hb_sig3DTot->Fill(Signif3D, evtWgt);
658  }
659  if(Signif3D<m_sel2VrtSigCut)continue; //Main PV-SV distance quality cut
660 
661  curVrt.Good = true; // Vertex is absolutely good
662 
663  } // end for(auto& curVrt : (*wrkVrtSet))
664 
665  //--Final cleaning of the 1-track vertices set. Must be behind all other cleanings.
666  if(m_multiWithOneTrkVrt) clean1TrVertexSet(wrkVrtSet.get());
667 
668  //Checks
669  int n2trVrt = 0; // N of vertices with 2 tracks
670  int nNtrVrt = 0; // N vertices with 3 and more tracks
671  int ngoodVertices = 0; // Final number of good vertices
672  std::vector<WrkVrt> goodVertices(0);
673 
674  for(auto & iv : (*wrkVrtSet)) {
675  int nth = iv.selTrk.size();
676  if(nth == 0) continue; // Definitely bad vertices
677 
678  if(iv.Good){
679  ngoodVertices++;
680  goodVertices.emplace_back(iv);
681  if(nth==2) n2trVrt++;
682  if(nth>=3) nNtrVrt++;
683  }
684  }
685 
686  if(ngoodVertices == 0 || (n2trVrt+nNtrVrt)==0){ // No good vertices at all
687  return finalVertices;
688  }
689 
690  //sorting
691  while(1){
692  bool swapDone = false; // Sort on XY distance from (0.,0.)
693  for(unsigned int iv = 0; iv<goodVertices.size()-1; iv++) {
694  if(goodVertices[iv].vertex.perp() > goodVertices[iv+1].vertex.perp()){
695  std::swap( goodVertices[iv], goodVertices[iv+1] );
696  swapDone = true;
697  }
698  }
699  if(!swapDone) break;
700  }
701 
702  while(1){
703  bool swapDone = false; // Then sort on Projected dist if R<20.
704  for(unsigned int iv = 0; iv<goodVertices.size()-1; iv++) {
705  if(goodVertices[iv+1].vertex.perp() > 400.) continue;
706  if(goodVertices[iv].projectedVrt > goodVertices[iv+1].projectedVrt){
707  std::swap( goodVertices[iv], goodVertices[iv+1] );
708  swapDone = true;
709  }
710  }
711  if(!swapDone) break;
712  }
713 
714  if(ngoodVertices>1){
715  if( goodVertices[1].vertexMom.M()-goodVertices[0].vertexMom.M() > 5000.){
716  std::swap( goodVertices[0], goodVertices[1] );
717  }
718  }
719 
720  if(m_fillHist){
721  Hists& h = getHists();
722  h.m_hb_distVV->Fill(minVrtVrtDist(wrkVrtSet.get(), foundV1, foundV2), evtWgt);
723  }
724 
725 
726  //----------------------------------------------------------------------------------
727  // Nonused tracks for one-track-vertex search
728  //
729  // VK - It tries to recover tracks which were already rejected on previous stages of algorithm.
730 
731  std::vector<int> nonusedTrk(0);
732  for(int trk=0; trk<nTracks; trk++){
733  bool present = false;
734 
735  for(const auto& iv : (*wrkVrtSet)){
736  if(iv.Good){
737  for(auto t_in_V : iv.selTrk){
738  if(trk==t_in_V){
739  present = true;
740  break;
741  }
742  }
743  }
744  if(present) break;
745  }
746 
747  if(!present) nonusedTrk.push_back(trk);
748  }
749 
750  struct MatchedSV{int indVrt; double Signif3D;};
751  std::vector<MatchedSV> matchSV(0);
752 
753  for(const auto& i_trk : nonusedTrk){
754  MatchedSV tmpV = {0, 1.e9};
755 
756  for(unsigned int iv = 0; iv<goodVertices.size(); iv++){
757  //--Find vertex closest to the given track
758  if(!goodVertices[iv].Good) continue;
759  if(goodVertices[iv].selTrk.size()<2) continue;
760  if(vrtVrtDist(primVrt, goodVertices[iv].vertex, goodVertices[iv].vertexCov, jetDir) < 10.) continue; //--Too close to PV
761 
762  double Signif = 0.;
763  std::vector<double> Impact, ImpactError;
764  if(xAODwrk) Signif = m_fitSvc->VKalGetImpact(xAODwrk->listJetTracks[i_trk], goodVertices[iv].vertex, 1, Impact, ImpactError, *state);
765  if(Signif<tmpV.Signif3D){
766  tmpV.Signif3D = Signif;
767  tmpV.indVrt=iv;
768  }
769  }
770 
771  matchSV.push_back(tmpV);
772  }
773 
774  for(int iv = 0; iv<static_cast<int>(goodVertices.size()); iv++){
775  WrkVrt newV(goodVertices[iv]);
776  bool addedT = false;
777  std::map<double,int> addTrk;
778 
779  for(unsigned int it = 0; it<nonusedTrk.size(); it++){
780  if(matchSV[it].indVrt==iv) addTrk[matchSV[it].Signif3D]=it;
781  }
782 
783  std::map<double,int>::iterator atrk=addTrk.begin();
784  if(!addTrk.empty()){
785  if(atrk->first<4.){
786  newV.selTrk.push_back(nonusedTrk[atrk->second]);
787  addedT=true;
788  }
789  }
790 
791  if(addTrk.size()>1){
792  ++atrk;
793  if(atrk->first<4.){
794  newV.selTrk.push_back(nonusedTrk[atrk->second]);
795  }
796  }
797 
798  if(addedT){
799  double vProb = 0.;
800  if(xAODwrk) vProb = refitVertex(newV, xAODwrk->listJetTracks, *state, true);
801  if(vProb>0.01) goodVertices[iv] = newV;
802  else{
803  std::vector<WrkVrt> TestVertices(1,newV);
804  if(xAODwrk) vProb = improveVertexChi2(&TestVertices, 0, xAODwrk->listJetTracks, *state, true);
805  if(vProb>0.01) goodVertices[iv] = TestVertices[0];
806  }
807  }
808 
809  } // end for(unsigned int iv)
810 
811 
812  //-------------------------------------------
813  // Saving and final cleaning
814  //
815  int ngoodVertices_final = 0; // Final number of good vertices
816  int n1trVrt = 0; // Final number of good 1-track vertices
817  TLorentzVector vertexMom;
818  bool isPrimaryVertex = true;
819 
820  for(auto& vrt : goodVertices){
821  int nth = vrt.selTrk.size();
822  if(xAODwrk) xAODwrk->tmpListTracks.clear();
823 
824  for(int i = 0; i < nth; i++) {
825  int j = vrt.selTrk[i]; // Track number
826  if(xAODwrk) xAODwrk->tmpListTracks.push_back( xAODwrk->listJetTracks[j] );
827  }
828 
829  if( m_fillHist ){
830  Hists& h = getHists();
831  if(nth==1) h.m_hb_r1dc->Fill(vrt.vertex.perp(), evtWgt);
832  if(nth==2) h.m_hb_r2dc->Fill(vrt.vertex.perp(), evtWgt);
833  if(nth==3) h.m_hb_r3dc->Fill(vrt.vertex.perp(), evtWgt);
834  if(nth> 3) h.m_hb_rNdc->Fill(vrt.vertex.perp(), evtWgt);
835  double Signif3D = vrtVrtDist(primVrt, vrt.vertex, vrt.vertexCov, jetDir);
836 
837  if(nth==2){
838  if(vrt.vertexCharge==0) h.m_hb_totmass2T1->Fill(vrt.vertexMom.M(), evtWgt);
839  else h.m_hb_totmass2T2->Fill(vrt.vertexMom.M(), evtWgt);
840  h.m_hb_sig3D2tr->Fill(Signif3D , evtWgt);
841  if(vrt.vertexCharge==0) h.m_hb_totmassEE->Fill(massV0(vrt.trkAtVrt, m_massE, m_massE), evtWgt);
842 
843  }
844  else if(vrt.vertexMom.M()>6000.) h.m_hb_sig3D1tr->Fill(Signif3D, evtWgt);
845  else h.m_hb_sig3DNtr->Fill(Signif3D, evtWgt);
846  }
847 
848  // xAOD::Vertex creation-----------------------------
849  xAOD::Vertex * tmpVertex=new (std::nothrow) xAOD::Vertex();
850  if(!tmpVertex){ //Premature stop due memory allocation failure
851  return finalVertices;
852  }
853  tmpVertex->makePrivateStore();
854  tmpVertex->setPosition(vrt.vertex);
855 
856  std::vector<float> floatErrMtx;
857  floatErrMtx.resize(6);
858  for(int i = 0; i<6; i++) floatErrMtx[i] = vrt.vertexCov[i];
859  tmpVertex->setCovariance(floatErrMtx);
860 
861  tmpVertex->setFitQuality(vrt.chi2, (float)(nth*2-3));
862 
863  std::vector<Trk::VxTrackAtVertex> & tmpVTAV = tmpVertex->vxTrackAtVertex();
864  tmpVTAV.clear();
865 
866  for(int ii = 0; ii<nth; ii++) {
867  AmgSymMatrix(5) CovMtxP;
868  CovMtxP.setIdentity();
869  Trk::Perigee * tmpMeasPer = new Trk::Perigee( 0., 0.,
870  vrt.trkAtVrt[ii][0],
871  vrt.trkAtVrt[ii][1],
872  vrt.trkAtVrt[ii][2],
873  Trk::PerigeeSurface(vrt.vertex),
874  std::move(CovMtxP) );
875  tmpVTAV.emplace_back( 1., tmpMeasPer );
876 
877  if(xAODwrk){
879  TEL.setElement( xAODwrk->tmpListTracks[ii] );
880  const xAOD::TrackParticleContainer* cont = (const xAOD::TrackParticleContainer* ) (xAODwrk->tmpListTracks[ii]->container() );
881  TEL.setStorableObject(*cont);
882  tmpVertex->addTrackAtVertex(TEL,1.);
883  }
884  }
885 
886  finalVertices.push_back(tmpVertex);
887  ngoodVertices_final++;
888  if(nth==1) n1trVrt++;
889 
890  if(isPrimaryVertex && m_multiWithPrimary ){ // skip primary vertex if present
891  isPrimaryVertex = false; // for next vertices in the loop
892  continue;
893  }
894 
895  vertexMom += vrt.vertexMom;
896 
897  } // end for(const auto& vrt : goodVertices)
898 
899  if(m_fillHist){
900  Hists& h = getHists();
901  h.m_hb_goodvrtN->Fill(ngoodVertices_final+0.1, evtWgt);
902  h.m_curTup->ewgt = evtWgt;
903  if(n1trVrt) h.m_hb_goodvrtN->Fill(n1trVrt+15., evtWgt);
904  fillNVrtNTup(goodVertices, trkScore, primVrt, jetDir);
905  }
906 
907  if(ngoodVertices_final==0){
908  return finalVertices;
909  }
910 
911  //-----------------------------------------------------------------------------------
912  // Saving of results
913  //
914  //
915  double totMass = vertexMom.M();
916  results.push_back(totMass); //1st
917  double eRatio = vertexMom.E()/momentumJet.E();
918  results.push_back(eRatio<1. ? eRatio : 1.); //2nd
919  results.push_back(vrt2TrackNumber); //3rd
920  results.push_back(nTracks); //4th
921  if(xAODwrk) results.push_back(xAODwrk->listSecondTracks.size()); //5th
922  results.push_back(0.); //6th - not clear what to use here -> return 0.
923  results.push_back(momentumJet.E()); //7th
924 
925  if(m_fillHist){
926  Hists& h = getHists();
927  h.m_hb_ratio->Fill( results[1], evtWgt);
928  h.m_hb_totmass->Fill( results[0], evtWgt);
929  h.m_hb_nvrt2->Fill( results[2], evtWgt);
930  h.m_hb_mom->Fill( momentumJet.Perp(), evtWgt);
931  }
932 
933  return finalVertices;
934 
935 }

◆ improveVertexChi2()

template<class Particle >
double InDet::InDetVKalVxInJetTool::improveVertexChi2 ( std::vector< WrkVrt > *  WrkVrtSet,
int  V,
std::vector< const Particle * > &  AllTracks,
Trk::IVKalState istate,
bool  ifCovV0 
) const
private

Definition at line 1512 of file BTagVrtSecMulti.cxx.

1516  {
1517  WrkVrt vrt = (*wrkVrtSet)[V];
1518  int NTrk = vrt.selTrk.size();
1519  if( NTrk<2 ) return 0.;
1520 
1521  double Prob=TMath::Prob(vrt.chi2, 2*NTrk-3);
1522  //----Start track removal iterations
1523  while(Prob<0.01){
1524  NTrk = vrt.selTrk.size();
1525  if(NTrk==2) return Prob;
1526 
1527  int SelT = -1;
1528  double Chi2Max = 0.;
1529  for(int i = 0; i<NTrk; i++){
1530  double Chi2 = vrt.chi2PerTrk[i];
1531  if(Chi2>Chi2Max){
1532  Chi2Max = Chi2;
1533  SelT = i;
1534  }
1535  }
1536 
1537  if (SelT<0) return 0;
1538  vrt.detachedTrack=vrt.selTrk[SelT];
1539  vrt.selTrk.erase( vrt.selTrk.begin() + SelT ); //remove track
1540  StatusCode sc = refitVertex(wrkVrtSet, V, AllTrackList, istate, ifCovV0);
1541  if(sc.isFailure()) return 0.;
1542 
1543  Prob = TMath::Prob(vrt.chi2, 2*(NTrk-1)-3);
1544  }
1545  return Prob;
1546  }

◆ initialize()

StatusCode InDet::InDetVKalVxInJetTool::initialize ( )

Definition at line 43 of file InDetVKalVxInJetTool.cxx.

43  {
44  ATH_MSG_DEBUG("InDetVKalVxInJetTool initialize() called");
45 
47  ATH_CHECK(m_trackClassificator.retrieve( DisableTool{!m_useTrackClassificator} ));
48  if(!m_useTrackClassificator) ATH_MSG_DEBUG("TrackClassificator disabled");
49 
50  m_useEtaDependentCuts = !(m_etaDependentCutsSvc.name().empty());
52  ATH_CHECK(m_etaDependentCutsSvc.retrieve());
53  ATH_MSG_DEBUG("Using InDetEtaDependentCutsSvc. Individual inclusive track selections from config not used");
54  }
55  else{
56  ATH_MSG_DEBUG("Using individual inclusive track selections from config");
57  }
58 
59  if (m_fitter.retrieve().isFailure()) {
60  if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG) << "Could not find Trk::TrkVKalVrtFitter" << endmsg;
61  return StatusCode::SUCCESS;
62  } else {
63  if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG) << "InDetVKalVxInJetTool TrkVKalVrtFitter found" << endmsg;
64  }
65  m_fitSvc = dynamic_cast<Trk::TrkVKalVrtFitter*>(&(*m_fitter));
66  if(!m_fitSvc){
67  if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<" No implemented Trk::ITrkVKalVrtFitter interface" << endmsg;
68  return StatusCode::SUCCESS;
69  }
70 
72  //------------------------------------------
73  if(msgLvl(MSG::DEBUG)) ATH_CHECK(m_timingProfile.retrieve());
74 //------------------------------------------
75 // Chose whether IBL is installed
76  if(m_existIBL){ // 4-layer pixel detector
77  if( m_beampipeR==0.) m_beampipeR=24.0;
78  if( m_rLayerB ==0.) m_rLayerB =34.0;
79  if( m_rLayer1 ==0.) m_rLayer1 =51.6;
80  if( m_rLayer2 ==0.) m_rLayer2 =90.0;
81  m_rLayer3 =122.5;
82  } else { // 3-layer pixel detector
83  if( m_beampipeR==0.) m_beampipeR=29.4;
84  if( m_rLayerB ==0.) m_rLayerB =51.5;
85  if( m_rLayer1 ==0.) m_rLayer1 =90.0;
86  if( m_rLayer2 ==0.) m_rLayer2 =122.5;
87  }
88 
89  if(m_fillHist){
91  ATH_MSG_FATAL("Filling histograms not supported in MT jobs.");
92  return StatusCode::FAILURE;
93  }
94 
95  SmartIF<ITHistSvc> hist_root{Gaudi::svcLocator()->service("THistSvc")};
96  ATH_CHECK(hist_root.isValid());
97  ATH_MSG_DEBUG( "InDetVKalVxInJetTool Histograms found" );
98 
99  std::string histDir;
100  if(m_multiVertex) histDir="/file1/stat/MSVrtInJet"+name()+"/";
101  else histDir="/file1/stat/SVrtInJet"+name()+"/";
102  m_h = std::make_unique<Hists>();
103  ATH_CHECK( m_h->book (*hist_root, histDir) );
104 
105 //-------------------------------------------------------
106  }
107 
108  if(!m_multiVertex)m_multiWithPrimary = false;
109 
110  if(m_getNegativeTag){
111  if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Negative TAG is requested! " << endmsg;
112  if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Not compatible with negativeTAIL option, so getNegativeTail is set to FALSE." << endmsg;
113  m_getNegativeTail=false;
114  }
115 
116  for(int ntv=2; ntv<=10; ntv++) m_chiScale[ntv]=TMath::ChisquareQuantile(0.9,2.*ntv-3.)/ntv;
117  m_chiScale[0]=m_chiScale[2];
118  for(int ntv=2; ntv<=10; ntv++) m_chiScale[ntv]/=m_chiScale[0];
119 
120  if(m_RobustFit>7)m_RobustFit=7;
121  if(m_RobustFit<0)m_RobustFit=0;
122 
124 
125  ATH_CHECK(detStore()->retrieve(m_beamPipeMgr, "BeamPipe"));
126  ATH_CHECK(detStore()->retrieve(m_pixelManager, "ITkPixel"));
127 
128  InDetMaterialVeto matVeto(m_beamPipeMgr, m_pixelManager);
129 
130  m_ITkPixMaterialMap = matVeto.ITkPixMaterialMap();
131 
132  }
133 
134  return StatusCode::SUCCESS;
135 
136  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ insideMatLayer()

bool InDet::InDetVKalVxInJetTool::insideMatLayer ( float  xvt,
float  yvt 
) const
private

Definition at line 109 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

110  {
111  float R = std::hypot(xvt, yvt);
112  if(m_existIBL){ // 4-layer pixel detector
113  if( std::abs(R-m_beampipeR)< 1.0) return true; // Beam Pipe removal
114  if( std::abs(R-m_rLayerB) < 2.5) return true;
115  if( std::abs(R-m_rLayer1) < 3.0) return true;
116  if( std::abs(R-m_rLayer2) < 3.0) return true;
117  }else{ // 3-layer pixel detector
118  if( std::abs(R-m_beampipeR)< 1.5) return true; // Beam Pipe removal
119  if( std::abs(R-m_rLayerB) < 3.5) return true;
120  if( std::abs(R-m_rLayer1) < 4.0) return true;
121  if( std::abs(R-m_rLayer2) < 5.0) return true;
122  }
123  return false;
124  }

◆ interfaceID()

static const InterfaceID& InDet::ISecVertexInJetFinder::interfaceID ( )
inlinestaticinherited

Definition at line 58 of file ISecVertexInJetFinder.h.

59  {
60  return IID_ISecVertexInJetFinder;
61  };

◆ isPart()

bool InDet::InDetVKalVxInJetTool::isPart ( std::deque< long int >  test,
std::deque< long int >  base 
)
staticprivate

Definition at line 1596 of file BTagVrtSecMulti.cxx.

1597  {
1598  std::deque<long int>::iterator trk = test.begin();
1599  for(trk = test.begin(); trk!=test.end(); ++trk){
1600  if(std::find(base.begin(), base.end(), (*trk)) == base.end()) return false; //element not found => test is not part of base
1601  }
1602  return true;
1603  }

◆ jetProjDist()

double InDet::InDetVKalVxInJetTool::jetProjDist ( Amg::Vector3D SecVrt,
const xAOD::Vertex primVrt,
const TLorentzVector &  JetDir 
)
staticprivate

Definition at line 1605 of file BTagVrtSecMulti.cxx.

1606  {
1607  Amg::Vector3D vv = SecVrt-primVrt.position();
1608  return ( vv.x()*jetDir.X()+vv.y()*jetDir.Y()+vv.z()*jetDir.Z() )/ jetDir.P();
1609  }

◆ makeVrtCovMatrix()

Amg::MatrixX InDet::InDetVKalVxInJetTool::makeVrtCovMatrix ( std::vector< double > &  ErrorMatrix)
staticprivate

Definition at line 511 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

513  {
514  Amg::MatrixX vrtCovMtx(3,3);
515  vrtCovMtx(0,0) = errorMatrix[0];
516  vrtCovMtx(0,1) = vrtCovMtx(1,0) = errorMatrix[1];
517  vrtCovMtx(1,1) = errorMatrix[2];
518  vrtCovMtx(0,2) = vrtCovMtx(2,0) = errorMatrix[3];
519  vrtCovMtx(1,2) = vrtCovMtx(2,1) = errorMatrix[4];
520  vrtCovMtx(2,2) = errorMatrix[5];
521  return vrtCovMtx;
522  }

◆ massV0()

double InDet::InDetVKalVxInJetTool::massV0 ( std::vector< std::vector< double > > &  trkAtVrt,
double  massP,
double  massPi 
)
staticprivate

Definition at line 292 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

295  {
296  double ap1=1./std::abs(trkAtVrt[0][2]);
297  double ap2=1./std::abs(trkAtVrt[1][2]);
298  CxxUtils::sincos phi1 (trkAtVrt[0][0]);
299  CxxUtils::sincos theta1(trkAtVrt[0][1]);
300  CxxUtils::sincos phi2 (trkAtVrt[1][0]);
301  CxxUtils::sincos theta2(trkAtVrt[1][1]);
302  double px = phi1.cs*theta1.sn*ap1
303  + phi2.cs*theta2.sn*ap2;
304  double py = phi1.sn*theta1.sn*ap1
305  + phi2.sn*theta2.sn*ap2;
306  double pz = theta1.cs*ap1
307  + theta2.cs*ap2;
308  double ee= (ap1 > ap2) ?
309  (std::sqrt(ap1*ap1+massP*massP)+std::sqrt(ap2*ap2+massPi*massPi)):
310  (std::sqrt(ap2*ap2+massP*massP)+std::sqrt(ap1*ap1+massPi*massPi));
311  double test=(ee-pz)*(ee+pz)-px*px-py*py;
312  return test>0 ? std::sqrt(test) : 0.;
313  }

◆ MaxOfShared()

double InDet::InDetVKalVxInJetTool::MaxOfShared ( std::vector< WrkVrt > *  WrkVrtSet,
std::vector< std::deque< long int > > *  trkInVrt,
long int &  selectedTrack,
long int &  selectedVertex 
)
staticprivate

Definition at line 1100 of file BTagVrtSecMulti.cxx.

1105  {
1106  long int NTrack = TrkInVrt->size();
1107  double MaxOf = -999999999, SelectedProb = -1.;
1108  int NShareMax = 0;
1109  for(const auto& trk : (*TrkInVrt)){
1110  int NVrt = trk.size(); // Number of vertices for this track
1111  if(NVrt > NShareMax) NShareMax=NVrt;
1112  }
1113  if(NShareMax<=1) return MaxOf; // No shared tracks
1114 
1115  for(int it = 0; it<NTrack; it++) {
1116  int NVrt = (*TrkInVrt)[it].size(); // Number of vertices for this track
1117  if( NVrt <= 1 ) continue; // Should ALWAYS be checked for safety
1118  if( NVrt < NShareMax ) continue; // Not a shared track with maximal sharing
1119 
1120  int N2trVrt = 0;
1121  for(auto &vrtn : (*TrkInVrt)[it] ){
1122  if((*wrkVrtSet).at(vrtn).selTrk.size()==2) N2trVrt++;
1123  } //count number of 2-track vertices
1124 
1125  for(const auto& VertexNumber : (*TrkInVrt)[it]){
1126  WrkVrt vrt = (*wrkVrtSet).at(VertexNumber);
1127  if(!vrt.Good) continue;
1128  int NTrkInVrt = vrt.selTrk.size();
1129  if( NTrkInVrt <= 1) continue; // one track vertex - nothing to do
1130  if(N2trVrt>0 && N2trVrt<NShareMax && NTrkInVrt>2) continue; // Mixture of multi-track and 2-track vrts. Skip multi-track then.
1131 
1132  for(int itmp = 0; itmp<NTrkInVrt; itmp++){
1133  if( vrt.selTrk[itmp] == it ) { // Track found.
1134  double Chi2Red = vrt.chi2PerTrk.at(itmp); // Normal Chi2 seems the best
1135  if(NTrkInVrt==2){
1136  Chi2Red = vrt.chi2/2.; //VK 2track vertices with Normal Chi2Red
1137  if(vrt.vertexMom.M()>c_vrtBCMassLimit) Chi2Red = 100.; //VK break immediately very heavy 2tr vertices
1138  }
1139 
1140  double prob_vrt = TMath::Prob(vrt.chi2, 2*vrt.selTrk.size()-3);
1141  if( MaxOf < Chi2Red ){
1142  if(MaxOf>0 && prob_vrt>0.01 && SelectedProb<0.01) continue; // Don't disassemble good vertices if a bad one is present
1143  MaxOf = Chi2Red;
1144  selectedTrack = it;
1145  selectedVertex = VertexNumber;
1146  SelectedProb = prob_vrt;
1147  }
1148  }
1149  }
1150 
1151  } // end for(const auto& VertexNumber)
1152 
1153  } // end for(int it = 0; it<NTrack; it++)
1154 
1155  //-- Additional check for a common track in 2tr-2tr/Ntr vertex topology
1156  if( (*TrkInVrt)[selectedTrack].size() == 2){
1157  int v1 = (*TrkInVrt)[selectedTrack][0];
1158  int v2 = (*TrkInVrt)[selectedTrack][1];
1159  WrkVrt vrt1 = (*wrkVrtSet)[v1];
1160  WrkVrt vrt2 = (*wrkVrtSet)[v2];
1161  double prb1 = TMath::Prob(vrt1.chi2, 2*vrt1.selTrk.size()-3);
1162  double prb2 = TMath::Prob(vrt2.chi2, 2*vrt2.selTrk.size()-3);
1163  double dst1 = vrt1.projectedVrt;
1164  double dst2 = vrt2.projectedVrt;
1165 
1166  if(prb1>0.05 && prb2>0.05){
1167  if(vrt1.selTrk.size()==2 && vrt2.selTrk.size()==2){
1168  if (selectedVertex==v1 && dst2<dst1) selectedVertex = v2; // Swap to remove the closest to PV vertex
1169  else if(selectedVertex==v2 && dst1<dst2) selectedVertex = v1; // Swap to remove the closest to PV vertex
1170 
1171  double M1 = vrt1.vertexMom.M();
1172  double M2 = vrt2.vertexMom.M();
1173  if( M1>c_vrtBCMassLimit && M2<c_vrtBCMassLimit ) selectedVertex = v1;
1174  if( M1<c_vrtBCMassLimit && M2>c_vrtBCMassLimit ) selectedVertex = v2;
1175  }
1176 
1177  if( vrt1.selTrk.size()+vrt2.selTrk.size() > 4){
1178  if( vrt1.selTrk.size()==2 && dst1>dst2) selectedVertex = v2;
1179  if( vrt2.selTrk.size()==2 && dst2>dst1) selectedVertex = v1;
1180  }
1181  }
1182  }
1183 
1184  return MaxOf;
1185  }

◆ mergeAndRefitOverlapVertices()

template<class Particle >
void InDet::InDetVKalVxInJetTool::mergeAndRefitOverlapVertices ( std::vector< WrkVrt > *  WrkVrtSet,
int  V1,
int  V2,
std::vector< const Particle * > &  AllTrackLis,
Trk::IVKalState istate 
) const
private

Definition at line 1387 of file BTagVrtSecMulti.cxx.

1390  {
1391  WrkVrt vrt1 = (*wrkVrtSet)[V1];
1392  WrkVrt vrt2 = (*wrkVrtSet)[V2];
1393  if(!vrt1.Good)return; //bad vertex
1394  if(!vrt2.Good)return; //bad vertex
1395 
1396  WrkVrt newvrt;
1397  newvrt.Good = true;
1398  if( nTrkCommon( wrkVrtSet, V1, V2)<2 )return; //No overlap
1399  //- V1 should become ref. vertex. Another Vrt tracks will be added to it.
1400  if( vrt1.selTrk.size() < vrt2.selTrk.size() ) std::swap(V1,V2); //Vertex with NTrk=max is chosen
1401  else if( vrt1.selTrk.size() == vrt2.selTrk.size() ){
1402  if( vrt1.chi2 > vrt2.chi2 ) std::swap(V1,V2); // Vertex with minimal Chi2 is chosen
1403  }
1404 
1405  //- Fill base track list for new vertex
1406  newvrt.selTrk.resize( vrt1.selTrk.size() );
1407  std::copy(vrt1.selTrk.begin(), vrt1.selTrk.end(), newvrt.selTrk.begin());
1408  //- Identify non-common tracks in second vertex
1409  std::vector<int> noncommonTrk(0);
1410  for(auto &it : vrt2.selTrk){
1411  if( std::find(vrt1.selTrk.begin(), vrt1.selTrk.end(), it) == vrt1.selTrk.end() ) noncommonTrk.push_back(it);
1412  }
1413 
1414  // Try to add non-common tracks one by one
1415  std::vector<const Particle*> fitTrackList(0);
1416  std::vector<int> detachedTrk(0);
1417  StatusCode sc;
1418  WrkVrt bestVrt;
1419  bool foundMerged = false;
1420 
1421  for(auto nct : noncommonTrk){
1422  fitTrackList.clear();
1423  for(const auto& trk : newvrt.selTrk) fitTrackList.push_back( AllTrackList[trk] );
1424  fitTrackList.push_back( AllTrackList.at(nct) );
1425 
1426  m_fitSvc->setApproximateVertex(vrt1.vertex[0], vrt1.vertex[1], vrt1.vertex[2], istate);
1427  sc = VKalVrtFitBase(fitTrackList, newvrt.vertex, newvrt.vertexMom,
1428  newvrt.vertexCharge, newvrt.vertexCov,
1429  newvrt.chi2PerTrk, newvrt.trkAtVrt, newvrt.chi2,
1430  istate, false);
1431  if( sc.isFailure() || TMath::Prob(newvrt.chi2, 2*newvrt.selTrk.size()+2-3)<0.001 ) {
1432  detachedTrk.push_back(nct);
1433  continue;
1434  }
1435 
1436  newvrt.selTrk.push_back(nct); // Compatible track. Add to common vertex.
1437  bestVrt = newvrt;
1438  foundMerged = true;
1439  }
1440 
1441  if(foundMerged) vrt1=bestVrt;
1442  vrt2.Good=false;
1443 
1444  // Now detached tracks
1445  if(detachedTrk.size()>1){
1446  WrkVrt nVrt;
1447  fitTrackList.clear();
1448  nVrt.selTrk.clear();
1449 
1450  for(auto nct : detachedTrk){
1451  fitTrackList.push_back( AllTrackList[nct] );
1452  nVrt.selTrk.push_back(nct);
1453  }
1454 
1455  m_fitSvc->setApproximateVertex(vrt2.vertex[0], vrt2.vertex[1], vrt2.vertex[2], istate);
1456  sc = VKalVrtFitBase(fitTrackList, nVrt.vertex, nVrt.vertexMom,
1457  nVrt.vertexCharge, nVrt.vertexCov,
1458  nVrt.chi2PerTrk, nVrt.trkAtVrt, nVrt.chi2,
1459  istate, false);
1460  if(sc.isSuccess()) (*wrkVrtSet).push_back(nVrt);
1461 
1462  } else if( detachedTrk.size()==1 ){
1463  bool tFound = false;
1464  for( auto &vrt : (*wrkVrtSet) ){
1465  if( !vrt.Good || vrt.selTrk.size()<2 ) continue;
1466  if( std::find(vrt.selTrk.begin(), vrt.selTrk.end(), detachedTrk[0]) != vrt.selTrk.end() ) {
1467  tFound=true; break;
1468  }
1469  }
1470 
1471  if(!tFound) { //Track is not present in other vertices.
1472  double Chi2min = 1.e9;
1473  int selectedTrk = -1;
1474  WrkVrt saveVrt;
1475  fitTrackList.resize(2);
1476  fitTrackList[0]= AllTrackList[detachedTrk[0]];
1477 
1478  for(auto trk : vrt2.selTrk){
1479  if(trk==detachedTrk[0]) continue;
1480  WrkVrt nVrt;
1481  nVrt.Good = true;
1482  fitTrackList[1] = AllTrackList[trk];
1483  m_fitSvc->setApproximateVertex(vrt2.vertex[0], vrt2.vertex[1], vrt2.vertex[2], istate);
1484  sc = VKalVrtFitBase(fitTrackList, nVrt.vertex, nVrt.vertexMom,
1485  nVrt.vertexCharge, nVrt.vertexCov,
1486  nVrt.chi2PerTrk, nVrt.trkAtVrt, nVrt.chi2,
1487  istate, false);
1488  if(sc.isSuccess() && nVrt.chi2<Chi2min) {
1489  Chi2min = nVrt.chi2;
1490  saveVrt = nVrt;
1491  selectedTrk = trk;
1492  }
1493  }
1494 
1495  if(Chi2min<1.e9){
1496  saveVrt.selTrk.resize(1);
1497  saveVrt.selTrk[0] = detachedTrk[0];
1498  saveVrt.detachedTrack = selectedTrk;
1499  saveVrt.vertexMom = momAtVrt(saveVrt.trkAtVrt[0]); //redefine vertex momentum
1500  (*wrkVrtSet).push_back(saveVrt);
1501  }
1502  } // end if(!tFound)
1503 
1504  } // end else if( detachedTrk.size()==1 )
1505 
1506  }

◆ mergeAndRefitVertices()

template<class Particle >
double InDet::InDetVKalVxInJetTool::mergeAndRefitVertices ( std::vector< WrkVrt > *  WrkVrtSet,
int  V1,
int  V2,
WrkVrt newvrt,
std::vector< const Particle * > &  AllTrackList,
Trk::IVKalState istate 
) const
private

Definition at line 1338 of file BTagVrtSecMulti.cxx.

1342  {
1343  WrkVrt vrt1 = (*wrkVrtSet)[V1];
1344  WrkVrt vrt2 = (*wrkVrtSet)[V2];
1345  if(!vrt1.Good) return -1.; //bad vertex
1346  if(!vrt2.Good) return -1.; //bad vertex
1347 
1348  newvrt.Good = true;
1349  int NTrk_V1 = vrt1.selTrk.size();
1350  int NTrk_V2 = vrt2.selTrk.size();
1351  newvrt.selTrk.resize(NTrk_V1+NTrk_V2);
1352  std::copy(vrt1.selTrk.begin(), vrt1.selTrk.end(), newvrt.selTrk.begin());
1353  std::copy(vrt2.selTrk.begin(), vrt2.selTrk.end(), newvrt.selTrk.begin()+NTrk_V1);
1354 
1355  std::deque<long int>::iterator TransfEnd ;
1356  sort( newvrt.selTrk.begin(), newvrt.selTrk.end() );
1357  TransfEnd = unique( newvrt.selTrk.begin(), newvrt.selTrk.end() );
1358  newvrt.selTrk.erase( TransfEnd, newvrt.selTrk.end());
1359 
1360  std::vector<const Particle*> fitTrackList(0);
1361  for(const auto& trk : newvrt.selTrk) fitTrackList.push_back( AllTrackList[trk] );
1362 
1363  m_fitSvc->setApproximateVertex( 0.5*(vrt1.vertex[0]+vrt2.vertex[0]),
1364  0.5*(vrt1.vertex[1]+vrt2.vertex[1]),
1365  0.5*(vrt1.vertex[2]+vrt2.vertex[2]),
1366  istate);
1367 
1368  StatusCode sc=VKalVrtFitBase(fitTrackList,
1369  newvrt.vertex,
1370  newvrt.vertexMom,
1371  newvrt.vertexCharge,
1372  newvrt.vertexCov,
1373  newvrt.chi2PerTrk,
1374  newvrt.trkAtVrt,
1375  newvrt.chi2,
1376  istate,
1377  false);
1378  if( sc.isFailure() ) return -1.;
1379  if( newvrt.chi2>500. ) return -1.; //VK protection
1380  if( newvrt.chi2PerTrk.size()==2) newvrt.chi2PerTrk[0] = newvrt.chi2PerTrk[1] = newvrt.chi2/2.;
1381  return TMath::Prob(newvrt.chi2, 2*newvrt.selTrk.size()-3);
1382  }

◆ minVrtVrtDist()

double InDet::InDetVKalVxInJetTool::minVrtVrtDist ( std::vector< WrkVrt > *  WrkVrtSet,
int &  V1,
int &  V2 
) const
private

Definition at line 1263 of file BTagVrtSecMulti.cxx.

1265  {
1266  V1 = V2 = 0;
1267  for(auto& vrt : (*wrkVrtSet)){
1268  vrt.dCloseVrt = 1000000.;
1269  vrt.nCloseVrt = -1;
1270  }
1271  double foundMinVrtDst = 1000000.;
1272 
1273  for(unsigned int iv = 0; iv<wrkVrtSet->size()-1; iv++) {
1274  WrkVrt vrt_i = (*wrkVrtSet)[iv];
1275  if( vrt_i.selTrk.size()< 2) continue; // Bad vertices
1276  if(!vrt_i.Good ) continue; // Bad vertices
1277 
1278  for(unsigned int jv = iv+1; jv<wrkVrtSet->size(); jv++) {
1279  WrkVrt vrt_j = (*wrkVrtSet)[jv];
1280  if( vrt_j.selTrk.size()< 2) continue; // Bad vertices
1281  if(!vrt_j.Good ) continue; // Bad vertices
1282  double tmp = std::abs(vrt_i.vertex.x()-vrt_j.vertex.x())
1283  + std::abs(vrt_i.vertex.y()-vrt_j.vertex.y())
1284  + std::abs(vrt_i.vertex.z()-vrt_j.vertex.z());
1285  if(tmp>20.) continue;
1286 
1287  double tmpDst = vrtVrtDist(vrt_i.vertex, vrt_i.vertexCov,
1288  vrt_j.vertex, vrt_j.vertexCov);
1289  if(tmpDst < foundMinVrtDst){
1290  foundMinVrtDst = tmpDst;
1291  V1 = iv;
1292  V2 = jv;
1293  }
1294  if(tmpDst < vrt_i.dCloseVrt){
1295  vrt_i.dCloseVrt = tmpDst;
1296  vrt_i.nCloseVrt = jv;
1297  }
1298  if(tmpDst < vrt_j.dCloseVrt){
1299  vrt_j.dCloseVrt=tmpDst;
1300  vrt_j.nCloseVrt=iv;
1301  }
1302 
1303  }
1304  }
1305 
1306  return foundMinVrtDst;
1307  }

◆ minVrtVrtDistNext()

double InDet::InDetVKalVxInJetTool::minVrtVrtDistNext ( std::vector< WrkVrt > *  WrkVrtSet,
int &  V1,
int &  V2 
)
staticprivate

Definition at line 1312 of file BTagVrtSecMulti.cxx.

1313  {
1314  V1 = 0; V2 = 0;
1315  double foundMinVrtDst = 1000000.;
1316 
1317  for(unsigned int iv = 0; iv<wrkVrtSet->size()-1; iv++) {
1318  WrkVrt vrt_i = (*wrkVrtSet)[iv];
1319  if(vrt_i.selTrk.size()< 2) continue; // Bad vertex
1320  if(vrt_i.nCloseVrt==-1) continue; // Used vertex
1321 
1322  if(vrt_i.dCloseVrt<foundMinVrtDst){
1323  int vtmp = vrt_i.nCloseVrt;
1324  if((*wrkVrtSet)[vtmp].nCloseVrt==-1) continue; // Close vertex to given [iv] one is modified already
1325  foundMinVrtDst = vrt_i.dCloseVrt;
1326  V1 = iv;
1327  V2 = vtmp;
1328  }
1329  }
1330 
1331  return foundMinVrtDst;
1332  }

◆ momAtVrt()

TLorentzVector InDet::InDetVKalVxInJetTool::momAtVrt ( const std::vector< double > &  inpTrk) const
private

Definition at line 385 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

387  {
388  double api=1./std::abs(inpTrk[2]);
389  CxxUtils::sincos phi (inpTrk[0]);
390  CxxUtils::sincos theta(inpTrk[1]);
391  double px = phi.cs * theta.sn*api;
392  double py = phi.sn * theta.sn*api;
393  double pz = theta.cs*api;
394  double ee = std::sqrt( api*api + m_massPi*m_massPi);
395  return {px,py,pz,ee};
396  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ notFromBC()

int InDet::InDetVKalVxInJetTool::notFromBC ( int  PDGID)
staticprivate

Definition at line 606 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

606  {
607  int noBC=0;
608  if(PDGID<=0)return 1;
609  if(PDGID>600 && PDGID<4000)noBC=1;
610  if(PDGID<400 || PDGID>5600)noBC=1;
611  if(PDGID==513 || PDGID==523 || PDGID==533 || PDGID==543)noBC=1; //Remove tracks from B* (they are in PV)
612  if(PDGID==5114 || PDGID==5214 || PDGID==5224 || PDGID==5314 || PDGID==5324)noBC=1; //Remove tracks from B_Barions* (they are in PV)
613  //if(PDGID==413 || PDGID==423 || PDGID==433 )continue; //Keep tracks from D* (they are from B vertex)
614  //if(PDGID==4114 || PDGID==4214 || PDGID==4224 || PDGID==4314 || PDGID==4324)continue;
615  return noBC;
616  }

◆ nTrkCommon()

int InDet::InDetVKalVxInJetTool::nTrkCommon ( std::vector< WrkVrt > *  WrkVrtSet,
int  V1,
int  V2 
)
staticprivate

Definition at line 1238 of file BTagVrtSecMulti.cxx.

1241  {
1242  WrkVrt vrt1 = (*wrkVrtSet).at(V1);
1243  WrkVrt vrt2 = (*wrkVrtSet).at(V2);
1244  int NTrk_V1 = vrt1.selTrk.size(); if( NTrk_V1< 2) return 0; // Bad vertex
1245  int NTrk_V2 = vrt2.selTrk.size(); if( NTrk_V2< 2) return 0; // Bad vertex
1246 
1247  int nTrkCom = 0;
1248  if(NTrk_V1 < NTrk_V2){
1249  for(const auto& trk : vrt1.selTrk){
1250  if(std::find(vrt2.selTrk.begin(), vrt2.selTrk.end(), trk) != vrt2.selTrk.end()) nTrkCom++;
1251  }
1252  } else {
1253  for(const auto& trk : vrt2.selTrk){
1254  if( std::find(vrt1.selTrk.begin(), vrt1.selTrk.end(), trk) != vrt1.selTrk.end()) nTrkCom++;
1255  }
1256  }
1257  return nTrkCom;
1258  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printWrkSet()

void InDet::InDetVKalVxInJetTool::printWrkSet ( const std::vector< WrkVrt > *  WrkSet,
const std::string &  name 
) const
private

Definition at line 80 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

80  {
81  int nGoodV=0;
82  for(const auto & iv : *wrkVrtSet) {
83  std::ostringstream ostr1,ostr2;
84  for(long kk : iv.selTrk) {ostr1<<kk<<", ";}
85  for(int kk=0; kk<(int)iv.selTrk.size(); kk++) {ostr2<<momAtVrt(iv.trkAtVrt[kk]).Perp()<<", ";}
87  <<"= "<<iv.vertex[0]
88  <<", "<<iv.vertex[1]
89  <<", "<<iv.vertex[2]
90  <<" NTrk="<<iv.selTrk.size()
91  <<" is good="<<std::boolalpha<<iv.Good<<std::noboolalpha
92  <<" Chi2="<<iv.chi2
93  <<" Mass="<<iv.vertexMom.M()
94  <<" detached="<<iv.detachedTrack
95  <<" proj.dist="<<iv.projectedVrt
96  <<" trk="<<ostr1.str()<<" trk Pt="<<ostr2.str());
97  if(iv.Good)nGoodV++;
98  }
99  ATH_MSG_DEBUG(name<<" N="<<nGoodV);
100  }

◆ projSV_PV()

double InDet::InDetVKalVxInJetTool::projSV_PV ( const Amg::Vector3D SV,
const xAOD::Vertex PV,
const TLorentzVector &  Jet 
)
staticprivate

Definition at line 103 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

104  {
105  TVector3 SV_PV( SV.x()-PV.x(), SV.y()-PV.y(), SV.z()-PV.z() );
106  return Jet.Vect().Unit()*SV_PV.Unit();
107  }

◆ pTvsDir()

double InDet::InDetVKalVxInJetTool::pTvsDir ( const Amg::Vector3D Dir,
const std::vector< double > &  inpTrk 
)
staticprivate

Definition at line 333 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

335  {
336  double norm=std::hypot(dir.x(),dir.y(),dir.z());
337  double sx=dir.x()/norm; double sy=dir.y()/norm; double sz=dir.z()/norm;
338 
339  double px=0.,py=0.,pz=0.; double scale;
340  double api=1./std::abs(inpTrk[2]);
341  CxxUtils::sincos phi (inpTrk[0]);
342  CxxUtils::sincos theta(inpTrk[1]);
343 
344  px = phi.cs * theta.sn*api;
345  py = phi.sn * theta.sn*api;
346  pz = theta.cs*api;
347  scale = px*sx + py*sy + pz*sz;
348  px -= sx*scale;
349  py -= sy*scale;
350  pz -= sz*scale;
351  return std::hypot(px,py,pz);
352  }

◆ rankBTrk()

double InDet::InDetVKalVxInJetTool::rankBTrk ( double  TrkPt,
double  JetPt,
double  Signif 
) const
private

Definition at line 21 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

22  {
23  double p_prob=0.;
24  double s_prob=0.;
25  if(TrkPt > 0. && JetPt > 0.){
26  double coeffPt=10.;
27  double pfrac=(TrkPt-m_cutPt)/std::sqrt(JetPt);
28  p_prob= pfrac/(coeffPt+pfrac); // Old probability to be b-track
29  if (Signif == 0.) return p_prob; //should be less than some epsilon?
30  }
31  if( Signif != 0.) {
32  double coeffSig=1.0;
33  s_prob=(Signif-coeffSig)/Signif; // Old probability to be b-track
34  if(TrkPt + JetPt == 0.) return s_prob;
35  }
36  //----------------------------------Initial definition of selective variable
37  double contrib=0.4;
38  return (1.+contrib)*std::max(s_prob,0.)+(1.-contrib)*p_prob;
39  }

◆ refitVertex() [1/2]

template<class Particle >
StatusCode InDet::InDetVKalVxInJetTool::refitVertex ( std::vector< WrkVrt > *  WrkVrtSet,
int  selectedVertex,
std::vector< const Particle * > &  selectedTracks,
Trk::IVKalState istate,
bool  ifCovV0 
) const
private

Definition at line 1550 of file BTagVrtSecMulti.cxx.

1555  {
1556  WrkVrt vrt = (*wrkVrtSet)[selectedVertex];
1557  int nth = vrt.selTrk.size();
1558  if(nth<2) return StatusCode::SUCCESS;
1559 
1560  double vProb = refitVertex(vrt, selectedTracks, istate, ifCovV0);
1561  if(vProb<0) return StatusCode::FAILURE;
1562  else return StatusCode::SUCCESS;
1563  }

◆ refitVertex() [2/2]

template<class Particle >
double InDet::InDetVKalVxInJetTool::refitVertex ( WrkVrt Vrt,
std::vector< const Particle * > &  SelectedTracks,
Trk::IVKalState istate,
bool  ifCovV0 
) const
private

Definition at line 1567 of file BTagVrtSecMulti.cxx.

1571  {
1572  int nth = Vrt.selTrk.size();
1573  if(nth<2) return -1.;
1574 
1575  std::vector<const Particle*> ListTracks(0);
1576  for(const auto& j : Vrt.selTrk) ListTracks.push_back( selectedTracks[j] );
1577  Vrt.Good = false;
1578  Vrt.chi2PerTrk.resize(nth);
1579  for(int i = 0; i < nth; i++) Vrt.chi2PerTrk[i]=100000.+i; //VK safety
1580 
1581  m_fitSvc->setApproximateVertex(Vrt.vertex[0], Vrt.vertex[1], Vrt.vertex[2], istate);
1582  StatusCode SC = VKalVrtFitBase(ListTracks, Vrt.vertex, Vrt.vertexMom,
1583  Vrt.vertexCharge, Vrt.vertexCov,
1584  Vrt.chi2PerTrk, Vrt.trkAtVrt, Vrt.chi2,
1585  istate, ifCovV0);
1586  if(SC.isSuccess()) Vrt.Good = true;
1587  else{
1588  Vrt.Good = false;
1589  return -1.;
1590  }
1591 
1592  if(Vrt.chi2PerTrk.size()==2) Vrt.chi2PerTrk[0] = Vrt.chi2PerTrk[1] = Vrt.chi2/2.;
1593  return TMath::Prob(Vrt.chi2, 2*nth-1);
1594  }

◆ removeDoubleEntries()

template<class Trk >
void InDet::InDetVKalVxInJetTool::removeDoubleEntries ( std::vector< const Trk * > &  ListTracks) const
private

Definition at line 581 of file InDetVKalVxInJetTool.h.

582  {
583  typename std::vector<const Trk*>::iterator TransfEnd;
584  sort(ListTracks.begin(),ListTracks.end());
585  TransfEnd = unique(ListTracks.begin(),ListTracks.end());
586  ListTracks.erase( TransfEnd, ListTracks.end());
587  }

◆ removeEntryInList()

template<class Trk >
void InDet::InDetVKalVxInJetTool::removeEntryInList ( std::vector< const Trk * > &  ListTracks,
std::vector< float > &  rank,
int  Outlier 
) const
private

Definition at line 572 of file InDetVKalVxInJetTool.h.

573  {
574  if(Outlier < 0 ) return;
575  if(Outlier >= (int)ListTracks.size() ) return;
576  ListTracks.erase( ListTracks.begin()+Outlier);
577  rank.erase( rank.begin()+Outlier);
578  }

◆ removeTrackFromVertex()

void InDet::InDetVKalVxInJetTool::removeTrackFromVertex ( std::vector< WrkVrt > *  wrkVrtSet,
std::vector< std::deque< long int > > *  trkInVrt,
long int &  selectedTrack,
long int &  selectedVertex 
) const
private

Definition at line 1188 of file BTagVrtSecMulti.cxx.

1193  {
1194  int posInVrtFit = 0; //Position of selectedTrack in vertex fit track list.
1196  WrkVrt vrt = (*wrkVrtSet)[selectedVertex];
1197  std::deque<long int> trk = (*TrkInVrt).at(selectedTrack);
1198 
1199  for(it = vrt.selTrk.begin(); it!=vrt.selTrk.end(); ++it) {
1200  if( (*it) == selectedTrack ) {
1201  vrt.selTrk.erase(it); break;
1202  }
1203  posInVrtFit++;
1204  }
1205 
1206  for(it = trk.begin(); it!=trk.end(); ++it) {
1207  if( (*it) == selectedVertex ) {
1208  trk.erase(it); break;
1209  }
1210  }
1211 
1212  vrt.detachedTrack = selectedTrack;
1213 
1214  //Check if track is removed from 2tr vertex => then sharing of track left should also be decreased
1215  if( vrt.selTrk.size() == 1){
1216  long int LeftTrack = vrt.selTrk[0]; // track left in 1tr vertex
1217  for(it = (*TrkInVrt).at(LeftTrack).begin(); it!=(*TrkInVrt)[LeftTrack].end(); ++it) {
1218  if( (*it) == selectedVertex ) {
1219  (*TrkInVrt)[LeftTrack].erase(it); break;
1220  }
1221  }
1222 
1223  if( TMath::Prob(vrt.chi2, 1) < 0.05 ) vrt.Good = false; // Not really good Chi2 for one-track vertex
1224  if( vrt.vertexMom.M()>c_vrtBCMassLimit) vrt.Good = false; // Vertex is too heavy
1225 
1226  int ipos = 0;
1227  if(posInVrtFit==0) ipos = 1; // Position of remaining track in previous 2track vertex fit
1228  vrt.vertexMom = momAtVrt(vrt.trkAtVrt[ipos]); //Redefine vertexMom using remaining track
1229  if(!(*TrkInVrt)[LeftTrack].empty()) vrt.Good = false; //Vertex is declared false only if remaining track is still linked to another vertex
1230  vrt.trkAtVrt.erase(vrt.trkAtVrt.begin()+posInVrtFit); //Remove also TrkAtVrt
1231  }
1232 
1233  }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ select2TrVrt() [1/2]

template<class Track >
int InDet::InDetVKalVxInJetTool::select2TrVrt ( std::vector< const Track * > &  selectedTracks,
std::vector< const Track * > &  tracksForFit,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir,
std::vector< double > &  inpMass,
int &  nRefPVTrk,
std::vector< const Track * > &  trkFromV0,
std::vector< const Track * > &  listSecondTracks,
compatibilityGraph_t compatibilityGraph,
float  evtWgt 
) const

Definition at line 560 of file BTagVrtSec.cxx.

571  {
572  StatusCode sc;
573  std::vector<Vrt2Tr> all2TrVrt(0);
574  int NTracks = static_cast<int>( selectedTracks.size() );
575  std::vector< std::vector<float> > trkScore(NTracks);
576 
577  //
578  // Impact parameters with sign calculations
579  //
580  for (int i=0; i<NTracks; i++) {
581  std::vector<double> Impact, ImpactError;
582  double TrkSig3D = m_fitSvc->VKalGetImpact(selectedTracks[i], primVrt.position(), 1, Impact, ImpactError);
583 
584  AmgVector(5) tmpPerigee = getPerigee(selectedTracks[i])->parameters();
585  if( sin(tmpPerigee[2]-jetDir.Phi())*Impact[0] < 0 ) Impact[0] = -std::abs(Impact[0]);
586  else Impact[0] = std::abs(Impact[0]);
587  if( (tmpPerigee[3]-jetDir.Theta())*Impact[1] < 0 ) Impact[1] = -std::abs(Impact[1]);
588  else Impact[1] = std::abs(Impact[1]);
589 
590  double SignifR = Impact[0]/ std::sqrt(ImpactError[0]);
591  double SignifZ = Impact[1]/ std::sqrt(ImpactError[2]);
592  int hitIBL=0, hitBL=0, hL1=0, nLays=0;
593  getPixelLayers(selectedTracks[i] , hitIBL, hitBL, hL1, nLays );
594 
595  if(m_useTrackClassificator) trkScore[i] = m_trackClassificator->trkTypeWgts(selectedTracks[i], primVrt, jetDir);
596 
597  if(m_fillHist){
598  Hists& h = getHists();
599  h.m_hb_impactR->Fill(SignifR, evtWgt);
600  h.m_hb_impactZ->Fill(SignifZ, evtWgt);
601  h.m_hb_impactRZ->Fill(SignifR, SignifZ, evtWgt);
602  h.m_hb_impact->Fill(TrkSig3D, evtWgt);
603 
604  if(i<DevTuple::maxNTrk && h.m_curTup){
605  h.m_curTup->etatrk[i] = selectedTracks[i]->eta();
606  h.m_curTup->p_prob[i] = rankBTrk(selectedTracks[i]->pt(),jetDir.Pt(),0.);
607  h.m_curTup->s_prob[i] = rankBTrk(0.,0.,TrkSig3D);
608  h.m_curTup->SigR[i] = SignifR;
609  h.m_curTup->SigZ[i] = SignifZ;
610  h.m_curTup->d0[i] = Impact[0];
611  h.m_curTup->Z0[i] = Impact[1];
612  h.m_curTup->idMC[i] = getG4Inter(selectedTracks[i]);
613  if(getIdHF(selectedTracks[i])) h.m_curTup->idMC[i] = 2;
614  if(getMCPileup(selectedTracks[i])) h.m_curTup->idMC[i] = 3;
615  h.m_curTup->wgtB[i] = m_useTrackClassificator ? trkScore[i][0] : -1.;
616  h.m_curTup->wgtL[i] = m_useTrackClassificator ? trkScore[i][1] : -1.;
617  h.m_curTup->wgtG[i] = m_useTrackClassificator ? trkScore[i][2] : -1.;
618  h.m_curTup->sig3D[i] = TrkSig3D;
619  h.m_curTup->chg[i] = tmpPerigee[4]<0. ? 1: -1;
620  h.m_curTup->ibl[i] = hitIBL;
621  h.m_curTup->bl[i] = hitBL;
622  h.m_curTup->fhitR[i] = selectedTracks[i]->radiusOfFirstHit();
623  TLorentzVector TLV = selectedTracks[i]->p4();
624  h.m_curTup->pTvsJet[i] = TLV.Perp(jetDir.Vect());
625  TLorentzVector normJ;
626  normJ.SetPtEtaPhiM(1.,jetDir.Eta(),jetDir.Phi(),0.);
627  h.m_curTup->prodTJ[i] = std::sqrt(std::abs(TLV.Dot(normJ)));
628  h.m_curTup->nVrtT[i] = 0;
629  }
630  }
631 
632  } // end for (int i=0; i<NTracks; i++)
633 
634  if(m_fillHist){
635  Hists& h = getHists();
636  h.m_curTup->ptjet = jetDir.Perp();
637  h.m_curTup->etajet = jetDir.Eta();
638  h.m_curTup->phijet = jetDir.Phi();
639  h.m_curTup->nTrkInJet = std::min(NTracks,DevTuple::maxNTrk);
640  }
641 
642  listSecondTracks.reserve(2*NTracks); // Reserve memory for single vertex
643 
644  Amg::Vector3D iniVrt(0.,0.,0.);
645 
646  for (int i=0; i<NTracks-1; i++) {
648  if(m_multiWithPrimary){
649  if(trkScore[i][2] > 0.75) continue; //---- Use classificator to remove Pileup+Interactions only
650  }
651  else{
652  if(trkScore[i][0]==0.) continue; //Explicitly remove non-classified tracks
653  }
654  }
655 
656  for (int j=i+1; j<NTracks; j++) {
658  if(m_multiWithPrimary) { // For multi-vertex with primary one search
659  if(trkScore[j][2] > 0.75)continue;
660  }else{
661  if(trkScore[j][0]==0.)continue;
662  if(getVrtScore(i,j,trkScore) < m_cutBVrtScore) continue;
663  }
664  }
665 
666  int badTracks = 0; //Bad tracks identification
667  tracksForFit.resize(2);
668  std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
669  m_fitSvc->setMassInputParticles( inpMass, *state ); // Use pion masses for fit
670  tracksForFit[0] = selectedTracks[i];
671  tracksForFit[1] = selectedTracks[j];
672 
673  Vrt2Tr tmpVrt;
674  sc = VKalVrtFitFastBase(tracksForFit, tmpVrt.fitVertex, *state); // Fast crude estimation
675  if( sc.isFailure() || tmpVrt.fitVertex.perp() > m_rLayer2*2. ) { // No initial estimation
676  iniVrt = primVrt.position();
677  if(m_multiWithPrimary) iniVrt.setZero();
678  } else {
679  double jetVrtDir = projSV_PV(tmpVrt.fitVertex,primVrt,jetDir);
680  if(m_multiWithPrimary) jetVrtDir = std::abs(jetVrtDir); // Always positive when primary vertex is seeked for
681  if( jetVrtDir>0. ) iniVrt = tmpVrt.fitVertex; // Good initial estimation
682  else iniVrt = primVrt.position();
683  }
684 
685  m_fitSvc->setApproximateVertex(iniVrt.x(), iniVrt.y(), iniVrt.z(),*state);
686  tmpVrt.i = i;
687  tmpVrt.j = j;
688  m_fitSvc->setRobustness(6, *state);
689 
690  long int Charge;
691  sc = VKalVrtFitBase(tracksForFit, tmpVrt.fitVertex, tmpVrt.momentum, Charge,
692  tmpVrt.errorMatrix, tmpVrt.chi2PerTrk, tmpVrt.trkAtVrt, tmpVrt.chi2,
693  *state, true);
694  if(sc.isFailure()) continue; // No fit
695  if(tmpVrt.chi2 > m_sel2VrtChi2Cut) continue; // Bad Chi2
696  if(std::abs(tmpVrt.fitVertex.z())> 650.) continue; // definitely outside of Pixel detector
697  double Dist2D = tmpVrt.fitVertex.perp();
698  if(Dist2D > 180. ) continue; // can't be from B decay
699 
700  double vrErr = vrtRadiusError(tmpVrt.fitVertex, tmpVrt.errorMatrix);
702  if(vrErr>1.5&&getVrtScore(i,j,trkScore) < 4.*m_cutBVrtScore) continue;
703  }
704 
705  double mass_PiPi = tmpVrt.momentum.M();
706  if(mass_PiPi > m_vrt2TrMassLimit) continue; // can't be from B decay
707  vrtVrtDist(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, tmpVrt.signif3D);
708  vrtVrtDist2D(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, tmpVrt.signif2D);
709 
710  TVector3 SVmPV(tmpVrt.fitVertex.x()-primVrt.x(),
711  tmpVrt.fitVertex.y()-primVrt.y(),
712  tmpVrt.fitVertex.z()-primVrt.z());
713  double jetVrtDir = SVmPV.Dot(jetDir.Vect());
714  if(jetVrtDir > 0) {tmpVrt.dRSVPV = jetDir.DeltaR(TLorentzVector(SVmPV, 1.));} //DeltaR SV-PV vs jet
715  else{tmpVrt.dRSVPV = jetDir.DeltaR(TLorentzVector(-SVmPV, 1.));}
716  if(tmpVrt.dRSVPV > m_coneForTag ) continue; // SV is outside of the jet cone
717 
718  double vPos = SVmPV.Dot(tmpVrt.momentum.Vect())/tmpVrt.momentum.Rho();
719  if((!m_multiWithPrimary) &&(!m_getNegativeTail) &&( ((!m_getNegativeTag) && jetVrtDir<0.) || (m_getNegativeTag && jetVrtDir > 0.) )) continue; // secondary vertex behind primary
720  if(vPos<-100.) continue; // Secondary vertex is too far behind primary
721 
722  // Check track pixel hit patterns vs vertex position.
723  if(m_useVertexCleaningPix && !check2TrVertexInPixel(selectedTracks[i], selectedTracks[j], tmpVrt.fitVertex, tmpVrt.errorMatrix)) continue;
724  // Check track first measured points vs vertex position.
726  float ihitR = selectedTracks[i]->radiusOfFirstHit();
727  float jhitR = selectedTracks[j]->radiusOfFirstHit();
728  if(std::abs(ihitR-jhitR)>25.) continue; // Hits in different pixel layers
729  if(tmpVrt.fitVertex.perp()-std::min(ihitR,jhitR) > 2.*vrErr) continue; // Vertex is behind hit in pixel
730  }
731 
732  tmpVrt.signif3DProj = vrtVrtDist(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, jetDir);
733  if(m_fillHist){
734  Hists& h = getHists();
735  double Signif3DSign = tmpVrt.signif3D;
736  if(jetVrtDir<0) Signif3DSign = -tmpVrt.signif3D;
737  h.m_hb_signif3D->Fill(Signif3DSign, evtWgt);
738  h.m_hb_sig3DNtr->Fill(tmpVrt.signif3DProj, evtWgt);
739  }
740 
741  if(m_multiWithPrimary) continue; // Multivertex with primary one. All below is not needed
742 
743  //
744  // Check if V0 or material interaction on Pixel layer is present
745  //
746  if(Charge==0 && tmpVrt.signif3D>8. && mass_PiPi<900.) {
747  double mass_PPi = massV0(tmpVrt.trkAtVrt, m_massP, m_massPi);
748  double mass_EE = massV0(tmpVrt.trkAtVrt, m_massE, m_massE);
749  if(m_fillHist && !m_multiVertex){
750  Hists& h = getHists();
751  h.m_hb_massEE->Fill(mass_EE, evtWgt);
752  }
753 
754  if(mass_EE < 40.) badTracks = 3;
755  else{
756  if(m_fillHist && !m_multiVertex){
757  Hists& h = getHists();
758  h.m_hb_massPiPi->Fill(mass_PiPi, evtWgt);
759  h.m_hb_massPPi->Fill(mass_PPi, evtWgt);
760  }
761  if(std::abs(mass_PiPi-m_massK0) < 22.) badTracks = 1;
762  if(std::abs(mass_PPi-m_massLam) < 8.) badTracks = 2;
763  }
764 
765  //
766  // Creation of V0 tracks
767  //
768  if(badTracks){
769  std::vector<double> inpMassV0;
770  //Reset VKalVrt settings
771  state = m_fitSvc->makeState();
772  //matrix are calculated
773 
774  if(badTracks==1) { // K0 case
775  inpMassV0.push_back(m_massPi);
776  inpMassV0.push_back(m_massPi);
777  m_fitSvc->setMassInputParticles(inpMassV0, *state);
779  m_fitSvc->setCnstType(1, *state); // Set mass constraint
780  }
781 
782  else if(badTracks==2) { // Lambda case
783  if( std::abs(tmpVrt.trkAtVrt[0][2]) < std::abs(tmpVrt.trkAtVrt[1][2]) ) {
784  inpMassV0.push_back(m_massP);
785  inpMassV0.push_back(m_massPi);
786  } else {
787  inpMassV0.push_back(m_massPi);
788  inpMassV0.push_back(m_massP);
789  }
790  m_fitSvc->setMassInputParticles(inpMassV0, *state);
792  m_fitSvc->setCnstType(1, *state); // Set mass constraint
793  }
794 
795  else if(badTracks==3) { // Gamma case
796  inpMassV0.push_back(m_massE);
797  inpMassV0.push_back(m_massE);
798  m_fitSvc->setMassInputParticles( inpMassV0, *state );
799  m_fitSvc->setCnstType(12, *state); // Set 3d angular constraint
800  }
801 
802  m_fitSvc->setApproximateVertex(tmpVrt.fitVertex.x(), tmpVrt.fitVertex.y(), tmpVrt.fitVertex.z(), *state);
803 
804  TLorentzVector MomentumV0;
805  Amg::Vector3D fitVertexV0;
806  std::vector< std::vector<double> > TrkAtVrtV0;
807  std::vector<double> errorMatrixV0;
808  double Chi2V0;
809  std::vector<double> Chi2PerTrk;
810 
811  sc = VKalVrtFitBase(tracksForFit, fitVertexV0, MomentumV0, Charge,
812  errorMatrixV0, Chi2PerTrk, TrkAtVrtV0, Chi2V0,
813  *state, true);
814  if(sc.isSuccess()) {
815 
816  std::vector<double> VKPerigee, CovPerigee;
817  sc = m_fitSvc->VKalVrtCvtTool(fitVertexV0, MomentumV0, errorMatrixV0, 0,
818  VKPerigee, CovPerigee, *state);
819 
820  if(sc.isSuccess()) {
821  std::unique_ptr<Trk::Perigee> perigee = m_fitSvc->CreatePerigee(VKPerigee, CovPerigee, *state);
822  std::vector<double> Impact, ImpactError;
823  double ImpactSignifV0 = m_fitSvc->VKalGetImpact(perigee.get(), primVrt.position(), 0, Impact, ImpactError, *state);
824 
825  if(m_fillHist){
826  Hists& h = getHists();
827  h.m_hb_impV0->Fill( ImpactSignifV0, evtWgt);
828  }
829 
830  if(ImpactSignifV0>3.0) badTracks = 0;
831  } else {
832  badTracks = 0;
833  }
834  }
835 
836  } // end if(badTracks)
837 
838  } // end if(Charge==0 && tmpVrt.signif3D>8. && mass_PiPi<900.)
839 
840  //
841  // Check interactions on material layers
842  //
844  float xvt = tmpVrt.fitVertex.x();
845  float yvt = tmpVrt.fitVertex.y();
846  float zvt = tmpVrt.fitVertex.z();
847  float Rvt = std::hypot(xvt,yvt);
848  int bin = m_ITkPixMaterialMap->FindBin(zvt,Rvt);
849  if(m_ITkPixMaterialMap->GetBinContent(bin)>0) badTracks = 4;
850  } else {
851  float minWgtI = m_useTrackClassificator ? std::min(trkScore[i][2],trkScore[j][2]) : 1.0; // Use dummy value of 1.0 to pass minWgt requirement in case trackClassificator is not used
852  if(minWgtI > 0.50 && Dist2D > m_beampipeR-vrtRadiusError(tmpVrt.fitVertex, tmpVrt.errorMatrix)) badTracks = 4;
853  }
854 
855  tmpVrt.badVrt = badTracks;
856  all2TrVrt.push_back(tmpVrt);
857 
858  if(m_fillHist){
859  Hists& h = getHists();
860  h.m_hb_r2d->Fill(tmpVrt.fitVertex.perp(), evtWgt);
861  }
862 
863  //
864  // Creation of tracks from V0 list
865  //
866  if(badTracks){
867  trkFromV0.push_back(selectedTracks[i]);
868  trkFromV0.push_back(selectedTracks[j]);
869  }
870 
871  } // end loop over j
872  } // end loop over i
873 
874  //============================================================================
875  //-- Save results
876  listSecondTracks.clear();
877  std::map<int,int> trkHF; // use map with track index as key + value to get list of tracks in 2-track vertices without duplicates
878  for(auto &vv : all2TrVrt){
879  if(vv.badVrt){
880  if(m_useITkMaterialRejection)continue;
881  if(!m_multiVertex && m_rejectBadVertices)continue;
882  }
883  if(m_multiWithPrimary || m_multiVertex) add_edge(vv.i,vv.j,compatibilityGraph);
884  trkHF[vv.i] = vv.i;
885  trkHF[vv.j] = vv.j;
886  }
887 
888  for(auto it : trkHF) listSecondTracks.push_back(selectedTracks[it.second]);
889 
890  //-Debug
891  if(m_fillHist){
892  Hists& h = getHists();
893  if (h.m_curTup){
894  h.m_curTup->ewgt = evtWgt;
895  for(auto &it : trkHF) h.m_curTup->itHF[h.m_curTup->NTHF++] = it.second;
896  for(auto &vv : all2TrVrt){
897  h.m_curTup->nVrtT[vv.i]++;
898  h.m_curTup->nVrtT[vv.j]++;
899  }
900  fillVrtNTup(all2TrVrt);
901  }
902  }
903 
904  //
905  //--------------------------------------------------------------------
906  //-- Post-selection checks
907  //--------------------------------------------------------------------
908  if(m_fillHist){
909  float weight = listSecondTracks.empty() ? 0. : 1.;
910  Hists& h = getHists();
911  h.m_pr_effVrt2tr->Fill(static_cast<float>(nRefPVTrk), weight);
912  h.m_pr_effVrt2trEta->Fill(jetDir.Eta(), weight);
913  }
914 
915  return all2TrVrt.size();
916 
917  }

◆ select2TrVrt() [2/2]

template<class Trk >
int InDet::InDetVKalVxInJetTool::select2TrVrt ( std::vector< const Trk * > &  SelectedTracks,
std::vector< const Trk * > &  TracksForFit,
const xAOD::Vertex primVrt,
const TLorentzVector &  JetDir,
std::vector< double > &  InpMass,
int &  nRefPVTrk,
std::vector< const Trk * > &  TrkFromV0,
std::vector< const Trk * > &  ListSecondTracks,
compatibilityGraph_t compatibilityGraph,
float  evtWgt = 1 
) const
private

◆ selGoodTrkParticle()

int InDet::InDetVKalVxInJetTool::selGoodTrkParticle ( const std::vector< const xAOD::TrackParticle * > &  inpPart,
const xAOD::Vertex primVrt,
const TLorentzVector &  jetDir,
std::vector< const xAOD::TrackParticle * > &  selPart,
float  evtWgt = 1. 
) const
private

Definition at line 103 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/CutTrk.cxx.

109  {
110 
111  std::vector<const xAOD::TrackParticle*>::const_iterator i_ntrk;
112  std::vector<double> Impact,ImpactError;
113  std::multimap<double,const xAOD::TrackParticle*> orderedTrk;
114  int nPrimTrk=0;
115  for (i_ntrk = InpTrk.begin(); i_ntrk < InpTrk.end(); ++i_ntrk) {
116 
117  if((*i_ntrk)->numberDoF() == 0) continue; //Protection
118  if( (*i_ntrk)->pt() > JetDir.Pt() ) continue;
119 
120  //
121  //-- Perigee in TrackParticle
122  //
123  const Trk::Perigee mPer=(*i_ntrk)->perigeeParameters() ;
124  AmgVector(5) VectPerig = mPer.parameters();
125 
126 
127  double trkChi2 = (*i_ntrk)->chiSquared() / (*i_ntrk)->numberDoF();
128 
129  double CovTrkMtx11 = (*i_ntrk)->definingParametersCovMatrix()(0,0);
130  double CovTrkMtx22 = (*i_ntrk)->definingParametersCovMatrix()(1,1);
131  double CovTrkMtx55 = (*i_ntrk)->definingParametersCovMatrix()(4,4);
132  double ConeDist = coneDist(VectPerig,JetDir);
133 
134  double trkP=1./std::abs(VectPerig[4]);
135  double trkPErr=std::sqrt(CovTrkMtx55)*trkP ;
136 
137  uint8_t PixelHits,SctHits,BLayHits,sctSharedHits,pixSharedHits;
138  if( !((*i_ntrk)->summaryValue(PixelHits,xAOD::numberOfPixelHits)) ) continue; // Track is
139  if( !((*i_ntrk)->summaryValue( SctHits,xAOD::numberOfSCTHits)) ) continue; // definitely bad
140  if( !((*i_ntrk)->summaryValue(BLayHits,xAOD::numberOfInnermostPixelLayerHits))) BLayHits=0;
141  if( !((*i_ntrk)->summaryValue(sctSharedHits,xAOD::numberOfSCTSharedHits))) sctSharedHits=0; //VK Bad for high Pt
142  if( !((*i_ntrk)->summaryValue(pixSharedHits,xAOD::numberOfPixelSharedHits)))pixSharedHits=0; //and many tracks
143  long int SharedHits = sctSharedHits+pixSharedHits;
144 
145  uint8_t splSCTHits,outSCTHits,splPixHits,outPixHits;
146  if( !((*i_ntrk)->summaryValue(splSCTHits,xAOD::numberOfSCTSpoiltHits))) splSCTHits=0;
147  if( !((*i_ntrk)->summaryValue(outSCTHits,xAOD::numberOfSCTOutliers))) outSCTHits=0;
148  if( !((*i_ntrk)->summaryValue(splPixHits,xAOD::numberOfPixelSpoiltHits)))splPixHits=0;
149  if( !((*i_ntrk)->summaryValue(outPixHits,xAOD::numberOfPixelOutliers))) outPixHits=0;
150  bool badHits = ( splSCTHits || outSCTHits || outPixHits || splPixHits );
151 
152  Amg::Vector3D perigeePos=mPer.position();
153  double ImpactA0=std::sqrt( (perigeePos.x()-PrimVrt.x())*(perigeePos.x()-PrimVrt.x())
154  +(perigeePos.y()-PrimVrt.y())*(perigeePos.y()-PrimVrt.y()) );
155  double ImpactZ=perigeePos.z()-PrimVrt.z();
156  double ImpactSignif=std::sqrt(ImpactA0*ImpactA0/CovTrkMtx11+ImpactZ*ImpactZ/CovTrkMtx22);
157 
158  if(m_fillHist){
159  Hists& h = getHists();
160  h.m_hb_trkD0->Fill( ImpactA0, evtWgt);
161  }
162 
163  double eta = (*i_ntrk)->eta();
164 
165  std::unordered_map<std::string,double> TrkVarDouble;
166  std::unordered_map<std::string,int> TrkVarInt;
167 
168  TrkVarDouble["eta"] = eta;
169  TrkVarDouble["PInvVert"] = VectPerig[4];
170  TrkVarDouble["ThetaVert"] = VectPerig[3];
171  TrkVarDouble["A0Vert"] = ImpactA0;
172  TrkVarDouble["ZVert"] = ImpactZ;
173  TrkVarDouble["Chi2"] = trkChi2;
174  TrkVarDouble["ConeDist"] = ConeDist;
175  TrkVarDouble["CovTrkMtx11"] = CovTrkMtx11;
176  TrkVarDouble["CovTrkMtx22"] = CovTrkMtx22;
177  TrkVarDouble["trkP"] = trkP;
178  TrkVarDouble["trkPErr"] = trkPErr;
179 
180  TrkVarInt["PixelHits"] = PixelHits;
181  TrkVarInt["SctHits"] = SctHits;
182  TrkVarInt["BLayHits"] = BLayHits;
183  TrkVarInt["badHits"] = badHits;
184  TrkVarInt["SharedHits"] = SharedHits;
185 
186  StatusCode sc = cutTrk(TrkVarDouble, TrkVarInt);
187  if( sc.isFailure() ) continue;
188 
189  double rnkBTrk=rankBTrk(0.,0.,ImpactSignif);
190  if(rnkBTrk<0.7)nPrimTrk += 1;
191  orderedTrk.emplace(rnkBTrk,*i_ntrk);
192  }
193 
194  //---- Order tracks according to ranks
195  std::map<double,const xAOD::TrackParticle*>::reverse_iterator rt=orderedTrk.rbegin();
196  SelectedTracks.resize(orderedTrk.size());
197  for ( int cntt=0; rt!=orderedTrk.rend(); ++rt,++cntt) {SelectedTracks[cntt]=(*rt).second;}
198  return nPrimTrk;
199  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ totalMom() [1/2]

TLorentzVector InDet::InDetVKalVxInJetTool::totalMom ( const std::vector< const Trk::Perigee * > &  inpTrk) const
private

Definition at line 354 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

356  {
357  AmgVector(5) vectPerig; vectPerig.setZero();
358  double px=0.,py=0.,pz=0.,ee=0.;
359  for (const auto *i : inpTrk) {
360  if(!i) continue;
361  vectPerig = i->parameters();
362  double api=1./std::abs(vectPerig[4]);
363  CxxUtils::sincos phi (vectPerig[2]);
364  CxxUtils::sincos theta(vectPerig[3]);
365  px += phi.cs * theta.sn*api;
366  py += phi.sn * theta.sn*api;
367  pz += theta.cs*api;
368  ee += std::sqrt( api*api + m_massPi*m_massPi);
369  }
370  return {px,py,pz,ee};
371  }

◆ totalMom() [2/2]

TLorentzVector InDet::InDetVKalVxInJetTool::totalMom ( const std::vector< const xAOD::TrackParticle * > &  inpTrk)
staticprivate

Definition at line 373 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

375  {
376  TLorentzVector sum(0.,0.,0.,0.);
377  for (const auto *i : InpTrk) {
378  if( i == nullptr ) continue;
379  sum += i->p4();
380  }
381  return sum;
382  }

◆ trackClassification()

void InDet::InDetVKalVxInJetTool::trackClassification ( std::vector< WrkVrt > *  wrkVrtSet,
std::vector< std::deque< long int > > *  trkInVrt 
)
staticprivate

Definition at line 1082 of file BTagVrtSecMulti.cxx.

1085  {
1086  int NSet = wrkVrtSet->size();
1087  for(int iv = 0; iv<NSet; iv++) {
1088  if(!(*wrkVrtSet)[iv].Good) continue;
1089  int NTrkAtVrt = (*wrkVrtSet)[iv].selTrk.size();
1090  if(NTrkAtVrt<2) continue;
1091 
1092  for(int jt = 0; jt<NTrkAtVrt; jt++){
1093  int tracknum = (*wrkVrtSet)[iv].selTrk[jt];
1094  (*TrkInVrt).at(tracknum).push_back(iv);
1095  }
1096  }
1097  }

◆ trackDecorationNames()

virtual std::vector<std::string> InDet::ISecVertexInJetFinder::trackDecorationNames ( ) const
inlinevirtualinherited

Return a list of the names of track decorations created by this tool, in order to allow them to be locked when the calling algorithm completes.

Return an empty list by default.

Reimplemented in InDet::InDetImprovedJetFitterVxFinder.

Definition at line 72 of file ISecVertexInJetFinder.h.

73  {
74  return std::vector<std::string>();
75  }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ VKalVrtFitBase()

StatusCode InDet::InDetVKalVxInJetTool::VKalVrtFitBase ( const std::vector< const xAOD::TrackParticle * > &  listPart,
Amg::Vector3D Vertex,
TLorentzVector &  Momentum,
long int &  Charge,
std::vector< double > &  ErrorMatrix,
std::vector< double > &  Chi2PerTrk,
std::vector< std::vector< double > > &  TrkAtVrt,
double &  Chi2,
Trk::IVKalState istate,
bool  ifCovV0 
) const
private

Definition at line 417 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

427  {
428  std::vector<const xAOD::NeutralParticle*> netralPartDummy(0);
429  return m_fitSvc->VKalVrtFit( listPart, netralPartDummy,Vertex, Momentum, Charge,
430  ErrorMatrix, Chi2PerTrk, TrkAtVrt, Chi2,
431  istate, ifCovV0 );
432 
433  }

◆ VKalVrtFitFastBase()

StatusCode InDet::InDetVKalVxInJetTool::VKalVrtFitFastBase ( const std::vector< const xAOD::TrackParticle * > &  listPart,
Amg::Vector3D Vertex,
Trk::IVKalState istate 
) const
private

Definition at line 408 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

412  {
413  return m_fitSvc->VKalVrtFitFast(listTrk, FitVertex, istate);
414  }

◆ vrtRadiusError()

double InDet::InDetVKalVxInJetTool::vrtRadiusError ( const Amg::Vector3D secVrt,
const std::vector< double > &  vrtErr 
)
staticprivate

Definition at line 262 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

263  {
264  double DirX=SecVrt.x(), DirY=SecVrt.y();
265  double Covar = DirX*VrtErr[0]*DirX
266  +2.*DirX*VrtErr[1]*DirY
267  +DirY*VrtErr[2]*DirY;
268  Covar /= DirX*DirX + DirY*DirY;
269  Covar=std::sqrt(Covar);
270  if(Covar != Covar) Covar = 0.;
271  return Covar;
272  }

◆ vrtVrtDist() [1/3]

double InDet::InDetVKalVxInJetTool::vrtVrtDist ( const Amg::Vector3D Vrt1,
const std::vector< double > &  VrtErr1,
const Amg::Vector3D Vrt2,
const std::vector< double > &  VrtErr2 
) const
private

Definition at line 227 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

230  {
231  double Signif;
232  Amg::Vector3D SVPV(Vrt1.x()- Vrt2.x(),Vrt1.y()- Vrt2.y(),Vrt1.z()- Vrt2.z());
233 
234  AmgSymMatrix(3) PrimCovMtx; //Create
235  PrimCovMtx(0,0) = VrtErr1[0]+VrtErr2[0];
236  PrimCovMtx(0,1) = PrimCovMtx(1,0) = VrtErr1[1]+VrtErr2[1];
237  PrimCovMtx(1,1) = VrtErr1[2]+VrtErr2[2];
238  PrimCovMtx(0,2) = PrimCovMtx(2,0) = VrtErr1[3]+VrtErr2[3];
239  PrimCovMtx(1,2) = PrimCovMtx(2,1) = VrtErr1[4]+VrtErr2[4];
240  PrimCovMtx(2,2) = VrtErr1[5]+VrtErr2[5];
241 
242  bool success=true;
243  AmgSymMatrix(3) WgtMtx;
244  PrimCovMtx.computeInverseWithCheck(WgtMtx, success);
245  if( !success || WgtMtx(0,0)<=0. || WgtMtx(1,1)<=0. || WgtMtx(2,2)<=0. ){
246  ATH_MSG_DEBUG(" Cov.matrix inversion failure in vertex distance significane");
247  return 1.e10;
248  }
249 
250  Signif=SVPV.transpose()*WgtMtx*SVPV;
251  if(Signif<=0.)return 1.e10; //Something is wrong in distance significance.
252  Signif=std::sqrt(Signif);
253  if(Signif != Signif) Signif = 0.;
254  return Signif;
255  }

◆ vrtVrtDist() [2/3]

double InDet::InDetVKalVxInJetTool::vrtVrtDist ( const xAOD::Vertex primVrt,
const Amg::Vector3D SecVrt,
const std::vector< double > &  SecVrtErr,
const TLorentzVector &  JetDir 
) const
private

Definition at line 192 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

195  {
196  Amg::Vector3D jetDir(JetDir.Vect().Unit().X(), JetDir.Vect().Unit().Y(), JetDir.Vect().Unit().Z());
197  double projDist=(SecVrt-PrimVrt.position()).dot(jetDir);
198  Amg::Vector3D SVPV=jetDir*projDist;
199 
200  AmgSymMatrix(3) PrimCovMtx=PrimVrt.covariancePosition(); //Create
201  PrimCovMtx(0,0) += SecVrtErr[0];
202  PrimCovMtx(0,1) += SecVrtErr[1];
203  PrimCovMtx(1,0) += SecVrtErr[1];
204  PrimCovMtx(1,1) += SecVrtErr[2];
205  PrimCovMtx(0,2) += SecVrtErr[3];
206  PrimCovMtx(2,0) += SecVrtErr[3];
207  PrimCovMtx(1,2) += SecVrtErr[4];
208  PrimCovMtx(2,1) += SecVrtErr[4];
209  PrimCovMtx(2,2) += SecVrtErr[5];
210 
211  bool success=true;
212  AmgSymMatrix(3) WgtMtx;
213  PrimCovMtx.computeInverseWithCheck(WgtMtx, success);
214  if( !success || WgtMtx(0,0)<=0. || WgtMtx(1,1)<=0. || WgtMtx(2,2)<=0. ){
215  ATH_MSG_DEBUG(" Cov.matrix inversion failure in vertex distance significane");
216  return 1.e10;
217  }
218 
219  double Signif=SVPV.transpose()*WgtMtx*SVPV;
220  if(Signif<=0.)return 1.e10; //Something is wrong in distance significance.
221  Signif=std::sqrt(Signif);
222  if( Signif!=Signif ) Signif = 0.;
223  if(projDist<0)Signif=-Signif;
224  return Signif;
225  }

◆ vrtVrtDist() [3/3]

double InDet::InDetVKalVxInJetTool::vrtVrtDist ( const xAOD::Vertex primVrt,
const Amg::Vector3D SecVrt,
const std::vector< double > &  VrtErr,
double &  Signif 
) const
private

Definition at line 126 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

129  {
130 
131  Amg::Vector3D SVPV(PrimVrt.x()- SecVrt.x(),PrimVrt.y()- SecVrt.y(),PrimVrt.z()- SecVrt.z());
132 
133  AmgSymMatrix(3) PrimCovMtx=PrimVrt.covariancePosition(); //Create
134  PrimCovMtx(0,0) += SecVrtErr[0];
135  PrimCovMtx(0,1) += SecVrtErr[1];
136  PrimCovMtx(1,0) += SecVrtErr[1];
137  PrimCovMtx(1,1) += SecVrtErr[2];
138  PrimCovMtx(0,2) += SecVrtErr[3];
139  PrimCovMtx(2,0) += SecVrtErr[3];
140  PrimCovMtx(1,2) += SecVrtErr[4];
141  PrimCovMtx(2,1) += SecVrtErr[4];
142  PrimCovMtx(2,2) += SecVrtErr[5];
143 
144  bool success=true;
145  AmgSymMatrix(3) WgtMtx;
146  PrimCovMtx.computeInverseWithCheck(WgtMtx, success);
147  if( !success || WgtMtx(0,0)<=0. || WgtMtx(1,1)<=0. || WgtMtx(2,2)<=0. ){
148  ATH_MSG_DEBUG(" Cov.matrix inversion failure in vertex distance significane");
149  return 1.e10;
150  }
151 
152  Signif=SVPV.transpose()*WgtMtx*SVPV;
153 
154  if(Signif<=0.)return 1.e10; //Something is wrong in distance significance.
155  Signif=std::sqrt(Signif);
156  if( Signif!=Signif ) Signif = 0.;
157  return SVPV.norm();
158  }

◆ vrtVrtDist2D()

double InDet::InDetVKalVxInJetTool::vrtVrtDist2D ( const xAOD::Vertex primVrt,
const Amg::Vector3D SecVrt,
const std::vector< double > &  VrtErr,
double &  Signif 
) const
private

Definition at line 160 of file InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx.

163  {
164  Amg::Vector2D SVPV(PrimVrt.x()- SecVrt.x(),PrimVrt.y()- SecVrt.y());
165 
166  AmgSymMatrix(3) PrimCovMtx=PrimVrt.covariancePosition(); //Create
167  AmgSymMatrix(2) CovMtx;
168  CovMtx(0,0) = PrimCovMtx(0,0) + SecVrtErr[0];
169  CovMtx(0,1) = PrimCovMtx(0,1) + SecVrtErr[1];
170  CovMtx(1,0) = PrimCovMtx(1,0) + SecVrtErr[1];
171  CovMtx(1,1) = PrimCovMtx(1,1) + SecVrtErr[2];
172 
173  bool success=true;
174  AmgSymMatrix(2) WgtMtx;
175  CovMtx.computeInverseWithCheck(WgtMtx, success);
176  if( !success || WgtMtx(0,0)<=0. || WgtMtx(1,1)<=0. ){
177  ATH_MSG_DEBUG(" Cov.matrix inversion failure in vertex distance significane");
178  return 1.e10;
179  }
180 
181  Signif=SVPV.transpose()*WgtMtx*SVPV;
182 
183  if(Signif<=0.)return 1.e10; //Something is wrong in distance significance.
184  Signif=std::sqrt(Signif);
185  if( Signif!=Signif ) Signif = 0.;
186  return SVPV.norm();
187  }

Member Data Documentation

◆ m_a0TrkErrorCut

DoubleProperty InDet::InDetVKalVxInJetTool::m_a0TrkErrorCut
private
Initial value:
{this, "A0TrkErrorCut", 1.,
"Track A0 error cut"}

Definition at line 201 of file InDetVKalVxInJetTool.h.

◆ m_beamPipeMgr

const BeamPipeDetectorManager* InDet::InDetVKalVxInJetTool::m_beamPipeMgr = nullptr
private

Definition at line 267 of file InDetVKalVxInJetTool.h.

◆ m_beampipeR

double InDet::InDetVKalVxInJetTool::m_beampipeR = 0.
private

Definition at line 220 of file InDetVKalVxInJetTool.h.

◆ m_chiScale

float InDet::InDetVKalVxInJetTool::m_chiScale[11] {}
private

Definition at line 363 of file InDetVKalVxInJetTool.h.

◆ m_coneForTag

DoubleProperty InDet::InDetVKalVxInJetTool::m_coneForTag
private
Initial value:
{this, "ConeForTag", 0.4,
"Cone around jet direction for track selection"}

Definition at line 193 of file InDetVKalVxInJetTool.h.

◆ m_cutA0

DoubleProperty InDet::InDetVKalVxInJetTool::m_cutA0 {this, "CutA0", 5., "Track A0 selection cut"}
private

Definition at line 189 of file InDetVKalVxInJetTool.h.

◆ m_cutBLayHits

IntegerProperty InDet::InDetVKalVxInJetTool::m_cutBLayHits
private
Initial value:
{this, "CutBLayHits", 0,
"Remove track is it has less B-layer hits"}

Definition at line 183 of file InDetVKalVxInJetTool.h.

◆ m_cutBVrtScore

DoubleProperty InDet::InDetVKalVxInJetTool::m_cutBVrtScore
private
Initial value:
{this, "CutBVrtScore", 0.015,
"B vertex selection cut on 2track vertex score (probability-like) based on track classification"}

Definition at line 205 of file InDetVKalVxInJetTool.h.

◆ m_cutChi2

DoubleProperty InDet::InDetVKalVxInJetTool::m_cutChi2 {this, "CutChi2", 5., "Track Chi2 selection cut"}
private

Definition at line 190 of file InDetVKalVxInJetTool.h.

◆ m_cutPixelHits

IntegerProperty InDet::InDetVKalVxInJetTool::m_cutPixelHits
private
Initial value:
{this, "CutPixelHits", 1,
"Remove track is it has less Pixel hits"}

Definition at line 179 of file InDetVKalVxInJetTool.h.

◆ m_cutPt

DoubleProperty InDet::InDetVKalVxInJetTool::m_cutPt {this, "CutPt", 700., "Track Pt selection cut"}
private

Definition at line 187 of file InDetVKalVxInJetTool.h.

◆ m_cutSctHits

IntegerProperty InDet::InDetVKalVxInJetTool::m_cutSctHits
private
Initial value:
{this, "CutSctHits", 4,
"Remove track is it has less SCT hits"}

Definition at line 177 of file InDetVKalVxInJetTool.h.

◆ m_cutSharedHits

IntegerProperty InDet::InDetVKalVxInJetTool::m_cutSharedHits
private
Initial value:
{this, "CutSharedHits", 1000,
"Reject final 2tr vertices if tracks have shared hits"}

Definition at line 185 of file InDetVKalVxInJetTool.h.

◆ m_cutSiHits

IntegerProperty InDet::InDetVKalVxInJetTool::m_cutSiHits
private
Initial value:
{this, "CutSiHits", 7,
"Remove track is it has less Pixel+SCT hits"}

Definition at line 181 of file InDetVKalVxInJetTool.h.

◆ m_cutZVrt

DoubleProperty InDet::InDetVKalVxInJetTool::m_cutZVrt {this, "CutZVrt", 15., "Track Z impact selection cut"}
private

Definition at line 188 of file InDetVKalVxInJetTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_etaDependentCutsSvc

ServiceHandle<InDet::IInDetEtaDependentCutsSvc> InDet::InDetVKalVxInJetTool::m_etaDependentCutsSvc {this, "InDetEtaDependentCutsSvc", ""}
private

service to get cut values depending on different variable

Definition at line 261 of file InDetVKalVxInJetTool.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> InDet::InDetVKalVxInJetTool::m_eventInfoKey {this, "EventInfoName", "EventInfo"}
private

Definition at line 256 of file InDetVKalVxInJetTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_existIBL

BooleanProperty InDet::InDetVKalVxInJetTool::m_existIBL
private
Initial value:
{this, "ExistIBL", true,
"Inform whether 3-layer or 4-layer detector is used"}

Definition at line 214 of file InDetVKalVxInJetTool.h.

◆ m_fillHist

BooleanProperty InDet::InDetVKalVxInJetTool::m_fillHist
private
Initial value:
{this, "FillHist", false,
"Fill technical histograms"}

Definition at line 212 of file InDetVKalVxInJetTool.h.

◆ m_fitSvc

Trk::TrkVKalVrtFitter* InDet::InDetVKalVxInJetTool::m_fitSvc {}
private

Definition at line 250 of file InDetVKalVxInJetTool.h.

◆ m_fitter

ToolHandle< Trk::IVertexFitter > InDet::InDetVKalVxInJetTool::m_fitter {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool"}
private

Definition at line 248 of file InDetVKalVxInJetTool.h.

◆ m_getNegativeTag

BooleanProperty InDet::InDetVKalVxInJetTool::m_getNegativeTag
private
Initial value:
{this, "getNegativeTag", false,
"Return ONLY negative secondary vertices (not for multivertex!)"}

Definition at line 238 of file InDetVKalVxInJetTool.h.

◆ m_getNegativeTail

BooleanProperty InDet::InDetVKalVxInJetTool::m_getNegativeTail
private
Initial value:
{this, "getNegativeTail", false,
"Allow secondary vertex behind the primary one (negative) w/r jet direction (not for multivertex!)"}

Definition at line 236 of file InDetVKalVxInJetTool.h.

◆ m_h

std::unique_ptr<Hists> InDet::InDetVKalVxInJetTool::m_h
private

Definition at line 175 of file InDetVKalVxInJetTool.h.

◆ m_ITkPixMaterialMap

std::unique_ptr<TH2D> InDet::InDetVKalVxInJetTool::m_ITkPixMaterialMap
private

Definition at line 269 of file InDetVKalVxInJetTool.h.

◆ m_massB

const double InDet::InDetVKalVxInJetTool::m_massB =5279.400
private

Definition at line 276 of file InDetVKalVxInJetTool.h.

◆ m_massE

const double InDet::InDetVKalVxInJetTool::m_massE = 0.511
private

Definition at line 273 of file InDetVKalVxInJetTool.h.

◆ m_massK0

const double InDet::InDetVKalVxInJetTool::m_massK0 = 497.648
private

Definition at line 274 of file InDetVKalVxInJetTool.h.

◆ m_massLam

const double InDet::InDetVKalVxInJetTool::m_massLam =1115.683
private

Definition at line 275 of file InDetVKalVxInJetTool.h.

◆ m_massP

const double InDet::InDetVKalVxInJetTool::m_massP = 938.272
private

Definition at line 272 of file InDetVKalVxInJetTool.h.

◆ m_massPi

const double InDet::InDetVKalVxInJetTool::m_massPi = 139.5702
private

Definition at line 271 of file InDetVKalVxInJetTool.h.

◆ m_multiVertex

BooleanProperty InDet::InDetVKalVxInJetTool::m_multiVertex
private
Initial value:
{this, "MultiVertex", false,
"Run Multiple Secondary Vertices in jet finder"}

Definition at line 232 of file InDetVKalVxInJetTool.h.

◆ m_multiWithOneTrkVrt

BooleanProperty InDet::InDetVKalVxInJetTool::m_multiWithOneTrkVrt
private
Initial value:
{this, "MultiWithOneTrkVrt", true,
"Allow one-track-vertex addition to already found secondary vertices. MultiVertex Finder only!"}

Definition at line 240 of file InDetVKalVxInJetTool.h.

◆ m_multiWithPrimary

BooleanProperty InDet::InDetVKalVxInJetTool::m_multiWithPrimary
private
Initial value:
{this, "MultiWithPrimary", false,
"Find Multiple Secondary Vertices + primary vertex in jet. MultiVertex Finder only!"}

Definition at line 234 of file InDetVKalVxInJetTool.h.

◆ m_pixelManager

const InDetDD::PixelDetectorManager* InDet::InDetVKalVxInJetTool::m_pixelManager = nullptr
private

Definition at line 268 of file InDetVKalVxInJetTool.h.

◆ m_rejectBadVertices

BooleanProperty InDet::InDetVKalVxInJetTool::m_rejectBadVertices
private
Initial value:
{this, "rejectBadVertices", false,
"Reject V0s after checking 3D PV impact"}

Definition at line 230 of file InDetVKalVxInJetTool.h.

◆ m_rLayer1

double InDet::InDetVKalVxInJetTool::m_rLayer1 = 0.
private

Definition at line 222 of file InDetVKalVxInJetTool.h.

◆ m_rLayer2

double InDet::InDetVKalVxInJetTool::m_rLayer2 = 0.
private

Definition at line 223 of file InDetVKalVxInJetTool.h.

◆ m_rLayer3

double InDet::InDetVKalVxInJetTool::m_rLayer3 = 0.
private

Definition at line 224 of file InDetVKalVxInJetTool.h.

◆ m_rLayerB

double InDet::InDetVKalVxInJetTool::m_rLayerB = 0.
private

Definition at line 221 of file InDetVKalVxInJetTool.h.

◆ m_RobustFit

IntegerProperty InDet::InDetVKalVxInJetTool::m_RobustFit
private
Initial value:
{this, "RobustFit", 1,
"Use vertex fit with RobustFit functional(VKalVrt) for common secondary vertex fit"}

Definition at line 217 of file InDetVKalVxInJetTool.h.

◆ m_secTrkChi2Cut

DoubleProperty InDet::InDetVKalVxInJetTool::m_secTrkChi2Cut
private
Initial value:
{this, "SecTrkChi2Cut", 10.,
"Track - common secondary vertex association cut. Single Vertex Finder only"}

Definition at line 191 of file InDetVKalVxInJetTool.h.

◆ m_sel2VrtChi2Cut

DoubleProperty InDet::InDetVKalVxInJetTool::m_sel2VrtChi2Cut
private
Initial value:
{this, "Sel2VrtChi2Cut", 10.,
"Cut on Chi2 of 2-track vertex for initial selection"}

Definition at line 195 of file InDetVKalVxInJetTool.h.

◆ m_sel2VrtSigCut

DoubleProperty InDet::InDetVKalVxInJetTool::m_sel2VrtSigCut
private
Initial value:
{this, "Sel2VrtSigCut", 4.,
"Cut on significance of 3D distance between initial 2-track vertex and PV"}

Definition at line 197 of file InDetVKalVxInJetTool.h.

◆ m_timingProfile

ServiceHandle<IChronoStatSvc> InDet::InDetVKalVxInJetTool::m_timingProfile {this,"ChronoStatSvc","ChronoStatSvc"}
private

Definition at line 251 of file InDetVKalVxInJetTool.h.

◆ m_trackClassificator

ToolHandle< IInDetTrkInJetType > InDet::InDetVKalVxInJetTool::m_trackClassificator {this, "TrackClassTool", "InDet::InDetTrkInJetType"}
private

Definition at line 254 of file InDetVKalVxInJetTool.h.

◆ m_trackDetachCut

DoubleProperty InDet::InDetVKalVxInJetTool::m_trackDetachCut
private
Initial value:
{this, "TrackDetachCut", 6.,
"To allow track from vertex detachment for MultiVertex Finder"}

Definition at line 245 of file InDetVKalVxInJetTool.h.

◆ m_trkSigCut

DoubleProperty InDet::InDetVKalVxInJetTool::m_trkSigCut
private
Initial value:
{this, "TrkSigCut", 2.,
"Track 3D impact significance w/r primary vertex"}

Definition at line 199 of file InDetVKalVxInJetTool.h.

◆ m_useEtaDependentCuts

bool InDet::InDetVKalVxInJetTool::m_useEtaDependentCuts = false
private

Definition at line 259 of file InDetVKalVxInJetTool.h.

◆ m_useFrozenVersion

BooleanProperty InDet::InDetVKalVxInJetTool::m_useFrozenVersion
private
Initial value:
{this, "UseFrozenVersion", false,
"Switch from default frozen version to the development/improved one"}

Definition at line 210 of file InDetVKalVxInJetTool.h.

◆ m_useITkMaterialRejection

BooleanProperty InDet::InDetVKalVxInJetTool::m_useITkMaterialRejection
private
Initial value:
{this, "useITkMaterialRejection", false,
"Reject vertices from hadronic interactions in detector material using ITk layout"}

Definition at line 264 of file InDetVKalVxInJetTool.h.

◆ m_useTrackClassificator

bool InDet::InDetVKalVxInJetTool::m_useTrackClassificator = true
private

Definition at line 253 of file InDetVKalVxInJetTool.h.

◆ m_useVertexCleaningFMP

BooleanProperty InDet::InDetVKalVxInJetTool::m_useVertexCleaningFMP
private
Initial value:
{this, "useVertexCleaningFMP", false,
"Clean vertices requiring track F(irst) M(easured) P(oints) matching to vertex position"}

Definition at line 228 of file InDetVKalVxInJetTool.h.

◆ m_useVertexCleaningPix

BooleanProperty InDet::InDetVKalVxInJetTool::m_useVertexCleaningPix
private
Initial value:
{this, "useVertexCleaningPix", false,
"Clean vertices requiring track pixel hit patterns according to vertex position"}

Definition at line 226 of file InDetVKalVxInJetTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexMergeCut

DoubleProperty InDet::InDetVKalVxInJetTool::m_vertexMergeCut
private
Initial value:
{this, "VertexMergeCut", 3.,
"To allow vertex merging for MultiVertex Finder"}

Definition at line 243 of file InDetVKalVxInJetTool.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vrt2TrMassLimit

DoubleProperty InDet::InDetVKalVxInJetTool::m_vrt2TrMassLimit
private
Initial value:
{this, "Vrt2TrMassLimit", 4000.,
"Maximal allowed mass for 2-track vertices"}

Definition at line 207 of file InDetVKalVxInJetTool.h.

◆ m_zTrkErrorCut

DoubleProperty InDet::InDetVKalVxInJetTool::m_zTrkErrorCut
private
Initial value:
{this, "ZTrkErrorCut", 5.,
"Track Z impact error cut"}

Definition at line 203 of file InDetVKalVxInJetTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::pixelEndCap2
@ pixelEndCap2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:239
InDet::InDetVKalVxInJetTool::m_cutZVrt
DoubleProperty m_cutZVrt
Definition: InDetVKalVxInJetTool.h:188
base
std::string base
Definition: hcg.cxx:78
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:261
Trk::TrkVKalVrtFitter::VKalVrtFit
virtual StatusCode VKalVrtFit(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::NeutralParticle * > &, Amg::Vector3D &Vertex, TLorentzVector &Momentum, long int &Charge, dvect &ErrorMatrix, dvect &Chi2PerTrk, std::vector< std::vector< double >> &TrkAtVrt, double &Chi2, IVKalState &istate, bool ifCovV0=false) const override final
xAOD::Vertex_v1::x
float x() const
Returns the x position.
test_pyathena.eta
eta
Definition: test_pyathena.py:10
FlavorTagDiscriminants::OnnxModelVersion::V2
@ V2
xAOD::numberOfInnermostPixelLayerSplitHits
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
Definition: TrackingPrimitives.h:240
InDet::InDetVKalVxInJetTool::removeEntryInList
void removeEntryInList(std::vector< const Trk * > &, std::vector< float > &, int) const
Definition: InDetVKalVxInJetTool.h:572
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
xAOD::Vertex_v1::setPosition
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
verify_menu_config.results
results
Definition: verify_menu_config.py:67
fitman.sy
sy
Definition: fitman.py:524
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
xAOD::Vertex_v1::setFitQuality
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Definition: Vertex_v1.cxx:150
fitman.sz
sz
Definition: fitman.py:527
test_pyathena.px
px
Definition: test_pyathena.py:18
InDet::InDetVKalVxInJetTool::m_cutPixelHits
IntegerProperty m_cutPixelHits
Definition: InDetVKalVxInJetTool.h:179
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:272
xAOD::numberOfSCTSpoiltHits
@ numberOfSCTSpoiltHits
number of SCT hits with broad errors (width/sqrt(12)) [unit8_t].
Definition: TrackingPrimitives.h:274
InDet::InDetVKalVxInJetTool::m_h
std::unique_ptr< Hists > m_h
Definition: InDetVKalVxInJetTool.h:175
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
InDet::InDetVKalVxInJetTool::m_fitSvc
Trk::TrkVKalVrtFitter * m_fitSvc
Definition: InDetVKalVxInJetTool.h:250
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
InDet::InDetVKalVxInJetTool::getPixelLayers
void getPixelLayers(const xAOD::TrackParticle *Part, int &blHit, int &l1Hit, int &l2Hit, int &nLay) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:441
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDet::InDetVKalVxInJetTool::getG4Inter
static int getG4Inter(const xAOD::TrackParticle *TP)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:629
Jet
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:47
Trk::TrkVKalVrtFitter::CreatePerigee
virtual std::unique_ptr< Trk::Perigee > CreatePerigee(const std::vector< double > &VKPerigee, const std::vector< double > &VKCov, IVKalState &istate) const override final
Definition: CvtPerigee.cxx:159
InDet::InDetVKalVxInJetTool::m_sel2VrtSigCut
DoubleProperty m_sel2VrtSigCut
Definition: InDetVKalVxInJetTool.h:197
InDet::InDetVKalVxInJetTool::getHists
Hists & getHists() const
Definition: InDetVKalVxInJetTool.cxx:395
Trk::TrkVKalVrtFitter::setRobustness
virtual void setRobustness(int, IVKalState &istate) const override final
Definition: SetFitOptions.cxx:116
InDet::InDetVKalVxInJetTool::m_timingProfile
ServiceHandle< IChronoStatSvc > m_timingProfile
Definition: InDetVKalVxInJetTool.h:251
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
InDet::InDetVKalVxInJetTool::DevTuple::maxNVrt
static const int maxNVrt
Definition: InDetVKalVxInJetTool.h:290
InDet::InDetVKalVxInJetTool::findMax
static int findMax(std::vector< double > &chi2PerTrk, std::vector< float > &rank)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:318
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::numberOfNextToInnermostPixelLayerSplitHits
@ numberOfNextToInnermostPixelLayerSplitHits
number of Pixel 1st layer barrel hits split by cluster splitting
Definition: TrackingPrimitives.h:251
InDet::InDetVKalVxInJetTool::vrtRadiusError
static double vrtRadiusError(const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:262
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::InDetVKalVxInJetTool::m_rLayerB
double m_rLayerB
Definition: InDetVKalVxInJetTool.h:221
InDet::InDetVKalVxInJetTool::jetProjDist
static double jetProjDist(Amg::Vector3D &SecVrt, const xAOD::Vertex &primVrt, const TLorentzVector &JetDir)
Definition: BTagVrtSecMulti.cxx:1605
InDet::InDetVKalVxInJetTool::notFromBC
static int notFromBC(int PDGID)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:606
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
DMTest::P
P_v1 P
Definition: P.h:23
InDet::InDetVKalVxInJetTool::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: InDetVKalVxInJetTool.h:268
Trk::TrkVKalVrtFitter::VKalVrtFitFast
virtual StatusCode VKalVrtFitFast(std::span< const xAOD::TrackParticle *const >, Amg::Vector3D &Vertex, double &minDZ, IVKalState &istate) const
Definition: VKalVrtFitFastSvc.cxx:56
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
InDet::InDetVKalVxInJetTool::m_chiScale
float m_chiScale[11]
Definition: InDetVKalVxInJetTool.h:363
python.compressB64.sx
string sx
Definition: compressB64.py:96
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
skel.it
it
Definition: skel.GENtoEVGEN.py:396
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
InDet::InDetVKalVxInJetTool::m_cutSiHits
IntegerProperty m_cutSiHits
Definition: InDetVKalVxInJetTool.h:181
bin
Definition: BinsDiffFromStripMedian.h:43
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
InDet::InDetVKalVxInJetTool::m_coneForTag
DoubleProperty m_coneForTag
Definition: InDetVKalVxInJetTool.h:193
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::TrkVKalVrtFitter::VKalGetImpact
virtual double VKalGetImpact(const xAOD::TrackParticle *, const Amg::Vector3D &Vertex, const long int Charge, dvect &Impact, dvect &ImpactError, IVKalState &istate) const override final
Definition: VKalGetImpact.cxx:91
InDet::InDetVKalVxInJetTool::m_useVertexCleaningPix
BooleanProperty m_useVertexCleaningPix
Definition: InDetVKalVxInJetTool.h:226
InDet::InDetVKalVxInJetTool::m_beampipeR
double m_beampipeR
Definition: InDetVKalVxInJetTool.h:220
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
InDet::median
float median(std::vector< float > &Vec)
Definition: BTagVrtSec.cxx:35
InDet::InDetVKalVxInJetTool::minVrtVrtDist
double minVrtVrtDist(std::vector< WrkVrt > *WrkVrtSet, int &V1, int &V2) const
Definition: BTagVrtSecMulti.cxx:1263
InDet::InDetVKalVxInJetTool::m_trackDetachCut
DoubleProperty m_trackDetachCut
Definition: InDetVKalVxInJetTool.h:245
xAOD::expectInnermostPixelLayerHit
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
Definition: TrackingPrimitives.h:236
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
InDet::InDetVKalVxInJetTool::massV0
static double massV0(std::vector< std::vector< double > > &trkAtVrt, double massP, double massPi)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:292
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
x
#define x
xAOD::Vertex_v1::setCovariance
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
InDet::InDetVKalVxInJetTool::m_useFrozenVersion
BooleanProperty m_useFrozenVersion
Definition: InDetVKalVxInJetTool.h:210
InDet::getVrtScore
float getVrtScore(int i, int j, std::vector< std::vector< float >> &trkScore)
Definition: BTagVrtSec.cxx:58
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
xAOD::numberOfBLayerHits
@ numberOfBLayerHits
these are the hits in the first pixel layer, i.e.
Definition: TrackingPrimitives.h:231
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
InDet::InDetVKalVxInJetTool::mergeAndRefitVertices
double mergeAndRefitVertices(std::vector< WrkVrt > *WrkVrtSet, int V1, int V2, WrkVrt &newvrt, std::vector< const Particle * > &AllTrackList, Trk::IVKalState &istate) const
Definition: BTagVrtSecMulti.cxx:1338
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
InDet::InDetVKalVxInJetTool::fillNVrtNTup
void fillNVrtNTup(std::vector< WrkVrt > &vrtSet, std::vector< std::vector< float > > &trkScore, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:550
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
InDet::InDetVKalVxInJetTool::fillVrtNTup
void fillVrtNTup(std::vector< Vrt2Tr > &all2TrVrt) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:524
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
InDet::InDetVKalVxInJetTool::GetTrkFitWeights
StatusCode GetTrkFitWeights(std::vector< double > &wgt, const Trk::IVKalState &istate) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:435
Trk::pixelEndCap0
@ pixelEndCap0
three pixel discs (on each side)
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:237
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:129
python.changerun.kk
list kk
Definition: changerun.py:41
InDet::InDetVKalVxInJetTool::m_rLayer1
double m_rLayer1
Definition: InDetVKalVxInJetTool.h:222
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
xAOD::Vertex_v1::addTrackAtVertex
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
Definition: Vertex_v1.cxx:314
InDet::c_vrtBCMassLimit
const double c_vrtBCMassLimit
Definition: BTagVrtSec.cxx:66
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:262
Trk::TrkVKalVrtFitter::setMassForConstraint
virtual void setMassForConstraint(double Mass, IVKalState &istate) const override final
Definition: SetFitOptions.cxx:134
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::expectNextToInnermostPixelLayerHit
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
Definition: TrackingPrimitives.h:247
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
InDet::InDetVKalVxInJetTool::VKalVrtFitBase
StatusCode VKalVrtFitBase(const std::vector< const xAOD::TrackParticle * > &listPart, Amg::Vector3D &Vertex, TLorentzVector &Momentum, long int &Charge, std::vector< double > &ErrorMatrix, std::vector< double > &Chi2PerTrk, std::vector< std::vector< double > > &TrkAtVrt, double &Chi2, Trk::IVKalState &istate, bool ifCovV0) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:417
InDet::InDetVKalVxInJetTool::m_useTrackClassificator
bool m_useTrackClassificator
Definition: InDetVKalVxInJetTool.h:253
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:355
Trk::pixelBarrel2
@ pixelBarrel2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:234
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDet::InDetVKalVxInJetTool::getPixelProblems
void getPixelProblems(const xAOD::TrackParticle *Part, int &splshIBL, int &splshBL) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:487
z
#define z
InDet::InDetVKalVxInJetTool::m_useEtaDependentCuts
bool m_useEtaDependentCuts
Definition: InDetVKalVxInJetTool.h:259
Trk::TrkVKalVrtFitter::setApproximateVertex
virtual void setApproximateVertex(double X, double Y, double Z, IVKalState &istate) const override final
Definition: SetFitOptions.cxx:108
Trk::pixelEndCap1
@ pixelEndCap1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:238
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::InDetVKalVxInJetTool::totalMom
TLorentzVector totalMom(const std::vector< const Trk::Perigee * > &inpTrk) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:354
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::InDetVKalVxInJetTool::m_multiVertex
BooleanProperty m_multiVertex
Definition: InDetVKalVxInJetTool.h:232
InDet::InDetVKalVxInJetTool::m_cutSharedHits
IntegerProperty m_cutSharedHits
Definition: InDetVKalVxInJetTool.h:185
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
Trk::TrkVKalVrtFitter::setCnstType
virtual void setCnstType(int, IVKalState &istate) const override final
Definition: SetFitOptions.cxx:82
InDet::InDetVKalVxInJetTool::m_cutChi2
DoubleProperty m_cutChi2
Definition: InDetVKalVxInJetTool.h:190
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
AnalysisUtils::Sort::pT
void pT(COLL *coll)
sort by pT
Definition: AnalysisMisc.h:315
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::InDetVKalVxInJetTool::m_secTrkChi2Cut
DoubleProperty m_secTrkChi2Cut
Definition: InDetVKalVxInJetTool.h:191
InDet::InDetVKalVxInJetTool::m_cutBVrtScore
DoubleProperty m_cutBVrtScore
Definition: InDetVKalVxInJetTool.h:205
xAOD::numberOfPixelOutliers
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:260
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT_PAI_gasdata::SC
const float SC[NC]
Cross sections for Carbon.
Definition: TRT_PAI_gasdata.h:255
InDet::InDetVKalVxInJetTool::m_beamPipeMgr
const BeamPipeDetectorManager * m_beamPipeMgr
Definition: InDetVKalVxInJetTool.h:267
InDet::InDetVKalVxInJetTool::getMCPileup
static int getMCPileup(const xAOD::TrackParticle *TP)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:638
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
InDet::InDetVKalVxInJetTool::selGoodTrkParticle
int selGoodTrkParticle(const std::vector< const xAOD::TrackParticle * > &inpPart, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< const xAOD::TrackParticle * > &selPart, float evtWgt=1.) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/CutTrk.cxx:103
xAOD::Vertex_v1::z
float z() const
Returns the z position.
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
InDet::InDetVKalVxInJetTool::removeDoubleEntries
void removeDoubleEntries(std::vector< const Trk * > &) const
Definition: InDetVKalVxInJetTool.h:581
InDet::InDetVKalVxInJetTool::rankBTrk
double rankBTrk(double TrkPt, double JetPt, double Signif) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:21
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
InDet::InDetVKalVxInJetTool::m_vrt2TrMassLimit
DoubleProperty m_vrt2TrMassLimit
Definition: InDetVKalVxInJetTool.h:207
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
InDet::InDetVKalVxInJetTool::m_cutSctHits
IntegerProperty m_cutSctHits
Definition: InDetVKalVxInJetTool.h:177
InDet::InDetVKalVxInJetTool::disassembleVertex
void disassembleVertex(std::vector< WrkVrt > *WrkVrtSet, int iv, std::vector< const Particle * > AllTracks, Trk::IVKalState &istate) const
Definition: BTagVrtSecMulti.cxx:947
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
InDet::InDetVKalVxInJetTool::m_cutBLayHits
IntegerProperty m_cutBLayHits
Definition: InDetVKalVxInJetTool.h:183
InDet::InDetVKalVxInJetTool::m_ITkPixMaterialMap
std::unique_ptr< TH2D > m_ITkPixMaterialMap
Definition: InDetVKalVxInJetTool.h:269
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
InDet::InDetVKalVxInJetTool::m_rejectBadVertices
BooleanProperty m_rejectBadVertices
Definition: InDetVKalVxInJetTool.h:230
InDet::InDetVKalVxInJetTool::getVrtSecMulti
std::vector< xAOD::Vertex * > getVrtSecMulti(workVectorArrxAOD *, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &results, compatibilityGraph_t &compatibilityGraph) const
Definition: BTagVrtSecMulti.cxx:41
InDet::InDetVKalVxInJetTool::VKalVrtFitFastBase
StatusCode VKalVrtFitFastBase(const std::vector< const xAOD::TrackParticle * > &listPart, Amg::Vector3D &Vertex, Trk::IVKalState &istate) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:408
InDet::InDetVKalVxInJetTool::m_massE
const double m_massE
Definition: InDetVKalVxInJetTool.h:273
TauGNNUtils::Variables::Track::trackPt
bool trackPt(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:472
beamspotman.dir
string dir
Definition: beamspotman.py:623
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
Trk::pixelBarrel1
@ pixelBarrel1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:233
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg::py
@ py
Definition: GeoPrimitives.h:39
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
InDet::InDetVKalVxInJetTool::m_cutPt
DoubleProperty m_cutPt
Definition: InDetVKalVxInJetTool.h:187
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::InDetVKalVxInJetTool::getIdHF
static int getIdHF(const xAOD::TrackParticle *TP)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:578
xAOD::numberOfPixelSpoiltHits
@ numberOfPixelSpoiltHits
number of pixel hits with broad errors (width/sqrt(12)) [unit8_t].
Definition: TrackingPrimitives.h:267
InDet::InDetVKalVxInJetTool::m_rLayer2
double m_rLayer2
Definition: InDetVKalVxInJetTool.h:223
InDet::InDetVKalVxInJetTool::m_etaDependentCutsSvc
ServiceHandle< InDet::IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
service to get cut values depending on different variable
Definition: InDetVKalVxInJetTool.h:262
InDet::InDetVKalVxInJetTool::trackClassification
static void trackClassification(std::vector< WrkVrt > *wrkVrtSet, std::vector< std::deque< long int > > *trkInVrt)
Definition: BTagVrtSecMulti.cxx:1082
InDet::InDetVKalVxInJetTool::m_massB
const double m_massB
Definition: InDetVKalVxInJetTool.h:276
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:192
Results
std::vector< Result > Results
Definition: CscSplitClusterFitter.cxx:22
InDet::InDetVKalVxInJetTool::m_fillHist
BooleanProperty m_fillHist
Definition: InDetVKalVxInJetTool.h:212
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::InDetVKalVxInJetTool::refitVertex
StatusCode refitVertex(std::vector< WrkVrt > *WrkVrtSet, int selectedVertex, std::vector< const Particle * > &selectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
Definition: BTagVrtSecMulti.cxx:1550
Trk::TrkVKalVrtFitter::VKalGetTrkWeights
virtual StatusCode VKalGetTrkWeights(dvect &Weights, const IVKalState &istate) const override final
Definition: VKalVrtFitSvc.cxx:546
InDet::InDetVKalVxInJetTool::clean1TrVertexSet
static void clean1TrVertexSet(std::vector< WrkVrt > *WrkVrtSet)
Definition: BTagVrtSecMulti.cxx:1026
InDet::InDetVKalVxInJetTool::removeTrackFromVertex
void removeTrackFromVertex(std::vector< WrkVrt > *wrkVrtSet, std::vector< std::deque< long int > > *trkInVrt, long int &selectedTrack, long int &selectedVertex) const
Definition: BTagVrtSecMulti.cxx:1188
Trk::VxSecVKalVertexInfo
Definition: VxSecVKalVertexInfo.h:70
InDet::InDetVKalVxInJetTool::m_useVertexCleaningFMP
BooleanProperty m_useVertexCleaningFMP
Definition: InDetVKalVxInJetTool.h:228
IDTPM::chiSquared
float chiSquared(const U &p)
Definition: TrackParametersHelper.h:128
InDet::InDetVKalVxInJetTool::m_sel2VrtChi2Cut
DoubleProperty m_sel2VrtChi2Cut
Definition: InDetVKalVxInJetTool.h:195
InDet::InDetVKalVxInJetTool::m_fitter
ToolHandle< Trk::IVertexFitter > m_fitter
Definition: InDetVKalVxInJetTool.h:249
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
InDet::InDetVKalVxInJetTool::getPixelDiscs
static void getPixelDiscs(const xAOD::TrackParticle *Part, int &d0Hit, int &d1Hit, int &d2Hit)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:501
InDet::InDetVKalVxInJetTool::m_zTrkErrorCut
DoubleProperty m_zTrkErrorCut
Definition: InDetVKalVxInJetTool.h:203
Amg::deltaR
double deltaR(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
Definition: GeoPrimitivesHelpers.h:122
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
InDet::InDetVKalVxInJetTool::m_useITkMaterialRejection
BooleanProperty m_useITkMaterialRejection
Definition: InDetVKalVxInJetTool.h:265
InDet::InDetVKalVxInJetTool::mergeAndRefitOverlapVertices
void mergeAndRefitOverlapVertices(std::vector< WrkVrt > *WrkVrtSet, int V1, int V2, std::vector< const Particle * > &AllTrackLis, Trk::IVKalState &istate) const
Definition: BTagVrtSecMulti.cxx:1387
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition: DVL_algorithms.h:135
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
InDet::InDetVKalVxInJetTool::MaxOfShared
static double MaxOfShared(std::vector< WrkVrt > *WrkVrtSet, std::vector< std::deque< long int > > *trkInVrt, long int &selectedTrack, long int &selectedVertex)
Definition: BTagVrtSecMulti.cxx:1100
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
InDet::InDetVKalVxInJetTool::momAtVrt
TLorentzVector momAtVrt(const std::vector< double > &inpTrk) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:385
InDet::InDetVKalVxInJetTool::getVrtSec
xAOD::Vertex * getVrtSec(const std::vector< const xAOD::TrackParticle * > &inpTrk, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &results, std::vector< const xAOD::TrackParticle * > &selSecTrk, std::vector< const xAOD::TrackParticle * > &trkFromV0, int &nRefPVTrk, compatibilityGraph_t &compatibilityGraph) const
Definition: BTagVrtSec.cxx:69
xAOD::numberOfSCTOutliers
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
Definition: TrackingPrimitives.h:269
InDet::InDetVKalVxInJetTool::m_rLayer3
double m_rLayer3
Definition: InDetVKalVxInJetTool.h:224
python.BackTrackingConfig.numThreads
int numThreads
Definition: BackTrackingConfig.py:61
InDet::InDetVKalVxInJetTool::getPreviousParent
static const xAOD::TruthParticle * getPreviousParent(const xAOD::TruthParticle *child, int &ParentPDG)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:617
InDet::InDetVKalVxInJetTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: InDetVKalVxInJetTool.h:257
xAOD::TruthVertex_v1::nIncomingParticles
size_t nIncomingParticles() const
Get the number of incoming particles.
Definition: TruthVertex_v1.cxx:47
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
InDet::InDetVKalVxInJetTool::m_massLam
const double m_massLam
Definition: InDetVKalVxInJetTool.h:275
xAOD::Vertex_v1::y
float y() const
Returns the y position.
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDet::InDetVKalVxInJetTool::m_trackClassificator
ToolHandle< IInDetTrkInJetType > m_trackClassificator
Definition: InDetVKalVxInJetTool.h:255
Amg::setRThetaPhi
void setRThetaPhi(Amg::Vector3D &v, double r, double theta, double phi)
sets radius, the theta and phi angle of a vector.
Definition: GeoPrimitivesHelpers.h:80
InDet::InDetVKalVxInJetTool::cutTrk
StatusCode cutTrk(const std::unordered_map< std::string, double > &TrkVarDouble, const std::unordered_map< std::string, int > &TrkVarInt, float evtWgt=1.) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/CutTrk.cxx:17
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DetType::Part
Part
Definition: DetType.h:14
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
InDet::InDetVKalVxInJetTool::improveVertexChi2
double improveVertexChi2(std::vector< WrkVrt > *WrkVrtSet, int V, std::vector< const Particle * > &AllTracks, Trk::IVKalState &istate, bool ifCovV0) const
Definition: BTagVrtSecMulti.cxx:1512
InDet::InDetVKalVxInJetTool::fitCommonVrt
double fitCommonVrt(std::vector< const Trk * > &listSecondTracks, std::vector< float > &trkRank, const xAOD::Vertex &primVrt, const TLorentzVector &jetDir, std::vector< double > &inpMass, Amg::Vector3D &fitVertex, std::vector< double > &errorMatrix, TLorentzVector &momentum, std::vector< std::vector< double > > &trkAtVrt) const
xAOD::numberOfInnermostPixelLayerSharedHits
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
Definition: TrackingPrimitives.h:239
InDet::InDetVKalVxInJetTool::m_massPi
const double m_massPi
Definition: InDetVKalVxInJetTool.h:271
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
xAOD::numberOfContribPixelLayers
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector [unit8_t].
Definition: TrackingPrimitives.h:230
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
InDet::InDetVKalVxInJetTool::check2TrVertexInPixel
bool check2TrVertexInPixel(const Track *p1, const Track *p2, Amg::Vector3D &, std::vector< double > &) const
Definition: BTagVrtSec.cxx:921
InDet::InDetVKalVxInJetTool::pTvsDir
static double pTvsDir(const Amg::Vector3D &Dir, const std::vector< double > &inpTrk)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:333
InDet::InDetVKalVxInJetTool::m_existIBL
BooleanProperty m_existIBL
Definition: InDetVKalVxInJetTool.h:214
InDet::InDetVKalVxInJetTool::m_vertexMergeCut
DoubleProperty m_vertexMergeCut
Definition: InDetVKalVxInJetTool.h:243
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
calibdata.copy
bool copy
Definition: calibdata.py:27
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
Trk::TrkVKalVrtFitter::VKalVrtCvtTool
virtual StatusCode VKalVrtCvtTool(const Amg::Vector3D &Vertex, const TLorentzVector &Momentum, const dvect &CovVrtMom, const long int &Charge, dvect &Perigee, dvect &CovPerigee, IVKalState &istate) const override final
Definition: VKalVrtFitSvc.cxx:364
InDet::InDetVKalVxInJetTool::m_a0TrkErrorCut
DoubleProperty m_a0TrkErrorCut
Definition: InDetVKalVxInJetTool.h:201
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
InDet::InDetVKalVxInJetTool::m_multiWithPrimary
BooleanProperty m_multiWithPrimary
Definition: InDetVKalVxInJetTool.h:234
OfflineHitType::Outlier
@ Outlier
xAOD::numberOfNextToInnermostPixelLayerSharedHits
@ numberOfNextToInnermostPixelLayerSharedHits
number of Pixel 1st layer barrel hits shared by several tracks.
Definition: TrackingPrimitives.h:250
InDet::InDetVKalVxInJetTool::compatibilityGraph_t
boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS > compatibilityGraph_t
Definition: InDetVKalVxInJetTool.h:362
PlotCalibFromCool.vv
vv
Definition: PlotCalibFromCool.py:716
InDet::InDetVKalVxInJetTool::projSV_PV
static double projSV_PV(const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Jet)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:103
InDet::InDetVKalVxInJetTool::m_multiWithOneTrkVrt
BooleanProperty m_multiWithOneTrkVrt
Definition: InDetVKalVxInJetTool.h:240
InDet::InDetVKalVxInJetTool::DevTuple::maxNTrk
static const int maxNTrk
Definition: InDetVKalVxInJetTool.h:289
InDet::InDetVKalVxInJetTool::m_cutA0
DoubleProperty m_cutA0
Definition: InDetVKalVxInJetTool.h:189
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FlavorTagDiscriminants::OnnxModelVersion::V1
@ V1
InDet::InDetVKalVxInJetTool::coneDist
static double coneDist(const AmgVector(5) &, const TLorentzVector &)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:276
Trk::TrkVKalVrtFitter::setMassInputParticles
virtual void setMassInputParticles(const std::vector< double > &, IVKalState &istate) const override final
Definition: SetFitOptions.cxx:187
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
InDet::InDetVKalVxInJetTool::m_massP
const double m_massP
Definition: InDetVKalVxInJetTool.h:272
InDet::InDetVKalVxInJetTool::getPerigee
static const Trk::Perigee * getPerigee(const xAOD::TrackParticle *)
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:401
InDet::InDetVKalVxInJetTool::vrtVrtDist
double vrtVrtDist(const xAOD::Vertex &primVrt, const Amg::Vector3D &SecVrt, const std::vector< double > &VrtErr, double &Signif) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:126
InDet::InDetVKalVxInJetTool::m_massK0
const double m_massK0
Definition: InDetVKalVxInJetTool.h:274
InDet::InDetVKalVxInJetTool::nTrkCommon
static int nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, int V1, int V2)
Definition: BTagVrtSecMulti.cxx:1238
InDet::InDetVKalVxInJetTool::vrtVrtDist2D
double vrtVrtDist2D(const xAOD::Vertex &primVrt, const Amg::Vector3D &SecVrt, const std::vector< double > &VrtErr, double &Signif) const
Definition: InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx:160
InDet::InDetVKalVxInJetTool::m_getNegativeTail
BooleanProperty m_getNegativeTail
Definition: InDetVKalVxInJetTool.h:236
Trk::TrkVKalVrtFitter::makeState
virtual std::unique_ptr< IVKalState > makeState(const EventContext &ctx) const override final
Definition: TrkVKalVrtFitter.cxx:118
InDet::InDetVKalVxInJetTool::check1TrVertexInPixel
bool check1TrVertexInPixel(const Track *p1, Amg::Vector3D &, std::vector< double > &) const
Definition: InDetVKalVxInJetTool.h:606
InDet::InDetVKalVxInJetTool::m_trkSigCut
DoubleProperty m_trkSigCut
Definition: InDetVKalVxInJetTool.h:199
fitman.k
k
Definition: fitman.py:528
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
InDet::InDetVKalVxInJetTool::m_getNegativeTag
BooleanProperty m_getNegativeTag
Definition: InDetVKalVxInJetTool.h:238
InDet::InDetVKalVxInJetTool::select2TrVrt
int select2TrVrt(std::vector< const Trk * > &SelectedTracks, std::vector< const Trk * > &TracksForFit, const xAOD::Vertex &primVrt, const TLorentzVector &JetDir, std::vector< double > &InpMass, int &nRefPVTrk, std::vector< const Trk * > &TrkFromV0, std::vector< const Trk * > &ListSecondTracks, compatibilityGraph_t &compatibilityGraph, float evtWgt=1) const
InDet::InDetVKalVxInJetTool::m_RobustFit
IntegerProperty m_RobustFit
Definition: InDetVKalVxInJetTool.h:217
Trk::TrkVKalVrtFitter
Definition: TrkVKalVrtFitter.h:67
InDet::InDetVKalVxInJetTool::minVrtVrtDistNext
static double minVrtVrtDistNext(std::vector< WrkVrt > *WrkVrtSet, int &V1, int &V2)
Definition: BTagVrtSecMulti.cxx:1312
xAOD::TruthVertex_v1::incomingParticleLinks
const TPLinks_t & incomingParticleLinks() const
Get all the incoming particles.