ATLAS Offline Software
Loading...
Searching...
No Matches
Rec::NewVrtSecInclusiveTool Class Reference

#include <NewVrtSecInclusiveTool.h>

Inheritance diagram for Rec::NewVrtSecInclusiveTool:
Collaboration diagram for Rec::NewVrtSecInclusiveTool:

Classes

struct  Hists
struct  DevTuple
struct  Vrt2Tr
struct  WrkVrt

Public Member Functions

 NewVrtSecInclusiveTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~NewVrtSecInclusiveTool ()
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual std::unique_ptr< Trk::VxSecVertexInfofindAllVertices (const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &inputTracks, const xAOD::Vertex &primaryVertex) const override final
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
 DeclareInterfaceID (IVrtInclusive, 1, 0)

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

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

Private Member Functions

void lockDecorations (const std::vector< const xAOD::TrackParticle * > &inpTrk) const
int getIdHF (const xAOD::TrackParticle *TP) const
std::vector< xAOD::Vertex * > getVrtSecMulti (const EventContext &ctx, workVectorArrxAOD *inpParticlesxAOD, const xAOD::Vertex &primVrt, compatibilityGraph_t &compatibilityGraph) const
void printWrkSet (const std::vector< WrkVrt > *WrkSet, const std::string &name) const
ROOT::Math::PxPyPzEVector momAtVrt (const std::vector< double > &inpTrk) const
double minVrtVrtDist (std::vector< WrkVrt > *WrkVrtSet, int &indexV1, int &indexV2, std::vector< double > &check) const
double distToMatLayerSignificance (Vrt2Tr &Vrt) const
double refitVertex (WrkVrt &Vrt, std::vector< const xAOD::TrackParticle * > &SelectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
double refineVerticesWithCommonTracks (WrkVrt &v1, WrkVrt &v2, std::vector< const xAOD::TrackParticle * > &allTrackList, Trk::IVKalState &istate) const
double mergeAndRefitVertices (WrkVrt &v1, WrkVrt &v2, WrkVrt &newvrt, std::vector< const xAOD::TrackParticle * > &AllTrackList, Trk::IVKalState &istate, int robKey=0) const
double improveVertexChi2 (WrkVrt &vertex, std::vector< const xAOD::TrackParticle * > &allTracks, Trk::IVKalState &istate, bool ifCovV0) const
void selGoodTrkParticle (workVectorArrxAOD *xAODwrk, const xAOD::Vertex &primVrt) const
void select2TrVrt (const EventContext &ctx, std::vector< const xAOD::TrackParticle * > &SelectedTracks, const xAOD::Vertex &primVrt, std::map< long int, std::vector< double > > &vrt, compatibilityGraph_t &compatibilityGraph) const
HistsgetHists () const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static const xAOD::TruthParticlegetPreviousParent (const xAOD::TruthParticle *child)
static bool isExcitedHadron (const xAOD::TruthParticle *tp)
static bool isDisplaced (const xAOD::TrackParticle *tp)
static int getG4Inter (const xAOD::TrackParticle *TP)
static int getMCPileup (const xAOD::TrackParticle *TP)
static int getProdVrtBarcode (const xAOD::TrackParticle *TP, float resolLimit=0.1)
static bool checkTrue2TrVrt (const xAOD::TrackParticle *TP1, const xAOD::TrackParticle *TP2, float nearCut=0.1)
static double massV0 (const std::vector< std::vector< double > > &TrkAtVrt, double massP, double massPi)
static double vrtRadiusError (const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr)
static int nTrkCommon (std::vector< WrkVrt > *WrkVrtSet, int indexV1, int indexV2)
static bool isPart (const std::deque< long int > &test, std::deque< long int > base)
static std::vector< double > estimVrtPos (int nTrk, std::deque< long int > &selTrk, std::map< long int, std::vector< double > > &vrt)
static double vrtVrtDist (const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
static double vrtVrtDist2D (const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
static double vrtVrtDist (const Amg::Vector3D &vrt1, const std::vector< double > &vrtErr1, const Amg::Vector3D &vrt2, const std::vector< double > &vrtErr2)
static double PntPntDist (const Amg::Vector3D &Vrt1, const Amg::Vector3D &Vrt2)
static double projSV_PV (const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
static double MomProjDist (const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
static int mostHeavyTrk (WrkVrt V, std::vector< const xAOD::TrackParticle * > AllTracks)
static void getPixelDiscs (const xAOD::TrackParticle *Part, int &d0Hit, int &d1Hit, int &d2Hit)
static int getIBLHit (const xAOD::TrackParticle *Part)
static int getBLHit (const xAOD::TrackParticle *Part)

Private Attributes

double m_w_1 {}
std::unique_ptr< Histsm_h
Gaudi::Property< bool > m_fillHist {this, "FillHist", false, "Fill debugging and development histograms+ntuple" }
Gaudi::Property< int > m_cutSctHits {this, "CutSctHits", 4, "Remove track if it has less SCT hits" }
Gaudi::Property< int > m_cutPixelHits {this, "CutPixelHits", 2, "Remove track if it has less Pixel hits"}
Gaudi::Property< int > m_cutTRTHits {this, "CutTRTHits", 10, "Remove track if it has less TRT hits"}
Gaudi::Property< int > m_cutSiHits {this, "CutSiHits", 8, "Remove track if it has less Pixel+SCT hits" }
Gaudi::Property< int > m_cutBLayHits {this, "CutBLayHits", 0, "Remove track if it has less B-layer hits" }
Gaudi::Property< int > m_cutSharedHits {this,"CutSharedHits",1, "Reject final 2tr vertices if tracks have shared hits" }
Gaudi::Property< float > m_cutPt {this, "CutPt", 500., "Track Pt selection cut" }
Gaudi::Property< float > m_cutD0Min {this, "CutD0Min", 0., "Track minimal D0 selection cut" }
Gaudi::Property< float > m_cutD0Max {this, "CutD0Max", 10., "Track maximal D0 selection cut" }
Gaudi::Property< float > m_maxZVrt {this, "MaxZVrt", 15., "Track Z impact selection max"}
Gaudi::Property< float > m_minZVrt {this, "MinZVrt", 0., "Track Z impact selection min"}
Gaudi::Property< float > m_cutChi2 {this, "CutChi2", 5., "Track Chi2 selection cut" }
Gaudi::Property< float > m_antiPileupSigRCut {this, "AntiPileupSigRCut", 2.0, "Upper cut on significance of 2D distance between beam and perigee" }
Gaudi::Property< float > m_trkSigCut {this, "TrkSigCut", 2.0, "Track 3D impact significance w/r primary vertex. Should be >=AntiPileupSigRCut" }
Gaudi::Property< float > m_dRdZRatioCut {this, "dRdZRatioCut", 0.25, "Cut on dR/dZ ratio to remove pileup tracks" }
Gaudi::Property< float > m_fastZSVCut {this, "FastZSVCut", 10., "Cut to remove SV candidates based on fast SV estimation. To save full fit CPU." }
Gaudi::Property< float > m_removeTrkMatSignif {this, "removeTrkMatSignif", 0., "Significance of Vertex-TrackingMaterial distance for removal. No removal if <=0." }
Gaudi::Property< float > m_beampipeR {this, "BeampipeR", 24.3, "Radius of the beampipe material for aggressive material rejection" }
Gaudi::Property< float > m_vrtMassLimit {this, "VrtMassLimit", 5500., "Maximal allowed mass for found vertices" }
Gaudi::Property< float > m_globVrtProbCut {this, "GlobVrtProbCut", 0.005, "Cut on probability of any vertex for final selection" }
Gaudi::Property< float > m_maxSVRadiusCut {this, "MaxSVRadiusCut", 140., "Cut on maximal radius of SV (def = Pixel detector size)" }
Gaudi::Property< float > m_selVrtSigCut {this, "SelVrtSigCut", 3.0, "Cut on significance of 3D distance between vertex and PV" }
Gaudi::Property< float > m_vertexMergeCut {this, "VertexMergeCut", 4., "To allow vertex merging for MultiVertex Finder" }
Gaudi::Property< bool > m_multiWithOneTrkVrt {this, "MultiWithOneTrkVrt", true, "Allow one-track-vertex addition to already found secondary vertices"}
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
ToolHandle< Trk::IExtrapolatorm_extrapolator {this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator", "Name of the extrapolator tool"}
ToolHandle< Trk::TrkVKalVrtFitterm_fitSvc {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool", "Name of the Vertex Fitter tool"}
ToolHandle< Reco::ITrackToVertexm_trackToVertexTool {this, "TrackToVertexTool", "Reco::TrackToVertex/TrackToVertex", "Name of the TrackToVertex tool"}
ToolHandle< Rec::ITwoTrackVertexSelectorm_ini_v2trselector
ToolHandle< Rec::ITwoTrackVertexSelectorm_fin_v2trselector
Gaudi::Property< std::string > m_augString {this, "AugmentingVersionString", "_NVSI", "Augmentation version string"}
double m_massPi {}
double m_massP {}
double m_massE {}
double m_massK0 {}
double m_massLam {}
std::string m_instanceName
SG::AuxElement::Decorator< char > m_is_selected
SG::AuxElement::Decorator< char > m_is_svtrk_final
SG::AuxElement::Decorator< float > m_pt_wrtSV
SG::AuxElement::Decorator< float > m_eta_wrtSV
SG::AuxElement::Decorator< float > m_phi_wrtSV
SG::AuxElement::Decorator< float > m_d0_wrtSV
SG::AuxElement::Decorator< float > m_z0_wrtSV
SG::AuxElement::Decorator< float > m_errP_wrtSV
SG::AuxElement::Decorator< float > m_errd0_wrtSV
SG::AuxElement::Decorator< float > m_errz0_wrtSV
SG::AuxElement::Decorator< float > m_chi2_toSV
float m_chiScale [11] {}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 81 of file NewVrtSecInclusiveTool.h.

Member Typedef Documentation

◆ compatibilityGraph_t

using Rec::NewVrtSecInclusiveTool::compatibilityGraph_t = boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>
private

Definition at line 312 of file NewVrtSecInclusiveTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ NewVrtSecInclusiveTool()

Rec::NewVrtSecInclusiveTool::NewVrtSecInclusiveTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 30 of file NewVrtSecInclusiveTool.cxx.

32 :
33 AthAlgTool(type,name,parent),
34 m_instanceName(name),
35 m_is_selected("is_selected"),
36 m_is_svtrk_final("is_svtrk_final"),
37 m_pt_wrtSV("pt_wrtSV"),
38 m_eta_wrtSV("eta_wrtSV"),
39 m_phi_wrtSV("phi_wrtSV"),
40 m_d0_wrtSV("d0_wrtSV"),
41 m_z0_wrtSV("z0_wrtSV"),
42 m_errP_wrtSV("errP_wrtSV"),
43 m_errd0_wrtSV("errd0_wrtSV"),
44 m_errz0_wrtSV("errz0_wrtSV"),
45 m_chi2_toSV("chi2_toSV")
46 {
47//
48// Declare additional interface
49//
50 declareInterface< IVrtInclusive >(this);
51//
57
58 }
AthAlgTool()
Default constructor:
SG::AuxElement::Decorator< float > m_eta_wrtSV
SG::AuxElement::Decorator< float > m_chi2_toSV
SG::AuxElement::Decorator< float > m_errP_wrtSV
SG::AuxElement::Decorator< float > m_z0_wrtSV
SG::AuxElement::Decorator< float > m_pt_wrtSV
SG::AuxElement::Decorator< float > m_errd0_wrtSV
SG::AuxElement::Decorator< float > m_errz0_wrtSV
SG::AuxElement::Decorator< float > m_d0_wrtSV
SG::AuxElement::Decorator< char > m_is_selected
SG::AuxElement::Decorator< char > m_is_svtrk_final
SG::AuxElement::Decorator< float > m_phi_wrtSV
constexpr double lambdaMassInMeV
the mass of the lambda baryon (in MeV)
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses

◆ ~NewVrtSecInclusiveTool()

Rec::NewVrtSecInclusiveTool::~NewVrtSecInclusiveTool ( )
virtual

Definition at line 61 of file NewVrtSecInclusiveTool.cxx.

61 {
62 ATH_MSG_DEBUG("NewVrtSecInclusiveTool destructor called");
63 }
#define ATH_MSG_DEBUG(x)

Member Function Documentation

◆ checkTrue2TrVrt()

bool Rec::NewVrtSecInclusiveTool::checkTrue2TrVrt ( const xAOD::TrackParticle * TP1,
const xAOD::TrackParticle * TP2,
float nearCut = 0.1 )
staticprivate

Definition at line 365 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

366 {
367 if( !TP1 || !TP2 )return false;
368 static const SG::ConstAccessor<ElementLink<xAOD::TruthParticleContainer>> truthParticleLinkAcc( "truthParticleLink");
369 if( !truthParticleLinkAcc.isAvailable(*TP1) ) return false;
370 if( !truthParticleLinkAcc.isAvailable(*TP2) ) return false;
371 const ElementLink<xAOD::TruthParticleContainer>& tplink1 = truthParticleLinkAcc( *TP1 );
372 if( !tplink1.isValid() ) return false;
373 const ElementLink<xAOD::TruthParticleContainer>& tplink2 = truthParticleLinkAcc( *TP2 );
374 if( !tplink2.isValid() ) return false;
375 const xAOD::TruthParticle *tpart1 = (*tplink1); // truth particle for TrackPartile1
376 const xAOD::TruthParticle *tpart2 = (*tplink2); // truth particle for TrackPartile2
377 //-----
378 if(!tpart1->hasProdVtx()) return false;
379 if(!tpart2->hasProdVtx()) return false;
380 if(tpart1->prodVtx()->nOutgoingParticles()<2) return false;
381 if(tpart2->prodVtx()->nOutgoingParticles()<2) return false;
382 //-----
383 Amg::Vector3D vpos1(tpart1->prodVtx()->x(),tpart1->prodVtx()->y(),tpart1->prodVtx()->z());
384 Amg::Vector3D vpos2(tpart2->prodVtx()->x(),tpart2->prodVtx()->y(),tpart2->prodVtx()->z());
385 return Amg::distance(vpos1,vpos2)<nearCut ? true : false;
386 }
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
float z() const
Vertex longitudinal distance along the beam line form the origin.
float y() const
Vertex y displacement.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
float x() const
Vertex x displacement.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ DeclareInterfaceID()

Rec::IVrtInclusive::DeclareInterfaceID ( IVrtInclusive ,
1 ,
0  )
inherited

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ 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.

◆ distToMatLayerSignificance()

double Rec::NewVrtSecInclusiveTool::distToMatLayerSignificance ( Vrt2Tr & Vrt) const
private

Definition at line 389 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

390 {
391 const EventContext& ctx = Gaudi::Hive::currentContext();
392 if(Vrt.fitVertex.perp()<20.) return 1.e9;
393 double normP=1./Vrt.momentum.P();
394 Amg::Vector3D momentumP(Vrt.momentum.Px()*normP,Vrt.momentum.Py()*normP,Vrt.momentum.Pz()*normP);
395 Amg::Vector3D momentumN=-momentumP;
396
397 const Trk::Layer * someLayer = nullptr;
398 const Trk::Layer * nextLayerP = nullptr;
399 const Trk::Layer * nextLayerN = nullptr;
400 const auto *volume = m_extrapolator->trackingGeometry()->lowestTrackingVolume(Vrt.fitVertex);
401 someLayer = volume->associatedLayer(Vrt.fitVertex);
402 const auto *material = someLayer->layerMaterialProperties();
403 if(material){
404 nextLayerP=someLayer;
405 } else {
406 nextLayerP = someLayer->nextLayer(Vrt.fitVertex,momentumP);
407 if(nextLayerP){ if(!nextLayerP->layerMaterialProperties())nextLayerP=nullptr; }
408 nextLayerN = someLayer->nextLayer(Vrt.fitVertex,momentumN);
409 if(nextLayerN){ if(!nextLayerN->layerMaterialProperties())nextLayerN=nullptr; }
410 }
411 momentumP *= 1.e5; //100GeV to have straight trajectory
412 double charge = 1.;
413 const Trk::Perigee pseudoVrtPart(Vrt.fitVertex, momentumP, charge, Vrt.fitVertex);
414
415 const Trk::TrackParameters * extrapParP=nullptr; //along momentum
416 const Trk::TrackParameters * extrapParN=nullptr; //backward
417 if(nextLayerP){ extrapParP = m_extrapolator->extrapolate(ctx, pseudoVrtPart,
418 nextLayerP->surfaceRepresentation(), Trk::anyDirection, false, Trk::nonInteractingMuon).release();}
419 if(nextLayerN){ extrapParN = m_extrapolator->extrapolate(ctx, pseudoVrtPart,
420 nextLayerN->surfaceRepresentation(), Trk::anyDirection, false, Trk::nonInteractingMuon).release();}
421
422 float distanceP=1.e9, distanceN=1.e9;
423 if(extrapParP)distanceP=PntPntDist(extrapParP->position(), Vrt.fitVertex);
424 if(extrapParN)distanceN=PntPntDist(extrapParN->position(), Vrt.fitVertex);
425 if(distanceP==1.e9 && distanceN==1.e9) return 1.e9;
426
427 //std::pair<const Trk::TrackParameters*,const Trk::Layer*> next=
428 // m_extrapolator->extrapolateToNextActiveLayer(pseudoVrtPart,Trk::anyDirection,true,Trk::pion) ;
429
430 double signif=1.e9;
431 std::vector<double> pntCovar={1.e-2,0.,1.e-2,0.,0.,4.e-2};
432 if(distanceP<distanceN)signif=vrtVrtDist(Vrt.fitVertex, Vrt.errorMatrix, extrapParP->position(), pntCovar);
433 else signif=vrtVrtDist(Vrt.fitVertex, Vrt.errorMatrix, extrapParN->position(), pntCovar);
434 delete extrapParP;
435 delete extrapParN;
436 return signif;
437 }
double charge(const T &p)
Definition AtlasPID.h:997
ToolHandle< Trk::IExtrapolator > m_extrapolator
static double PntPntDist(const Amg::Vector3D &Vrt1, const Amg::Vector3D &Vrt2)
static double vrtVrtDist(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &udir) const
getting the next/previous Layer if registered - unit for direction vector required
Definition Layer.cxx:161
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
const Amg::Vector3D & position() const
Access method for the position.
@ anyDirection
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ nonInteractingMuon
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ estimVrtPos()

std::vector< double > Rec::NewVrtSecInclusiveTool::estimVrtPos ( int nTrk,
std::deque< long int > & selTrk,
std::map< long int, std::vector< double > > & vrt )
staticprivate

Definition at line 439 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

440 {
441 std::vector<double> estimation(3,0.);
442 int ntsel=selTrk.size();
443 for( int i=0; i<ntsel-1; i++){
444 for( int j=i+1; j<ntsel; j++){
445 int k = selTrk[i]<selTrk[j] ? selTrk[i]*nTrk+selTrk[j] : selTrk[j]*nTrk+selTrk[i];
446 estimation[0]+=vrt.at(k)[0];
447 estimation[1]+=vrt[k][1];
448 estimation[2]+=vrt[k][2];
449 } }
450 estimation[0] /= ntsel*(ntsel-1)/2;
451 estimation[1] /= ntsel*(ntsel-1)/2;
452 estimation[2] /= ntsel*(ntsel-1)/2;
453 return estimation;
454 }
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ evtStore()

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.

◆ 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

◆ finalize()

StatusCode Rec::NewVrtSecInclusiveTool::finalize ( )
overridevirtual

Definition at line 245 of file NewVrtSecInclusiveTool.cxx.

246 {
247 ATH_MSG_DEBUG("NewVrtSecInclusiveTool finalize()");
248 return StatusCode::SUCCESS;
249 }

◆ findAllVertices()

std::unique_ptr< Trk::VxSecVertexInfo > Rec::NewVrtSecInclusiveTool::findAllVertices ( const EventContext & ctx,
const std::vector< const xAOD::TrackParticle * > & inputTracks,
const xAOD::Vertex & primaryVertex ) const
finaloverridevirtual

Implements Rec::IVrtInclusive.

Definition at line 253 of file NewVrtSecInclusiveTool.cxx.

257 {
258 std::vector<xAOD::Vertex*> listVrtSec(0);
259
260 if(m_fillHist) {
261 Hists& h = getHists();
262 h.m_curTup->nTrk=0;
263 h.m_curTup->n2Vrt=0;
264 h.m_curTup->nNVrt=0;
265 };
266
267 workVectorArrxAOD * tmpVectxAOD=new workVectorArrxAOD();
268 tmpVectxAOD->inpTrk.resize(inpTrk.size());
269 std::copy(inpTrk.begin(),inpTrk.end(), tmpVectxAOD->inpTrk.begin());
270 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
271 tmpVectxAOD->beamX=beamSpotHandle->beamPos().x();
272 tmpVectxAOD->beamY=beamSpotHandle->beamPos().y();
273 tmpVectxAOD->beamZ=beamSpotHandle->beamPos().z();
274 tmpVectxAOD->tanBeamTiltX=tan(beamSpotHandle->beamTilt(0));
275 tmpVectxAOD->tanBeamTiltY=tan(beamSpotHandle->beamTilt(1));
276
277 compatibilityGraph_t compatibilityGraph;
278 listVrtSec = getVrtSecMulti(ctx,tmpVectxAOD,primVrt,compatibilityGraph);
279
280 for (const auto trk : tmpVectxAOD->listSelTracks) {
281 // Mark the track as selected
282 m_is_selected(*trk) = true;
284 }
285 delete tmpVectxAOD;
286
287 for (const auto &vrt : listVrtSec) {
288 for (const auto &trk : vrt->trackParticleLinks()) {
289
290 // Mark the track as a final track
291 m_is_svtrk_final(**trk) = true;
292
293 // Get the perigee of the track at the vertex
294 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << (*trk)->index() << ": Get the perigee of the track at the vertex." );
295 auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(ctx, **trk, vrt->position() );
296 if( !sv_perigee ) {
297 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": > Track index " << (*trk)->index() << ": Failed in obtaining the SV perigee!" );
298 }
299
300 float qOverP_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::qOverP] : -FLT_MAX;
301 float theta_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::theta] : -FLT_MAX;
302 float p_wrtSV = sv_perigee ? 1.0 / std::abs( qOverP_wrtSV ) : -FLT_MAX;
303 float pt_wrtSV = sv_perigee ? p_wrtSV * sin( theta_wrtSV ) : -FLT_MAX;
304 float eta_wrtSV = sv_perigee ? -log( tan( theta_wrtSV/2. ) ) : -FLT_MAX;
305 float phi_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::phi] : -FLT_MAX;
306 float d0_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::d0] : -FLT_MAX;
307 float z0_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::z0] : -FLT_MAX;
308 float errd0_wrtSV = sv_perigee ? std::sqrt((*sv_perigee->covariance())( Trk::d0, Trk::d0 )) : -FLT_MAX;
309 float errz0_wrtSV = sv_perigee ? std::sqrt((*sv_perigee->covariance())( Trk::z0, Trk::z0 )) : -FLT_MAX;
310 float errP_wrtSV = sv_perigee ? std::sqrt((*sv_perigee->covariance())( Trk::qOverP, Trk::qOverP )) : -FLT_MAX;
311
312 m_pt_wrtSV(**trk) = pt_wrtSV;
313 m_eta_wrtSV(**trk) = eta_wrtSV;
314 m_phi_wrtSV(**trk) = phi_wrtSV;
315 m_d0_wrtSV(**trk) = d0_wrtSV;
316 m_z0_wrtSV(**trk) = z0_wrtSV;
317 m_errP_wrtSV(**trk) = errP_wrtSV;
318 m_errd0_wrtSV(**trk) = errd0_wrtSV;
319 m_errz0_wrtSV(**trk) = errz0_wrtSV;
320 }
321 }
322
323 std::unique_ptr<Trk::VxSecVertexInfo> res = std::make_unique<Trk::VxSecVertexInfo>(Trk::VxSecVertexInfo(listVrtSec));
324
325 if(m_fillHist){
326 Hists& h = getHists();
327 h.m_tuple->Fill();
328 };
329
330 lockDecorations (inpTrk);
331
332 return res;
333 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::pair< std::vector< unsigned int >, bool > res
boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS > compatibilityGraph_t
void lockDecorations(const std::vector< const xAOD::TrackParticle * > &inpTrk) const
Gaudi::Property< bool > m_fillHist
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
std::vector< xAOD::Vertex * > getVrtSecMulti(const EventContext &ctx, workVectorArrxAOD *inpParticlesxAOD, const xAOD::Vertex &primVrt, compatibilityGraph_t &compatibilityGraph) const
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ phi
Definition ParamDefs.h:75
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
@ GaussianSumFilter
Tracks from Gaussian Sum Filter.

◆ getBLHit()

int Rec::NewVrtSecInclusiveTool::getBLHit ( const xAOD::TrackParticle * Part)
staticprivate

Definition at line 223 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

224 {
225 uint8_t BLhit,BLexp;
226 if(!Part->summaryValue( BLexp, xAOD::expectNextToInnermostPixelLayerHit) ) BLexp = 0;
227 if( BLexp==0 ) return -1;
228 if(!Part->summaryValue( BLhit, xAOD::numberOfNextToInnermostPixelLayerHits) ) BLhit = 0;
229 if(BLhit) return 1;
230 else return 0;
231 }
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?

◆ getG4Inter()

int Rec::NewVrtSecInclusiveTool::getG4Inter ( const xAOD::TrackParticle * TP)
staticprivate

Definition at line 296 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

296 {
298 truthParticleLinkAcc ( "truthParticleLink");
299 if( truthParticleLinkAcc.isAvailable( *TP ) ) {
300 const ElementLink<xAOD::TruthParticleContainer>& tplink =
301 truthParticleLinkAcc( *TP );
302 if( tplink.isValid() && HepMC::is_simulation_particle((*tplink))) return 1;
303 }
304 return 0;
305 }
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...

◆ getHists()

NewVrtSecInclusiveTool::Hists & Rec::NewVrtSecInclusiveTool::getHists ( ) const
private

Definition at line 368 of file NewVrtSecInclusiveTool.cxx.

369 {
370 // We earlier checked that no more than one thread is being used.
371 Hists* h ATLAS_THREAD_SAFE = m_h.get();
372 return *h;
373 }
#define ATLAS_THREAD_SAFE

◆ getIBLHit()

int Rec::NewVrtSecInclusiveTool::getIBLHit ( const xAOD::TrackParticle * Part)
staticprivate

Definition at line 214 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

215 {
216 uint8_t IBLhit,IBLexp;
217 if(!Part->summaryValue( IBLexp, xAOD::expectInnermostPixelLayerHit) ) IBLexp = 0;
218 if( IBLexp==0 ) return -1;
219 if(!Part->summaryValue( IBLhit, xAOD::numberOfInnermostPixelLayerHits) ) IBLhit = 0;
220 if(IBLhit) return 1;
221 else return 0;
222 }
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer

◆ getIdHF()

int Rec::NewVrtSecInclusiveTool::getIdHF ( const xAOD::TrackParticle * TP) const
private

Definition at line 242 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

242 {
244 truthParticleLinkAcc ( "truthParticleLink");
245 if( truthParticleLinkAcc.isAvailable(*TP) ) {
246 const ElementLink<xAOD::TruthParticleContainer>& tplink = truthParticleLinkAcc(*TP);
247 if( !tplink.isValid() ) return 0;
248 static const SG::ConstAccessor< float >truthMatchProbabilityAcc ( "truthMatchProbability" );
249 if( truthMatchProbabilityAcc( *TP ) < 0.75 ) return 0;
250 if( HepMC::is_simulation_particle((*tplink))) return 0;
251 //-------------
252 const xAOD::TruthParticle * parent1=getPreviousParent(*tplink);
253 if(!parent1 || !parent1->isHadron()) return 0;
254 if(parent1->isBottomHadron()) return isExcitedHadron(parent1) ? 0 : 1; //Ground state B-hadron
255 if(parent1->isCharmHadron() && !isExcitedHadron(parent1))return 1; //Ground state C-hadron
256 //--------------
257 const xAOD::TruthParticle * parent2=getPreviousParent(parent1);
258 if(!parent2 || !parent2->isHadron()) return 0;
259 if(parent2->isBottomHadron()) return isExcitedHadron(parent2) ? 0 : 1; //Ground state B-hadron
260 if(parent2->isCharmHadron() && !isExcitedHadron(parent2))return 1; //Ground state C-hadron
261 //--------------
262 const xAOD::TruthParticle * parent3=getPreviousParent(parent2);
263 if(!parent3 || !parent3->isHadron()) return 0;
264 if(parent3->isBottomHadron()) return isExcitedHadron(parent3) ? 0 : 1; //Ground state B-hadron
265 if(parent3->isCharmHadron() && !isExcitedHadron(parent3))return 1; //Ground state C-hadron
266 }
267 return 0;
268 }
static const xAOD::TruthParticle * getPreviousParent(const xAOD::TruthParticle *child)
bool isBottomHadron() const
Determine if the PID is that of a b-hadron.
bool isHadron() const
Whether the particle is a hadron.
bool isCharmHadron() const
Determine if the PID is that of a c-hadron.

◆ getMCPileup()

int Rec::NewVrtSecInclusiveTool::getMCPileup ( const xAOD::TrackParticle * TP)
staticprivate

Definition at line 306 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

306 {
308 truthParticleLinkAcc ( "truthParticleLink");
309 if( truthParticleLinkAcc.isAvailable( *TP ) ) {
310 const ElementLink<xAOD::TruthParticleContainer>& tplink =
311 truthParticleLinkAcc( *TP );
312 if( !tplink.isValid() ) return 1;
313 } else { return 1; }
314 return 0;
315 }

◆ getPixelDiscs()

void Rec::NewVrtSecInclusiveTool::getPixelDiscs ( const xAOD::TrackParticle * Part,
int & d0Hit,
int & d1Hit,
int & d2Hit )
staticprivate

Definition at line 233 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

234 {
235 uint32_t HitPattern=Part->hitPattern();
236 d0Hit=0; if( HitPattern&((1<<Trk::pixelEndCap0)) ) d0Hit=1;
237 d1Hit=0; if( HitPattern&((1<<Trk::pixelEndCap1)) ) d1Hit=1;
238 d2Hit=0; if( HitPattern&((1<<Trk::pixelEndCap2)) ) d2Hit=1;
239 }
@ pixelEndCap0
three pixel discs (on each side)
setEventNumber uint32_t

◆ getPreviousParent()

const xAOD::TruthParticle * Rec::NewVrtSecInclusiveTool::getPreviousParent ( const xAOD::TruthParticle * child)
staticprivate

Definition at line 269 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

269 {
270 if( child->hasProdVtx() ){
271 if( child->prodVtx()->nIncomingParticles()==1 ){
272 return *(child->prodVtx()->incomingParticleLinks())[0];
273 }
274 }
275 return nullptr;
276 }
size_t nIncomingParticles() const
Get the number of incoming particles.

◆ getProdVrtBarcode()

int Rec::NewVrtSecInclusiveTool::getProdVrtBarcode ( const xAOD::TrackParticle * TP,
float resolLimit = 0.1 )
staticprivate

Definition at line 317 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

318 {
319 int barVrt{HepMC::UNDEFINED_ID};
320 if(!TP)return barVrt;
321 static const SG::ConstAccessor<ElementLink<xAOD::TruthParticleContainer>> truthParticleLinkAcc( "truthParticleLink");
322 if( truthParticleLinkAcc.isAvailable( *TP ) ) {
323 barVrt=-1;
324 const ElementLink<xAOD::TruthParticleContainer>& tplink = truthParticleLinkAcc( *TP );
325 if( !tplink.isValid() ) return barVrt;
326 const xAOD::TruthParticle *tparticle = (*tplink); // truth particle for TrackPartile
327 if(tparticle->hasProdVtx()){ // truth particle has production vertex
328 barVrt = HepMC::uniqueID(tparticle->prodVtx());
329 if(HepMC::is_simulation_vertex(tparticle->prodVtx())) return barVrt; // Geant4 vertex
330 if(tparticle->prodVtx()->nIncomingParticles()!=1) return barVrt; // Safety!
331 const xAOD::TruthParticle *parent = *(tparticle->prodVtx()->incomingParticleLinks())[0];
332 Amg::Vector3D vpos0(tparticle->prodVtx()->x(),tparticle->prodVtx()->y(),tparticle->prodVtx()->z()); //Truth vertex position
333 //
334 //-- Now check parent
335 if(!parent->isHadron()) return barVrt; // Parent is parton not particle! Stop.
336 if(!parent->hasProdVtx()) return barVrt; // Parent particle doesn't have production vertex
337 Amg::Vector3D vpos1(parent->prodVtx()->x(),parent->prodVtx()->y(),parent->prodVtx()->z()); //Truth vertex position
338 if( Amg::distance(vpos0,vpos1) > resolLimit) return barVrt; // Parent vertex is far
339 barVrt = HepMC::uniqueID(parent->prodVtx()); // Else use parent vertex as reference
340 if(HepMC::is_simulation_vertex(parent->prodVtx())) return barVrt; // Geant4 vertex
341 if(parent->prodVtx()->nIncomingParticles()!=1) return barVrt; // Not a decay vertex
342 const xAOD::TruthParticle *grandparent = *(parent->prodVtx()->incomingParticleLinks())[0];
343 //
344 //-- Now check grandparent
345 if(!grandparent->isHadron()) return barVrt; // Grandparent is parton not particle! Stop.
346 if(!grandparent->hasProdVtx()) return barVrt; // Parent particle doesn't have production vertex
347 Amg::Vector3D vpos2(grandparent->prodVtx()->x(),grandparent->prodVtx()->y(),grandparent->prodVtx()->z()); //Truth vertex position
348 if( Amg::distance(vpos0,vpos2) > resolLimit) return barVrt; // Grandparent vertex is far
349 barVrt = HepMC::uniqueID(grandparent->prodVtx()); // Use grandparent vertex as reference
350 if(HepMC::is_simulation_vertex(grandparent->prodVtx())) return barVrt; // Geant4 vertex
351 if(grandparent->prodVtx()->nIncomingParticles()!=1) return barVrt; // Not a decay vertex
352 const xAOD::TruthParticle *biggrandparent = *(grandparent->prodVtx()->incomingParticleLinks())[0];
353 //
354 //-- Now check biggrandparent
355 if(!biggrandparent->isHadron()) return barVrt; // BigGrandparent is parton not particle! Stop.
356 if(!biggrandparent->hasProdVtx()) return barVrt; // Parent particle doesn't have production vertex
357 Amg::Vector3D vpos3(biggrandparent->prodVtx()->x(),biggrandparent->prodVtx()->y(),biggrandparent->prodVtx()->z());
358 if( Amg::distance(vpos0,vpos3) > resolLimit) return barVrt; // Grandparent vertex is far
359 barVrt = HepMC::uniqueID(biggrandparent->prodVtx()); // Use grandparent vertex as reference
360 }
361 }
362 return barVrt;
363 }
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
int uniqueID(const T &p)
constexpr int UNDEFINED_ID

◆ getVrtSecMulti()

std::vector< xAOD::Vertex * > Rec::NewVrtSecInclusiveTool::getVrtSecMulti ( const EventContext & ctx,
workVectorArrxAOD * inpParticlesxAOD,
const xAOD::Vertex & primVrt,
compatibilityGraph_t & compatibilityGraph ) const
private

Definition at line 29 of file VrtSecMulti.cxx.

34 {
35
36 const double probVrtMergeLimit=0.01;
37
38 int i,j;
39 int inpNPart=xAODwrk->inpTrk.size();
40 std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
41 ATH_MSG_DEBUG( "getVrtSecMulti() called with NPart=" << inpNPart);
42
43 std::vector<xAOD::Vertex*> finalVertices(0);
44
45 if( inpNPart < 2 ) { return finalVertices;} // 0,1 track => nothing to do!
46
47 selGoodTrkParticle( xAODwrk, primVrt);
48 int nTracks = xAODwrk->listSelTracks.size();
49
50 if( nTracks < 2 ) { return finalVertices;} // 0,1 selected track => nothing to do!
51
52 ATH_MSG_DEBUG( "Number of selected tracks = " <<nTracks);
53
54 if(m_fillHist){
55 Hists& h = getHists();
56 h.m_hb_ntrksel->Fill( (double) nTracks, m_w_1);
57 }
58
59//
60// inpTrk[] - input track list
61// listSelTracks[] - list of good tracks in jet for vertex search
62//------------------------------------------------------------
63// Initial track list ready
64// Find 2track vertices
65//
66
67 std::map<long int,std::vector<double>> foundVrt2t;
68 select2TrVrt(ctx, xAODwrk->listSelTracks, primVrt, foundVrt2t, compatibilityGraph);
69
70//---
71 ATH_MSG_DEBUG(" Defined edges in the graph="<< num_edges(compatibilityGraph));
72 if(num_edges(compatibilityGraph)==0){ return finalVertices;} //No vertices!
73
74//
75// m_Incomp[] - main vector of pointers for multivertex search
76//-----------------------------------------------------------------------------------------------------
77// Secondary track list is ready
78// Creation of initial vertex set
79//
80
81
82 std::unique_ptr<std::vector<WrkVrt>> wrkVrtSet = std::make_unique<std::vector<WrkVrt>>();
83 WrkVrt newvrt; newvrt.Good=true;
84 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
86 long int NPTR=0, nth=2; // VK nth=2 to speed up PGRAPH when it's used
87
88
89 std::vector< std::vector<int> > allCliques;
90 bron_kerbosch_all_cliques(compatibilityGraph, clique_visitor(allCliques));
91 for(int cq=0; cq<(int)allCliques.size();cq++){
92 newvrt.selTrk.clear();
93 NPTR=allCliques[cq].size();
94 for(i=0;i<NPTR;i++){ newvrt.selTrk.push_back(allCliques[cq][i]);}
95//==================================================
96 xAODwrk->tmpListTracks.clear();
97 TLorentzVector vpsum;
98 for(i=0;i<NPTR;i++) {
99 xAODwrk->tmpListTracks.push_back( xAODwrk->listSelTracks.at(newvrt.selTrk[i]) );
100 vpsum += xAODwrk->listSelTracks.at(newvrt.selTrk[i])->p4();
101 }
102 std::vector<double> iniVrtPos=estimVrtPos(nTracks,newvrt.selTrk,foundVrt2t);
103 m_fitSvc->setApproximateVertex(iniVrtPos[0], iniVrtPos[1], iniVrtPos[2], *state); /*Use as starting point*/
104 sc=m_fitSvc->VKalVrtFit(xAODwrk->tmpListTracks, neutralPartDummy,
105 newvrt.vertex, newvrt.vertexMom, newvrt.vertexCharge, newvrt.vertexCov,
106 newvrt.chi2PerTrk, newvrt.trkAtVrt, newvrt.chi2,
107 *state, false);
108 if( sc.isFailure() ) continue; /* Bad fit - goto next solution */
109 ATH_MSG_VERBOSE("Found IniVertex="<<newvrt.vertex[0]<<", "<<newvrt.vertex[1]<<", "<<newvrt.vertex[2]);
110 ATH_MSG_VERBOSE("with Chi2="<<newvrt.chi2<<" Ntrk="<<NPTR<<" trk1,2="<<newvrt.selTrk[0]<<", "<<newvrt.selTrk[1]);
111 if(NPTR==2 && newvrt.chi2>10.) continue; /* Bad 2track vertex */
112 if(newvrt.chi2PerTrk.size()==2) newvrt.chi2PerTrk[0]=newvrt.chi2PerTrk[1]=newvrt.chi2/2.;
113 newvrt.Good = true;
114 newvrt.projectedVrt=MomProjDist(newvrt.vertex, primVrt, newvrt.vertexMom); //3D SV-PV distance
115 wrkVrtSet->push_back(newvrt);
116 }
117 std::sort(wrkVrtSet->begin(),wrkVrtSet->end(),[](const WrkVrt& a, const WrkVrt& b){return a.selTrk.size()>b.selTrk.size();});
118//==================================================================================
119// boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>::vertex_iterator vertexIt, vertexEnd;
120// boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>::adjacency_iterator neighbourIt, neighbourEnd;
121// tie(vertexIt, vertexEnd) = vertices(compatibilityGraph);
122// for (; vertexIt != vertexEnd; ++vertexIt) { std::cout << *vertexIt << " is connected with ";
123// tie(neighbourIt, neighbourEnd) = adjacent_vertices(*vertexIt, compatibilityGraph);
124// for (; neighbourIt != neighbourEnd; ++neighbourIt) std::cout << *neighbourIt << " "; std::cout << "\n"; }
125//==================================================================================
126 if((*wrkVrtSet).empty())return finalVertices;
127 if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Initial Vertices");
128 //
129 //--Count track participation in different vertices
130 std::vector<int> trkNPairs(nTracks,0);
131 for(auto &vrt : (*wrkVrtSet)){
132 int ntInV=vrt.selTrk.size()-1;
133 for(auto &trk : vrt.selTrk)trkNPairs.at(trk) += ntInV;
134 }
135//
136//- Resolve all overlapped vertices
137//
138 state = m_fitSvc->makeState(ctx);
139 std::multimap<double,std::pair<int,int>> vrtWithCommonTrk;
140 while(true){
141 int nSoluI=(*wrkVrtSet).size();
142 vrtWithCommonTrk.clear();
143 unsigned int nTComMax=0;
144 for(int iv=0; iv<nSoluI-1; iv++ ){
145 if(!(*wrkVrtSet)[iv].Good) continue;
146 if( (*wrkVrtSet)[iv].selTrk.size()<nTComMax) continue; // Optimisation. Only biggest overlap matters
147 for(int jv=iv+1; jv<nSoluI; jv++){
148 if(!(*wrkVrtSet)[jv].Good) continue;
149 if( (*wrkVrtSet)[jv].selTrk.size()<nTComMax) continue; // Optimisation. Only biggest overlap matters
150 unsigned int nTCom=nTrkCommon( wrkVrtSet.get(), iv, jv);
151 if(!nTCom) continue;
152 if(nTCom<nTComMax) continue;
153 double sumChi2=(*wrkVrtSet)[iv].chi2+(*wrkVrtSet)[jv].chi2;
154 sumChi2=std::min(sumChi2,999.)*1.e-3;
155 vrtWithCommonTrk.emplace(nTCom+sumChi2,std::make_pair(iv,jv));
156 nTComMax=std::max(nTComMax,nTCom);
157 } }
158 if(vrtWithCommonTrk.empty())break;
159 //============================== DEBUG output
160 //for(auto ku : vrtWithCommonTrk)std::cout<<" nCom="<<ku.first<<" v1="<<ku.second.first<<" v2="<<ku.second.second<<'\n';
161 //if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Overlapped Vertex Cleaning");
162 //===========================================
163 for( const auto& ov : std::ranges::reverse_view(vrtWithCommonTrk)) {
164 WrkVrt & v1 = (*wrkVrtSet)[ov.second.first];
165 WrkVrt & v2 = (*wrkVrtSet)[ov.second.second];
166 if(!v1.Good)continue; //----One of the vertices is already preocessed
167 if(!v2.Good)continue;
168 //--Recheck amount of common tracks
169 unsigned int nTCom=nTrkCommon( wrkVrtSet.get(), ov.second.first, ov.second.second);
170 if(nTCom<nTComMax)continue; //----One of the vertices is already preocessed
171 //--First check if one vertex is fully contained in another
172 if( nTCom==v1.selTrk.size() || nTCom==v2.selTrk.size() ){
173 if(nTCom==v1.selTrk.size()){v1.Good = false; continue;}
174 if(nTCom==v2.selTrk.size()){v2.Good = false; continue;}
175 }
176 //--Then check if 2 vertices with common tracks can be simply merged
177 if( nTCom>1 && TMath::Prob( v1.chi2, 2*v1.selTrk.size()-3) > probVrtMergeLimit
178 && TMath::Prob( v2.chi2, 2*v2.selTrk.size()-3) > probVrtMergeLimit){
179 double prbV=mergeAndRefitVertices( v1, v2, newvrt, xAODwrk->listSelTracks, *state);
180 if(prbV>probVrtMergeLimit){
181 v1.Good = false; v2.Good = false;
182 newvrt.Good = true;
183 newvrt.projectedVrt=MomProjDist(newvrt.vertex, primVrt, newvrt.vertexMom); //3D SV-PV distance
184 std::swap(v1,newvrt); //Replace v1 by new vertex
185 continue;
186 } }
187 //--If not mergeable - refine them
188 refineVerticesWithCommonTracks( v1, v2, xAODwrk->listSelTracks, *state);
189 }
190 }
191 if(m_fillHist){
192 int cvgood=0; for(const auto& vrt:(*wrkVrtSet)) if(vrt.Good)cvgood++;
193 Hists& h = getHists();
194 h.m_hb_rawVrtN->Fill( (float)cvgood, m_w_1);
195 }
196//
197//-Clean duplicated 1track vertices if they exist
198//
200 for(auto &v1t : (*wrkVrtSet)){
201 if(v1t.selTrk.size()!=1 || !v1t.Good)continue;
202 int ind_t=v1t.selTrk[0];
203 if(trkNPairs[ind_t]<2){ v1t.Good=false; continue; } //Remove 1tr-vertex if track crosses only one other track
204 if( xAODwrk->listSelTracks[ind_t]->pt()<m_cutPt*2){ v1t.Good=false; continue; }; //Tighten track_pt cut for 1-track vertex
205 for(auto &vrt :(*wrkVrtSet)){ // Check if the track is present in another vertex, including other 1-track ones
206 if(!vrt.Good || &v1t==&vrt)continue;
207 if(std::find(vrt.selTrk.begin(),vrt.selTrk.end(),ind_t) != vrt.selTrk.end()){ v1t.Good=false; break; }
208 } }
209 }
210//
211//-Remove all bad vertices from the working set
212//
213 int tmpV=0; while( tmpV<(int)(*wrkVrtSet).size() )if( !(*wrkVrtSet)[tmpV].Good ) { (*wrkVrtSet).erase((*wrkVrtSet).begin()+tmpV);} else {tmpV++;}
214 if((*wrkVrtSet).empty())return finalVertices;
215 if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Intermediate Vertices");
216 for( auto &tmpV : (*wrkVrtSet) ) tmpV.projectedVrt=MomProjDist(tmpV.vertex, primVrt, tmpV.vertexMom ); //Setup ProjectedVrt
217//----------------------------------------------------------------------------
218
219//----------------------------------------------------------------------------
220//
221// Final check/merge for close vertices
222//
223 int foundV1=-1, foundV2=-1;
224 std::vector<double> checkedDst(0);
225 double minDistVV=minVrtVrtDist( wrkVrtSet.get(), foundV1, foundV2, checkedDst); //recalculate VV distances
226 if(m_fillHist){
227 Hists& h = getHists();
228 h.m_hb_distVV->Fill( minDistVV, m_w_1);
229 }
230 while ( minDistVV < m_vertexMergeCut) {
231 if(foundV1<foundV2) { int tmp=foundV1; foundV1=foundV2; foundV2=tmp;}
232 double probV=mergeAndRefitVertices( (*wrkVrtSet)[foundV1], (*wrkVrtSet)[foundV2], newvrt, xAODwrk->listSelTracks, *state, 0);
233 ATH_MSG_DEBUG( "Merged vertex prob=" << probV<<" Vrt1="<<foundV1<<" Vrt2="<<foundV2<<" dst="<<minDistVV);
234 if(probV<probVrtMergeLimit){ //--- If merged vertex is bad - try to remove the worst track
235 int pos=std::max_element(newvrt.chi2PerTrk.begin(),newvrt.chi2PerTrk.end())-newvrt.chi2PerTrk.begin();
236 newvrt.detachedTrack=newvrt.selTrk[pos];
237 newvrt.selTrk.erase(newvrt.selTrk.begin()+pos);
238 probV = refitVertex( newvrt, xAODwrk->listSelTracks, *state, false);
239 ATH_MSG_DEBUG( "Attempt to improve prob=" << probV);
240 }
241 if(probV>probVrtMergeLimit && newvrt.vertexMom.M()<m_vrtMassLimit){ // Good merged vertex found
242 newvrt.projectedVrt=MomProjDist(newvrt.vertex, primVrt, newvrt.vertexMom);
243 std::swap((*wrkVrtSet)[foundV1],newvrt);
244 (*wrkVrtSet)[foundV2].Good=false; //Drop vertex
245 (*wrkVrtSet)[foundV2].selTrk.clear(); //Clean dropped vertex
246 } else checkedDst.push_back(minDistVV);
247 minDistVV=minVrtVrtDist( wrkVrtSet.get(), foundV1, foundV2, checkedDst);
248 }
249//
250// Try to improve vertices with big Chi2 if something went wrong. Just precaution.
251 for(int iv=0; iv<(int)wrkVrtSet->size(); iv++) {
252 if(!(*wrkVrtSet)[iv].Good ) continue; //don't work on vertex which is already bad
253 if( (*wrkVrtSet)[iv].selTrk.size()<3 ) continue;
254 double tmpProb=TMath::Prob( (*wrkVrtSet)[iv].chi2, 2*(*wrkVrtSet)[iv].selTrk.size()-3 ); //Chi2 of the original vertex
255 if(tmpProb<m_globVrtProbCut){
256 ATH_MSG_DEBUG( "BAD vertex found prob=" << tmpProb);
257 tmpProb=improveVertexChi2( (*wrkVrtSet)[iv], xAODwrk->listSelTracks, *state, false);
258 (*wrkVrtSet)[iv].projectedVrt=MomProjDist((*wrkVrtSet)[iv].vertex, primVrt, (*wrkVrtSet)[iv].vertexMom);
259 }
260 }
261//
262//-Modify too heavy vertices
263 for(auto & iv : (*wrkVrtSet)){
264 if( iv.vertexMom.M()>m_vrtMassLimit ) {
265 ATH_MSG_DEBUG( "Heavy vertex found Mass=" << iv.vertexMom.M());
266 int it_bad=mostHeavyTrk(iv,xAODwrk->listSelTracks);
267 if(it_bad>-1){
268 iv.selTrk.erase( iv.selTrk.begin() + it_bad );
269 refitVertex(iv, xAODwrk->listSelTracks, *state, false);
270 iv.projectedVrt=MomProjDist(iv.vertex, primVrt, iv.vertexMom);
271 } } }
272//--------------------------------------------------------------------------------------------------------
273// Final vertex selection/cleaning
274//
275 double signif3D=0., signif2D=0.;
276
277//----- Vertices with >1 tracks
278 for(int iv=0; iv<(int)wrkVrtSet->size(); iv++) {
279 WrkVrt & curVrt=(*wrkVrtSet)[iv];
280 nth=(*wrkVrtSet)[iv].selTrk.size();
281 if(nth == 1) continue; // 1track vertices for later...
282 if(!curVrt.Good ) continue; //don't work on vertex which is already bad
283 (*wrkVrtSet)[iv].Good = false; /* Make all vertices bad for futher selection */
284 if(nth < 1) continue; /* Definitely bad vertices */
285 if((*wrkVrtSet)[iv].projectedVrt<0.) continue; /* Remove vertices behind primary one */
286 if( TMath::Prob( curVrt.chi2, 2*nth-3)<m_globVrtProbCut) continue; /* Bad Chi2 of refitted vertex */
287//-----------------------------------------------------------------------------------------
288 vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, signif3D);
289 if(m_fillHist){
290 Hists& h = getHists();
291 if(nth==2 && curVrt.vertexCharge==0) h.m_hb_massPiPi1->Fill(curVrt.vertexMom.M(), m_w_1);
292 h.m_hb_sig3DTot->Fill( signif3D, m_w_1);
293 if(nth==2)h.m_hb_sig3D2tr->Fill( signif3D, m_w_1);
294 if(nth >2)h.m_hb_sig3DNtr->Fill( signif3D, m_w_1);
295 }
296//
297//--- Check V0s and conversions. Necessity must be checked in physics applications
298#if 0
299 if(nth==2 && curVrt.vertexCharge==0 && curVrt.detachedTrack<0){
300 double mass_PiPi = curVrt.vertexMom.M();
301 double mass_PPi = massV0(curVrt.trkAtVrt,m_massP,m_massPi);
302 double mass_EE = massV0(curVrt.trkAtVrt,m_massE,m_massE);
303 if(m_fillHist){
304 Hists& h = getHists();
305 h.m_hb_massPiPi->Fill( mass_PiPi, m_w_1);
306 h.m_hb_massPPi ->Fill( mass_PPi, m_w_1);
307 if( curVrt.vertex.perp()>20.)h.m_hb_massEE ->Fill( mass_EE, m_w_1);
308 }
309 if( std::abs(mass_PiPi-m_massK0) < 22.) continue;
310 if( std::abs(mass_PPi-m_massLam) < 8.) continue;
311 if( mass_EE < 60. && curVrt.vertex.perp() > 20.) continue;
312 }
313#endif
314//---
315 if(signif3D<m_selVrtSigCut) continue; //Main PV-SV distance quality cut
316 if(curVrt.vertex.perp() > m_maxSVRadiusCut) continue; // Too far from interaction point
317 curVrt.Good = true; /* Vertex is absolutely good */
318 }
319 if(msgLvl(MSG::DEBUG))printWrkSet(wrkVrtSet.get(),"Final Vertices");
320//-------------------------------------------
321// Debug ntuple filling and BDT application
322//
323 std::vector<double> impact,impactError;
324 for(int iv=0; iv<(int)wrkVrtSet->size(); iv++) {
325 WrkVrt & curVrt=(*wrkVrtSet)[iv];
326 nth=curVrt.selTrk.size();
327 if(!curVrt.Good || nth<2) continue;
328 double minPtT=1.e6, minSig3DT=1.e6, maxSig3DT=0.;
329 int ntrkBC=0,ntrkI=0,sumIBLHits=0,sumBLHits=0;
330 for(i=0;i<nth;i++) {
331 j=curVrt.selTrk[i]; //Track number
332 minPtT=std::min( minPtT, xAODwrk->listSelTracks[j]->pt());
333 m_fitSvc->VKalGetImpact(xAODwrk->listSelTracks[j], primVrt.position(), 1, impact, impactError, *state);
334 double SigR2 = impact[0]*impact[0]/impactError[0];
335 double SigZ2 = impact[1]*impact[1]/impactError[2];
336 minSig3DT=std::min( minSig3DT, sqrt( SigR2 + SigZ2) );
337 maxSig3DT=std::max( maxSig3DT, sqrt( SigR2 + SigZ2) );
338 sumIBLHits += std::max(getIBLHit(xAODwrk->listSelTracks[j]),0);
339 sumBLHits += std::max(getBLHit(xAODwrk->listSelTracks[j]),0);
340 if(m_fillHist) {
341 ntrkBC += getIdHF(xAODwrk->listSelTracks[j]);
342 ntrkI += getG4Inter(xAODwrk->listSelTracks[j]);
343 }
344 }
345 float vProb=TMath::Prob(curVrt.chi2, 2*nth-3);
346 float cosSVPVM=projSV_PV(curVrt.vertex, primVrt, curVrt.vertexMom);
347 float vrtR=curVrt.vertex.perp();
348 TLorentzVector SVPV(curVrt.vertex.x()-primVrt.x(),curVrt.vertex.y()-primVrt.y(),curVrt.vertex.z()-primVrt.z(), 10.);
349 if(m_fillHist){
350 Hists& h = getHists();
351 if( nth>1 ){
352 vrtVrtDist(primVrt,curVrt.vertex, curVrt.vertexCov, signif3D);
353 float Dist2D=vrtVrtDist2D(primVrt,curVrt.vertex, curVrt.vertexCov, signif2D);
354 h.m_curTup->NVrtTrk [h.m_curTup->nNVrt] = nth;
355 h.m_curTup->NVrtTrkHF [h.m_curTup->nNVrt] = ntrkBC;
356 h.m_curTup->NVrtTrkI [h.m_curTup->nNVrt] = ntrkI;
357 h.m_curTup->NVrtProb [h.m_curTup->nNVrt] = vProb;
358 h.m_curTup->NVrtSig3D [h.m_curTup->nNVrt] = signif3D;
359 h.m_curTup->NVrtSig2D [h.m_curTup->nNVrt] = signif2D;
360 h.m_curTup->NVrtDist2D[h.m_curTup->nNVrt] = vrtR<20. ? Dist2D : vrtR;
361 h.m_curTup->NVrtM [h.m_curTup->nNVrt] = curVrt.vertexMom.M();
362 h.m_curTup->NVrtPt [h.m_curTup->nNVrt] = curVrt.vertexMom.Pt();
363 h.m_curTup->NVrtEta [h.m_curTup->nNVrt] = SVPV.Eta();
364 h.m_curTup->NVrtIBL [h.m_curTup->nNVrt] = sumIBLHits;
365 h.m_curTup->NVrtBL [h.m_curTup->nNVrt] = sumBLHits;
366 h.m_curTup->NVrtCosSPM[h.m_curTup->nNVrt] = cosSVPVM;
367 h.m_curTup->NVrtCh [h.m_curTup->nNVrt] = curVrt.vertexCharge;
368 h.m_curTup->NVMinPtT [h.m_curTup->nNVrt] = minPtT;
369 h.m_curTup->NVMinS3DT [h.m_curTup->nNVrt] = minSig3DT;
370 h.m_curTup->NVrtBDT [h.m_curTup->nNVrt] = 1.1;
371 h.m_curTup->NVrtHR1 [h.m_curTup->nNVrt] = xAODwrk->listSelTracks[curVrt.selTrk[0]]->radiusOfFirstHit();
372 h.m_curTup->NVrtHR2 [h.m_curTup->nNVrt] = xAODwrk->listSelTracks[curVrt.selTrk[1]]->radiusOfFirstHit();
373 if( h.m_curTup->nNVrt < DevTuple::maxNVrt-1 )h.m_curTup->nNVrt++;
374 }
375 }
376//--------Final selection of the remaining 2-track vertices
377// Should be tighter than initila 2-track vertex selection for compatibility graph construction
378//
379 if(nth==2){
380 float wgtSelect=-1.1;
381 xAOD::Vertex testV;
382 testV.makePrivateStore();
383 testV.setPosition(curVrt.vertex);
384 std::vector<float> testVcov(curVrt.vertexCov.begin(),curVrt.vertexCov.end());
385 testV.setCovariance(testVcov);
386 testV.setFitQuality(curVrt.chi2,1.);
387 bool acceptV=m_fin_v2trselector->isgood(ctx,
388 std::make_pair(xAODwrk->listSelTracks[curVrt.selTrk[0]],
389 xAODwrk->listSelTracks[curVrt.selTrk[1]]),
390 testV,
391 std::make_pair(momAtVrt(curVrt.trkAtVrt[0]),momAtVrt(curVrt.trkAtVrt[1])), primVrt, wgtSelect);
392 curVrt.BDT=wgtSelect;
393 if(m_fillHist){
394 Hists& h = getHists();
395 h.m_hb_fakeSVBDT->Fill(wgtSelect,1.);
396 h.m_curTup->NVrtBDT[h.m_curTup->nNVrt-1] = wgtSelect;
397 }
398 if(!acceptV){
399 curVrt.Good = false; // Disable 2-track vertex with bad BDT score
400 if(m_multiWithOneTrkVrt){ // Check if linked 1-track vertex exists and disable it
401 for(auto it : curVrt.selTrk){
402 for(auto &vtmp : (*wrkVrtSet)){
403 if(vtmp.selTrk.size()!=1 || (!vtmp.Good)) continue;
404 if(it==vtmp.detachedTrack)vtmp.Good=false;
405 } } }
406 }
407 }
408 } //End vertex set loop
409//
410//-- Debug ntuple for 1track vertex is filled here
411//
413 Hists& h = getHists();
414 for(auto & vrt : (*wrkVrtSet)) {
415 if( !vrt.Good || vrt.selTrk.size() != 1 ) continue; // Good 1track vertices
416 const auto *xaodtp=xAODwrk->listSelTracks[vrt.selTrk[0]];
417 m_fitSvc->VKalGetImpact(ctx, xaodtp, primVrt.position(), 1, impact, impactError);
418 double SigR2 = std::abs(impact[0]*impact[0]/impactError[0]);
419 double SigZ2 = std::abs(impact[1]*impact[1]/impactError[2]);
420 float dist2D=vrtVrtDist2D(primVrt,vrt.vertex, vrt.vertexCov, signif2D);
421 h.m_curTup->NVrtTrk [h.m_curTup->nNVrt] = 1;
422 h.m_curTup->NVrtTrkHF [h.m_curTup->nNVrt] = getIdHF(xaodtp);
423 h.m_curTup->NVrtProb [h.m_curTup->nNVrt] = trkNPairs[vrt.selTrk[0]];
424 h.m_curTup->NVrtSig3D [h.m_curTup->nNVrt] = 0.;
425 h.m_curTup->NVrtSig2D [h.m_curTup->nNVrt] = signif2D;
426 h.m_curTup->NVrtDist2D[h.m_curTup->nNVrt] = dist2D;
427 h.m_curTup->NVrtM [h.m_curTup->nNVrt] = vrt.vertexMom.M();
428 h.m_curTup->NVrtPt [h.m_curTup->nNVrt] = vrt.vertexMom.Pt();
429 h.m_curTup->NVrtCosSPM[h.m_curTup->nNVrt] = 0.;
430 h.m_curTup->NVrtCh [h.m_curTup->nNVrt] = vrt.vertexCharge;
431 h.m_curTup->NVMinPtT [h.m_curTup->nNVrt] = xaodtp->pt();
432 h.m_curTup->NVMinS3DT [h.m_curTup->nNVrt] = sqrt(SigR2 + SigZ2);
433 h.m_curTup->NVrtBDT [h.m_curTup->nNVrt] = 1.1;
434 h.m_curTup->NVrtIBL [h.m_curTup->nNVrt] = std::max(getIBLHit(xaodtp),0);
435 h.m_curTup->NVrtBL [h.m_curTup->nNVrt] = std::max(getBLHit (xaodtp),0);
436 if( h.m_curTup->nNVrt < DevTuple::maxNVrt-1 )h.m_curTup->nNVrt++;
437 } }
438//-------------------------------------------
439//Sorting and check
440 std::multimap<double,WrkVrt,std::greater<double>> goodVertexMap;
441 int nNtrVrt=0;
442 for(auto & iv : (*wrkVrtSet) ) {
443 nth=iv.selTrk.size();
444 if(nth==1)iv.BDT=-2.; //To move 1-track vertices to the end of the vertex list later
445 double selector=iv.BDT;
446 if(nth==1) selector=iv.BDT+std::min(iv.vertexMom.Pt()*1.e-5,1.);
447 else if(nth>2) selector=iv.BDT+iv.vertexMom.M()*1.e-5;
448 if( iv.Good && nth>0 ) {
449 goodVertexMap.emplace(selector,iv); // add it and sort in the map
450 if(nth>1)nNtrVrt++;
451 }
452 }
453 if(nNtrVrt==0){ //--- No good vertices at all
454 if(m_fillHist) {
455 Hists& h = getHists();
456 h.m_curTup->nNVrt=0;
457 }
458 return finalVertices;
459 }
460//
461//-------------------------------------------
462// Final vertex refit for full covariance matrix and xAOD::Vertex creation
463//
464 static const SG::AuxElement::Decorator<float> wgtBDT("wgtBDT");
465 static const SG::AuxElement::Decorator<int> nTrksDec("nTracks");
466 static const SG::AuxElement::Decorator<int> vChrgTot("vCharge");
467 int n1trVrt=0; // Final number of good 1-track vertices
468 for(auto & iv : goodVertexMap){
469 WrkVrt & curVrt=iv.second;
470 nth=curVrt.selTrk.size();
471 xAODwrk->tmpListTracks.clear();
472 for(auto t : curVrt.selTrk)xAODwrk->tmpListTracks.push_back( xAODwrk->listSelTracks[t] );
473 if(m_fillHist){
474 Hists& h = getHists();
475 h.m_hb_totmass->Fill(curVrt.vertexMom.M(), m_w_1);
476 h.m_hb_r2d->Fill( curVrt.vertex.perp(), m_w_1);
477 }
478//--- Re-fit with full error matrix and xAOD::Vertex creation
479 std::unique_ptr<xAOD::Vertex> tmpVertex;
480 if(nth>1){ //-- Common case with full refit
481 tmpVertex=m_fitSvc->fit(xAODwrk->tmpListTracks,curVrt.vertex,*state);
482 } else if(nth==1){ //-- Special case for 1-track vertex
483 tmpVertex=std::make_unique<xAOD::Vertex>();
484 if(!tmpVertex)continue;
485 tmpVertex->makePrivateStore();
486 tmpVertex->setPosition(curVrt.vertex);
487 std::vector<float> floatErrMtx(6);
488 for(int i=0; i<6; i++) floatErrMtx[i]=curVrt.vertexCov[i];
489 tmpVertex->setCovariance(floatErrMtx);
490 tmpVertex->setFitQuality(curVrt.chi2, (float)(nth*2-3));
491 std::vector<Trk::VxTrackAtVertex> & tmpVTAV=tmpVertex->vxTrackAtVertex(); tmpVTAV.clear();
492 AmgSymMatrix(5) CovMtxP;
493 CovMtxP.setIdentity();
494 Trk::Perigee * tmpMeasPer = new (std::nothrow) Trk::Perigee( 0.,0.,
495 curVrt.trkAtVrt[0][0],
496 curVrt.trkAtVrt[0][1],
497 curVrt.trkAtVrt[0][2],
498 Trk::PerigeeSurface(curVrt.vertex),
499 std::move(CovMtxP) );
500 tmpVTAV.emplace_back( 1., tmpMeasPer );
501 ElementLink<xAOD::TrackParticleContainer> TEL; TEL.setElement( xAODwrk->tmpListTracks[0] );
502 const xAOD::TrackParticleContainer* cont = (const xAOD::TrackParticleContainer* ) (xAODwrk->tmpListTracks[0]->container() );
503 TEL.setStorableObject(*cont);
504 tmpVertex->addTrackAtVertex(TEL,1.);
505 n1trVrt++;
506 }
507 if(tmpVertex){
508 wgtBDT (*tmpVertex) =curVrt.BDT;
509 nTrksDec(*tmpVertex) =curVrt.selTrk.size();
510 vChrgTot(*tmpVertex) =curVrt.vertexCharge;
511 tmpVertex->setVertexType(xAOD::VxType::SecVtx);
512 // Transferring ownership to caller (usually taken by VxSecVertexInfo)
513 finalVertices.push_back(tmpVertex.release());
514 for (int ind=0; ind<nth; ind++) {
515 m_chi2_toSV(*xAODwrk->listSelTracks[curVrt.selTrk[ind]]) = curVrt.chi2PerTrk[ind] > FLT_MAX ? FLT_MAX : curVrt.chi2PerTrk[ind];
516 }
517 }
518 }
519 if(m_fillHist){
520 Hists& h = getHists();
521 h.m_hb_goodvrtN->Fill( finalVertices.size()+0.1, m_w_1);
522 h.m_hb_goodvrt1N->Fill( n1trVrt+0.1, m_w_1);
523 }
524//-----------------------------------------------------------------------------------
525// Saving of results
526//
527 return finalVertices;
528
529 }
#define AmgSymMatrix(dim)
static Double_t a
static Double_t sc
if(pathvar)
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
bool msgLvl(const MSG::Level lvl) const
double improveVertexChi2(WrkVrt &vertex, std::vector< const xAOD::TrackParticle * > &allTracks, Trk::IVKalState &istate, bool ifCovV0) const
void selGoodTrkParticle(workVectorArrxAOD *xAODwrk, const xAOD::Vertex &primVrt) const
double mergeAndRefitVertices(WrkVrt &v1, WrkVrt &v2, WrkVrt &newvrt, std::vector< const xAOD::TrackParticle * > &AllTrackList, Trk::IVKalState &istate, int robKey=0) const
Gaudi::Property< float > m_vrtMassLimit
double refitVertex(WrkVrt &Vrt, std::vector< const xAOD::TrackParticle * > &SelectedTracks, Trk::IVKalState &istate, bool ifCovV0) const
static double vrtVrtDist2D(const xAOD::Vertex &primVrt, const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr, double &signif)
double refineVerticesWithCommonTracks(WrkVrt &v1, WrkVrt &v2, std::vector< const xAOD::TrackParticle * > &allTrackList, Trk::IVKalState &istate) const
static double projSV_PV(const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
Gaudi::Property< float > m_cutPt
Gaudi::Property< float > m_vertexMergeCut
Gaudi::Property< float > m_globVrtProbCut
void select2TrVrt(const EventContext &ctx, std::vector< const xAOD::TrackParticle * > &SelectedTracks, const xAOD::Vertex &primVrt, std::map< long int, std::vector< double > > &vrt, compatibilityGraph_t &compatibilityGraph) const
static int nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, int indexV1, int indexV2)
ToolHandle< Rec::ITwoTrackVertexSelector > m_fin_v2trselector
ToolHandle< Trk::TrkVKalVrtFitter > m_fitSvc
static double massV0(const std::vector< std::vector< double > > &TrkAtVrt, double massP, double massPi)
Gaudi::Property< float > m_maxSVRadiusCut
ROOT::Math::PxPyPzEVector momAtVrt(const std::vector< double > &inpTrk) const
static double MomProjDist(const Amg::Vector3D &SV, const xAOD::Vertex &PV, const TLorentzVector &Direction)
void printWrkSet(const std::vector< WrkVrt > *WrkSet, const std::string &name) const
static int mostHeavyTrk(WrkVrt V, std::vector< const xAOD::TrackParticle * > AllTracks)
double minVrtVrtDist(std::vector< WrkVrt > *WrkVrtSet, int &indexV1, int &indexV2, std::vector< double > &check) const
Gaudi::Property< float > m_selVrtSigCut
static std::vector< double > estimVrtPos(int nTrk, std::deque< long int > &selTrk, std::map< long int, std::vector< double > > &vrt)
Gaudi::Property< bool > m_multiWithOneTrkVrt
float z() const
Returns the z position.
float y() const
Returns the y position.
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
const Amg::Vector3D & position() const
Returns the 3-pos.
float x() const
Returns the x position.
double chi2(TH1 *h0, TH1 *h1)
::StatusCode StatusCode
StatusCode definition for legacy code.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)
@ SecVtx
Secondary vertex.
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ improveVertexChi2()

