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  DevTuple
struct  Hists
struct  Vrt2Tr
struct  WrkVrt

Public Member Functions

 NewVrtSecInclusiveTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~NewVrtSecInclusiveTool ()
StatusCode initialize ()
StatusCode finalize ()
std::unique_ptr< Trk::VxSecVertexInfofindAllVertices (const std::vector< const xAOD::TrackParticle * > &inputTracks, const xAOD::Vertex &primaryVertex) const 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

Static Public Member Functions

static const InterfaceID & interfaceID ()

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 (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 (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 311 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
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)

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

◆ 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 ( )

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 std::vector< const xAOD::TrackParticle * > & inputTracks,
const xAOD::Vertex & primaryVertex ) const
finalvirtual

Implements Rec::IVrtInclusive.

Definition at line 253 of file NewVrtSecInclusiveTool.cxx.

256 {
257 std::vector<xAOD::Vertex*> listVrtSec(0);
258
259 if(m_fillHist) {
260 Hists& h = getHists();
261 h.m_curTup->nTrk=0;
262 h.m_curTup->n2Vrt=0;
263 h.m_curTup->nNVrt=0;
264 };
265
266 workVectorArrxAOD * tmpVectxAOD=new workVectorArrxAOD();
267 tmpVectxAOD->inpTrk.resize(inpTrk.size());
268 std::copy(inpTrk.begin(),inpTrk.end(), tmpVectxAOD->inpTrk.begin());
269 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
270 tmpVectxAOD->beamX=beamSpotHandle->beamPos().x();
271 tmpVectxAOD->beamY=beamSpotHandle->beamPos().y();
272 tmpVectxAOD->beamZ=beamSpotHandle->beamPos().z();
273 tmpVectxAOD->tanBeamTiltX=tan(beamSpotHandle->beamTilt(0));
274 tmpVectxAOD->tanBeamTiltY=tan(beamSpotHandle->beamTilt(1));
275
276 compatibilityGraph_t compatibilityGraph;
277 listVrtSec = getVrtSecMulti(tmpVectxAOD,primVrt,compatibilityGraph);
278
279 for (const auto trk : tmpVectxAOD->listSelTracks) {
280 // Mark the track as selected
281 m_is_selected(*trk) = true;
283 }
284 delete tmpVectxAOD;
285
286 for (const auto &vrt : listVrtSec) {
287 for (const auto &trk : vrt->trackParticleLinks()) {
288
289 // Mark the track as a final track
290 m_is_svtrk_final(**trk) = true;
291
292 // Get the perigee of the track at the vertex
293 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << (*trk)->index() << ": Get the perigee of the track at the vertex." );
294 auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(Gaudi::Hive::currentContext(), **trk, vrt->position() );
295 if( !sv_perigee ) {
296 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": > Track index " << (*trk)->index() << ": Failed in obtaining the SV perigee!" );
297 }
298
299 float qOverP_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::qOverP] : -FLT_MAX;
300 float theta_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::theta] : -FLT_MAX;
301 float p_wrtSV = sv_perigee ? 1.0 / std::abs( qOverP_wrtSV ) : -FLT_MAX;
302 float pt_wrtSV = sv_perigee ? p_wrtSV * sin( theta_wrtSV ) : -FLT_MAX;
303 float eta_wrtSV = sv_perigee ? -log( tan( theta_wrtSV/2. ) ) : -FLT_MAX;
304 float phi_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::phi] : -FLT_MAX;
305 float d0_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::d0] : -FLT_MAX;
306 float z0_wrtSV = sv_perigee ? sv_perigee->parameters() [Trk::z0] : -FLT_MAX;
307 float errd0_wrtSV = sv_perigee ? std::sqrt((*sv_perigee->covariance())( Trk::d0, Trk::d0 )) : -FLT_MAX;
308 float errz0_wrtSV = sv_perigee ? std::sqrt((*sv_perigee->covariance())( Trk::z0, Trk::z0 )) : -FLT_MAX;
309 float errP_wrtSV = sv_perigee ? std::sqrt((*sv_perigee->covariance())( Trk::qOverP, Trk::qOverP )) : -FLT_MAX;
310
311 m_pt_wrtSV(**trk) = pt_wrtSV;
312 m_eta_wrtSV(**trk) = eta_wrtSV;
313 m_phi_wrtSV(**trk) = phi_wrtSV;
314 m_d0_wrtSV(**trk) = d0_wrtSV;
315 m_z0_wrtSV(**trk) = z0_wrtSV;
316 m_errP_wrtSV(**trk) = errP_wrtSV;
317 m_errd0_wrtSV(**trk) = errd0_wrtSV;
318 m_errz0_wrtSV(**trk) = errz0_wrtSV;
319 }
320 }
321
322 std::unique_ptr<Trk::VxSecVertexInfo> res = std::make_unique<Trk::VxSecVertexInfo>(Trk::VxSecVertexInfo(listVrtSec));
323
324 if(m_fillHist){
325 Hists& h = getHists();
326 h.m_tuple->Fill();
327 };
328
329 lockDecorations (inpTrk);
330
331 return res;
332 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::pair< std::vector< unsigned int >, bool > res
std::vector< xAOD::Vertex * > getVrtSecMulti(workVectorArrxAOD *inpParticlesxAOD, const xAOD::Vertex &primVrt, compatibilityGraph_t &compatibilityGraph) const
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
@ 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 {
297 static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer> >
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 367 of file NewVrtSecInclusiveTool.cxx.

368 {
369 // We earlier checked that no more than one thread is being used.
370 Hists* h ATLAS_THREAD_SAFE = m_h.get();
371 return *h;
372 }
#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 {
243 static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer> >
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 {
307 static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer> >
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 ( workVectorArrxAOD * inpParticlesxAOD,
const xAOD::Vertex & primVrt,
compatibilityGraph_t & compatibilityGraph ) const
private

Definition at line 29 of file VrtSecMulti.cxx.

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

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.

◆ interfaceID()

const InterfaceID & Rec::IVrtInclusive::interfaceID ( )
inlinestaticinherited

Definition at line 43 of file IVrtInclusive.h.

43{ return IID_IVrtInclusive;}
static const InterfaceID IID_IVrtInclusive("IVrtInclusive", 1, 0)

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

◆ 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:81

◆ lockDecorations()

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

Definition at line 335 of file NewVrtSecInclusiveTool.cxx.

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

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

160{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 193 of file NewVrtSecInclusiveTool.h.

193{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 171 of file NewVrtSecInclusiveTool.h.

171{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 182 of file NewVrtSecInclusiveTool.h.

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

◆ m_chi2_toSV

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

Definition at line 212 of file NewVrtSecInclusiveTool.h.

◆ m_chiScale

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

Definition at line 312 of file NewVrtSecInclusiveTool.h.

312{};

◆ 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 152 of file NewVrtSecInclusiveTool.h.

152{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 159 of file NewVrtSecInclusiveTool.h.

159{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 156 of file NewVrtSecInclusiveTool.h.

156{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 155 of file NewVrtSecInclusiveTool.h.

155{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 149 of file NewVrtSecInclusiveTool.h.

149{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 154 of file NewVrtSecInclusiveTool.h.

154{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 148 of file NewVrtSecInclusiveTool.h.

148{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 153 of file NewVrtSecInclusiveTool.h.

153{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 151 of file NewVrtSecInclusiveTool.h.

151{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 150 of file NewVrtSecInclusiveTool.h.

150{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 207 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 164 of file NewVrtSecInclusiveTool.h.

164{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 210 of file NewVrtSecInclusiveTool.h.

◆ m_errP_wrtSV

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

Definition at line 209 of file NewVrtSecInclusiveTool.h.

◆ m_errz0_wrtSV

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

Definition at line 211 of file NewVrtSecInclusiveTool.h.

◆ m_eta_wrtSV

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

Definition at line 205 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 184 of file NewVrtSecInclusiveTool.h.

184{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 167 of file NewVrtSecInclusiveTool.h.

167{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 145 of file NewVrtSecInclusiveTool.h.

145{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 190 of file NewVrtSecInclusiveTool.h.

190 {this, "TwoTrkVtxSelectorFinal", "Rec::TwoTrackVrtBDTSelector/V2TrBDTSelectorFin",
191 "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 185 of file NewVrtSecInclusiveTool.h.

185{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 175 of file NewVrtSecInclusiveTool.h.

175{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 144 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 188 of file NewVrtSecInclusiveTool.h.

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

◆ m_instanceName

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

Definition at line 200 of file NewVrtSecInclusiveTool.h.

◆ m_is_selected

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

Definition at line 202 of file NewVrtSecInclusiveTool.h.

◆ m_is_svtrk_final

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

Definition at line 203 of file NewVrtSecInclusiveTool.h.

◆ m_massE

double Rec::NewVrtSecInclusiveTool::m_massE {}
private

Definition at line 197 of file NewVrtSecInclusiveTool.h.

197{};

◆ m_massK0

double Rec::NewVrtSecInclusiveTool::m_massK0 {}
private

Definition at line 198 of file NewVrtSecInclusiveTool.h.

198{};

◆ m_massLam

double Rec::NewVrtSecInclusiveTool::m_massLam {}
private

Definition at line 199 of file NewVrtSecInclusiveTool.h.

199{};

◆ m_massP

double Rec::NewVrtSecInclusiveTool::m_massP {}
private

Definition at line 196 of file NewVrtSecInclusiveTool.h.

196{};

◆ m_massPi

double Rec::NewVrtSecInclusiveTool::m_massPi {}
private

Definition at line 195 of file NewVrtSecInclusiveTool.h.

195{};

◆ 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 176 of file NewVrtSecInclusiveTool.h.

176{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 157 of file NewVrtSecInclusiveTool.h.

157{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 158 of file NewVrtSecInclusiveTool.h.

158{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 179 of file NewVrtSecInclusiveTool.h.

179{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 206 of file NewVrtSecInclusiveTool.h.

◆ m_pt_wrtSV

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

Definition at line 204 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 170 of file NewVrtSecInclusiveTool.h.

170{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 177 of file NewVrtSecInclusiveTool.h.

177{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 186 of file NewVrtSecInclusiveTool.h.

186{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 163 of file NewVrtSecInclusiveTool.h.

163{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 178 of file NewVrtSecInclusiveTool.h.

178{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 174 of file NewVrtSecInclusiveTool.h.

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

◆ m_w_1

double Rec::NewVrtSecInclusiveTool::m_w_1 {}
private

Definition at line 106 of file NewVrtSecInclusiveTool.h.

106{};

◆ m_z0_wrtSV

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

Definition at line 208 of file NewVrtSecInclusiveTool.h.


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