7#ifndef VRTSECINCLUSIVE_VRTSECINCLUSIVE_H
8#define VRTSECINCLUSIVE_VRTSECINCLUSIVE_H
11#include "VrtSecInclusive/Constants.h"
17#include "GaudiKernel/ToolHandle.h"
18#include "GaudiKernel/ITHistSvc.h"
32#include "GaudiKernel/ServiceHandle.h"
97 virtual StatusCode
execute()
override;
118 Gaudi::Property<std::string>
m_augVerString{
this,
"AugmentingVersionString",
"_VSI"};
125 Gaudi::Property<bool>
m_doTruth{
this,
"DoTruth",
false};
166 Gaudi::Property<bool>
m_doTRTPixCut{
this,
"doTRTPixCut",
false,
"mode for R-hadron displaced vertex"};
270 ToolHandle <Trk::ITrkVKalVrtFitter>
m_fitSvc{
this,
"VertexFitterTool",
"Trk::TrkVKalVrtFitter",
" Private TrkVKalVrtFitter"};
271 PublicToolHandle <Trk::ITruthToTrack>
m_truthToTrack{
this,
"TruthToTrack",
"Trk::TruthToTrack/InDetTruthToTrack"};
274 PublicToolHandle< Reco::ITrackToVertex >
m_trackToVertexTool{
this,
"TrackToVertexTool",
"Reco::TrackToVertex"};
275 PublicToolHandle<Trk::ITrackToVertexIPEstimator>
m_trackToVertexIPEstimatorTool{
this,
"TrackToVertexIPEstimatorTool",
"Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator"};
276 PublicToolHandle<Trk::IExtrapolator>
m_extrapolator{
this,
"Extrapolator",
"Trk::Extrapolator/AtlasExtrapolator"};
280 ToolHandle<IInDetConditionsTool>
m_pixelCondSummaryTool{
this,
"PixelConditionsSummaryTool",
"PixelConditionsSummaryTool",
"Tool to retrieve Pixel Conditions summary"};
281 ToolHandle<IInDetConditionsTool>
m_sctCondSummaryTool{
this,
"InDetSCT_ConditionsSummaryTool",
"SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool",
"Tool to retrieve SCT conditions summary"};
287 Gaudi::Property<std::string>
m_checkPatternStrategy{
this,
"CheckHitPatternStrategy",
"Classical",
"Either Classical or Extrapolation"};
370 using PatternBank = std::map<const xAOD::TrackParticle*, std::pair< std::unique_ptr<ExtrapolatedPattern>, std::unique_ptr<ExtrapolatedPattern> > >;
415 StatusCode
rearrangeTracks(
const EventContext& ctx, std::vector<WrkVrt>* );
422 StatusCode
mergeByShuffling(
const EventContext& ctx, std::vector<WrkVrt>* );
449 void printWrkSet(
const std::vector<WrkVrt> *WrkVrtSet,
const std::string& name);
464 std::vector< std::deque<long int> > *,
465 const long int & ,
const long int & );
467 StatusCode
disassembleVertex(std::vector<WrkVrt> *,
const unsigned& vertexIndex );
469 void trackClassification(std::vector< WrkVrt >* , std::map<
long int, std::vector<long int> >& );
474 static size_t nTrkCommon( std::vector<WrkVrt> *WrkVrtSet,
const std::pair<unsigned, unsigned>& pairIndex ) ;
553 std::vector<WrkVrt>*,
const std::string& name,
bool final =
false );
575 template<
class LeptonFlavor>
Helper class to provide type-safe access to aux data.
Extrapolation for HepMC particles.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
SG::Decorator< T, ALLOC > Decorator
Manage lookup of vectors of auxiliary data.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
ITruthToTrack is an interface to create Trk::TrackParameters from a HepMC::GenParticle.
Interface class IVertexMapper.
Gaudi::Property< bool > m_doSelectIDAndGSFTracks
bool patternCheck(const uint32_t &pattern, const Amg::Vector3D &vertex)
Gaudi::Property< bool > m_doRemoveNonLeptonVertices
Gaudi::Property< bool > m_SAloneTRT
SG::AuxElement::Decorator< std::vector< std::vector< float > > > IPDecoratorType
Gaudi::Property< double > m_pvCompatibilityCut
VrtSecInclusive(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Gaudi::Property< double > m_associateChi2Cut
Gaudi::Property< double > m_d0TrkPVDstMinCut
bool selectTrack_pTCut(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_doWildMerging
Gaudi::Property< double > m_TrkPtCut
Gaudi::Property< double > m_d0TrkErrorCut
Gaudi::Property< double > m_TruthTrkLen
Gaudi::Property< bool > m_doTRTPixCut
std::map< std::string, PatternStrategyFunc > m_patternStrategyFuncs
static const xAOD::TruthParticle * getTrkGenParticle(const xAOD::TrackParticle *)
Gaudi::Property< bool > m_do_d0Cut
const xAOD::Vertex * m_thePV
Gaudi::Property< double > m_SelVrtChi2Cut
StatusCode refitVertexWithSuggestion(WrkVrt &, const Amg::Vector3D &)
refit the vertex with suggestion
Gaudi::Property< bool > m_do_z0errCut
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonLocation
bool passedFakeReject(const Amg::Vector3D &FitVertex, const xAOD::TrackParticle *itrk, const xAOD::TrackParticle *jtrk)
Flag false if the consistituent tracks are not consistent with the vertex position.
Gaudi::Property< int > m_trkExtrapolator
StatusCode setupNtupleVariables()
bool checkTrackHitPatternToVertex(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
static bool patternCheckRun1(const uint32_t &pattern, const Amg::Vector3D &vertex)
Gaudi::Property< int > m_CutSiHits
bool checkTrackHitPatternToVertexByExtrapolationAssist(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
Gaudi::Property< bool > m_doRemoveCaloTaggedMuons
Gaudi::Property< bool > m_do_d0errCut
void printWrkSet(const std::vector< WrkVrt > *WrkVrtSet, const std::string &name)
print the contents of reconstructed vertices
Gaudi::Property< bool > m_doMergeFinalVerticesDistance
Gaudi::Property< double > m_twoTrVrtMaxPerigeeDist
static bool patternCheckRun2(const uint32_t &pattern, const Amg::Vector3D &vertex)
bool checkTrackHitPatternToVertexByExtrapolation(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
Gaudi::Property< bool > m_doTightPVcompatibilityCut
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Condition service.
SG::WriteHandleKey< xAOD::VertexContainer > m_vertexKey
Gaudi::Property< bool > m_doReassembleVertices
Gaudi::Property< int > m_CutBLayHits
Gaudi::Property< double > m_reassembleMaxImpactParameterZ0
bool selectTrack_chi2Cut(const xAOD::TrackParticle *) const
bool selectTrack_notPVassociated(const xAOD::TrackParticle *) const
track-by-track selection strategies
void lockTrackDecorations(const xAOD::TrackParticle *trk, bool onlySelection) const
lock decorations at the end of the algorithm
Gaudi::Property< double > m_mergeByShufflingAllowance
void trackClassification(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &)
Gaudi::Property< bool > m_doPVcompatibilityCut
StatusCode selectTracksFromElectrons(const EventContext &ctx)
StatusCode selectTracksFromMuons(const EventContext &ctx)
std::map< unsigned, SG::Decorator< float > > m_trkDecors
Gaudi::Property< bool > m_do_PVvetoCut
ExtrapolatedPattern * extrapolatedPattern(const xAOD::TrackParticle *, enum Trk::PropDirection)
void selectTrack(const xAOD::TrackParticle *)
Vertexing Algorithm Member Functions.
void lockLeptonDecorations(const SG::AuxVectorData *cont) const
PublicToolHandle< Trk::IVertexMapper > m_vertexMapper
bool selectTrack_hitPatternTight(const xAOD::TrackParticle *) const
StatusCode deleteNtupleVariables()
double findWorstChi2ofMaximallySharedTrack(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &, long int &, long int &)
Gaudi::Property< bool > m_passThroughTrackSelection
Gaudi::Property< double > m_associateMaxD0Signif
static bool selectTrack_d0signifCut(const xAOD::TrackParticle *)
Gaudi::Property< double > m_z0TrkPVDstMaxCut
Gaudi::Property< unsigned int > m_SelTrkMaxCutoff
bool selectTrack_d0errCut(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_doMergeByShuffling
std::unique_ptr< NtupleVars > m_ntupleVars
Gaudi::Property< bool > m_doFastMode
Gaudi::Property< bool > m_doIntersectionPos
static bool patternCheckRun1OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
Gaudi::Property< bool > m_truncateWrkVertices
Gaudi::Property< std::string > m_truthParticleFilter
Gaudi::Property< double > m_associateMinDistanceToPV
bool getSVImpactParameters(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex, std::vector< double > &impactParameters, std::vector< double > &impactParErrors)
get secondary vertex impact parameters
Gaudi::Property< int > m_CutTightTRTHits
StatusCode categorizeVertexTruthTopology(xAOD::Vertex *vertex)
Gaudi::Property< std::string > m_mcEventContainerName
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronLocation
std::unordered_map< std::string, bool > m_vertexCollectionsDefinitions
void removeInconsistentTracks(WrkVrt &)
Remove inconsistent tracks from vertices.
Gaudi::Property< bool > m_doSuggestedRefitOnMerging
StatusCode clearNtupleVariables()
Gaudi::Property< double > m_twoTrVrtMinDistFromPV
ToolHandle< IInDetConditionsTool > m_sctCondSummaryTool
bool selectTrack_hitPattern(const xAOD::TrackParticle *) const
StatusCode associateNonSelectedTracks(const EventContext &ctx, std::vector< WrkVrt > *)
in addition to selected tracks, associate as much tracks as possible
Gaudi::Property< int > m_geoModel
PublicToolHandle< Trk::ITruthToTrack > m_truthToTrack
Gaudi::Property< bool > m_doSelectTracksWithLRTCuts
Gaudi::Property< bool > m_do_z0Cut
Gaudi::Property< double > m_twoTrVrtMinRadius
unsigned m_vertexingAlgorithmStep
Gaudi::Property< double > m_VertexMergeFinalDistCut
Gaudi::Property< bool > m_doSelectTracksFromElectrons
Gaudi::Property< double > m_associatePtCut
Gaudi::Property< std::string > m_all2trksVerticesContainerName
StatusCode fillAANT_SelectedBaseTracks()
Gaudi::Property< bool > m_FillHist
bool checkTrackHitPatternToVertexOuterOnly(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
Gaudi::Property< double > m_associateMaxZ0Signif
std::vector< CutFunc > m_trackSelectionFuncs
Gaudi::Property< double > m_TrackDetachCut
std::optional< SG::Decorator< char > > m_decor_isSelected
void getIntersection(Track *trk, std::vector< IntersectionPos * > &layers, const Trk::Perigee *per)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackLocation
StatusCode augmentDVimpactParametersToLeptons(const std::string &containerName)
const PixelID * m_pixelId
StatusCode(VrtSecInclusive::*)(const EventContext &) TrackSelectionAlg
Gaudi::Property< bool > m_ImpactWrtBL
Gaudi::Property< double > m_z0TrkErrorCut
std::map< std::string, TH1 * > m_hists
static void fillTrackSummary(track_summary &summary, const xAOD::TrackParticle *trk)
retrieve the track hit information
double improveVertexChi2(WrkVrt &)
attempt to improve the vertex chi2 by removing the most-outlier track one by one until the vertex chi...
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Read/Write Handle Keys.
Gaudi::Property< std::string > m_secondaryVerticesContainerName
double distanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the physical distance
StatusCode(VrtSecInclusive::*)(const EventContext &, std::vector< WrkVrt > *) vertexingAlg
StatusCode reassembleVertices(const EventContext &ctx, std::vector< WrkVrt > *)
attempt to merge vertices when all tracks of a vertex A is close to vertex B in terms of impact param...
StatusCode mergeFinalVertices(const EventContext &ctx, std::vector< WrkVrt > *)
attempt to merge vertices by lookng at the distance between two vertices
Gaudi::Property< int > m_CutSharedHits
static size_t nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, const std::pair< unsigned, unsigned > &pairIndex)
returns the number of tracks commonly present in both vertices
static double findMinVerticesNextPair(std::vector< WrkVrt > *, std::pair< unsigned, unsigned > &)
returns the next pair of vertices that give next-to-minimum distance significance
std::tuple< const TVector3, Detector, Bec, Layer, Flag > ExtrapolatedPoint
Gaudi::Property< bool > m_FillNtuple
bool(VrtSecInclusive::*)(const xAOD::TrackParticle *) const CutFunc
track selection
bool selectTrack_LRTR3Cut(const xAOD::TrackParticle *) const
std::optional< SG::Decorator< char > > m_decor_is_svtrk_final
double findMinVerticesPair(std::vector< WrkVrt > *, std::pair< unsigned, unsigned > &, const AlgForVerticesPair &)
returns the pair of vertices that give minimum in terms of some observable (e.g.
std::optional< VertexELType > m_decor_svLink
Gaudi::Property< bool > m_doFinalImproveChi2
std::map< const xAOD::TrackParticle *, std::pair< std::unique_ptr< ExtrapolatedPattern >, std::unique_ptr< ExtrapolatedPattern > > > PatternBank
Gaudi::Property< double > m_TrkChi2Cut
const AtlasDetectorID * m_atlasId
Gaudi::Property< bool > m_doMagnetMerging
Gaudi::Property< double > m_VertexMergeFinalDistScaling
StatusCode refitVertex(WrkVrt &)
refit the vertex.
virtual StatusCode execute() override
Gaudi::Property< std::string > m_checkPatternStrategy
static void removeTrackFromVertex(std::vector< WrkVrt > *, std::vector< std::deque< long int > > *, const long int &, const long int &)
virtual StatusCode initialize() override
Gaudi::Property< double > m_twoTrkVtxFormingD0Cut
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
bool selectTrack_d0Cut(const xAOD::TrackParticle *) const
StatusCode processPrimaryVertices()
Gaudi::Property< double > m_improveChi2ProbThreshold
Gaudi::Property< int > m_CutTRTHits
StatusCode defineDummyCollections(const EventContext &ctx)
bool selectTrack_z0Cut(const xAOD::TrackParticle *) const
std::vector< double > m_BeamPosition
SG::AuxElement::Decorator< std::vector< ElementLink< xAOD::VertexContainer > > > VertexELType
std::vector< IPDecoratorType > m_ipDecors
StatusCode refitAndSelectGoodQualityVertices(const EventContext &ctx, std::vector< WrkVrt > *)
finalization of the vertex and store to xAOD::VertexContainer
Gaudi::Property< bool > m_doTwoTrSoftBtag
std::vector< ExtrapolatedPoint > ExtrapolatedPattern
const xAOD::VertexContainer * m_primaryVertices
StatusCode mergeVertices(WrkVrt &destination, WrkVrt &source)
the 2nd vertex is merged into the 1st vertex.
Gaudi::Property< double > m_mergeByShufflingMaxSignificance
Gaudi::Property< int > m_CutSctHits
Gaudi::Property< double > m_d0TrkPVDstMaxCut
std::vector< const xAOD::TrackParticle * > m_associatedTracks
bool selectTrack_z0errCut(const xAOD::TrackParticle *) const
PublicToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
get a handle on the Track to Vertex tool
ToolHandle< Trk::ITrkVKalVrtFitter > m_fitSvc
Gaudi::Property< double > m_z0TrkPVSignifCut
SG::ReadHandleKey< xAOD::VertexContainer > m_PrimVrtLocation
std::vector< const xAOD::TrackParticle * > m_selectedTracks
Gaudi::Property< size_t > m_maxWrkVertices
StatusCode rearrangeTracks(const EventContext &ctx, std::vector< WrkVrt > *)
StatusCode disassembleVertex(std::vector< WrkVrt > *, const unsigned &vertexIndex)
StatusCode fillAANT_SecondaryVertices(xAOD::VertexContainer *)
Gaudi::Property< bool > m_doMapToLocal
Gaudi::Property< int > m_CutPixelHits
StatusCode dummyVertexContainer(const EventContext &ctx, const SG::WriteHandleKey< xAOD::VertexContainer > &handleKey)
double(VrtSecInclusive::*)(const WrkVrt &, const WrkVrt &) const AlgForVerticesPair
Gaudi::Property< double > m_d0TrkPVSignifCut
bool patternCheckOuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
Gaudi::Property< bool > m_removeFakeVrtLate
Gaudi::Property< double > m_reassembleMaxImpactParameterD0
Gaudi::Property< std::string > m_truthParticleContainerName
static bool selectTrack_z0signifCut(const xAOD::TrackParticle *)
Gaudi::Property< bool > m_removeFakeVrt
std::vector< std::pair< std::string, vertexingAlg > > m_vertexingAlgorithms
Gaudi::Property< std::string > m_augVerString
PublicToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
Gaudi::Property< bool > m_doDisappearingTrackVertexing
struct VKalVrtAthena::VrtSecInclusive::track_summary_properties track_summary
SG::WriteDecorHandleKey< xAOD::EventInfo > m_vertexingStatusKey
void setIntersection(Track *trk, IntersectionPos *bec, const Trk::Perigee *per)
StatusCode selectTracksInDet(const EventContext &ctx)
std::vector< const xAOD::TrackParticle * > m_leptonicTracks
StatusCode monitorVertexingAlgorithmStep(const EventContext &ctx, std::vector< WrkVrt > *, const std::string &name, bool final=false)
monitor the intermediate status of vertexing
Gaudi::Property< bool > m_doAssociateNonSelectedTracks
Gaudi::Property< double > m_VertexMergeCut
std::vector< std::pair< int, int > > m_incomp
StatusCode addEventInfo()
static bool patternCheckRun2OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
Gaudi::Property< bool > m_FillIntermediateVertices
PatternBank m_extrapolatedPatternBank
virtual ~VrtSecInclusive() override
Default Destructor.
StatusCode mergeByShuffling(const EventContext &ctx, std::vector< WrkVrt > *)
attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior ...
std::map< std::string, SG::WriteHandleKey< xAOD::VertexContainer > > m_intermediateVertexKey
Gaudi::Property< bool > m_doAugmentDVimpactParametersToElectrons
std::optional< SG::Decorator< char > > m_decor_isAssociated
virtual StatusCode initEvent()
std::vector< const xAOD::TruthVertex * > m_tracingTruthVertices
Gaudi::Property< double > m_z0TrkPVDstMinCut
void dumpTruthInformation()
StatusCode extractIncompatibleTrackPairs(const EventContext &ctx, std::vector< WrkVrt > *)
related to the graph method and verte finding
Gaudi::Property< bool > m_extrapPV
Gaudi::Property< bool > m_doTruth
SG::WriteHandleKey< xAOD::VertexContainer > m_twoTrksVertexKey
Gaudi::Property< bool > m_do_z0signifCut
StatusCode findNtrackVertices(const EventContext &ctx, std::vector< WrkVrt > *)
Gaudi::Property< int > m_CutTightSCTHits
bool(VrtSecInclusive::*)(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex) PatternStrategyFunc
Gaudi::Property< bool > m_doSelectTracksFromMuons
Gaudi::Property< double > m_twoTrVrtAngleCut
StatusCode selectInDetAndGSFTracks(const EventContext &ctx)
Gaudi::Property< bool > m_doAugmentDVimpactParametersToMuons
Gaudi::Property< bool > m_do_d0signifCut
Gaudi::Property< double > m_mcTrkResolution
double significanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the significance (Mahalanobis distance) between two reconstructed vertices
std::vector< TrackSelectionAlg > m_trackSelectionAlgs
std::map< const xAOD::TruthVertex *, bool > m_matchMap
Eigen::Matrix< double, 3, 1 > Vector3D
USAGE: openCoraCool.exe "COOLONL_SCT/COMP200".
Ensure that the ATLAS eigen extensions are properly loaded.
PropDirection
PropDirection, enum for direction of the propagation.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TruthParticle_v1 TruthParticle
Typedef to implementation.
double Chi2
VKalVrt fit covariance.
std::vector< double > vertexCov
VKalVrt fit vertex 4-momentum.
std::vector< double > Chi2PerTrk
VKalVrt fit chi2 result.
std::deque< long int > selectedTrackIndices
flagged true for good vertex candidates
std::deque< long int > associatedTrackIndices
list if indices in TrackParticleContainer for selectedBaseTracks
long int Charge
list of VKalVrt fit chi2 for each track
double Chi2_core
VKalVrt fit chi2 result.
double fitQuality() const
Amg::Vector3D vertex
list if indices in TrackParticleContainer for associatedTracks
TLorentzVector vertexMom
VKalVrt fit vertex position.
unsigned nTracksTotal() const
double closestWrkVrtValue
stores the index of the closest WrkVrt in std::vector<WrkVrt>
double ndof() const
stores the value of some observable to the closest WrkVrt ( observable = e.g. significance )
std::vector< std::vector< double > > TrkAtVrt
total charge of the vertex
unsigned long closestWrkVrtIndex
list of track parameters wrt the reconstructed vertex
uint8_t numSctBarrelLayer1_Hits
uint8_t numPixelDisk0_Hits
uint8_t numPixelDisk2_Hits
uint8_t numSctBarrelLayer0_Hits
uint8_t numPixelLayer1_Hits
uint8_t numSctBarrelLayer2_Hits
uint8_t numSctBarrelLayer3_Hits
uint8_t numPixelLayer2_Hits
uint8_t numPixelDisk1_Hits