double Rec::NewVrtSecInclusiveTool::improveVertexChi2 ( WrkVrt & vertex,
std::vector< const xAOD::TrackParticle * > & allTracks,
Trk::IVKalState & istate,
bool ifCovV0 ) const
private

Definition at line 195 of file MultiUtilities.cxx.

199 {
200
201 int nTrk=vertex.selTrk.size();
202 if( nTrk<2 )return 0.;
203 double prob=TMath::Prob( vertex.chi2, 2*nTrk-3);
204 //
205 //----Start track removal iterations
206 while(prob<0.01){
207 nTrk=vertex.selTrk.size();
208 if(nTrk==2)return prob;
209 int selT=0;
210 for(int i=0; i<nTrk; i++){ if( vertex.chi2PerTrk[i]>vertex.chi2PerTrk[selT]) selT=i; }
211 vertex.detachedTrack=vertex.selTrk[selT];
212 vertex.selTrk.erase( vertex.selTrk.begin() + selT ); //remove track
213 prob = refitVertex( vertex, allTrackList, istate, ifCovV0);
214 if(prob<0.)return 0.;
215 }
216 return prob;
217 }

◆ initialize()

StatusCode Rec::NewVrtSecInclusiveTool::initialize ( )
overridevirtual

Definition at line 66 of file NewVrtSecInclusiveTool.cxx.

66 {
67 ATH_MSG_DEBUG( "Initialising NewVrtSecInclusiveTool" );
68 ATH_CHECK( m_extrapolator.retrieve() );
69 ATH_CHECK( m_trackToVertexTool.retrieve() );
70 ATH_CHECK( m_beamSpotKey.initialize() );
71 ATH_CHECK( m_fitSvc.retrieve() );
72 ATH_CHECK( m_ini_v2trselector.retrieve() );
73 ATH_CHECK( m_fin_v2trselector.retrieve() );
74
75 m_is_selected = SG::AuxElement::Decorator<char>("is_selected"+m_augString);
76 m_is_svtrk_final = SG::AuxElement::Decorator<char>("is_svtrk_final"+m_augString);
77 m_pt_wrtSV = SG::AuxElement::Decorator<float>("pt_wrtSV"+m_augString);
78 m_eta_wrtSV = SG::AuxElement::Decorator<float>("eta_wrtSV"+m_augString);
79 m_phi_wrtSV = SG::AuxElement::Decorator<float>("phi_wrtSV"+m_augString);
80 m_d0_wrtSV = SG::AuxElement::Decorator<float>("d0_wrtSV"+m_augString);
81 m_z0_wrtSV = SG::AuxElement::Decorator<float>("z0_wrtSV"+m_augString);
82 m_errP_wrtSV = SG::AuxElement::Decorator<float>("errP_wrtSV"+m_augString);
83 m_errd0_wrtSV = SG::AuxElement::Decorator<float>("errd0_wrtSV"+m_augString);
84 m_errz0_wrtSV = SG::AuxElement::Decorator<float>("errz0_wrtSV"+m_augString);
85 m_chi2_toSV = SG::AuxElement::Decorator<float>("chi2_toSV"+m_augString);
86
87//------------------------------------------
88//
89 if(m_fillHist){
90 if (Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
91 ATH_MSG_FATAL("Filling histograms not supported in MT jobs.");
92 return StatusCode::FAILURE;
93 }
94
95 SmartIF<ITHistSvc> hist_root{service("THistSvc")};
96 if( !hist_root ) ATH_MSG_DEBUG("Could not find THistSvc service");
97 else ATH_MSG_DEBUG("NewVrtSecInclusiveTool Histograms found");
98 std::string histDir;
99 histDir="/NVSI/stat/MultiSVrt"+m_instanceName+"/";
100
101 m_h = std::make_unique<Hists>();
102 ATH_CHECK( m_h->book (*hist_root, histDir) );
103
104 m_w_1 = 1.;
105 }
106
107
108 return StatusCode::SUCCESS;
109
110 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
ToolHandle< Rec::ITwoTrackVertexSelector > m_ini_v2trselector
Gaudi::Property< std::string > m_augString

◆ 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.

◆ isDisplaced()

bool Rec::NewVrtSecInclusiveTool::isDisplaced ( const xAOD::TrackParticle * tp)
staticprivate

Definition at line 285 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

285 {
286 if(!TP)return false;
287 static const SG::ConstAccessor<ElementLink<xAOD::TruthParticleContainer>> truthParticleLinkAcc( "truthParticleLink");
288 if( truthParticleLinkAcc.isAvailable( *TP ) ) {
289 const ElementLink<xAOD::TruthParticleContainer>& tplink = truthParticleLinkAcc( *TP );
290 if( !tplink.isValid() ) return false;
291 if((*tplink)->hasProdVtx() && (*tplink)->prodVtx()->perp() > 1.*Gaudi::Units::mm) return true;
292 }
293 return false;
294 }

◆ isExcitedHadron()

bool Rec::NewVrtSecInclusiveTool::isExcitedHadron ( const xAOD::TruthParticle * tp)
staticprivate

Definition at line 277 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

277 {
278 if( !tp->hasProdVtx() )return false;
279 if( !tp->hasDecayVtx() )return false;
280 Amg::Vector3D pvrt(tp->prodVtx()->x(),tp->prodVtx()->y(),tp->prodVtx()->z());
281 Amg::Vector3D dvrt(tp->decayVtx()->x(),tp->decayVtx()->y(),tp->decayVtx()->z());
282 return Amg::distance(pvrt,dvrt) < 0.001*Gaudi::Units::mm ? true : false;
283 }
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
bool hasDecayVtx() const
Check for a decay vertex on this particle.

◆ isPart()

bool Rec::NewVrtSecInclusiveTool::isPart ( const std::deque< long int > & test,
std::deque< long int > base )
staticprivate

Definition at line 252 of file MultiUtilities.cxx.

254 {
255 for (long int trk : test)
256 if(std::find(base.begin(), base.end(), trk) == base.end()) return false; //element not found => test is not part of base
257 return true;
258 }
std::string base
Definition hcg.cxx:83

◆ lockDecorations()

void Rec::NewVrtSecInclusiveTool::lockDecorations ( const std::vector< const xAOD::TrackParticle * > & inpTrk) const
private

Definition at line 336 of file NewVrtSecInclusiveTool.cxx.

337 {
338 // We may have track from several containers. Use this to keep track
339 // of which ones we've processed. We only expect a few distinct ones,
340 // so just use a vector.
341 std::vector<const SG::AuxVectorData*> containers;
342 containers.reserve (16);
343
344 for (const xAOD::TrackParticle* t : inpTrk) {
345 const SG::AuxVectorData* c = t->container();
346 if (c && std::find (containers.begin(), containers.end(), c) == containers.end())
347 {
348 containers.push_back (c);
349 // Ok because we just made these decorations.
350 SG::AuxVectorData* c_nc ATLAS_THREAD_SAFE = const_cast<SG::AuxVectorData*> (c);
351 c_nc->lockDecoration (m_is_selected.auxid());
352 c_nc->lockDecoration (m_is_svtrk_final.auxid());
353 c_nc->lockDecoration (m_pt_wrtSV.auxid());
354 c_nc->lockDecoration (m_eta_wrtSV.auxid());
355 c_nc->lockDecoration (m_phi_wrtSV.auxid());
356 c_nc->lockDecoration (m_d0_wrtSV.auxid());
357 c_nc->lockDecoration (m_z0_wrtSV.auxid());
358 c_nc->lockDecoration (m_errP_wrtSV.auxid());
359 c_nc->lockDecoration (m_errd0_wrtSV.auxid());
360 c_nc->lockDecoration (m_errz0_wrtSV.auxid());
361 c_nc->lockDecoration (m_chi2_toSV.auxid());
362 }
363 }
364 }
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ massV0()

double Rec::NewVrtSecInclusiveTool::massV0 ( const std::vector< std::vector< double > > & TrkAtVrt,
double massP,
double massPi )
staticprivate

Definition at line 177 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

180 {
181 double ap1i=std::abs(TrkAtVrt[0][2]); double ap2i=std::abs(TrkAtVrt[1][2]);
182 CxxUtils::sincos phi1(TrkAtVrt[0][0]);
183 CxxUtils::sincos theta1(TrkAtVrt[0][1]);
184 CxxUtils::sincos phi2(TrkAtVrt[1][0]);
185 CxxUtils::sincos theta2(TrkAtVrt[1][1]);
186 double px = phi1.cs * theta1.sn * ap1i
187 + phi2.cs * theta2.sn * ap2i;
188 double py = phi1.sn * theta1.sn * ap1i
189 + phi2.sn * theta2.sn * ap2i;
190 double pz = theta1.cs * ap1i
191 + theta2.cs * ap2i;
192 double ee= (ap1i > ap2i) ?
193 (std::sqrt(ap1i*ap1i+massP*massP)+std::sqrt(ap2i*ap2i+massPi*massPi)):
194 (std::sqrt(ap2i*ap2i+massP*massP)+std::sqrt(ap1i*ap1i+massPi*massPi));
195 double test=(ee-pz)*(ee+pz)-px*px-py*py;
196 return test>0 ? std::sqrt(test) : 0.;
197 }

◆ mergeAndRefitVertices()

double Rec::NewVrtSecInclusiveTool::mergeAndRefitVertices ( WrkVrt & v1,
WrkVrt & v2,
WrkVrt & newvrt,
std::vector< const xAOD::TrackParticle * > & AllTrackList,
Trk::IVKalState & istate,
int robKey = 0 ) const
private

Definition at line 151 of file MultiUtilities.cxx.

155 {
156 if(!v1.Good)return -1.; //bad vertex
157 if(!v2.Good)return -1.; //bad vertex
158 std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
159 newvrt.Good=true;
160 int nTrk_V1=v1.selTrk.size();
161 int nTrk_V2=v2.selTrk.size();
162 newvrt.selTrk.resize(nTrk_V1+nTrk_V2);
163 std::copy(v1.selTrk.begin(),v1.selTrk.end(), newvrt.selTrk.begin());
164 std::copy(v2.selTrk.begin(),v2.selTrk.end(), newvrt.selTrk.begin()+nTrk_V1);
165
166 std::deque<long int>::iterator TransfEnd ;
167 sort( newvrt.selTrk.begin(), newvrt.selTrk.end() );
168 TransfEnd = unique( newvrt.selTrk.begin(), newvrt.selTrk.end() );
169 newvrt.selTrk.erase( TransfEnd, newvrt.selTrk.end());
170 std::vector<const xAOD::TrackParticle*> fitTrackList(0);
171 for(int it=0; it<(int)newvrt.selTrk.size(); it++)fitTrackList.push_back( AllTrackList[newvrt.selTrk[it]] );
172 m_fitSvc->setApproximateVertex( 0.5*(v1.vertex[0]+v2.vertex[0]),
173 0.5*(v1.vertex[1]+v2.vertex[1]),
174 0.5*(v1.vertex[2]+v2.vertex[2]),
175 istate);
176 m_fitSvc->setRobustness(robKey,istate);
177
178 StatusCode sc=m_fitSvc->VKalVrtFit(fitTrackList,neutralPartDummy,
179 newvrt.vertex, newvrt.vertexMom, newvrt.vertexCharge, newvrt.vertexCov,
180 newvrt.chi2PerTrk, newvrt.trkAtVrt, newvrt.chi2,
181 istate, false);
182 if( sc.isFailure() ) return -1.;
183 if( newvrt.chi2>500. ) return -1.; //VK protection
184 if( newvrt.chi2PerTrk.size()==2) newvrt.chi2PerTrk[0]=newvrt.chi2PerTrk[1]=newvrt.chi2/2.;
185
186 m_fitSvc->setRobustness(0,istate); //restore default behaviour
187
188 return TMath::Prob( newvrt.chi2, 2*newvrt.selTrk.size()-3);
189 }
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.

◆ minVrtVrtDist()

double Rec::NewVrtSecInclusiveTool::minVrtVrtDist ( std::vector< WrkVrt > * WrkVrtSet,
int & indexV1,
int & indexV2,
std::vector< double > & check ) const
private

Definition at line 70 of file MultiUtilities.cxx.

72 {
73 V1=V2=-1;
74 double foundMinVrtDst=1000000.;
75
76 for(int iv=0; iv<(int)wrkVrtSet->size()-1; iv++) {
77 if( (*wrkVrtSet)[iv].selTrk.size()< 2) continue; /* Bad vertices */
78 if(!(*wrkVrtSet)[iv].Good ) continue; /* Bad vertices */
79 for(int jv=iv+1; jv<(int)wrkVrtSet->size(); jv++) {
80 if( (*wrkVrtSet)[jv].selTrk.size()< 2) continue; /* Bad vertices */
81 if(!(*wrkVrtSet)[jv].Good ) continue; /* Bad vertices */
82 double tmp= std::abs((*wrkVrtSet)[iv].vertex.x()-(*wrkVrtSet)[jv].vertex.x())
83 +std::abs((*wrkVrtSet)[iv].vertex.y()-(*wrkVrtSet)[jv].vertex.y())
84 +std::abs((*wrkVrtSet)[iv].vertex.z()-(*wrkVrtSet)[jv].vertex.z());
85 if(tmp>20.) continue;
86 double tmpDst = vrtVrtDist((*wrkVrtSet)[iv].vertex,(*wrkVrtSet)[iv].vertexCov,
87 (*wrkVrtSet)[jv].vertex,(*wrkVrtSet)[jv].vertexCov);
88 if(std::find(checked.begin(),checked.end(),tmpDst) != checked.end()) continue; //Alreasy tried
89 if( tmpDst < foundMinVrtDst){foundMinVrtDst = tmpDst; V1=iv; V2=jv;}
90 }
91 }
92 return foundMinVrtDst;
93 }

◆ momAtVrt()

ROOT::Math::PxPyPzEVector Rec::NewVrtSecInclusiveTool::momAtVrt ( const std::vector< double > & inpTrk) const
private

Definition at line 201 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

202 {
203 double api=1./std::abs(inpTrk[2]);
204 CxxUtils::sincos phi(inpTrk[0]);
205 CxxUtils::sincos theta(inpTrk[1]);
206 double px = phi.cs * theta.sn * api;
207 double py = phi.sn * theta.sn * api;
208 double pz = theta.cs * api;
209 double ee = std::sqrt( px*px + py*py + pz*pz + m_massPi*m_massPi);
210 return {px,py,pz,ee};
211 }
Scalar phi() const
phi method
Scalar theta() const
theta method

◆ MomProjDist()

double Rec::NewVrtSecInclusiveTool::MomProjDist ( const Amg::Vector3D & SV,
const xAOD::Vertex & PV,
const TLorentzVector & Direction )
staticprivate

Definition at line 260 of file MultiUtilities.cxx.

262 {
263 Amg::Vector3D vv=SecVrt-primVrt.position();
264 return ( vv.x()*Mom.X()+vv.y()*Mom.Y()+vv.z()*Mom.Z() )/ Mom.P();
265 }

◆ mostHeavyTrk()

int Rec::NewVrtSecInclusiveTool::mostHeavyTrk ( WrkVrt V,
std::vector< const xAOD::TrackParticle * > AllTracks )
staticprivate

Definition at line 26 of file MultiUtilities.cxx.

28 {
29 int NTrk=V.selTrk.size(), SelT=-1;
30 if(NTrk<3)return -1;
31//--------------------------------------------------
32 TLorentzVector TSum;
33 for(int i=0; i<NTrk; i++){
34 TSum += AllTracks.at(V.selTrk[i])->p4();
35 }
36 double massMin=1.e9;
37 for(int i=0; i<NTrk; i++){
38 TLorentzVector TSum_m1 = TSum - AllTracks[V.selTrk[i]]->p4();
39 if(TSum_m1.M()<massMin){massMin=TSum_m1.M(); SelT=i;}
40 }
41 return SelT;
42 }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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 }

◆ nTrkCommon()

int Rec::NewVrtSecInclusiveTool::nTrkCommon ( std::vector< WrkVrt > * WrkVrtSet,
int indexV1,
int indexV2 )
staticprivate

Definition at line 48 of file MultiUtilities.cxx.

50 {
51 int nTrk_V1 = (*wrkVrtSet).at(V1).selTrk.size(); if( nTrk_V1< 2) return 0; /* Bad vertex */
52 int nTrk_V2 = (*wrkVrtSet).at(V2).selTrk.size(); if( nTrk_V2< 2) return 0; /* Bad vertex */
53 int nTrkCom=0;
54 if(nTrk_V1 < nTrk_V2){
55 for(int i=0; i<nTrk_V1; i++){
56 int trk=(*wrkVrtSet)[V1].selTrk[i];
57 for(int j=0; j<nTrk_V2; j++){ if( trk==(*wrkVrtSet)[V2].selTrk[j]){ nTrkCom++; break;} }
58 }
59 }else{
60 for(int i=0; i<nTrk_V2; i++){
61 int trk=(*wrkVrtSet)[V2].selTrk[i];
62 for(int j=0; j<nTrk_V1; j++){ if( trk==(*wrkVrtSet)[V1].selTrk[j]){ nTrkCom++; break;} }
63 }
64 }
65 return nTrkCom;
66 }

◆ 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.

◆ PntPntDist()

double Rec::NewVrtSecInclusiveTool::PntPntDist ( const Amg::Vector3D & Vrt1,
const Amg::Vector3D & Vrt2 )
staticprivate

Definition at line 149 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

150 {
151 double dx = Vrt1.x()- Vrt2.x();
152 double dy = Vrt1.y()- Vrt2.y();
153 double dz = Vrt1.z()- Vrt2.z();
154 return std::sqrt(dx*dx+dy*dy*dz*dz);
155 }

◆ printWrkSet()

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

Definition at line 27 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

27 {
28 int nGoodV=0;
29 if(msgLvl(MSG::INFO)){
30 for(int iv=0; iv<(int)WrkVrtSet->size(); iv++) {
31 msg(MSG::INFO)<<name
32 <<"= "<<(*WrkVrtSet)[iv].vertex[0]
33 <<", "<<(*WrkVrtSet)[iv].vertex[1]
34 <<", "<<(*WrkVrtSet)[iv].vertex[2]
35 <<" NTrk="<<(*WrkVrtSet)[iv].selTrk.size()
36 <<" is good="<<std::boolalpha<<(*WrkVrtSet)[iv].Good<<std::noboolalpha
37 <<" Chi2="<<(*WrkVrtSet)[iv].chi2
38 <<" Mass="<<(*WrkVrtSet)[iv].vertexMom.M()
39 <<" detached="<<(*WrkVrtSet)[iv].detachedTrack
40 <<" proj.dist="<<(*WrkVrtSet)[iv].projectedVrt
41 <<" trk=";
42 for(int kk=0; kk<(int)(*WrkVrtSet)[iv].selTrk.size(); kk++) {
43 msg(MSG::INFO)<<", "<<(*WrkVrtSet)[iv].selTrk[kk];}
44 for(int kk=0; kk<(int)(*WrkVrtSet)[iv].selTrk.size(); kk++) {
45 msg(MSG::INFO)<<", "<<momAtVrt((*WrkVrtSet)[iv].trkAtVrt[kk]).Pt();}
46 msg(MSG::INFO)<<endmsg;
47 if((*WrkVrtSet)[iv].Good)nGoodV++;
48 }
49 msg(MSG::INFO)<<name<<" N="<<nGoodV<<endmsg;
50 }
51 }
#define endmsg
MsgStream & msg() const

◆ projSV_PV()

double Rec::NewVrtSecInclusiveTool::projSV_PV ( const Amg::Vector3D & SV,
const xAOD::Vertex & PV,
const TLorentzVector & Direction )
staticprivate

Definition at line 54 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

55 {
56 TVector3 SV_PV( SV.x()-PV.x(), SV.y()-PV.y(), SV.z()-PV.z() );
57 return Direction.Vect().Unit()*SV_PV.Unit();
58 }

◆ refineVerticesWithCommonTracks()

double Rec::NewVrtSecInclusiveTool::refineVerticesWithCommonTracks ( WrkVrt & v1,
WrkVrt & v2,
std::vector< const xAOD::TrackParticle * > & allTrackList,
Trk::IVKalState & istate ) const
private

Definition at line 100 of file MultiUtilities.cxx.

104 {
105 if(!v1.Good || !v2.Good)return -1.; //bad vertex check for safety
106
107 int ntv1=v1.selTrk.size();
108 int ntv2=v2.selTrk.size();
109 if( ntv1<2 || ntv2<2 ) return -1.; //for safety
110 double prb_v1=TMath::Prob( v1.chi2, 2*ntv1-3);
111 double prb_v2=TMath::Prob( v2.chi2, 2*ntv2-3);
112 WrkVrt * badV =&v1;
113 WrkVrt * goodV=&v2;
114 bool swap=false;
115 //---- Good vertex selection
116 if(prb_v1>0.01&&prb_v2>0.01){ //Both vertices are good Prob>1%
117 if( ntv1==ntv2 ) {if(prb_v1>prb_v2) swap=true;} //If multiplicities are equal- select better Chi2
118 else {if(ntv1>ntv2) swap=true;}
119 }
120 if(prb_v1<0.01&&prb_v2<0.01){ //Both vertices are bad Prob<1%
121 if(prb_v1>prb_v2) swap=true; // select better Chi2
122 }
123 if(prb_v1>0.01&&prb_v2<0.01){ //Second vertex is bad Prob<1%
124 if(prb_v1>prb_v2) swap=true;
125 }
126 if(swap) {badV =&v2; goodV =&v1;}
127 int badVNtrk=(*badV).selTrk.size();
128 //-----------------
129 unsigned int it=0;
130 while( it<(*badV).selTrk.size() ){
131 int trk=(*badV).selTrk[it];
132 if(std::find((*goodV).selTrk.begin(),(*goodV).selTrk.end(),trk) != (*goodV).selTrk.end()){
133 (*badV).selTrk.erase((*badV).selTrk.begin()+it);
134 (*badV).detachedTrack=trk;
135 } else it++;
136 }
137 if((*badV).selTrk.size()<2){
138 (*badV).Good=false;
139 if((*badV).selTrk.size()==1 && m_multiWithOneTrkVrt){ //Special case if 1-track vertices are allowed
140 (*badV).vertexCharge=allTrackList[(*badV).selTrk.at(0)]->charge();
141 (*badV).vertexMom=allTrackList[(*badV).selTrk.at(0)]->p4();
142 if( badVNtrk>=2 && TMath::Prob((*badV).chi2,2*badVNtrk-3)>0.1 ) (*badV).Good=true; //Accept only if original vertex prob>10%!
143 }
144 return -1.;
145 }
146 return refitVertex((*badV),allTrackList, istate, false);
147 }
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().

◆ refitVertex()

double Rec::NewVrtSecInclusiveTool::refitVertex ( WrkVrt & Vrt,
std::vector< const xAOD::TrackParticle * > & SelectedTracks,
Trk::IVKalState & istate,
bool ifCovV0 ) const
private

Definition at line 221 of file MultiUtilities.cxx.

225 {
226 int i,j;
227 int nth = vrt.selTrk.size();
228
229 if(nth<2) return -1.;
230
231 std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
232 std::vector<const xAOD::TrackParticle*> listTracks(0);
233 for(i=0;i<nth;i++) {
234 j=vrt.selTrk[i]; /*Track number*/
235 listTracks.push_back( selectedTracks[j] );
236 }
237 vrt.Good = false;
238 vrt.chi2PerTrk.resize(nth);
239 for(i=0;i<nth;i++)vrt.chi2PerTrk[i]=100000.+i; //VK safety
240
241 m_fitSvc->setApproximateVertex(vrt.vertex[0],vrt.vertex[1],vrt.vertex[2],istate);
242 StatusCode sc=m_fitSvc->VKalVrtFit(listTracks,neutralPartDummy,vrt.vertex,vrt.vertexMom,vrt.vertexCharge,
243 vrt.vertexCov,vrt.chi2PerTrk, vrt.trkAtVrt,vrt.chi2,
244 istate, ifCovV0);
245 if(sc.isSuccess())vrt.Good = true;
246 else {vrt.Good = false; return -1.;}
247 if(vrt.chi2PerTrk.size()==2) vrt.chi2PerTrk[0]=vrt.chi2PerTrk[1]=vrt.chi2/2.;
248 return TMath::Prob( vrt.chi2, 2*nth-1);
249 }

◆ 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();
384 }
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)

◆ 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 {
366 }

◆ select2TrVrt()

void Rec::NewVrtSecInclusiveTool::select2TrVrt ( const EventContext & ctx,
std::vector< const xAOD::TrackParticle * > & SelectedTracks,
const xAOD::Vertex & primVrt,
std::map< long int, std::vector< double > > & vrt,
compatibilityGraph_t & compatibilityGraph ) const
private

-—Prepare data for selector

Definition at line 31 of file Sel2TrkVertices.cxx.

37 {
38 std::vector<const xAOD::NeutralParticle*> neutralPartDummy(0);
39 std::vector<const xAOD::TrackParticle*> tracksForFit(2,nullptr);
40 std::vector<double> impact,impactError;
41 std::vector<double> inpMass(2,m_massPi);
42 long int Charge;
43 int i,j;
45 Vrt2Tr tmpVrt;
46 std::vector<Vrt2Tr> all2TrVrt(0);
47 TLorentzVector PSum2T;
48 Amg::Vector3D iniVrt(0.,0.,0.);
49//
50 int NTracks = (int) (selectedTracks.size());
51//
52// impact parameters with sign calculations
53//
55 double signifR=0.,signifZ=0.;
56 std::vector<int> nPixHits(NTracks,0);
57 std::vector<double> trackSignif(NTracks),dRdZratio(NTracks);
58 for (i=0; i<NTracks; i++) {
59 m_fitSvc->VKalGetImpact(ctx, selectedTracks[i], primVrt.position(), 1, impact, impactError);
60 signifR = impact[0]/ sqrt(impactError[0]);
61 signifZ = impact[1]/ sqrt(impactError[2]);
62 trackSignif[i] = sqrt( signifR*signifR + signifZ*signifZ);
63 dRdZratio[i] = std::abs(signifR/signifZ);
64 if( !(selectedTracks[i]->summaryValue(nPixelHits,xAOD::numberOfPixelHits)) ) nPixelHits=0;
65 nPixHits[i]=nPixelHits;
66 if(m_fillHist){
67 Hists& h = getHists();
68 h.m_hb_impactR->Fill( signifR, m_w_1);
69 h.m_hb_impactZ->Fill( signifZ, m_w_1);
70 h.m_hb_impactRZ->Fill(signifR, signifZ, m_w_1);
71 h.m_hb_impact->Fill( trackSignif[i], m_w_1);
72 if( i<DevTuple::maxNTrk){
73 Hists& h = getHists();
74 h.m_curTup->pttrk[i]=selectedTracks[i]->pt();
75 h.m_curTup->d0trk[i]=selectedTracks[i]->d0();
76 h.m_curTup->Sig3D[i]=trackSignif[i];
77 h.m_curTup->idHF[i] =getIdHF(selectedTracks[i]);
78 h.m_curTup->dRdZrat[i] =dRdZratio[i];
79 h.m_curTup->displaced[i]=isDisplaced(selectedTracks[i]);
80
81 uint8_t TRTHits;
82 if( !(selectedTracks[i]->summaryValue( TRTHits,xAOD::numberOfTRTHits))) TRTHits=0;
83 h.m_curTup->trkTRT[i] =TRTHits;
84 h.m_curTup->etatrk[i] =selectedTracks[i]->eta();
85 }
86 }
87 }
88
89 if( m_fillHist ){
90 Hists& h = getHists();
91 h.m_curTup->nTrk=NTracks < DevTuple::maxNTrk ? NTracks : DevTuple::maxNTrk ;
92 h.m_curTup->n2Vrt=0;
93 }
94
95 std::vector<std::vector<std::tuple<int,float>>> trkCount(NTracks);
96 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
97 m_fitSvc->setMassInputParticles( inpMass, *state ); // Use pion masses for fit
98 for (i=0; i<NTracks-1; i++) {
99 if(trackSignif[i]<m_trkSigCut || dRdZratio[i]<m_dRdZRatioCut )continue;
100 for (j=i+1; j<NTracks; j++) {
101 if(trackSignif[j]<m_trkSigCut || dRdZratio[j]<m_dRdZRatioCut )continue;
102 PSum2T=selectedTracks[i]->p4()+selectedTracks[j]->p4();
103 if( std::abs(selectedTracks[i]->eta()-selectedTracks[j]->eta())==0 &&
104 std::abs(selectedTracks[i]->phi()-selectedTracks[j]->phi())==0 &&
105 std::abs(selectedTracks[i]->pt() -selectedTracks[j]->pt())==0 ) continue; //remove duplicated tracks
106 tracksForFit[0]=selectedTracks[i];
107 tracksForFit[1]=selectedTracks[j];
108 double minDZ=0.;
109 sc=m_fitSvc->VKalVrtFitFast(tracksForFit,tmpVrt.fitVertex,minDZ,*state); /* Fast crude estimation*/
110 if( sc.isFailure() ) { /* No initial estimation */
111 iniVrt=primVrt.position();
112 } else {
113 double cosMomVrtDir = projSV_PV(tmpVrt.fitVertex,primVrt,PSum2T);
114 if( cosMomVrtDir>0. ) iniVrt=tmpVrt.fitVertex; /* Good initial estimation */
115 else iniVrt=primVrt.position();
116 }
117 if(nPixHits[i]>0 && nPixHits[j]>0){ if(minDZ> m_fastZSVCut) continue; } // Drop SV candidates with big Z track-track distance.
118 else{ if(minDZ>2.*m_fastZSVCut) continue; } // Drop SV candidates with big Z track-track distance.
119 m_fitSvc->setApproximateVertex(iniVrt.x(), iniVrt.y(), iniVrt.z(), *state);
120 sc=m_fitSvc->VKalVrtFit(tracksForFit, neutralPartDummy, tmpVrt.fitVertex, tmpVrt.momentum, Charge,
121 tmpVrt.errorMatrix, tmpVrt.chi2PerTrk, tmpVrt.trkAtVrt, tmpVrt.chi2, *state, false );
122 if(sc.isFailure()) continue; /* No fit */
123 if(tmpVrt.chi2>20.) continue; /*Too bad Chi2 for nDoF=1 fit*/
126 float vQuality;
127 xAOD::Vertex testV;
128 testV.makePrivateStore();
129 testV.setPosition(tmpVrt.fitVertex);
130 std::vector<float> testVcov(tmpVrt.errorMatrix.begin(),tmpVrt.errorMatrix.end());
131 testV.setCovariance(testVcov);
132 testV.setFitQuality(tmpVrt.chi2,1.);
133 bool acceptV=m_ini_v2trselector->isgood(ctx,
134 std::make_pair(selectedTracks[i],selectedTracks[j]), testV,
135 std::make_pair(momAtVrt(tmpVrt.trkAtVrt[0]),momAtVrt(tmpVrt.trkAtVrt[1])), primVrt, vQuality);
136 if(!acceptV) continue; // Main 2-track vertex selection
137
138
139//Check close material layer. Not validated in detail, use with care.
140 double vrtR=tmpVrt.fitVertex.perp();
141 double dstMatSignif=1.e4;
142 if(m_removeTrkMatSignif>0. && vrtR>20.){
143 double vrtRErr=vrtRadiusError(tmpVrt.fitVertex,tmpVrt.errorMatrix );
144 if(vrtR<30.){ dstMatSignif=std::abs(vrtR-m_beampipeR)/vrtRErr;}
145 else { dstMatSignif=distToMatLayerSignificance(tmpVrt);} //Material in Pixel volume
146 if(dstMatSignif<m_removeTrkMatSignif)continue;
147 }
148//
149// Debugging and BDT
150 double minPtT = std::min(tracksForFit[0]->pt(),tracksForFit[1]->pt());
151 if( m_fillHist ){
152 float ihitR = selectedTracks[i]->radiusOfFirstHit();
153 float jhitR = selectedTracks[j]->radiusOfFirstHit();
154 int ihitIBL = getIBLHit(selectedTracks[i]);
155 int jhitIBL = getIBLHit(selectedTracks[j]);
156 int ihitBL = getBLHit (selectedTracks[i]);
157 int jhitBL = getBLHit (selectedTracks[j]);
158 double Prob2v=TMath::Prob(tmpVrt.chi2,1);
159 double cosSVPV=projSV_PV(tmpVrt.fitVertex, primVrt, tmpVrt.momentum);
160 ROOT::Math::PxPyPzMVector SVPV(tmpVrt.fitVertex.x()-primVrt.x(),
161 tmpVrt.fitVertex.y()-primVrt.y(),
162 tmpVrt.fitVertex.z()-primVrt.z(), 10.);
163
164 Hists& h = getHists();
165
166 if(Charge==0){h.m_hb_massPiPi->Fill(tmpVrt.momentum.M(),1.);}
167 h.m_hb_cosSVMom->Fill(cosSVPV,1.);
168 h.m_hb_etaSV->Fill(SVPV.Eta(),1.);
169
170 double Sig3D=0.,Sig2D=0., Dist2D=0.;
171 int idisk1=0,idisk2=0,idisk3=0,jdisk1=0,jdisk2=0,jdisk3=0;
172 int sumIBLHits = std::max(ihitIBL,0)+std::max(jhitIBL,0);
173 int sumBLHits = std::max(ihitBL, 0)+std::max(jhitBL, 0);
174 getPixelDiscs(selectedTracks[i],idisk1,idisk2,idisk3);
175 getPixelDiscs(selectedTracks[j],jdisk1,jdisk2,jdisk3);
176 vrtVrtDist(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, Sig3D);
177 Dist2D=vrtVrtDist2D(primVrt, tmpVrt.fitVertex, tmpVrt.errorMatrix, Sig2D);
178 int barVrt1=getProdVrtBarcode(tracksForFit[0],0.1); // FIXME barcode-based
179 int barVrt2=getProdVrtBarcode(tracksForFit[1],0.1); // FIXME barcode-based
180 h.m_hb_signif3D->Fill(Sig3D,1.);
181 h.m_curTup->VrtTrkHF [h.m_curTup->n2Vrt] = getIdHF(tracksForFit[0])+ getIdHF(tracksForFit[1]);
182 h.m_curTup->VrtTrkI [h.m_curTup->n2Vrt] = getG4Inter(tracksForFit[0])+ getG4Inter(tracksForFit[1]);
183 h.m_curTup->VrtTrueBar[h.m_curTup->n2Vrt] = (barVrt1 && barVrt2 && barVrt1==barVrt2) ? 1 : 0;
184 h.m_curTup->VrtTrueNear[h.m_curTup->n2Vrt] = checkTrue2TrVrt(tracksForFit[0],tracksForFit[1],0.1);
185 h.m_curTup->VrtCh [h.m_curTup->n2Vrt] = Charge;
186 h.m_curTup->VrtProb [h.m_curTup->n2Vrt] = Prob2v;
187 h.m_curTup->VrtSig3D [h.m_curTup->n2Vrt] = Sig3D;
188 h.m_curTup->VrtSig2D [h.m_curTup->n2Vrt] = Sig2D;
189 h.m_curTup->VrtDist2D[h.m_curTup->n2Vrt] = vrtR<20. ? Dist2D : vrtR;
190 h.m_curTup->VrtM [h.m_curTup->n2Vrt] = tmpVrt.momentum.M();
191 h.m_curTup->VrtZ [h.m_curTup->n2Vrt] = tmpVrt.fitVertex.z();
192 h.m_curTup->VrtPt [h.m_curTup->n2Vrt] = tmpVrt.momentum.Pt();
193 h.m_curTup->VrtEta [h.m_curTup->n2Vrt] = SVPV.Eta();
194 h.m_curTup->VrtIBL [h.m_curTup->n2Vrt] = sumIBLHits;
195 h.m_curTup->VrtBL [h.m_curTup->n2Vrt] = sumBLHits;
196 h.m_curTup->VrtCosSPM[h.m_curTup->n2Vrt] = cosSVPV;
197 h.m_curTup->VMinPtT [h.m_curTup->n2Vrt] = minPtT;
198 h.m_curTup->VMinS3DT [h.m_curTup->n2Vrt] = std::min(trackSignif[i],trackSignif[j]);
199 h.m_curTup->VMaxS3DT [h.m_curTup->n2Vrt] = std::max(trackSignif[i],trackSignif[j]);
200 h.m_curTup->VrtBDT [h.m_curTup->n2Vrt] = vQuality;
201 h.m_curTup->VrtHR1 [h.m_curTup->n2Vrt] = ihitR;
202 h.m_curTup->VrtHR2 [h.m_curTup->n2Vrt] = jhitR;
203 h.m_curTup->VrtDZ [h.m_curTup->n2Vrt] = minDZ;
204 h.m_curTup->VrtDisk [h.m_curTup->n2Vrt] = idisk1+10*idisk2+20*idisk3+30*jdisk1+40*jdisk2+50*jdisk3;
205 h.m_curTup->VSigMat [h.m_curTup->n2Vrt] = dstMatSignif;
206 h.m_curTup->VrtIT [h.m_curTup->n2Vrt] = i;
207 h.m_curTup->VrtJT [h.m_curTup->n2Vrt] = j;
208 if(h.m_curTup->n2Vrt<DevTuple::maxNVrt-1)h.m_curTup->n2Vrt++;
209 }
210//
211//--- Save good candidate for multi-vertex fit
212//
213 add_edge(i,j,compatibilityGraph);
214 goodVrt[NTracks*i+j]=std::vector<double>{tmpVrt.fitVertex.x(),tmpVrt.fitVertex.y(),tmpVrt.fitVertex.z()};
215 trkCount[i].emplace_back(j,vQuality); trkCount[j].emplace_back(i,vQuality);
216 }
217 }
218 //=== Resolve -!----!- case to speed up cluster finding
219 for(int t=0; t<NTracks; t++){
220 if(trkCount[t].size()==2){
221 i=std::get<0>(trkCount[t][0]);
222 j=std::get<0>(trkCount[t][1]);
223 if(trkCount[i].size()==1 && trkCount[j].size()==1 ){
224 if( std::get<1>(trkCount[t][0]) < std::get<1>(trkCount[t][1]) ) {
225 remove_edge(t,i,compatibilityGraph);
226 if(t<i)goodVrt.erase(NTracks*t+i); else goodVrt.erase(NTracks*i+t);
227 trkCount[i].clear();
228 trkCount[t].erase(trkCount[t].begin()+0);
229 } else {
230 remove_edge(t,j,compatibilityGraph);
231 if(t<j)goodVrt.erase(NTracks*t+j); else goodVrt.erase(NTracks*j+t);
232 trkCount[j].clear();
233 trkCount[t].erase(trkCount[t].begin()+1);
234 }
235 }
236 }
237 }
238
239 }
Scalar eta() const
pseudorapidity method
size_t size() const
Number of registered mappings.
static int getProdVrtBarcode(const xAOD::TrackParticle *TP, float resolLimit=0.1)
static void getPixelDiscs(const xAOD::TrackParticle *Part, int &d0Hit, int &d1Hit, int &d2Hit)
Gaudi::Property< float > m_trkSigCut
Gaudi::Property< float > m_removeTrkMatSignif
Gaudi::Property< float > m_fastZSVCut
Gaudi::Property< float > m_dRdZRatioCut
static double vrtRadiusError(const Amg::Vector3D &secVrt, const std::vector< double > &vrtErr)
static bool checkTrue2TrVrt(const xAOD::TrackParticle *TP1, const xAOD::TrackParticle *TP2, float nearCut=0.1)
Gaudi::Property< float > m_beampipeR
float nPixelHits(const U &p)
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].

◆ selGoodTrkParticle()

void Rec::NewVrtSecInclusiveTool::selGoodTrkParticle ( workVectorArrxAOD * xAODwrk,
const xAOD::Vertex & primVrt ) const
private

Definition at line 21 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/CutTrk.cxx.

24 {
25 std::vector<const xAOD::TrackParticle*>& inpTrk = xAODwrk->inpTrk;
26 std::vector<const xAOD::TrackParticle*>& selectedTracks = xAODwrk->listSelTracks;
27 std::vector<const xAOD::TrackParticle*>::const_iterator i_ntrk;
28 std::vector<double> impact,impactError;
29 std::multimap<double,const xAOD::TrackParticle*> orderedTrk;
30 if(m_fillHist){
31 Hists& h = getHists();
32 h.m_hb_ntrkInput->Fill( inpTrk.size()+0.1, m_w_1);
33 }
34 for (i_ntrk = inpTrk.begin(); i_ntrk < inpTrk.end(); ++i_ntrk) {
35//
36//-- Perigee in TrackParticle
37//
38 if(m_fillHist){
39 Hists& h = getHists();
40 h.m_hb_trkSelect->Fill( 0., m_w_1);
41 }
42 if((*i_ntrk)->numberDoF() == 0) continue; //Protection
43 double trkChi2 = (*i_ntrk)->chiSquared() / (*i_ntrk)->numberDoF();
44 if(trkChi2 > m_cutChi2) continue;
45 if( (*i_ntrk)->pt() < m_cutPt) continue;
46 if(m_fillHist){
47 Hists& h = getHists();
48 h.m_hb_trkSelect->Fill( 1., m_w_1);
49 }
50
51 const Trk::Perigee mPer=(*i_ntrk)->perigeeParameters() ;
52 const AmgSymMatrix(5) * locCov = mPer.covariance();
53 const double CovTrkMtx00 = (*locCov)(0,0);
54
55 uint8_t PixelHits,SctHits,BLayHits,TRTHits;
56 if( !((*i_ntrk)->summaryValue(PixelHits,xAOD::numberOfPixelHits)) ) continue; // Track is
57 if( !((*i_ntrk)->summaryValue( SctHits,xAOD::numberOfSCTHits)) ) continue; // definitely
58 if( SctHits<3 ) continue; // bad
59 if( !((*i_ntrk)->summaryValue( TRTHits,xAOD::numberOfTRTHits)) ) continue;
60 if( !((*i_ntrk)->summaryValue(BLayHits,xAOD::numberOfInnermostPixelLayerHits))) BLayHits=0;
61 if(m_fillHist){
62 Hists& h = getHists();
63 h.m_hb_trkSelect->Fill( 2., m_w_1);
64 }
65
66 Amg::Vector3D perigeePos=mPer.position();
67 double impactD0=sqrt( (perigeePos.x()-primVrt.x())*(perigeePos.x()-primVrt.x())
68 +(perigeePos.y()-primVrt.y())*(perigeePos.y()-primVrt.y()) );
69 double impactZ=perigeePos.z()-primVrt.z();
70 if(m_fillHist){
71 Hists& h = getHists();
72 h.m_hb_trkD0->Fill( impactD0, m_w_1);
73 h.m_hb_trkZ ->Fill( impactZ, m_w_1);
74 }
75 if(std::abs(impactZ)*std::sin((*i_ntrk)->theta())>m_maxZVrt && m_maxZVrt > 0.) continue;
76 if(std::abs(impactZ)*std::sin((*i_ntrk)->theta())<m_minZVrt && m_minZVrt > 0.) continue;
77 if(impactD0>m_cutD0Max) continue;
78 if(impactD0<m_cutD0Min) continue;
79 if(m_fillHist){
80 Hists& h = getHists();
81 h.m_hb_trkSelect->Fill( 3., m_w_1);
82 }
83
84 double bX=xAODwrk->beamX + (perigeePos.z()-xAODwrk->beamZ)*xAODwrk->tanBeamTiltX;
85 double bY=xAODwrk->beamY + (perigeePos.z()-xAODwrk->beamZ)*xAODwrk->tanBeamTiltY;
86 double impactBeam=sqrt( (perigeePos.x()-bX)*(perigeePos.x()-bX) + (perigeePos.y()-bY)*(perigeePos.y()-bY));
87//----Anti-pileup
88 double signifBeam = impactBeam / sqrt(CovTrkMtx00);
89 if(signifBeam < m_antiPileupSigRCut) continue; // cut against tracks from pileup vertices
90 if(m_fillHist){
91 Hists& h = getHists();
92 h.m_hb_trkSelect->Fill( 4., m_w_1);
93 }
94//----
95 if(PixelHits < m_cutPixelHits) continue;
96 if(SctHits < m_cutSctHits) continue;
97 if((PixelHits+SctHits) < m_cutSiHits) continue;
98 if(BLayHits < m_cutBLayHits) continue;
99 if(std::abs((*i_ntrk)->eta())<1.9 && TRTHits < m_cutTRTHits) continue; //TRT hits must be present inside TRT
100 if(m_fillHist){
101 Hists& h = getHists();
102 h.m_hb_trkSelect->Fill( 5., m_w_1);
103 }
104//----
105 orderedTrk.emplace(signifBeam,*i_ntrk);
106 selectedTracks.push_back(*i_ntrk);
107 }
108//---- Order tracks according to ranks
109 std::map<double,const xAOD::TrackParticle*>::reverse_iterator rt=orderedTrk.rbegin();
110 selectedTracks.resize(orderedTrk.size());
111 for ( int cntt=0; rt!=orderedTrk.rend(); ++rt,++cntt) {selectedTracks[cntt]=(*rt).second;}
112 }
Gaudi::Property< float > m_minZVrt
Gaudi::Property< int > m_cutPixelHits
Gaudi::Property< float > m_antiPileupSigRCut
Gaudi::Property< float > m_maxZVrt
Gaudi::Property< float > m_cutD0Min
Gaudi::Property< int > m_cutBLayHits
Gaudi::Property< float > m_cutD0Max
Gaudi::Property< float > m_cutChi2
Gaudi::Property< int > m_cutSctHits
Gaudi::Property< int > m_cutTRTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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.

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ vrtRadiusError()

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

Definition at line 160 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

161 {
162 double DirX=SecVrt.x(), DirY=SecVrt.y();
163 double Covar = DirX*VrtErr[0]*DirX
164 +2.*DirX*VrtErr[1]*DirY
165 +DirY*VrtErr[2]*DirY;
166 Covar /= DirX*DirX + DirY*DirY;
167 Covar=std::sqrt(std::abs(Covar));
168 if(Covar != Covar) Covar = 0.;
169 return Covar;
170 }

◆ vrtVrtDist() [1/2]

double Rec::NewVrtSecInclusiveTool::vrtVrtDist ( const Amg::Vector3D & vrt1,
const std::vector< double > & vrtErr1,
const Amg::Vector3D & vrt2,
const std::vector< double > & vrtErr2 )
staticprivate

Definition at line 119 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

122 {
123 double distx = vrt1.x()- vrt2.x();
124 double disty = vrt1.y()- vrt2.y();
125 double distz = vrt1.z()- vrt2.z();
126
127 AmgSymMatrix(3) primCovMtx; //Create
128 primCovMtx(0,0) = vrtErr1[0]+vrtErr2[0];
129 primCovMtx(0,1) = primCovMtx(1,0) = vrtErr1[1]+vrtErr2[1];
130 primCovMtx(1,1) = vrtErr1[2]+vrtErr2[2];
131 primCovMtx(0,2) = primCovMtx(2,0) = vrtErr1[3]+vrtErr2[3];
132 primCovMtx(1,2) = primCovMtx(2,1) = vrtErr1[4]+vrtErr2[4];
133 primCovMtx(2,2) = vrtErr1[5]+vrtErr2[5];
134
135 AmgSymMatrix(3) wgtMtx = primCovMtx.inverse();
136
137 double signif =
138 distx*wgtMtx(0,0)*distx
139 +disty*wgtMtx(1,1)*disty
140 +distz*wgtMtx(2,2)*distz
141 +2.*distx*wgtMtx(0,1)*disty
142 +2.*distx*wgtMtx(0,2)*distz
143 +2.*disty*wgtMtx(1,2)*distz;
144 signif=std::sqrt(std::abs(signif));
145 if(signif != signif) signif = 0.;
146 return signif;
147 }

◆ vrtVrtDist() [2/2]

double Rec::NewVrtSecInclusiveTool::vrtVrtDist ( const xAOD::Vertex & primVrt,
const Amg::Vector3D & secVrt,
const std::vector< double > & vrtErr,
double & signif )
staticprivate

Definition at line 60 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

63 {
64 double distx = primVrt.x()- secVrt.x();
65 double disty = primVrt.y()- secVrt.y();
66 double distz = primVrt.z()- secVrt.z();
67
68
69 AmgSymMatrix(3) primCovMtx=primVrt.covariancePosition(); //Create
70 primCovMtx(0,0) += secVrtErr[0];
71 primCovMtx(0,1) += secVrtErr[1];
72 primCovMtx(1,0) += secVrtErr[1];
73 primCovMtx(1,1) += secVrtErr[2];
74 primCovMtx(0,2) += secVrtErr[3];
75 primCovMtx(2,0) += secVrtErr[3];
76 primCovMtx(1,2) += secVrtErr[4];
77 primCovMtx(2,1) += secVrtErr[4];
78 primCovMtx(2,2) += secVrtErr[5];
79
80 AmgSymMatrix(3) wgtMtx = primCovMtx.inverse();
81
82 signif = distx*wgtMtx(0,0)*distx
83 +disty*wgtMtx(1,1)*disty
84 +distz*wgtMtx(2,2)*distz
85 +2.*distx*wgtMtx(0,1)*disty
86 +2.*distx*wgtMtx(0,2)*distz
87 +2.*disty*wgtMtx(1,2)*distz;
88 signif=std::sqrt(std::abs(signif));
89 if( signif!=signif ) signif = 0.;
90 return std::sqrt(distx*distx+disty*disty+distz*distz);
91 }

◆ vrtVrtDist2D()

double Rec::NewVrtSecInclusiveTool::vrtVrtDist2D ( const xAOD::Vertex & primVrt,
const Amg::Vector3D & secVrt,
const std::vector< double > & vrtErr,
double & signif )
staticprivate

Definition at line 93 of file Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx.

96 {
97 double distx = primVrt.x()- secVrt.x();
98 double disty = primVrt.y()- secVrt.y();
99
100
101 AmgSymMatrix(3) primCovMtx=primVrt.covariancePosition(); //Create
102 AmgSymMatrix(2) covMtx;
103 covMtx(0,0) = primCovMtx(0,0) + secVrtErr[0];
104 covMtx(0,1) = primCovMtx(0,1) + secVrtErr[1];
105 covMtx(1,0) = primCovMtx(1,0) + secVrtErr[1];
106 covMtx(1,1) = primCovMtx(1,1) + secVrtErr[2];
107
108 AmgSymMatrix(2) wgtMtx = covMtx.inverse();
109
110 signif = distx*wgtMtx(0,0)*distx
111 +disty*wgtMtx(1,1)*disty
112 +2.*distx*wgtMtx(0,1)*disty;
113 signif=std::sqrt(std::abs(signif));
114 if( signif!=signif ) signif = 0.;
115 return std::sqrt(distx*distx+disty*disty);
116 }

Member Data Documentation

◆ m_antiPileupSigRCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_antiPileupSigRCut {this, "AntiPileupSigRCut", 2.0, "Upper cut on significance of 2D distance between beam and perigee" }
private

Definition at line 161 of file NewVrtSecInclusiveTool.h.

161{this, "AntiPileupSigRCut", 2.0, "Upper cut on significance of 2D distance between beam and perigee" };

◆ m_augString

Gaudi::Property<std::string> Rec::NewVrtSecInclusiveTool::m_augString {this, "AugmentingVersionString", "_NVSI", "Augmentation version string"}
private

Definition at line 194 of file NewVrtSecInclusiveTool.h.

194{this, "AugmentingVersionString", "_NVSI", "Augmentation version string"};

◆ m_beampipeR

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_beampipeR {this, "BeampipeR", 24.3, "Radius of the beampipe material for aggressive material rejection" }
private

Definition at line 172 of file NewVrtSecInclusiveTool.h.

172{this, "BeampipeR", 24.3, "Radius of the beampipe material for aggressive material rejection" };

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> Rec::NewVrtSecInclusiveTool::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 183 of file NewVrtSecInclusiveTool.h.

183{ this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };

◆ m_chi2_toSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_chi2_toSV
private

Definition at line 213 of file NewVrtSecInclusiveTool.h.

◆ m_chiScale

float Rec::NewVrtSecInclusiveTool::m_chiScale[11] {}
private

Definition at line 313 of file NewVrtSecInclusiveTool.h.

313{};

◆ m_cutBLayHits

Gaudi::Property<int> Rec::NewVrtSecInclusiveTool::m_cutBLayHits {this, "CutBLayHits", 0, "Remove track if it has less B-layer hits" }
private

Definition at line 153 of file NewVrtSecInclusiveTool.h.

153{this, "CutBLayHits", 0, "Remove track if it has less B-layer hits" };

◆ m_cutChi2

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_cutChi2 {this, "CutChi2", 5., "Track Chi2 selection cut" }
private

Definition at line 160 of file NewVrtSecInclusiveTool.h.

160{this, "CutChi2", 5., "Track Chi2 selection cut" };

◆ m_cutD0Max

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_cutD0Max {this, "CutD0Max", 10., "Track maximal D0 selection cut" }
private

Definition at line 157 of file NewVrtSecInclusiveTool.h.

157{this, "CutD0Max", 10., "Track maximal D0 selection cut" };

◆ m_cutD0Min

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_cutD0Min {this, "CutD0Min", 0., "Track minimal D0 selection cut" }
private

Definition at line 156 of file NewVrtSecInclusiveTool.h.

156{this, "CutD0Min", 0., "Track minimal D0 selection cut" };

◆ m_cutPixelHits

Gaudi::Property<int> Rec::NewVrtSecInclusiveTool::m_cutPixelHits {this, "CutPixelHits", 2, "Remove track if it has less Pixel hits"}
private

Definition at line 150 of file NewVrtSecInclusiveTool.h.

150{this, "CutPixelHits", 2, "Remove track if it has less Pixel hits"};

◆ m_cutPt

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_cutPt {this, "CutPt", 500., "Track Pt selection cut" }
private

Definition at line 155 of file NewVrtSecInclusiveTool.h.

155{this, "CutPt", 500., "Track Pt selection cut" };

◆ m_cutSctHits

Gaudi::Property<int> Rec::NewVrtSecInclusiveTool::m_cutSctHits {this, "CutSctHits", 4, "Remove track if it has less SCT hits" }
private

Definition at line 149 of file NewVrtSecInclusiveTool.h.

149{this, "CutSctHits", 4, "Remove track if it has less SCT hits" };

◆ m_cutSharedHits

Gaudi::Property<int> Rec::NewVrtSecInclusiveTool::m_cutSharedHits {this,"CutSharedHits",1, "Reject final 2tr vertices if tracks have shared hits" }
private

Definition at line 154 of file NewVrtSecInclusiveTool.h.

154{this,"CutSharedHits",1, "Reject final 2tr vertices if tracks have shared hits" };

◆ m_cutSiHits

Gaudi::Property<int> Rec::NewVrtSecInclusiveTool::m_cutSiHits {this, "CutSiHits", 8, "Remove track if it has less Pixel+SCT hits" }
private

Definition at line 152 of file NewVrtSecInclusiveTool.h.

152{this, "CutSiHits", 8, "Remove track if it has less Pixel+SCT hits" };

◆ m_cutTRTHits

Gaudi::Property<int> Rec::NewVrtSecInclusiveTool::m_cutTRTHits {this, "CutTRTHits", 10, "Remove track if it has less TRT hits"}
private

Definition at line 151 of file NewVrtSecInclusiveTool.h.

151{this, "CutTRTHits", 10, "Remove track if it has less TRT hits"};

◆ m_d0_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_d0_wrtSV
private

Definition at line 208 of file NewVrtSecInclusiveTool.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_dRdZRatioCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_dRdZRatioCut {this, "dRdZRatioCut", 0.25, "Cut on dR/dZ ratio to remove pileup tracks" }
private

Definition at line 165 of file NewVrtSecInclusiveTool.h.

165{this, "dRdZRatioCut", 0.25, "Cut on dR/dZ ratio to remove pileup tracks" };

◆ m_errd0_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_errd0_wrtSV
private

Definition at line 211 of file NewVrtSecInclusiveTool.h.

◆ m_errP_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_errP_wrtSV
private

Definition at line 210 of file NewVrtSecInclusiveTool.h.

◆ m_errz0_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_errz0_wrtSV
private

Definition at line 212 of file NewVrtSecInclusiveTool.h.

◆ m_eta_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_eta_wrtSV
private

Definition at line 206 of file NewVrtSecInclusiveTool.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_extrapolator

ToolHandle<Trk::IExtrapolator> Rec::NewVrtSecInclusiveTool::m_extrapolator {this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator", "Name of the extrapolator tool"}
private

Definition at line 185 of file NewVrtSecInclusiveTool.h.

185{this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator", "Name of the extrapolator tool"};

◆ m_fastZSVCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_fastZSVCut {this, "FastZSVCut", 10., "Cut to remove SV candidates based on fast SV estimation. To save full fit CPU." }
private

Definition at line 168 of file NewVrtSecInclusiveTool.h.

168{this, "FastZSVCut", 10., "Cut to remove SV candidates based on fast SV estimation. To save full fit CPU." };

◆ m_fillHist

Gaudi::Property<bool> Rec::NewVrtSecInclusiveTool::m_fillHist {this, "FillHist", false, "Fill debugging and development histograms+ntuple" }
private

Definition at line 146 of file NewVrtSecInclusiveTool.h.

146{this, "FillHist", false, "Fill debugging and development histograms+ntuple" };

◆ m_fin_v2trselector

ToolHandle<Rec::ITwoTrackVertexSelector> Rec::NewVrtSecInclusiveTool::m_fin_v2trselector
private
Initial value:
{this, "TwoTrkVtxSelectorFinal", "Rec::TwoTrackVrtBDTSelector/V2TrBDTSelectorFin",
"Name of the final 2-track vertex selector"}

Definition at line 191 of file NewVrtSecInclusiveTool.h.

191 {this, "TwoTrkVtxSelectorFinal", "Rec::TwoTrackVrtBDTSelector/V2TrBDTSelectorFin",
192 "Name of the final 2-track vertex selector"};

◆ m_fitSvc

ToolHandle<Trk::TrkVKalVrtFitter> Rec::NewVrtSecInclusiveTool::m_fitSvc {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool", "Name of the Vertex Fitter tool"}
private

Definition at line 186 of file NewVrtSecInclusiveTool.h.

186{this, "VertexFitterTool", "Trk::TrkVKalVrtFitter/VertexFitterTool", "Name of the Vertex Fitter tool"};

◆ m_globVrtProbCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_globVrtProbCut {this, "GlobVrtProbCut", 0.005, "Cut on probability of any vertex for final selection" }
private

Definition at line 176 of file NewVrtSecInclusiveTool.h.

176{this, "GlobVrtProbCut", 0.005, "Cut on probability of any vertex for final selection" };

◆ m_h

std::unique_ptr<Hists> Rec::NewVrtSecInclusiveTool::m_h
private

Definition at line 145 of file NewVrtSecInclusiveTool.h.

◆ m_ini_v2trselector

ToolHandle<Rec::ITwoTrackVertexSelector> Rec::NewVrtSecInclusiveTool::m_ini_v2trselector
private
Initial value:
{this, "TwoTrkVtxSelectorIni", "Rec::TwoTrackVrtBDTSelector/V2TrBDTSelectorIni",
"Name of the initial 2-track vertex selector"}

Definition at line 189 of file NewVrtSecInclusiveTool.h.

189 {this, "TwoTrkVtxSelectorIni", "Rec::TwoTrackVrtBDTSelector/V2TrBDTSelectorIni",
190 "Name of the initial 2-track vertex selector"};

◆ m_instanceName

std::string Rec::NewVrtSecInclusiveTool::m_instanceName
private

Definition at line 201 of file NewVrtSecInclusiveTool.h.

◆ m_is_selected

SG::AuxElement::Decorator<char> Rec::NewVrtSecInclusiveTool::m_is_selected
private

Definition at line 203 of file NewVrtSecInclusiveTool.h.

◆ m_is_svtrk_final

SG::AuxElement::Decorator<char> Rec::NewVrtSecInclusiveTool::m_is_svtrk_final
private

Definition at line 204 of file NewVrtSecInclusiveTool.h.

◆ m_massE

double Rec::NewVrtSecInclusiveTool::m_massE {}
private

Definition at line 198 of file NewVrtSecInclusiveTool.h.

198{};

◆ m_massK0

double Rec::NewVrtSecInclusiveTool::m_massK0 {}
private

Definition at line 199 of file NewVrtSecInclusiveTool.h.

199{};

◆ m_massLam

double Rec::NewVrtSecInclusiveTool::m_massLam {}
private

Definition at line 200 of file NewVrtSecInclusiveTool.h.

200{};

◆ m_massP

double Rec::NewVrtSecInclusiveTool::m_massP {}
private

Definition at line 197 of file NewVrtSecInclusiveTool.h.

197{};

◆ m_massPi

double Rec::NewVrtSecInclusiveTool::m_massPi {}
private

Definition at line 196 of file NewVrtSecInclusiveTool.h.

196{};

◆ m_maxSVRadiusCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_maxSVRadiusCut {this, "MaxSVRadiusCut", 140., "Cut on maximal radius of SV (def = Pixel detector size)" }
private

Definition at line 177 of file NewVrtSecInclusiveTool.h.

177{this, "MaxSVRadiusCut", 140., "Cut on maximal radius of SV (def = Pixel detector size)" };

◆ m_maxZVrt

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_maxZVrt {this, "MaxZVrt", 15., "Track Z impact selection max"}
private

Definition at line 158 of file NewVrtSecInclusiveTool.h.

158{this, "MaxZVrt", 15., "Track Z impact selection max"};

◆ m_minZVrt

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_minZVrt {this, "MinZVrt", 0., "Track Z impact selection min"}
private

Definition at line 159 of file NewVrtSecInclusiveTool.h.

159{this, "MinZVrt", 0., "Track Z impact selection min"};

◆ m_multiWithOneTrkVrt

Gaudi::Property<bool> Rec::NewVrtSecInclusiveTool::m_multiWithOneTrkVrt {this, "MultiWithOneTrkVrt", true, "Allow one-track-vertex addition to already found secondary vertices"}
private

Definition at line 180 of file NewVrtSecInclusiveTool.h.

180{this, "MultiWithOneTrkVrt", true, "Allow one-track-vertex addition to already found secondary vertices"};

◆ m_phi_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_phi_wrtSV
private

Definition at line 207 of file NewVrtSecInclusiveTool.h.

◆ m_pt_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_pt_wrtSV
private

Definition at line 205 of file NewVrtSecInclusiveTool.h.

◆ m_removeTrkMatSignif

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_removeTrkMatSignif {this, "removeTrkMatSignif", 0., "Significance of Vertex-TrackingMaterial distance for removal. No removal if <=0." }
private

Definition at line 171 of file NewVrtSecInclusiveTool.h.

171{this, "removeTrkMatSignif", 0., "Significance of Vertex-TrackingMaterial distance for removal. No removal if <=0." };

◆ m_selVrtSigCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_selVrtSigCut {this, "SelVrtSigCut", 3.0, "Cut on significance of 3D distance between vertex and PV" }
private

Definition at line 178 of file NewVrtSecInclusiveTool.h.

178{this, "SelVrtSigCut", 3.0, "Cut on significance of 3D distance between vertex and PV" };

◆ m_trackToVertexTool

ToolHandle<Reco::ITrackToVertex> Rec::NewVrtSecInclusiveTool::m_trackToVertexTool {this, "TrackToVertexTool", "Reco::TrackToVertex/TrackToVertex", "Name of the TrackToVertex tool"}
private

Definition at line 187 of file NewVrtSecInclusiveTool.h.

187{this, "TrackToVertexTool", "Reco::TrackToVertex/TrackToVertex", "Name of the TrackToVertex tool"};

◆ m_trkSigCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_trkSigCut {this, "TrkSigCut", 2.0, "Track 3D impact significance w/r primary vertex. Should be >=AntiPileupSigRCut" }
private

Definition at line 164 of file NewVrtSecInclusiveTool.h.

164{this, "TrkSigCut", 2.0, "Track 3D impact significance w/r primary vertex. Should be >=AntiPileupSigRCut" };

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexMergeCut

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_vertexMergeCut {this, "VertexMergeCut", 4., "To allow vertex merging for MultiVertex Finder" }
private

Definition at line 179 of file NewVrtSecInclusiveTool.h.

179{this, "VertexMergeCut", 4., "To allow vertex merging for MultiVertex Finder" };

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vrtMassLimit

Gaudi::Property<float> Rec::NewVrtSecInclusiveTool::m_vrtMassLimit {this, "VrtMassLimit", 5500., "Maximal allowed mass for found vertices" }
private

Definition at line 175 of file NewVrtSecInclusiveTool.h.

175{this, "VrtMassLimit", 5500., "Maximal allowed mass for found vertices" };

◆ m_w_1

double Rec::NewVrtSecInclusiveTool::m_w_1 {}
private

Definition at line 107 of file NewVrtSecInclusiveTool.h.

107{};

◆ m_z0_wrtSV

SG::AuxElement::Decorator<float> Rec::NewVrtSecInclusiveTool::m_z0_wrtSV
private

Definition at line 209 of file NewVrtSecInclusiveTool.h.


The documentation for this class was generated from the following files: