ATLAS Offline Software
Loading...
Searching...
No Matches
VKalVrtAthena::VrtSecInclusive Class Reference

#include <VrtSecInclusive.h>

Inheritance diagram for VKalVrtAthena::VrtSecInclusive:

Classes

struct  WrkVrt
struct  track_summary_properties

Public Member Functions

 VrtSecInclusive (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.
virtual ~VrtSecInclusive () override
 Default Destructor.
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode initEvent ()
template<class TrackT>
void getIntersection (TrackT *trk, vector< IntersectionPos * > &layers, const Trk::Perigee *per)
template<class TrackT>
void setIntersection (TrackT *trk, IntersectionPos *layer, const Trk::Perigee *per)
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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 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

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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

enum  TrkParameter {
  k_d0 =0 , k_z0 =1 , k_theta =2 , k_phi =3 ,
  k_qOverP =4 , k_nTP =5
}
enum  TrkParameterUnc { k_d0d0 =0 , k_z0z0 =1 , k_nTPU =2 }
enum  mergeStep {
  RECONSTRUCT_NTRK , REASSEMBLE , SHUFFLE1 , SHUFFLE2 ,
  SHUFFLE3 , FINAL
}
using PatternStrategyFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex )
using IPDecoratorType = SG::AuxElement::Decorator< std::vector< std::vector<float> > >
using VertexELType = SG::AuxElement::Decorator< std::vector<ElementLink< xAOD::VertexContainer > > >
using Detector = int
using Bec = int
using Layer = int
using Flag = int
using ExtrapolatedPoint = std::tuple<const TVector3, Detector, Bec, Layer, Flag>
using ExtrapolatedPattern = std::vector< ExtrapolatedPoint >
using PatternBank = std::map<const xAOD::TrackParticle*, std::pair< std::unique_ptr<ExtrapolatedPattern>, std::unique_ptr<ExtrapolatedPattern> > >
using TrackSelectionAlg = StatusCode (VrtSecInclusive::*)(const EventContext&)
using CutFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle* ) const
 track selection
using vertexingAlg = StatusCode (VrtSecInclusive::*)( const EventContext&, std::vector<WrkVrt>* )
using AlgForVerticesPair = double (VrtSecInclusive::*)( const WrkVrt&, const WrkVrt& ) const
typedef struct VKalVrtAthena::VrtSecInclusive::track_summary_properties track_summary
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode defineDummyCollections (const EventContext &ctx)
StatusCode dummyVertexContainer (const EventContext &ctx, const SG::WriteHandleKey< xAOD::VertexContainer > &handleKey)
void declareProperties ()
StatusCode addEventInfo ()
StatusCode setupNtupleVariables ()
StatusCode setupNtuple ()
StatusCode clearNtupleVariables ()
StatusCode deleteNtupleVariables ()
StatusCode processPrimaryVertices ()
StatusCode fillAANT_SelectedBaseTracks ()
StatusCode fillAANT_SecondaryVertices (xAOD::VertexContainer *)
void selectTrack (const xAOD::TrackParticle *)
 Vertexing Algorithm Member Functions.
StatusCode selectTracksInDet (const EventContext &ctx)
StatusCode selectTracksFromMuons (const EventContext &ctx)
StatusCode selectTracksFromElectrons (const EventContext &ctx)
StatusCode selectInDetAndGSFTracks (const EventContext &ctx)
bool selectTrack_notPVassociated (const xAOD::TrackParticle *) const
 track-by-track selection strategies
bool selectTrack_pTCut (const xAOD::TrackParticle *) const
bool selectTrack_chi2Cut (const xAOD::TrackParticle *) const
bool selectTrack_hitPattern (const xAOD::TrackParticle *) const
bool selectTrack_hitPatternTight (const xAOD::TrackParticle *) const
bool selectTrack_d0Cut (const xAOD::TrackParticle *) const
bool selectTrack_z0Cut (const xAOD::TrackParticle *) const
bool selectTrack_d0errCut (const xAOD::TrackParticle *) const
bool selectTrack_z0errCut (const xAOD::TrackParticle *) const
bool selectTrack_LRTR3Cut (const xAOD::TrackParticle *) const
StatusCode extractIncompatibleTrackPairs (const EventContext &ctx, std::vector< WrkVrt > *)
 related to the graph method and verte finding
StatusCode findNtrackVertices (const EventContext &ctx, std::vector< WrkVrt > *)
StatusCode rearrangeTracks (const EventContext &ctx, std::vector< WrkVrt > *)
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 parameter
StatusCode mergeByShuffling (const EventContext &ctx, std::vector< WrkVrt > *)
 attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior of the vertex reconstruction resolution
StatusCode mergeFinalVertices (const EventContext &ctx, std::vector< WrkVrt > *)
 attempt to merge vertices by lookng at the distance between two vertices
StatusCode associateNonSelectedTracks (const EventContext &ctx, std::vector< WrkVrt > *)
 in addition to selected tracks, associate as much tracks as possible
StatusCode refitAndSelectGoodQualityVertices (const EventContext &ctx, std::vector< WrkVrt > *)
 finalization of the vertex and store to xAOD::VertexContainer
bool getSVImpactParameters (const EventContext &ctx, const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex, std::vector< double > &impactParameters, std::vector< double > &impactParErrors)
 get secondary vertex impact parameters
void printWrkSet (const std::vector< WrkVrt > *WrkVrtSet, const std::string &name)
 print the contents of reconstructed vertices
StatusCode refitVertex (const EventContext &, WrkVrt &)
 refit the vertex.
StatusCode refitVertex (WrkVrt &, Trk::IVKalState &istate)
StatusCode refitVertexWithSuggestion (const EventContext &ctx, WrkVrt &, const Amg::Vector3D &)
 refit the vertex with suggestion
StatusCode refitVertexWithSuggestion (WrkVrt &, const Amg::Vector3D &, Trk::IVKalState &istate)
double improveVertexChi2 (const EventContext &, WrkVrt &)
 attempt to improve the vertex chi2 by removing the most-outlier track one by one until the vertex chi2 satisfies a certain condition.
StatusCode disassembleVertex (const EventContext &ctx, std::vector< WrkVrt > *, const unsigned &vertexIndex)
void trackClassification (std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &)
double findWorstChi2ofMaximallySharedTrack (std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &, long int &, long int &)
double significanceBetweenVertices (const WrkVrt &, const WrkVrt &) const
 calculate the significance (Mahalanobis distance) between two reconstructed vertices
double distanceBetweenVertices (const WrkVrt &, const WrkVrt &) const
 calculate the physical distance
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.
StatusCode mergeVertices (const EventContext &ctx, WrkVrt &destination, WrkVrt &source)
 the 2nd vertex is merged into the 1st vertex.
ExtrapolatedPatternextrapolatedPattern (const xAOD::TrackParticle *, enum Trk::PropDirection)
bool patternCheck (const uint32_t &pattern, const Amg::Vector3D &vertex)
bool patternCheckOuterOnly (const uint32_t &pattern, const Amg::Vector3D &vertex)
bool checkTrackHitPatternToVertex (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 A classical method with hard-coded geometry.
bool checkTrackHitPatternToVertexOuterOnly (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 A classical method with hard-coded geometry.
bool checkTrackHitPatternToVertexByExtrapolation (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 New method with track extrapolation.
bool checkTrackHitPatternToVertexByExtrapolationAssist (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 New method with track extrapolation.
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.
void removeInconsistentTracks (WrkVrt &)
 Remove inconsistent tracks from vertices.
template<class Track>
void getIntersection (Track *trk, std::vector< IntersectionPos * > &layers, const Trk::Perigee *per)
template<class Track>
void setIntersection (Track *trk, IntersectionPos *bec, const Trk::Perigee *per)
StatusCode monitorVertexingAlgorithmStep (const EventContext &ctx, std::vector< WrkVrt > *, const std::string &name, bool final=false)
 monitor the intermediate status of vertexing
StatusCode categorizeVertexTruthTopology (xAOD::Vertex *vertex)
void dumpTruthInformation ()
template<class LeptonFlavor>
StatusCode augmentDVimpactParametersToLeptons (const EventContext &ctx, const std::string &containerName)
void lockTrackDecorations (const xAOD::TrackParticle *trk, bool onlySelection) const
 lock decorations at the end of the algorithm
void lockLeptonDecorations (const SG::AuxVectorData *cont) const
StatusCode lockTrackDecorations (bool onlySelection, const EventContext &ctx) 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 bool selectTrack_d0signifCut (const xAOD::TrackParticle *)
static bool selectTrack_z0signifCut (const xAOD::TrackParticle *)
static void removeTrackFromVertex (std::vector< WrkVrt > *, std::vector< std::deque< long int > > *, const long int &, const long int &)
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
static void fillTrackSummary (track_summary &summary, const xAOD::TrackParticle *trk)
 retrieve the track hit information
static bool patternCheckRun1 (const uint32_t &pattern, const Amg::Vector3D &vertex)
static bool patternCheckRun2 (const uint32_t &pattern, const Amg::Vector3D &vertex)
static bool patternCheckRun1OuterOnly (const uint32_t &pattern, const Amg::Vector3D &vertex)
static bool patternCheckRun2OuterOnly (const uint32_t &pattern, const Amg::Vector3D &vertex)
static const xAOD::TruthParticlegetTrkGenParticle (const xAOD::TrackParticle *)

Private Attributes

Gaudi::Property< int > m_geoModel {this, "GeoModel", VKalVrtAthena::GeoModel::Run2}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_TrackLocation {this, "TrackLocation", "InDetTrackParticles"}
SG::ReadHandleKey< xAOD::MuonContainerm_MuonLocation {this, "MuonLocation", "Muons"}
SG::ReadHandleKey< xAOD::ElectronContainerm_ElectronLocation {this, "ElectronLocation", "Electrons"}
SG::ReadHandleKey< xAOD::VertexContainerm_PrimVrtLocation {this, "PrimVrtLocation", "PrimaryVertices"}
Gaudi::Property< std::string > m_truthParticleContainerName {this, "McParticleContainer", "TruthParticles"}
Gaudi::Property< std::string > m_mcEventContainerName {this, "MCEventContainer", "TruthEvents"}
Gaudi::Property< std::string > m_augVerString {this, "AugmentingVersionString", "_VSI"}
Gaudi::Property< std::string > m_truthParticleFilter {this, "TruthParticleFilter", "Rhadron"}
Gaudi::Property< std::string > m_all2trksVerticesContainerName {this, "All2trkVerticesContainerName", "All2TrksVertices"}
Gaudi::Property< std::string > m_secondaryVerticesContainerName {this, "SecondaryVerticesContainerName", "SecondaryVertices"}
Gaudi::Property< bool > m_doTruth {this, "DoTruth", false}
Gaudi::Property< bool > m_FillHist {this, "FillHist", false}
Gaudi::Property< bool > m_FillNtuple {this, "FillNtuple", false}
Gaudi::Property< bool > m_FillIntermediateVertices {this, "FillIntermediateVertices", false}
Gaudi::Property< bool > m_doIntersectionPos {this, "DoIntersectionPos", false}
Gaudi::Property< bool > m_doMapToLocal {this, "DoMapToLocal", false}
Gaudi::Property< bool > m_extrapPV {this, "ExtrapPV", false}
Gaudi::Property< bool > m_passThroughTrackSelection {this, "PassThroughTrackSelection", false }
Gaudi::Property< bool > m_doFastMode {this, "DoFastMode", false}
Gaudi::Property< unsigned int > m_SelTrkMaxCutoff {this, "SelTrkMaxCutoff", 50}
Gaudi::Property< bool > m_SAloneTRT {this, "DoSAloneTRT", false}
Gaudi::Property< bool > m_do_PVvetoCut {this, "do_PVvetoCut", true}
Gaudi::Property< bool > m_do_d0Cut {this, "do_d0Cut", true}
Gaudi::Property< bool > m_do_z0Cut {this, "do_z0Cut", true}
Gaudi::Property< bool > m_do_d0errCut {this, "do_d0errCut", false}
Gaudi::Property< bool > m_do_z0errCut {this, "do_z0errCut", false}
Gaudi::Property< bool > m_do_d0signifCut {this, "do_d0signifCut", false}
Gaudi::Property< bool > m_do_z0signifCut {this, "do_z0signifCut", false}
Gaudi::Property< bool > m_ImpactWrtBL {this, "ImpactWrtBL", true}
Gaudi::Property< double > m_d0TrkPVDstMinCut {this, "a0TrkPVDstMinCut", 0. }
Gaudi::Property< double > m_d0TrkPVDstMaxCut {this, "a0TrkPVDstMaxCut", 1000.}
Gaudi::Property< double > m_d0TrkPVSignifCut {this, "a0TrkPVSignifCut", 0.}
Gaudi::Property< double > m_z0TrkPVDstMinCut {this, "zTrkPVDstMinCut", 0.}
Gaudi::Property< double > m_z0TrkPVDstMaxCut {this, "zTrkPVDstMaxCut", 1000.}
Gaudi::Property< double > m_z0TrkPVSignifCut {this, "zTrkPVSignifCut", 0.}
Gaudi::Property< double > m_d0TrkErrorCut {this, "TrkA0ErrCut", 10000}
Gaudi::Property< double > m_z0TrkErrorCut {this, "TrkZErrCut", 20000}
Gaudi::Property< double > m_twoTrkVtxFormingD0Cut {this, "twoTrkVtxFormingD0Cut", 1.}
Gaudi::Property< double > m_TrkChi2Cut {this, "TrkChi2Cut", 3.}
Gaudi::Property< double > m_TrkPtCut {this, "TrkPtCut", 1000.}
Gaudi::Property< bool > m_doTRTPixCut {this, "doTRTPixCut", false, "mode for R-hadron displaced vertex"}
Gaudi::Property< int > m_CutSctHits {this, "CutSctHits", 0}
Gaudi::Property< int > m_CutPixelHits {this, "CutPixelHits", 0}
Gaudi::Property< int > m_CutSiHits {this, "CutSiHits", 0}
Gaudi::Property< int > m_CutBLayHits {this, "CutBLayHits", 0}
Gaudi::Property< int > m_CutSharedHits {this, "CutSharedHits", 0}
Gaudi::Property< int > m_CutTRTHits {this, "CutTRTHits", 0}
Gaudi::Property< int > m_CutTightSCTHits {this, "CutTightSCTHits", 7}
Gaudi::Property< int > m_CutTightTRTHits {this, "CutTightTRTHits", 20}
Gaudi::Property< int > m_trkExtrapolator {this, "TrkExtrapolator", 2}
Gaudi::Property< bool > m_doPVcompatibilityCut {this, "DoPVcompatibility", true}
Gaudi::Property< bool > m_doTightPVcompatibilityCut {this, "DoTightPVcompatibility", false}
Gaudi::Property< bool > m_removeFakeVrt {this, "RemoveFake2TrkVrt", true}
Gaudi::Property< bool > m_removeFakeVrtLate {this, "DoDelayedFakeReject", false}
Gaudi::Property< bool > m_doReassembleVertices {this, "doReassembleVertices", false}
Gaudi::Property< bool > m_doMergeByShuffling {this, "doMergeByShuffling", false}
Gaudi::Property< bool > m_doSuggestedRefitOnMerging {this, "doSuggestedRefitOnMerging", true}
Gaudi::Property< bool > m_doMagnetMerging {this, "doMagnetMerging", true}
Gaudi::Property< bool > m_doWildMerging {this, "doWildMerging", true}
Gaudi::Property< bool > m_doMergeFinalVerticesDistance {this, "doMergeFinalVerticesDistance", false}
Gaudi::Property< bool > m_doAssociateNonSelectedTracks {this, "doAssociateNonSelectedTracks", false}
Gaudi::Property< bool > m_doFinalImproveChi2 {this, "doFinalImproveChi2", false}
Gaudi::Property< double > m_pvCompatibilityCut {this, "PVcompatibilityCut", -20.}
Gaudi::Property< double > m_SelVrtChi2Cut {this, "SelVrtChi2Cut", 4.5}
Gaudi::Property< double > m_VertexMergeFinalDistCut {this, "VertexMergeFinalDistCut", 1.}
Gaudi::Property< double > m_VertexMergeFinalDistScaling {this, "VertexMergeFinalDistScaling", 0.}
Gaudi::Property< double > m_VertexMergeCut {this, "VertexMergeCut", 3}
Gaudi::Property< double > m_TrackDetachCut {this, "TrackDetachCut", 6}
Gaudi::Property< bool > m_doTwoTrSoftBtag {this, "DoTwoTrSoftBtag", false}
Gaudi::Property< double > m_twoTrVrtAngleCut {this, "TwoTrVrtAngleCut", -10}
Gaudi::Property< double > m_twoTrVrtMinDistFromPV {this, "TwoTrVrtMinDistFromPVCut", 0.}
Gaudi::Property< bool > m_truncateWrkVertices {this, "TruncateListOfWorkingVertices", true}
Gaudi::Property< size_t > m_maxWrkVertices {this, "MaxNumberOfWorkingVertices", 1500}
Gaudi::Property< double > m_associateMinDistanceToPV {this, "associateMinDistanceToPV", 0.5}
Gaudi::Property< double > m_associateMaxD0Signif {this, "associateMaxD0Signif", 5.}
Gaudi::Property< double > m_associateMaxZ0Signif {this, "associateMaxZ0Signif", 5.}
Gaudi::Property< double > m_associatePtCut {this, "associatePtCut", 0.}
Gaudi::Property< double > m_associateChi2Cut {this, "associateChi2Cut", 20.}
Gaudi::Property< double > m_reassembleMaxImpactParameterD0 {this, "reassembleMaxImpactParameterD0", 1.}
Gaudi::Property< double > m_reassembleMaxImpactParameterZ0 {this, "reassembleMaxImpactParameterZ0", 5.}
Gaudi::Property< double > m_mergeByShufflingMaxSignificance {this, "mergeByShufflingMaxSignificance", 100.}
Gaudi::Property< double > m_mergeByShufflingAllowance {this, "mergeByShufflingAllowance", 4.}
Gaudi::Property< double > m_improveChi2ProbThreshold {this, "improveChi2ProbThreshold", 1.e-4}
Gaudi::Property< bool > m_doSelectTracksFromMuons {this, "doSelectTracksFromMuons", false}
Gaudi::Property< bool > m_doRemoveCaloTaggedMuons {this, "doRemoveCaloTaggedMuons", false}
Gaudi::Property< bool > m_doSelectTracksFromElectrons {this, "doSelectTracksFromElectrons", false}
Gaudi::Property< bool > m_doSelectIDAndGSFTracks {this, "doSelectIDAndGSFTracks", false}
Gaudi::Property< bool > m_doRemoveNonLeptonVertices {this, "doRemoveNonLeptonVertices", false}
Gaudi::Property< bool > m_doDisappearingTrackVertexing {this, "doDisappearingTrackVertexing", false}
Gaudi::Property< double > m_twoTrVrtMaxPerigeeDist {this, "twoTrVrtMaxPerigeeDist", 50}
Gaudi::Property< double > m_twoTrVrtMinRadius {this, "twoTrVrtMinRadius", 50}
Gaudi::Property< bool > m_doSelectTracksWithLRTCuts {this, "doSelectTracksWithLRTCuts", false}
Gaudi::Property< bool > m_doAugmentDVimpactParametersToMuons {this, "doAugmentDVimpactParametersToMuons", false}
Gaudi::Property< bool > m_doAugmentDVimpactParametersToElectrons {this, "doAugmentDVimpactParametersToElectrons", false}
Gaudi::Property< double > m_mcTrkResolution {this, "MCTrackResolution", 0.06}
Gaudi::Property< double > m_TruthTrkLen {this, "TruthTrkLen", 1000}
int m_vertexingStatus = 0
const xAOD::VertexContainerm_primaryVertices {}
const xAOD::Vertexm_thePV {}
std::vector< const xAOD::TrackParticle * > m_selectedTracks
std::vector< const xAOD::TrackParticle * > m_associatedTracks
std::vector< const xAOD::TrackParticle * > m_leptonicTracks
std::vector< double > m_BeamPosition
ToolHandle< Trk::ITrkVKalVrtFitterm_fitSvc {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter", " Private TrkVKalVrtFitter"}
PublicToolHandle< Trk::ITruthToTrackm_truthToTrack {this, "TruthToTrack", "Trk::TruthToTrack/InDetTruthToTrack"}
PublicToolHandle< Reco::ITrackToVertexm_trackToVertexTool {this, "TrackToVertexTool", "Reco::TrackToVertex"}
 get a handle on the Track to Vertex tool
PublicToolHandle< Trk::ITrackToVertexIPEstimatorm_trackToVertexIPEstimatorTool {this, "TrackToVertexIPEstimatorTool", "Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator"}
PublicToolHandle< Trk::IExtrapolatorm_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
PublicToolHandle< Trk::IVertexMapperm_vertexMapper {this, "VertexMapper", ""}
ToolHandle< IInDetConditionsToolm_pixelCondSummaryTool {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}
 Condition service.
ToolHandle< IInDetConditionsToolm_sctCondSummaryTool {this, "InDetSCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT conditions summary"}
const AtlasDetectorIDm_atlasId {}
const PixelIDm_pixelId {}
const SCT_IDm_sctId {}
Gaudi::Property< std::string > m_checkPatternStrategy {this, "CheckHitPatternStrategy", "Classical", "Either Classical or Extrapolation"}
std::map< std::string, PatternStrategyFuncm_patternStrategyFuncs
std::optional< SG::Decorator< char > > m_decor_isSelected
std::optional< SG::Decorator< char > > m_decor_isAssociated
std::optional< SG::Decorator< char > > m_decor_is_svtrk_final
std::map< unsigned, SG::Decorator< float > > m_trkDecors
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this,"EventInfoKey", "EventInfo", "EventInfo name"}
 Read/Write Handle Keys.
SG::WriteHandleKey< xAOD::VertexContainerm_vertexKey {this, "VertexKey", "", "Vertex key"}
SG::WriteHandleKey< xAOD::VertexContainerm_twoTrksVertexKey {this, "TwoTracksVertexKey", "", "Two Tracks Vertex key"}
std::map< std::string, SG::WriteHandleKey< xAOD::VertexContainer > > m_intermediateVertexKey
SG::WriteDecorHandleKey< xAOD::EventInfom_vertexingStatusKey {this, "VertexingStatusKey", m_eventInfoKey, ""}
std::vector< IPDecoratorTypem_ipDecors
std::optional< VertexELTypem_decor_svLink
TTree * m_tree_Vert {}
std::unique_ptr< NtupleVarsm_ntupleVars
std::map< std::string, TH1 * > m_hists
PatternBank m_extrapolatedPatternBank
std::vector< std::pair< int, int > > m_incomp
std::map< const xAOD::TruthVertex *, bool > m_matchMap
std::vector< TrackSelectionAlgm_trackSelectionAlgs
std::vector< CutFuncm_trackSelectionFuncs
std::vector< std::pair< std::string, vertexingAlg > > m_vertexingAlgorithms
unsigned m_vertexingAlgorithmStep = 0U
std::vector< const xAOD::TruthVertex * > m_tracingTruthVertices
std::unordered_map< std::string, bool > m_vertexCollectionsDefinitions
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 88 of file VrtSecInclusive.h.

Member Typedef Documentation

◆ AlgForVerticesPair

using VKalVrtAthena::VrtSecInclusive::AlgForVerticesPair = double (VrtSecInclusive::*)( const WrkVrt&, const WrkVrt& ) const
private

Definition at line 482 of file VrtSecInclusive.h.

◆ Bec

Definition at line 365 of file VrtSecInclusive.h.

◆ CutFunc

using VKalVrtAthena::VrtSecInclusive::CutFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle* ) const
private

track selection

Definition at line 395 of file VrtSecInclusive.h.

◆ Detector

Definition at line 364 of file VrtSecInclusive.h.

◆ ExtrapolatedPattern

Definition at line 369 of file VrtSecInclusive.h.

◆ ExtrapolatedPoint

Definition at line 368 of file VrtSecInclusive.h.

◆ Flag

Definition at line 367 of file VrtSecInclusive.h.

◆ IPDecoratorType

using VKalVrtAthena::VrtSecInclusive::IPDecoratorType = SG::AuxElement::Decorator< std::vector< std::vector<float> > >
private

Definition at line 305 of file VrtSecInclusive.h.

◆ Layer

Definition at line 366 of file VrtSecInclusive.h.

◆ PatternBank

using VKalVrtAthena::VrtSecInclusive::PatternBank = std::map<const xAOD::TrackParticle*, std::pair< std::unique_ptr<ExtrapolatedPattern>, std::unique_ptr<ExtrapolatedPattern> > >
private

Definition at line 370 of file VrtSecInclusive.h.

◆ PatternStrategyFunc

using VKalVrtAthena::VrtSecInclusive::PatternStrategyFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex )
private

Definition at line 288 of file VrtSecInclusive.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ track_summary

◆ TrackSelectionAlg

using VKalVrtAthena::VrtSecInclusive::TrackSelectionAlg = StatusCode (VrtSecInclusive::*)(const EventContext&)
private

Definition at line 391 of file VrtSecInclusive.h.

◆ VertexELType

using VKalVrtAthena::VrtSecInclusive::VertexELType = SG::AuxElement::Decorator< std::vector<ElementLink< xAOD::VertexContainer > > >
private

Definition at line 308 of file VrtSecInclusive.h.

◆ vertexingAlg

using VKalVrtAthena::VrtSecInclusive::vertexingAlg = StatusCode (VrtSecInclusive::*)( const EventContext&, std::vector<WrkVrt>* )
private

Definition at line 439 of file VrtSecInclusive.h.

Member Enumeration Documentation

◆ mergeStep

◆ TrkParameter

◆ TrkParameterUnc

Constructor & Destructor Documentation

◆ VrtSecInclusive()

VKalVrtAthena::VrtSecInclusive::VrtSecInclusive ( const std::string & name,
ISvcLocator * pSvcLocator )

Standard Athena-Algorithm Constructor.

Definition at line 39 of file VrtSecInclusive.cxx.

39 :
40 AthAlgorithm (name,pSvcLocator),
41 m_ntupleVars ( nullptr )
42 {
47
48 if( m_FillNtuple ) {
49 m_ntupleVars = std::make_unique<NtupleVars>( );
50 }
51 }
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
std::map< std::string, PatternStrategyFunc > m_patternStrategyFuncs
bool checkTrackHitPatternToVertex(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
bool checkTrackHitPatternToVertexByExtrapolationAssist(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
bool checkTrackHitPatternToVertexByExtrapolation(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
std::unique_ptr< NtupleVars > m_ntupleVars
bool checkTrackHitPatternToVertexOuterOnly(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
Gaudi::Property< bool > m_FillNtuple

◆ ~VrtSecInclusive()

VKalVrtAthena::VrtSecInclusive::~VrtSecInclusive ( )
overridevirtual

Default Destructor.

Definition at line 55 of file VrtSecInclusive.cxx.

56 {
57 }

Member Function Documentation

◆ addEventInfo()

StatusCode VKalVrtAthena::VrtSecInclusive::addEventInfo ( )
private

Definition at line 236 of file AANT_Tools.cxx.

236 {
237 // add event level variables
238 //
239 ATH_MSG_DEBUG( " > addEventInfo: in addEventInfo");
240
241 // this code has been taken from AnalysisExamples/VFitZmmOnAOD
242 //
243 //get EventInfo for run and event number
244
245 const xAOD::EventInfo* eventInfo;
246 ATH_CHECK( evtStore()->retrieve(eventInfo) );
247
248 //
249 //m_ntupleVars->m_runNumber = eventInfo->runNumber();
250 m_ntupleVars->get<unsigned int>( "RunNumber" ) = eventInfo->runNumber();
251 m_ntupleVars->get<unsigned int>( "Event") = eventInfo->eventNumber();
252 m_ntupleVars->get<unsigned int>( "Time" ) = eventInfo->timeStamp() ;
253 m_ntupleVars->get<unsigned int>( "LumiBlock" ) = eventInfo->lumiBlock() ;
254 m_ntupleVars->get<unsigned int>( "BCID" ) = eventInfo->bcid();
255
256 ATH_MSG_DEBUG( " > addEventInfo: event "<< m_ntupleVars->get<unsigned int>( "Event" ) );
257
258 return StatusCode::SUCCESS;
259 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
ServiceHandle< StoreGateSvc > & evtStore()
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
EventInfo_v1 EventInfo
Definition of the latest event info version.

◆ associateNonSelectedTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::associateNonSelectedTracks ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

in addition to selected tracks, associate as much tracks as possible

Definition at line 1106 of file VertexingAlgs.cxx.

1108 {
1109 SG::ReadHandle<xAOD::TrackParticleContainer> trackHandle = SG::makeHandle( m_TrackLocation, ctx );
1110 ATH_CHECK( trackHandle.isValid() );
1111 const xAOD::TrackParticleContainer *allTracks = trackHandle.cptr();
1112
1113 SG::ReadHandle<xAOD::VertexContainer> primVtxHandle = SG::makeHandle( m_PrimVrtLocation, ctx );
1114 ATH_CHECK( primVtxHandle.isValid() );
1115 const xAOD::VertexContainer *pvs = primVtxHandle.cptr();
1116
1117 if( !m_decor_isAssociated ) {
1118 m_decor_isAssociated.emplace ( "is_associated" + m_augVerString );
1119 }
1120
1121 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": #verticess = " << workVerticesContainer->size() );
1122
1123 unsigned associateCounter { 0 };
1124
1125 // Loop over vertices
1126 for( auto& wrkvrt : *workVerticesContainer ) {
1127
1128 if( !wrkvrt.isGood ) continue;
1129 if( wrkvrt.selectedTrackIndices.size() <= 1 ) continue;
1130
1131 improveVertexChi2( ctx, wrkvrt );
1132
1133 wrkvrt.Chi2_core = wrkvrt.Chi2;
1134
1135 auto& vertexPos = wrkvrt.vertex;
1136
1137 std::vector<double> distanceToPVs;
1138
1139 for( const auto* pv : *pvs ) {
1140 distanceToPVs.emplace_back( VKalVrtAthena::vtxVtxDistance( vertexPos, pv->position() ) );
1141 }
1142 const auto& minDistance = *( std::min_element( distanceToPVs.begin(), distanceToPVs.end() ) );
1143
1144 if( minDistance < m_associateMinDistanceToPV ) continue;
1145
1146
1147 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vertex pos = (" << vertexPos.x() << ", " << vertexPos.y() << ", " << vertexPos.z() << "), "
1148 "#selected = " << wrkvrt.selectedTrackIndices.size() << ", #assoc = " << wrkvrt.associatedTrackIndices.size() );
1149
1150 std::vector<const xAOD::TrackParticle*> candidates;
1151
1152 // Search for candidate tracks
1153 for( auto itr = allTracks->begin(); itr != allTracks->end(); ++itr ) {
1154 const auto* trk = *itr;
1155
1156 // If the track is already used for any DV candidate, reject.
1157 {
1158 auto result = std::find_if( workVerticesContainer->begin(), workVerticesContainer->end(),
1159 [&] ( WrkVrt& wrkvrt ) {
1160 auto found = std::find_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1161 [&]( long int index ) {
1162 // when using selected tracks from electrons, also check the orginal track particle from GSF to see if InDetTrackParticle (trk) is an electron that is already in the vertex
1163 if (m_doSelectTracksFromElectrons || m_doSelectIDAndGSFTracks) {
1164 const xAOD::TrackParticle *id_tr;
1165 id_tr = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(m_selectedTracks.at(index));
1166 return trk == m_selectedTracks.at(index) or trk == id_tr;
1167 }
1168 else{
1169 return trk == m_selectedTracks.at(index);
1170 }
1171 } );
1172 return found != wrkvrt.selectedTrackIndices.end();
1173 } );
1174 if( result != workVerticesContainer->end() ) continue;
1175 }
1176
1177 // If the track is already registered to the associated track list, reject.
1178 {
1179 auto result = std::find_if( m_associatedTracks.begin(), m_associatedTracks.end(),
1180 [&] (const auto* atrk) { return trk == atrk; } );
1181 if( result != m_associatedTracks.end() ) continue;
1182 }
1183
1184 // Reject PV-associated tracks
1185 // if( !selectTrack_notPVassociated( trk ) ) continue;
1186
1187 // pT selection
1188 if( trk->pt() < m_associatePtCut ) continue;
1189
1190 // chi2 selection
1191 if( trk->chiSquared() / trk->numberDoF() > m_associateChi2Cut ) continue;
1192
1193 // Hit pattern consistentcy requirement
1194 if( !checkTrackHitPatternToVertexOuterOnly( trk, vertexPos ) ) continue;
1195
1196 // Get the closest approach
1197 std::vector<double> impactParameters;
1198 std::vector<double> impactParErrors;
1199
1200 if( !getSVImpactParameters( ctx, trk, vertexPos, impactParameters, impactParErrors) ) continue;
1201
1202 if( std::abs( impactParameters.at(0) ) / sqrt( impactParErrors.at(0) ) > m_associateMaxD0Signif ) continue;
1203 if( std::abs( impactParameters.at(1) ) / sqrt( impactParErrors.at(1) ) > m_associateMaxZ0Signif ) continue;
1204
1205 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": trk " << trk
1206 << ": d0 to vtx = " << impactParameters.at(k_d0)
1207 << ", z0 to vtx = " << impactParameters.at(k_z0)
1208 << ", distance to vtx = " << hypot( impactParameters.at(k_d0), impactParameters.at(k_z0) ) );
1209
1210 candidates.emplace_back( trk );
1211
1212 }
1213
1214 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": number of candidate tracks = " << candidates.size() );
1215
1216 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
1217 // Attempt to add the track to the vertex and try fitting
1218 for( const auto* trk : candidates ) {
1219
1220 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": attempting to associate track = " << trk );
1221
1222 // Backup the current vertes status
1223 WrkVrt wrkvrt_backup = wrkvrt;
1224
1225 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1226
1227 std::vector<const xAOD::TrackParticle*> baseTracks;
1228 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
1229
1230 wrkvrt.Chi2PerTrk.clear();
1231
1232 for( const auto& index : wrkvrt.selectedTrackIndices ) {
1233 baseTracks.emplace_back( m_selectedTracks.at( index ) );
1234 wrkvrt.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
1235 }
1236 for( const auto& index : wrkvrt.associatedTrackIndices ) {
1237 baseTracks.emplace_back( m_associatedTracks.at( index ) );
1238 wrkvrt.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
1239 }
1240
1241 baseTracks.emplace_back( trk );
1242 wrkvrt.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
1243
1244 Amg::Vector3D initPos;
1245
1246 {
1247 StatusCode sc = m_fitSvc->VKalVrtFitFast( baseTracks, initPos, *state );/* Fast crude estimation */
1248
1249 if( sc.isFailure() ) ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation failed.");
1250
1251 const auto& diffPos = initPos - vertexPos;
1252
1253 if( diffPos.norm() > 10. ) {
1254
1255 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": approx vertex as original" );
1256 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1257
1258 } else {
1259
1260 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": approx vertex set to (" << initPos.x() << ", " << initPos.y() << ", " << initPos.z() << ")" );
1261 m_fitSvc->setApproximateVertex( initPos.x(), initPos.y(), initPos.z(), *state );
1262
1263 }
1264 }
1265
1266
1267 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": now vertex fitting..." );
1268
1269 StatusCode sc = m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
1270 wrkvrt.vertex,
1271 wrkvrt.vertexMom,
1272 wrkvrt.Charge,
1273 wrkvrt.vertexCov,
1274 wrkvrt.Chi2PerTrk,
1275 wrkvrt.TrkAtVrt,
1276 wrkvrt.Chi2,
1277 *state);
1278
1279 if( sc.isFailure() ) {
1280 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": VKalVrtFit failure. Revert to backup");
1281 wrkvrt = std::move(wrkvrt_backup);
1282
1283 if( m_FillHist ) m_hists["associateMonitor"]->Fill( 1 );
1284
1285 continue;
1286 }
1287
1288
1289 if( m_FillHist ) m_hists["associateMonitor"]->Fill( 0 );
1290
1291 auto& cov = wrkvrt.vertexCov;
1292
1293 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": succeeded in associating. New vertex pos = (" << vertexPos.perp() << ", " << vertexPos.z() << ", " << vertexPos.perp()*vertexPos.phi() << ")" );
1294 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": New vertex cov = (" << cov.at(0) << ", " << cov.at(1) << ", " << cov.at(2) << ", " << cov.at(3) << ", " << cov.at(4) << ", " << cov.at(5) << ")" );
1295
1296 associateCounter++;
1297
1298 wrkvrt.associatedTrackIndices.emplace_back( m_associatedTracks.size() );
1299
1300 m_associatedTracks.emplace_back( trk );
1301 (*m_decor_isAssociated)( *trk ) = true;
1302
1303 }
1304
1305 }
1306
1307 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1308 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": total associated number of tracks = " << associateCounter );
1309 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1310
1311 return StatusCode::SUCCESS;
1312 }
#define ATH_MSG_VERBOSE(x,...)
static Double_t sc
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Gaudi::Property< double > m_associateChi2Cut
Gaudi::Property< double > m_associateMaxD0Signif
Gaudi::Property< double > m_associateMinDistanceToPV
Gaudi::Property< double > m_associatePtCut
Gaudi::Property< bool > m_FillHist
Gaudi::Property< double > m_associateMaxZ0Signif
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackLocation
std::map< std::string, TH1 * > m_hists
double improveVertexChi2(const EventContext &, WrkVrt &)
attempt to improve the vertex chi2 by removing the most-outlier track one by one until the vertex chi...
std::vector< const xAOD::TrackParticle * > m_associatedTracks
ToolHandle< Trk::ITrkVKalVrtFitter > m_fitSvc
bool getSVImpactParameters(const EventContext &ctx, const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex, std::vector< double > &impactParameters, std::vector< double > &impactParErrors)
get secondary vertex impact parameters
SG::ReadHandleKey< xAOD::VertexContainer > m_PrimVrtLocation
std::vector< const xAOD::TrackParticle * > m_selectedTracks
Gaudi::Property< std::string > m_augVerString
std::optional< SG::Decorator< char > > m_decor_isAssociated
Eigen::Matrix< double, 3, 1 > Vector3D
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
double vtxVtxDistance(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ augmentDVimpactParametersToLeptons()

template<class LeptonFlavor>
StatusCode VKalVrtAthena::VrtSecInclusive::augmentDVimpactParametersToLeptons ( const EventContext & ctx,
const std::string & containerName )
private

Definition at line 108 of file Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h.

109 {
110
111 const xAOD::VertexContainer *secondaryVertexContainer{};
112 ATH_CHECK( evtStore()->retrieve( secondaryVertexContainer, "VrtSecInclusive_" + m_secondaryVerticesContainerName + m_augVerString) );
113
114 using LeptonContainer = DataVector<LeptonFlavor>;
115
116 const LeptonContainer *leptonContainer{};
117 ATH_CHECK( evtStore()->retrieve( leptonContainer, containerName ) );
118
119 if (m_ipDecors.empty()) {
120 m_ipDecors.emplace_back( "d0_wrtSVs" + m_augVerString );
121 m_ipDecors.emplace_back( "z0_wrtSVs" + m_augVerString );
122 m_ipDecors.emplace_back( "pt_wrtSVs" + m_augVerString );
123 m_ipDecors.emplace_back( "eta_wrtSVs" + m_augVerString );
124 m_ipDecors.emplace_back( "phi_wrtSVs" + m_augVerString );
125 m_ipDecors.emplace_back( "d0err_wrtSVs" + m_augVerString );
126 m_ipDecors.emplace_back( "z0err_wrtSVs" + m_augVerString );
127 }
128
129 // Grouping decorators
130 enum { k_ip_d0, k_ip_z0, k_ip_pt, k_ip_eta, k_ip_phi, k_ip_d0err, k_ip_z0err };
131
132 if( !m_decor_svLink ) {
133 m_decor_svLink.emplace ( "svLinks" + m_augVerString );
134 }
135
136 // Loop over leptons
137 for( const auto& lepton : *leptonContainer ) {
138
139 std::vector< std::vector< std::vector<float> > > ip_wrtSVs( m_ipDecors.size() ); // triple nest of { ip parameters, tracks, DVs }
140
141 bool linkFlag { false };
142
143 std::vector<unsigned> trackTypes;
144 genSequence<LeptonFlavor>( lepton, trackTypes );
145
146 // Loop over lepton types
147 for( auto& trackType : trackTypes ) {
148
149 std::vector< std::vector<float> > ip_wrtSV( m_ipDecors.size() ); // nest of { tracks, DVs }
150
151 const auto* trk = getLeptonTrackParticle<LeptonFlavor>( lepton, trackType );
152
153 if( !trk ) continue;
154
155 std::map< const xAOD::Vertex*, std::vector<double> > distanceMap;
156
157 std::vector<ElementLink< xAOD::VertexContainer > > links;
158
159 // Loop over vertices
160 for( const auto vtx : *secondaryVertexContainer ) {
161
162 std::vector<double> impactParameters;
163 std::vector<double> impactParErrors;
164
165 m_fitSvc->VKalGetImpact( ctx, trk, vtx->position(), static_cast<int>( lepton->charge() ), impactParameters, impactParErrors );
166
167 enum { k_d0, k_z0, k_theta, k_phi, k_qOverP }; // for the impact parameter
168 enum { k_d0d0, k_d0z0, k_z0z0 }; // for the par errors
169
170 const auto& theta = impactParameters.at( k_theta );
171 const auto& phi = impactParameters.at( k_phi );
172 const auto p = fabs( 1.0 / impactParameters.at(k_qOverP) );
173 const auto pt = fabs( p * sin( theta ) );
174 const auto eta = -log( tan(theta/2.) );
175
176 // filling the parameters to the corresponding container
177 ip_wrtSV.at( k_ip_d0 ) .emplace_back( impactParameters.at(k_d0) );
178 ip_wrtSV.at( k_ip_z0 ) .emplace_back( impactParameters.at(k_z0) );
179 ip_wrtSV.at( k_ip_pt ) .emplace_back( pt );
180 ip_wrtSV.at( k_ip_eta ) .emplace_back( eta );
181 ip_wrtSV.at( k_ip_phi ) .emplace_back( phi );
182 ip_wrtSV.at( k_ip_d0err ) .emplace_back( impactParErrors.at(k_d0d0) );
183 ip_wrtSV.at( k_ip_z0err ) .emplace_back( impactParErrors.at(k_z0z0) );
184
185 if( !linkFlag ) {
186
187 ElementLink<xAOD::VertexContainer> link_SV( *( dynamic_cast<const xAOD::VertexContainer*>( vtx->container() ) ), static_cast<size_t>( vtx->index() ) );
188 links.emplace_back( link_SV );
189
190 }
191
192 } // end of vertex loop
193
194 // The linking to the vertices need to be done only once
195 if( !linkFlag ) {
196 ( *m_decor_svLink )( *lepton ) = std::move(links);
197 linkFlag = true;
198 }
199
200 for( size_t ipar = 0; ipar < ip_wrtSVs.size(); ipar++ ) ip_wrtSVs.at( ipar ).emplace_back( ip_wrtSV.at( ipar ) );
201
202 } // end of track type loop
203
204 // decoration
205 for( size_t ipar = 0; ipar < m_ipDecors.size(); ipar++ ) {
206 m_ipDecors.at( ipar )( *lepton ) = ip_wrtSVs.at( ipar );
207 }
208
209 } // end of lepton container loop
210
211 return StatusCode::SUCCESS;
212 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Scalar theta() const
theta method
Gaudi::Property< std::string > m_secondaryVerticesContainerName
std::optional< VertexELType > m_decor_svLink
std::vector< IPDecoratorType > m_ipDecors
const xAOD::TrackParticle * getLeptonTrackParticle(const xAOD::Muon *muon, const unsigned &trackType)
void genSequence(const xAOD::Muon *, std::vector< unsigned > &trackTypes)

◆ categorizeVertexTruthTopology()

StatusCode VKalVrtAthena::VrtSecInclusive::categorizeVertexTruthTopology ( xAOD::Vertex * vertex)
private

Definition at line 43 of file TruthAlgs.cxx.

44 {
45
46 enum vertexCatogory_tracks {
47 allTruthAssociated,
48 hasFakeTracks,
49 allFakeTracks
50 };
51
52 enum vertexCategory_vertex {
53 uniqueTruthVertex,
54 multipleTruthVertices,
55 noTruthVertex
56 };
57
58
59 // std::multiset allows to have multiplicity of the element
60 multiset<const xAOD::TruthVertex*> truth_vertices;
61
62 // std::multiset doesn't allow to have multiplicity of the element
63 set<const xAOD::TruthVertex*> truth_vertices_types;
64
65 vector<const xAOD::TrackParticle*> reco_tracks; // associated with truth and has prodVtx
66 vector<const xAOD::TrackParticle*> orphan_tracks; // associated with truth, but does not have prodVtx
67 vector<const xAOD::TrackParticle*> fake_tracks; // no association with truth ( fake )
68
69 // loop over tracks
70 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): loop over tracks" );
71 typedef ElementLink<xAOD::TruthParticleContainer> truthLink;
72 static const SG::ConstAccessor< truthLink > truthParticleLinkAcc( "truthParticleLink" );
73 for( size_t itrk=0; itrk<vertex->nTrackParticles(); itrk++ ) {
74 const auto *trk = vertex->trackParticle( itrk );
75
76 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): track loop itrk = " << itrk );
77
78
79 const truthLink& link = truthParticleLinkAcc(*trk);
80
81 if ( ! link ) {
82 fake_tracks.emplace_back( trk );
83 continue;
84 }
85
86 const xAOD::TruthParticle *truth = *link;
87 if( ! truth->hasProdVtx() ) {
88 orphan_tracks.emplace_back( trk );
89 continue;
90 }
91
92 reco_tracks.emplace_back( trk );
93
94 truth_vertices_types .insert( truth->prodVtx() );
95 truth_vertices .insert( truth->prodVtx() );
96
97 }
98
99
100 // Add truth track pattern to the reco vertex
101 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Add truth track pattern to the reco vertex" );
102 const static SG::Accessor<char> trkpatAcc( "truth_trk_pattern" );
103 if( reco_tracks.size() == vertex->nTrackParticles() ) {
104 trkpatAcc( *vertex ) = allTruthAssociated;
105 } else if( fake_tracks.size() == vertex->nTrackParticles() ) {
106 trkpatAcc( *vertex ) = allFakeTracks;
107 } else {
108 trkpatAcc( *vertex ) = hasFakeTracks;
109 }
110
111
112 // Histogramming - counting the number of appearing truth vertices connected
113 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Histogramming - counting the number of appearing truth vertices connected" );
114 vector< tuple<const xAOD::TruthVertex*, size_t> > truth_vertex_histogram;
115 for( const auto *v : truth_vertices_types ) {
116 size_t count = truth_vertices.count( v );
117 truth_vertex_histogram.emplace_back( v, count );
118 }
119
120 // Determine the truth vertex associated to this vertex by majority decision
121 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Determine the truth vertex associated to this vertex by majority decision" );
122 tuple<const xAOD::TruthVertex*, size_t> tmp_tuple( nullptr, 0 );
123 for( const auto& t : truth_vertex_histogram ) {
124 const size_t& size_tmp = get<1>( tmp_tuple );
125 const size_t& size_this = get<1>( t );
126 if( size_tmp < size_this ) tmp_tuple = t;
127 }
128
129 // Add truth track pattern to the reco vertex
130 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Add truth track pattern to the reco vertex" );
131 char truth_vtx_pattern = 0;
132 if( truth_vertices_types.empty() ) {
133 truth_vtx_pattern = noTruthVertex;
134 } else if( truth_vertices_types.size() == 1 ) {
135 truth_vtx_pattern = uniqueTruthVertex;
136 } else {
137 truth_vtx_pattern = multipleTruthVertices;
138 }
139 static const SG::Accessor<char> vtxpatAcc( "truth_vtx_pattern" );
140 vtxpatAcc(*vertex) = truth_vtx_pattern;
141
142
144 if( noTruthVertex != truth_vtx_pattern ) {
145
146 // Retrieve the truth vertex container for element link
147 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Retrieve the truth vertex container for element link" );
148 const xAOD::TruthVertexContainer* truthVertexContainer{};
149 ATH_CHECK( evtStore()->retrieve( truthVertexContainer, "TruthVertices") );
150
151 // create the element link
152 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): create the element link" );
153 const auto *theVertex = get<0>( tmp_tuple );
154 if( theVertex ) {
155 // Add the truth vertex element link to the reco vertex
156 vtx_link.toIndexedElement(*truthVertexContainer,theVertex->index());
157 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Add the truth vertex element link to the reco vertex" );
158 }
159 }
160 // [JDC] a ElementLink decorator should be filled every event
161 // although using a null link
163 linkAcc( "truth_vtx_link" );
164 linkAcc(*vertex) = vtx_link;
165
166 return StatusCode::SUCCESS;
167 }
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
pointer & link(pointer p) const
Return a reference to the link for an element.
TruthVertexContainer_v1 TruthVertexContainer
Declare the latest version of the truth vertex container.
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ checkTrackHitPatternToVertex()

bool VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertex ( const xAOD::TrackParticle * trk,
const Amg::Vector3D & vertex )
private

A classical method with hard-coded geometry.

Definition at line 2046 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2047 {
2048
2049 const uint32_t pattern = trk->hitPattern();
2050
2051 return patternCheck( pattern, vertex );
2052
2053 }
bool patternCheck(const uint32_t &pattern, const Amg::Vector3D &vertex)
uint32_t hitPattern() const
setEventNumber uint32_t

◆ checkTrackHitPatternToVertexByExtrapolation()

bool VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolation ( const xAOD::TrackParticle * trk,
const Amg::Vector3D & vertex )
private

New method with track extrapolation.

Definition at line 1039 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

1040 {
1041
1042 if( m_extrapolatedPatternBank.find( trk ) == m_extrapolatedPatternBank.end() ) {
1043
1044 std::unique_ptr<ExtrapolatedPattern> exPattern_along( extrapolatedPattern( trk, Trk::alongMomentum ) );
1045 std::unique_ptr<ExtrapolatedPattern> exPattern_oppos( extrapolatedPattern( trk, Trk::oppositeMomentum ) );
1046
1047 m_extrapolatedPatternBank.emplace( trk, std::make_pair( std::move(exPattern_along), std::move(exPattern_oppos) ) );
1048
1049 }
1050
1051 auto& exPattern = m_extrapolatedPatternBank.at( trk );
1052
1053 using LayerCombination = std::vector<int>;
1054
1055 std::map<LayerCombination, unsigned> layerMap;
1056 if( layerMap.empty() ) {
1057 layerMap[ { 1, 0, 0 } ] = Trk::pixelBarrel0;
1058 layerMap[ { 1, 0, 1 } ] = Trk::pixelBarrel1;
1059 layerMap[ { 1, 0, 2 } ] = Trk::pixelBarrel2;
1060 layerMap[ { 1, 0, 3 } ] = Trk::pixelBarrel3;
1061
1062 layerMap[ { 1, 2, 0 } ] = Trk::pixelEndCap0;
1063 layerMap[ { 1, 2, 1 } ] = Trk::pixelEndCap1;
1064 layerMap[ { 1, 2, 2 } ] = Trk::pixelEndCap2;
1065 layerMap[ { 1,-2, 0 } ] = Trk::pixelEndCap0;
1066 layerMap[ { 1,-2, 1 } ] = Trk::pixelEndCap1;
1067 layerMap[ { 1,-2, 2 } ] = Trk::pixelEndCap2;
1068
1069 layerMap[ { 2, 0, 0 } ] = Trk::sctBarrel0;
1070 layerMap[ { 2, 0, 1 } ] = Trk::sctBarrel1;
1071 layerMap[ { 2, 0, 2 } ] = Trk::sctBarrel2;
1072 layerMap[ { 2, 0, 3 } ] = Trk::sctBarrel3;
1073
1074 layerMap[ { 2, 2, 0 } ] = Trk::sctEndCap0;
1075 layerMap[ { 2, 2, 1 } ] = Trk::sctEndCap1;
1076 layerMap[ { 2, 2, 2 } ] = Trk::sctEndCap2;
1077 layerMap[ { 2, 2, 3 } ] = Trk::sctEndCap3;
1078 layerMap[ { 2, 2, 4 } ] = Trk::sctEndCap4;
1079 layerMap[ { 2, 2, 5 } ] = Trk::sctEndCap5;
1080 layerMap[ { 2, 2, 6 } ] = Trk::sctEndCap6;
1081 layerMap[ { 2, 2, 7 } ] = Trk::sctEndCap7;
1082 layerMap[ { 2, 2, 8 } ] = Trk::sctEndCap8;
1083 layerMap[ { 2,-2, 0 } ] = Trk::sctEndCap0;
1084 layerMap[ { 2,-2, 1 } ] = Trk::sctEndCap1;
1085 layerMap[ { 2,-2, 2 } ] = Trk::sctEndCap2;
1086 layerMap[ { 2,-2, 3 } ] = Trk::sctEndCap3;
1087 layerMap[ { 2,-2, 4 } ] = Trk::sctEndCap4;
1088 layerMap[ { 2,-2, 5 } ] = Trk::sctEndCap5;
1089 layerMap[ { 2,-2, 6 } ] = Trk::sctEndCap6;
1090 layerMap[ { 2,-2, 7 } ] = Trk::sctEndCap7;
1091 layerMap[ { 2,-2, 8 } ] = Trk::sctEndCap8;
1092 }
1093
1094 enum { position=0, detector=1, bec=2, layer=3, isGood=4 };
1095
1096 // Lambda!
1097 auto getDetectorType = [&]( const ExtrapolatedPoint& point ) -> unsigned {
1098
1099 const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
1100
1101 for( auto& pair : layerMap ) {
1102 if( pair.first == comb ) {
1103 return pair.second;
1104 }
1105 }
1106
1108 };
1109
1110 enum { kShouldNotHaveHit, kShouldHaveHit, kMayHaveHit };
1111 std::vector<unsigned> expectedHitPattern(Trk::numberOfDetectorTypes, kShouldNotHaveHit);
1112
1113 auto minExpectedRadius = AlgConsts::maxValue;
1114
1115 // Loop over extrapolated points (along direction)
1116 auto& exPattern_along = *( exPattern.first );
1117
1118 for( auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
1119 if( std::next( itr ) == exPattern_along.end() ) continue;
1120
1121 const auto& point = *itr;
1122 const auto& nextPoint = *( std::next( itr ) );
1123
1124 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": isGood = " << std::get<isGood>( point ) );
1125
1126 const auto& thisPos = std::get<position>( point );
1127 const auto& nextPos = std::get<position>( nextPoint );
1128
1129 auto sectionVector = nextPos - thisPos;
1130 auto vertexVector = TVector3( vertex.x(), vertex.y(), vertex.z() ) - thisPos;
1131
1132
1133 const auto& detectorType = getDetectorType( point );
1134
1135 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": detType = " << detectorType );
1136
1137 if( detectorType == AlgConsts::invalidUnsigned ) continue;
1138 if( detectorType >= Trk::numberOfDetectorTypes ) continue;
1139
1140 // if the vertex is nearby (within 10 mm), the hit may be presnet ("X")
1141 if( vertexVector.Mag() < 10. ) {
1142 expectedHitPattern.at( detectorType ) = kMayHaveHit;
1143 continue;
1144 }
1145
1146 // if the front-end module is not active, then the hit is not expected,
1147 // which means the hit may be present
1148 if( !static_cast<bool>(std::get<isGood>( point )) ) {
1149 expectedHitPattern.at( detectorType ) = kMayHaveHit;
1150 continue;
1151 }
1152
1153 // if the inner product of the above two vectors is positive,
1154 // then point is inner than the vertex.
1155 // Else, the point is outer than the vertex and expect to have hits
1156 // when the track is originated from the vertex.
1157
1158 if( sectionVector.Mag() == 0. ) continue;
1159
1160 ATH_MSG_VERBOSE( " > " << __FUNCTION__
1161 << ": hitPos = (" << thisPos.Perp() << ", " << thisPos.z() << ", " << thisPos.Phi() << ")"
1162 << ", sectionVec = (" << sectionVector.Perp() << ", " << sectionVector.z() << ", " << sectionVector.Phi() << ")"
1163 << ", vertexVec = (" << vertexVector.Perp() << ", " << vertexVector.z() << ", " << vertexVector.Phi() << ")"
1164 << ", cos(s,v) = " << sectionVector * vertexVector / ( sectionVector.Mag() * vertexVector.Mag() + AlgConsts::infinitesimal ) );
1165
1166 if( sectionVector * vertexVector > 0. ) continue;
1167
1168 if( minExpectedRadius > thisPos.Perp() ) minExpectedRadius = thisPos.Perp();
1169
1170 // now, the hit is expected to present.
1171
1172 expectedHitPattern.at( detectorType ) = kShouldHaveHit;
1173 }
1174
1175 // Loop over extrapolated points (opposite direction)
1176 auto& exPattern_oppos = *( exPattern.second );
1177 bool oppositeFlag = false;
1178
1179 for( auto itr = exPattern_oppos.begin(); itr != exPattern_oppos.end(); ++itr ) {
1180 if( std::next( itr ) == exPattern_oppos.end() ) continue;
1181
1182 const auto& point = *itr;
1183 const auto& nextPoint = *( std::next( itr ) );
1184
1185 const auto& thisPos = std::get<position>( point );
1186 const auto& nextPos = std::get<position>( nextPoint );
1187
1188 auto sectionVector = nextPos - thisPos;
1189 auto vertexVector = TVector3( vertex.x(), vertex.y(), vertex.z() ) - thisPos;
1190
1191 const auto& detectorType = getDetectorType( point );
1192
1193 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": detType = " << detectorType );
1194
1195 ATH_MSG_DEBUG( " > " << __FUNCTION__
1196 << ": hitPos = (" << thisPos.Perp() << ", " << thisPos.z() << ", " << thisPos.Phi() << ")"
1197 << ", vertex = (" << vertex.perp() << ", " << vertex.z() << ", " << vertex.phi() << ")"
1198 << ", cos(s,v) = " << sectionVector * vertexVector / ( sectionVector.Mag() * vertexVector.Mag() + AlgConsts::infinitesimal ) );
1199
1200 if( detectorType == AlgConsts::invalidUnsigned ) continue;
1201 if( detectorType >= Trk::numberOfDetectorTypes ) continue;
1202
1203 if( sectionVector * vertexVector < 0. ) {
1204 oppositeFlag = true;
1205 }
1206 }
1207
1208 // If the first expected point's radius is smaller than the vertex radius,
1209 // it's the case that the vertex was reconstructed in the opposite phi-direction
1210 // to the track outgoing direction. Such a case should be rejected.
1211 // bool oppositeFlag = ( minExpectedRadius < vertex.perp() );
1212
1213 std::string msg = "Expected hit pattern: ";
1214 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
1215 msg += Form("%s", expectedHitPattern.at(i) < kMayHaveHit? Form("%u", expectedHitPattern.at(i)) : "X" );
1216 }
1217 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
1218
1219 msg = "Recorded hit pattern: ";
1220 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
1221 msg += Form("%u", ( trk->hitPattern() >> i ) & 1 );
1222 }
1223 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
1224
1225 std::vector<unsigned> matchedLayers;
1226
1227 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
1228 const unsigned recordedPattern = ( (trk->hitPattern()>>i) & 1 );
1229
1230 if( expectedHitPattern.at(i) == kMayHaveHit ) {
1231 matchedLayers.emplace_back( i );
1232 } else if( expectedHitPattern.at(i) == kShouldHaveHit ) {
1233 if( expectedHitPattern.at(i) != recordedPattern ) {
1234 break;
1235 } else {
1236 matchedLayers.emplace_back( i );
1237 }
1238 } else {
1239 if( expectedHitPattern.at(i) != recordedPattern ) {
1240 break;
1241 }
1242 }
1243
1244 }
1245
1246 uint8_t PixelHits = 0;
1247 uint8_t SctHits = 0;
1248 uint8_t TRTHits = 0;
1249 if( !(trk->summaryValue( PixelHits, xAOD::numberOfPixelHits ) ) ) PixelHits =0;
1250 if( !(trk->summaryValue( SctHits, xAOD::numberOfSCTHits ) ) ) SctHits =0;
1251 if( !(trk->summaryValue( TRTHits, xAOD::numberOfTRTHits ) ) ) TRTHits =0;
1252
1253 auto dphi = trk->phi() - vertex.phi();
1254 while( dphi > TMath::Pi() ) dphi -= TMath::TwoPi();
1255 while( dphi < -TMath::Pi() ) dphi += TMath::TwoPi();
1256
1257 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vtx phi = " << vertex.phi() << ", track phi = " << trk->phi() << ", dphi = " << dphi
1258 << ", oppositeFlag = " << oppositeFlag
1259 << ", nPixelHits = " << static_cast<int>(PixelHits)
1260 << ", nSCTHits = " << static_cast<int>(SctHits)
1261 << ", nTRTHits = " << static_cast<int>(TRTHits)
1262 << ", nMatchedLayers = " << matchedLayers.size() );
1263
1264 if( PixelHits == 0 && vertex.perp() > 300. ) {
1265 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vertex r > 300 mm, w/o no pixel hits" );
1266 }
1267
1268
1269 // Requires the first 2 layers with the hit matches.
1270 if( matchedLayers.size() < 2 ) return false;
1271
1272 // In case of the first matched layer is not within pixel barrel, requires the first 4 layers with the hit match
1273 if( matchedLayers.at(0) >= Trk::pixelEndCap0 ) {
1274 if( matchedLayers.size() < 4 ) return false;
1275 }
1276
1277 // Sometimes the vertex is reconstructed at the opposite phi direction.
1278 // In this case, the pattern match may pass.
1279 // This can be avoided by requiring that the
1280 if( oppositeFlag ) return false;
1281
1282 // The following condition should apply for vertices outer than IBL.
1283 if( false /*matchedLayers.at(0) > Trk::pixelBarrel0*/ ) {
1284
1285 // If the dphi (defined above) is opposite, reject.
1286 if( fabs( dphi ) > TMath::Pi()/2.0 ) return false;
1287
1288 // If the track is not within the forward hemisphere to the vertex, reject.
1289 TVector3 trkP; trkP.SetPtEtaPhi( trk->pt(), trk->eta(), trk->phi() );
1290 TVector3 vtx; vtx.SetXYZ( vertex.x(), vertex.y(), vertex.z() );
1291 if( trkP.Dot( vtx ) < 0. ) return false;
1292
1293 }
1294
1295 return true;
1296 }
ExtrapolatedPattern * extrapolatedPattern(const xAOD::TrackParticle *, enum Trk::PropDirection)
std::tuple< const TVector3, Detector, Bec, Layer, Flag > ExtrapolatedPoint
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .).
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
@ layer
Definition HitInfo.h:79
@ oppositeMomentum
@ alongMomentum
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
@ pixelBarrel0
there are three or four pixel barrel layers (R1/R2)
@ pixelEndCap0
three pixel discs (on each side)
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].

◆ checkTrackHitPatternToVertexByExtrapolationAssist()

bool VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolationAssist ( const xAOD::TrackParticle * trk,
const Amg::Vector3D & vertex )
private

New method with track extrapolation.

Definition at line 2068 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2069 {
2070
2071 if( m_extrapolatedPatternBank.find( trk ) == m_extrapolatedPatternBank.end() ) {
2072
2073 std::unique_ptr<ExtrapolatedPattern> exPattern_along( extrapolatedPattern( trk, Trk::alongMomentum ) );
2074
2075 m_extrapolatedPatternBank.emplace( trk, std::make_pair( std::move(exPattern_along), nullptr ) );
2076
2077 }
2078
2079 if( vertex.perp() < 31.0 ) {
2080 double dphi = trk->phi() - vertex.phi();
2081 while( dphi > TMath::Pi() ) { dphi -= TMath::TwoPi(); }
2082 while( dphi < -TMath::Pi() ) { dphi += TMath::TwoPi(); }
2083 if( cos(dphi) < -0.8 ) return false;
2084 }
2085
2086 auto& exPattern = m_extrapolatedPatternBank.at( trk );
2087
2088 using LayerCombination = std::vector<int>;
2089
2090 std::map<LayerCombination, unsigned> layerMap;
2091 if( layerMap.empty() ) {
2092 layerMap[ { 1, 0, 0 } ] = Trk::pixelBarrel0;
2093 layerMap[ { 1, 0, 1 } ] = Trk::pixelBarrel1;
2094 layerMap[ { 1, 0, 2 } ] = Trk::pixelBarrel2;
2095 layerMap[ { 1, 0, 3 } ] = Trk::pixelBarrel3;
2096
2097 layerMap[ { 1, 2, 0 } ] = Trk::pixelEndCap0;
2098 layerMap[ { 1, 2, 1 } ] = Trk::pixelEndCap1;
2099 layerMap[ { 1, 2, 2 } ] = Trk::pixelEndCap2;
2100 layerMap[ { 1,-2, 0 } ] = Trk::pixelEndCap0;
2101 layerMap[ { 1,-2, 1 } ] = Trk::pixelEndCap1;
2102 layerMap[ { 1,-2, 2 } ] = Trk::pixelEndCap2;
2103
2104 layerMap[ { 2, 0, 0 } ] = Trk::sctBarrel0;
2105 layerMap[ { 2, 0, 1 } ] = Trk::sctBarrel1;
2106 layerMap[ { 2, 0, 2 } ] = Trk::sctBarrel2;
2107 layerMap[ { 2, 0, 3 } ] = Trk::sctBarrel3;
2108
2109 layerMap[ { 2, 2, 0 } ] = Trk::sctEndCap0;
2110 layerMap[ { 2, 2, 1 } ] = Trk::sctEndCap1;
2111 layerMap[ { 2, 2, 2 } ] = Trk::sctEndCap2;
2112 layerMap[ { 2, 2, 3 } ] = Trk::sctEndCap3;
2113 layerMap[ { 2, 2, 4 } ] = Trk::sctEndCap4;
2114 layerMap[ { 2, 2, 5 } ] = Trk::sctEndCap5;
2115 layerMap[ { 2, 2, 6 } ] = Trk::sctEndCap6;
2116 layerMap[ { 2, 2, 7 } ] = Trk::sctEndCap7;
2117 layerMap[ { 2, 2, 8 } ] = Trk::sctEndCap8;
2118 layerMap[ { 2,-2, 0 } ] = Trk::sctEndCap0;
2119 layerMap[ { 2,-2, 1 } ] = Trk::sctEndCap1;
2120 layerMap[ { 2,-2, 2 } ] = Trk::sctEndCap2;
2121 layerMap[ { 2,-2, 3 } ] = Trk::sctEndCap3;
2122 layerMap[ { 2,-2, 4 } ] = Trk::sctEndCap4;
2123 layerMap[ { 2,-2, 5 } ] = Trk::sctEndCap5;
2124 layerMap[ { 2,-2, 6 } ] = Trk::sctEndCap6;
2125 layerMap[ { 2,-2, 7 } ] = Trk::sctEndCap7;
2126 layerMap[ { 2,-2, 8 } ] = Trk::sctEndCap8;
2127 }
2128
2129 enum { position=0, detector=1, bec=2, layer=3, isGood=4 };
2130
2131 // Lambda!
2132 auto getDetectorType = [&]( const ExtrapolatedPoint& point ) -> unsigned {
2133
2134 const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
2135
2136 for( auto& pair : layerMap ) {
2137 if( pair.first == comb ) {
2138 return pair.second;
2139 }
2140 }
2141
2143 };
2144
2145 uint32_t disabledPattern { 0 };
2146
2147 // Loop over extrapolated points (along direction)
2148 auto& exPattern_along = *( exPattern.first );
2149
2150 for( auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
2151 if( std::next( itr ) == exPattern_along.end() ) continue;
2152
2153 const auto& point = *itr;
2154
2155 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": isGood = " << std::get<isGood>( point ) );
2156
2157 if( !std::get<isGood>( point ) ) {
2158 const auto& detectorType = getDetectorType( point );
2159 if (detectorType != AlgConsts::invalidUnsigned )[[likely]]{
2160 disabledPattern += (1 << detectorType);
2161 }
2162 }
2163 }
2164
2165 uint32_t hitPattern = trk->hitPattern();
2166 uint32_t modifiedPattern = disabledPattern | hitPattern;
2167
2168 std::string msg = "Disabled hit pattern: ";
2169 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
2170 msg += Form("%u", ( disabledPattern >> i ) & 1 );
2171 }
2172 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2173
2174 msg = "Recorded hit pattern: ";
2175 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
2176 msg += Form("%u", ( hitPattern >> i ) & 1 );
2177 }
2178 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2179
2180 return patternCheck( modifiedPattern, vertex );
2181
2182 }
#define likely(x)

◆ checkTrackHitPatternToVertexOuterOnly()

bool VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertexOuterOnly ( const xAOD::TrackParticle * trk,
const Amg::Vector3D & vertex )
private

A classical method with hard-coded geometry.

Definition at line 2057 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2058 {
2059
2060 const uint32_t pattern = trk->hitPattern();
2061
2062 return patternCheckOuterOnly( pattern, vertex );
2063
2064 }
bool patternCheckOuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)

◆ clearNtupleVariables()

StatusCode VKalVrtAthena::VrtSecInclusive::clearNtupleVariables ( )
private

Definition at line 227 of file AANT_Tools.cxx.

227 {
228
229 m_ntupleVars->clear();
230
231 return StatusCode::SUCCESS;
232 }

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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)

◆ declareProperties()

void VKalVrtAthena::VrtSecInclusive::declareProperties ( )
private

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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>

◆ defineDummyCollections()

StatusCode VKalVrtAthena::VrtSecInclusive::defineDummyCollections ( const EventContext & ctx)
private

Definition at line 273 of file VrtSecInclusive.cxx.

274 {
275 if ( not m_vertexCollectionsDefinitions.at(m_vertexKey.key()) ) {
277 }
278
282 }
283
284 for (const auto& [nameAlgo, handleKey] : m_intermediateVertexKey) {
285 if (not m_vertexCollectionsDefinitions.at( handleKey.key() )) {
286 ATH_CHECK( dummyVertexContainer(ctx, handleKey) );
287 }
288 }
289 }
290
291 return StatusCode::SUCCESS;
292 }
SG::WriteHandleKey< xAOD::VertexContainer > m_vertexKey
std::unordered_map< std::string, bool > m_vertexCollectionsDefinitions
StatusCode dummyVertexContainer(const EventContext &ctx, const SG::WriteHandleKey< xAOD::VertexContainer > &handleKey)
Gaudi::Property< bool > m_FillIntermediateVertices
std::map< std::string, SG::WriteHandleKey< xAOD::VertexContainer > > m_intermediateVertexKey
SG::WriteHandleKey< xAOD::VertexContainer > m_twoTrksVertexKey

◆ deleteNtupleVariables()

StatusCode VKalVrtAthena::VrtSecInclusive::deleteNtupleVariables ( )
private

Definition at line 209 of file AANT_Tools.cxx.

209 {
210
211 m_ntupleVars->deleteNtupleVariables();
212
213 return StatusCode::SUCCESS;
214 }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ disassembleVertex()

StatusCode VKalVrtAthena::VrtSecInclusive::disassembleVertex ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer,
const unsigned & vertexIndex )
private

Definition at line 117 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

118 {
119
120 auto& wrkvrt = workVerticesContainer->at(iv);
121
122 ATH_MSG_VERBOSE(" >> disassembleVertex(): begin: disassembling vertex[" << iv << "], workVerticesContainer.size() = " << workVerticesContainer->size() );
123 ATH_MSG_VERBOSE(" >> disassembleVertex(): Vertex: r = " << wrkvrt.vertex.perp() << ", z = " << wrkvrt.vertex.z() );
124
125 // Loop over the tracks associated to the vertex and slect the maximum chi2 track
126 const auto& ntrk = wrkvrt.selectedTrackIndices.size();
127 size_t maxChi2TrackIndex = AlgConsts::invalidUnsigned;
128
129 // If the size of the tracks is less than 2, this algorithm is meaningless.
130 if( wrkvrt.selectedTrackIndices.size() <= 2 ) return StatusCode::SUCCESS;
131
132 for( auto& index : wrkvrt.selectedTrackIndices ) {
133 const xAOD::TrackParticle* trk = m_selectedTracks.at( index );
134
135 ATH_MSG_VERBOSE(" >> disassembleVertex(): > track at vertex[" << iv << "]: "
136 << "index = " << trk->index()
137 << ", pT = " << trk->pt()
138 << ", phi = " << trk->phi()
139 << ", d0 = " << trk->d0()
140 << ", z0 = " << trk->z0());
141 }
142
143 // find the track with the maximum chi2
144 const auto& max = std::max_element( wrkvrt.Chi2PerTrk.begin(), wrkvrt.Chi2PerTrk.end() );
145
146 if( max == wrkvrt.Chi2PerTrk.end() ) return StatusCode::SUCCESS;
147
148 maxChi2TrackIndex = max - wrkvrt.Chi2PerTrk.begin();
149
150 // return if no track is found.
151 if(maxChi2TrackIndex == AlgConsts::invalidUnsigned ) return StatusCode::SUCCESS;
152
153
154 // define work variables
155 vector<const xAOD::NeutralParticle*> dummyNeutrals;
156
157 vector<WrkVrt> new_vertices;
158
159 // Loop over the tracks associated to the vertex other than the selected tracks
160 ATH_MSG_VERBOSE(" >> disassembleVertex(): Loop over the tracks associated to the vertex other than the selected tracks.");
161 for(size_t itrk=0; itrk<ntrk; itrk++) {
162
163 ATH_MSG_VERBOSE(" >> disassembleVertex(): > Loop itrk = " << itrk << " / " << ntrk );
164
165 // reject the selected track
166 if( itrk == maxChi2TrackIndex ) {
167 ATH_MSG_VERBOSE(" >> disassembleVertex(): > skipped." );
168 continue;
169 }
170
171 const size_t this_trk_id = wrkvrt.selectedTrackIndices[itrk];
172 const size_t selected_trk_id = wrkvrt.selectedTrackIndices[maxChi2TrackIndex];
173
174 ATH_MSG_VERBOSE(" >> disassembleVertex(): > this_trk_id = " << this_trk_id << ", selected_trk_id = " << selected_trk_id << ", alltrks_size = " << m_selectedTracks.size() );
175 if( this_trk_id >= m_selectedTracks.size() ) {
176 ATH_MSG_VERBOSE(" >> disassembleVertex(): > this_trk_id is invalid. continue!" );
177 continue;
178 }
179 if( selected_trk_id >= m_selectedTracks.size() ) {
180 ATH_MSG_VERBOSE(" >> disassembleVertex(): > selected_trk_id is invalid. continue!" );
181 continue;
182 }
183
184 ATH_MSG_VERBOSE(" >> disassembleVertex(): > Storing tracks to ListBaseTracks" );
185 ATH_MSG_VERBOSE(" >> disassembleVertex(): > m_selectedTracks.at( this_trk_id ) = " << m_selectedTracks.at( this_trk_id )->index() );
186 ATH_MSG_VERBOSE(" >> disassembleVertex(): > m_selectedTracks.at( this_trk_id ) = " << m_selectedTracks.at( selected_trk_id )->index() );
187
188 vector<const xAOD::TrackParticle*> ListBaseTracks;
189 ListBaseTracks.emplace_back( m_selectedTracks.at( this_trk_id ) );
190 ListBaseTracks.emplace_back( m_selectedTracks.at( selected_trk_id ) );
191
192 ATH_MSG_VERBOSE(" >> disassembleVertex(): > ListBaseTracks was stored." );
193
194 WrkVrt newvrt;
195 newvrt.selectedTrackIndices.emplace_back( this_trk_id );
196 newvrt.selectedTrackIndices.emplace_back( selected_trk_id );
197
198 // Fit the new vertex
199 ATH_MSG_VERBOSE(" >> disassembleVertex(): > Fast Fit" );
200
201 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
202 ATH_CHECK( m_fitSvc->VKalVrtFitFast( ListBaseTracks, newvrt.vertex, *state ) );
203
204 ATH_MSG_VERBOSE( " >> disassembleVertex(): > ApproxVertex: r = " << newvrt.vertex.perp() << ", z = " << newvrt.vertex.z() );
205
206 if( vtxVtxDistance( wrkvrt.vertex, newvrt.vertex ) > 10. )
207 {
208 m_fitSvc->setApproximateVertex( wrkvrt.vertex[0], wrkvrt.vertex[1], wrkvrt.vertex[2], *state );
209 }
210 else
211 {
212 m_fitSvc->setApproximateVertex( newvrt.vertex[0], newvrt.vertex[1], newvrt.vertex[2], *state );
213 }
214
215 ATH_MSG_VERBOSE(" >> disassembleVertex(): > Fit the new vertex" );
216 StatusCode sc = m_fitSvc->VKalVrtFit(ListBaseTracks,
217 dummyNeutrals,
218 newvrt.vertex,
219 newvrt.vertexMom,
220 newvrt.Charge,
221 newvrt.vertexCov,
222 newvrt.Chi2PerTrk,
223 newvrt.TrkAtVrt,
224 newvrt.Chi2,
225 *state);
226
227 if( sc.isFailure() ) continue;
228
229 newvrt.closestWrkVrtIndex = 0;
230 newvrt.closestWrkVrtValue = AlgConsts::maxValue;
231
232 // register the new vertex to the vertex list
233 ATH_MSG_VERBOSE(" >> disassembleVertex(): > register the new vertex to the vertex list" );
234 new_vertices.emplace_back( newvrt );
235 }
236
237 // remove the selected track from the original vertex
238 wrkvrt.selectedTrackIndices.erase( wrkvrt.selectedTrackIndices.begin() + maxChi2TrackIndex ); //remove track
239 ATH_MSG_VERBOSE(" >> disassembleVertex(): removed the selected track from the original vertex. wrkvrt.selectedTrackIndices.size = " << wrkvrt.selectedTrackIndices.size() );
240
241 // refit the original vertex
242 ATH_MSG_VERBOSE(" >> disassembleVertex(): refit the original vertex" );
243
244 StatusCode sc = refitVertex( ctx, wrkvrt );
245 if( sc.isFailure() ) {
246 // WARNING CODE ATLASRECTS-3145::001 refitVertex Failure, vertex lost
247 ATH_MSG_WARNING("ATLASRECTS-3145::001" );
248 return StatusCode::SUCCESS;
249 }
250 // end of workaround
251
252 for( const auto& vertex : new_vertices ) {
253 ATH_MSG_VERBOSE(" >> disassembleVertex(): > emplace_back new vertex" );
254 workVerticesContainer->emplace_back( vertex );
255 }
256
257 ATH_MSG_VERBOSE(" >> disassembleVertex(): end. workVerticesContainer.size() = " << workVerticesContainer->size() );
258 return StatusCode::SUCCESS;
259 }
#define ATH_MSG_WARNING(x,...)
#define max(a, b)
Definition cfImp.cxx:41
StatusCode refitVertex(const EventContext &, WrkVrt &)
refit the vertex.
float z0() const
Returns the parameter.
float d0() const
Returns the parameter.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
std::deque< long int > selectedTrackIndices
flagged true for good vertex candidates

◆ distanceBetweenVertices()

double VKalVrtAthena::VrtSecInclusive::distanceBetweenVertices ( const WrkVrt & v1,
const WrkVrt & v2 ) const
private

calculate the physical distance

Definition at line 111 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

111 {
112 return (v2.vertex - v1.vertex).norm();
113 }

◆ dummyVertexContainer()

StatusCode VKalVrtAthena::VrtSecInclusive::dummyVertexContainer ( const EventContext & ctx,
const SG::WriteHandleKey< xAOD::VertexContainer > & handleKey )
private

Definition at line 263 of file VrtSecInclusive.cxx.

265 {
266 SG::WriteHandle<xAOD::VertexContainer> vHandle = SG::makeHandle( handleKey, ctx );
267 ATH_CHECK( vHandle.record( std::make_unique<xAOD::VertexContainer>(),
268 std::make_unique<xAOD::VertexAuxContainer>() ) );
269 m_vertexCollectionsDefinitions.at(handleKey.key()) = true;
270 return StatusCode::SUCCESS;
271 }
const std::string & key() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.

◆ dumpTruthInformation()

void VKalVrtAthena::VrtSecInclusive::dumpTruthInformation ( )
private

Definition at line 2229 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2229 {
2230
2231 const xAOD::EventInfo* eventInfo{};
2232 const xAOD::TruthParticleContainer* truthParticles{};
2233 const xAOD::TruthVertexContainer* truthVertices{};
2234
2235 auto sc0 = evtStore()->retrieve( eventInfo, "EventInfo" );
2236 if( sc0.isFailure() ) { return; }
2237
2238 if( !eventInfo->eventType( xAOD::EventInfo::IS_SIMULATION ) ) {
2239 return;
2240 }
2241
2242 auto sc1 = evtStore()->retrieve( truthParticles, "TruthParticles" );
2243 if( sc1.isFailure() ) { return; }
2244
2245 auto sc2 = evtStore()->retrieve( truthVertices, "TruthVertices" );
2246 if( sc2.isFailure() ) { return; }
2247
2248 if( !truthParticles ) { return; }
2249 if( !truthVertices ) { return; }
2250
2251 m_tracingTruthVertices.clear();
2252
2253 std::vector<const xAOD::TruthParticle*> truthSvTracks;
2254
2255 // truth particle selection functions
2256
2257 auto selectNone = [](const xAOD::TruthVertex*) ->bool { return false; };
2258
2259 auto selectRhadron = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2260 if( truthVertex->nIncomingParticles() != 1 ) return false;
2261 if( !truthVertex->incomingParticle(0) ) return false;
2262 if( abs(truthVertex->incomingParticle(0)->pdgId()) < 1000000 ) return false;
2263 if( abs(truthVertex->incomingParticle(0)->pdgId()) > 1000000000 ) return false; // Nuclear codes, e.g. deuteron
2264 // neutralino in daughters
2265 bool hasNeutralino = false;
2266 for( unsigned ip = 0; ip < truthVertex->nOutgoingParticles(); ip++ ) {
2267 const auto* p = truthVertex->outgoingParticle(ip);
2268 if( abs( p->pdgId() ) == 1000022 ) {
2269 hasNeutralino = true;
2270 break;
2271 }
2272 }
2273 return hasNeutralino;
2274 };
2275
2276 auto selectHNL = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2277 if( truthVertex->nIncomingParticles() != 1 ) return false;
2278 if( !truthVertex->incomingParticle(0) ) return false;
2279 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 50 ) return false;
2280 return true;
2281 };
2282
2283 auto selectHiggs = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2284 if( truthVertex->nIncomingParticles() != 1 ) return false;
2285 if( !truthVertex->incomingParticle(0) ) return false;
2286 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 36 ) return false;
2287 return true;
2288 };
2289
2290 auto selectKshort = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2291 if( truthVertex->nIncomingParticles() != 1 ) return false;
2292 if( !truthVertex->incomingParticle(0) ) return false;
2293 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 310 ) return false;
2294 return true;
2295 };
2296
2297 auto selectBhadron = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2298 if( truthVertex->nIncomingParticles() != 1 ) return false;
2299 if( !truthVertex->incomingParticle(0) ) return false;
2300 if( abs(truthVertex->incomingParticle(0)->pdgId()) <= 500 || abs(truthVertex->incomingParticle(0)->pdgId()) >= 600 ) return false;
2301 return true;
2302 };
2303
2304 auto selectHadInt = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2305 if( truthVertex->nIncomingParticles() != 1 ) return false;
2306 if( !truthVertex->incomingParticle(0) ) return false;
2307
2308 const auto* parent = truthVertex->incomingParticle(0);
2309 if( parent->isLepton() ) return false;
2310
2311 TLorentzVector p4sum_in;
2312 TLorentzVector p4sum_out;
2313 for( unsigned ip = 0; ip < truthVertex->nIncomingParticles(); ip++ ) {
2314 const auto* particle = truthVertex->incomingParticle(ip);
2315 TLorentzVector p4; p4.SetPtEtaPhiM( particle->pt(), particle->eta(), particle->phi(), particle->m() );
2316 p4sum_in += p4;
2317 }
2318 for( unsigned ip = 0; ip < truthVertex->nOutgoingParticles(); ip++ ) {
2319 const auto* particle = truthVertex->outgoingParticle(ip);
2320 TLorentzVector p4; p4.SetPtEtaPhiM( particle->pt(), particle->eta(), particle->phi(), particle->m() );
2321 p4sum_out += p4;
2322 }
2323 return p4sum_out.E() - p4sum_in.E() >= 100.;
2324 };
2325
2326
2327
2328 using ParticleSelectFunc = bool (*)(const xAOD::TruthVertex*);
2329 std::map<std::string, ParticleSelectFunc> selectFuncs { { "", selectNone },
2330 { "Kshort", selectKshort },
2331 { "Bhadron", selectBhadron },
2332 { "Rhadron", selectRhadron },
2333 { "HNL", selectHNL },
2334 { "Higgs", selectHiggs },
2335 { "HadInt", selectHadInt } };
2336
2337
2338 if( selectFuncs.find( m_truthParticleFilter ) == selectFuncs.end() ) {
2339 ATH_MSG_WARNING( " > " << __FUNCTION__ << ": invalid function specification: " << m_truthParticleFilter );
2340 return;
2341 }
2342
2343 auto selectFunc = selectFuncs.at( m_truthParticleFilter );
2344
2345 // loop over truth vertices
2346 for( const auto *truthVertex : *truthVertices ) {
2347 if( selectFunc( truthVertex ) ) {
2348 m_tracingTruthVertices.emplace_back( truthVertex );
2349 std::string msg;
2350 msg += Form("pdgId = %d, (r, z) = (%.2f, %.2f), ", truthVertex->incomingParticle(0)->pdgId(), truthVertex->perp(), truthVertex->z());
2351 msg += Form("nOutgoing = %lu, ", truthVertex->nOutgoingParticles() );
2352 msg += Form("mass = %.3f GeV, pt = %.3f GeV", truthVertex->incomingParticle(0)->m()/1.e3, truthVertex->incomingParticle(0)->pt()/1.e3 );
2353 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2354 }
2355 }
2356
2357 if( m_FillHist ) {
2358 for( const auto* truthVertex : m_tracingTruthVertices ) {
2359 m_hists["nMatchedTruths"]->Fill( 0., truthVertex->perp() );
2360 }
2361 }
2362
2363 }
Gaudi::Property< std::string > m_truthParticleFilter
std::vector< const xAOD::TruthVertex * > m_tracingTruthVertices
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15
setBGCode setTAP setLVL2ErrorBits bool
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode VKalVrtAthena::VrtSecInclusive::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 314 of file VrtSecInclusive.cxx.

315 {
316
317 //
318 ATH_MSG_DEBUG("VrtSecInclusive execute()");
319
320 // Reset values
321 for (auto& [key, val] : m_vertexCollectionsDefinitions) {
322 val = false;
323 }
324
326
327 SG::ReadHandle<xAOD::EventInfo> eventInfo = SG::makeHandle(m_eventInfoKey, ctx);
328 if (!eventInfo.isValid()) {
329 ATH_MSG_ERROR ("Could not retrieve EventInfo");
330 return StatusCode::FAILURE;
331 }
332
333 SG::WriteDecorHandle<xAOD::EventInfo,int> vertexingStatusDecor(m_vertexingStatusKey, ctx);
334
335 // clear ntuple variables
336 StatusCode sc = this->initEvent();
337 if(sc.isFailure()) {
338 ATH_MSG_WARNING("Problem in initEvent ");
339 vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
341 return StatusCode::SUCCESS;
342 }
343
344 // add event level info to ntuple
345 if( m_FillNtuple ) sc = addEventInfo();
346
347 if (sc.isFailure() ) {
348 ATH_MSG_WARNING("Failure in getEventInfo() ");
349 vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
351 return StatusCode::SUCCESS;
352 }
353
354
356 //
357 // Setup StoreGate Variables
358 //
359
360 // Check Return StatusCode::Failure if the user-specified container names have duplication.
361 {
362 std::vector<std::string> userContainerNames { m_secondaryVerticesContainerName, m_all2trksVerticesContainerName };
363 std::set<std::string> userContainerNamesSet;
364 for( auto& name : userContainerNames ) userContainerNamesSet.insert( name );
365 if( userContainerNamesSet.size() != userContainerNames.size() ) {
366 ATH_MSG_ERROR( " > " << __FUNCTION__ << ": detected duplicated user-specified container name. Please check your job property" );
367 return StatusCode::FAILURE;
368 }
369 }
370
371
373
374
375 // Later use elsewhere in the algorithm
376 m_selectedTracks.clear();
377 m_associatedTracks.clear();
378 m_leptonicTracks.clear();
379
381
383 //
384 // now start algorithm
385 //
386
387 //--------------------------------------------------------
388 // Primary vertex processing
389 //
390 sc = this->processPrimaryVertices(); // fetch the 1st primary reconstructed vertex
391
392 if( sc.isFailure() or !m_thePV ) {
393
394 ATH_MSG_DEBUG("processPrimaryVertices() failed");
395 vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
397 return StatusCode::SUCCESS;
398 }
399
400 // Perform track selection and store it to selectedBaseTracks
401 for( auto alg : m_trackSelectionAlgs ) {
402 ATH_CHECK( (this->*alg)(ctx) );
403 }
404
405 if( m_FillNtuple )
406 m_ntupleVars->get<unsigned int>( "NumSelTrks" ) = static_cast<int>( m_selectedTracks.size() );
407
408 // fill information about selected tracks in AANT
410
411 //-------------------------------------------------------
412 // Skip the event if the number of selected tracks is more than m_SelTrkMaxCutoff
413 if( m_selectedTracks.size() < 2 ) {
414 ATH_MSG_DEBUG( "execute: Too few (<2) selected reco tracks. Terminated reconstruction." );
416 vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
417 ATH_CHECK( lockTrackDecorations( true, ctx ) );
419 return StatusCode::SUCCESS;
420 }
421
422 if( m_selectedTracks.size() > m_SelTrkMaxCutoff ) {
423 ATH_MSG_INFO( "execute: Too many selected reco tracks. Terminated reconstruction." );
425 vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
426 ATH_CHECK( lockTrackDecorations( true, ctx ) );
428 return StatusCode::SUCCESS;
429 }
430
431 //-------------------------------------------------------
432 // Core part of Vertexing
433 //
434
435 {
436
438
439 // set of vertices created in the following while loop.
440 std::vector<WrkVrt> workVerticesContainer;
441
442 // the main sequence of the main vertexing algorithms
443 // see initialize() what kind of algorithms exist.
444 for( auto itr = m_vertexingAlgorithms.begin(); itr!=m_vertexingAlgorithms.end(); ++itr ) {
445
446 auto& name = itr->first;
447 auto alg = itr->second;
448
449 auto t_start = std::chrono::system_clock::now();
450
451 ATH_CHECK( (this->*alg)( ctx, &workVerticesContainer ) );
452
453 auto t_end = std::chrono::system_clock::now();
454
455 if( m_FillHist ) {
456 auto sec = std::chrono::duration_cast<std::chrono::microseconds>( t_end - t_start ).count();
457 m_hists["CPUTime"]->Fill( m_vertexingAlgorithmStep, sec/1.e6 );
458 }
459
460 std::erase_if( workVerticesContainer,
461 []( WrkVrt& wrkvrt ) {
462 return ( !wrkvrt.isGood || wrkvrt.nTracksTotal() < 2 ); }
463 );
464
465 ATH_CHECK( monitorVertexingAlgorithmStep( ctx, &workVerticesContainer, name, std::next( itr ) == m_vertexingAlgorithms.end() ) );
466
468
469 }
470 }
471
473 vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
474
475 // Fill AANT
476 if( m_FillNtuple ) {
477 m_tree_Vert->Fill();
479 }
480
481 ATH_CHECK( lockTrackDecorations( false, ctx ) );
482
483 ATH_MSG_VERBOSE( "execute: process done." );
484 // end
486 return StatusCode::SUCCESS;
487
488 }
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
void lockTrackDecorations(const xAOD::TrackParticle *trk, bool onlySelection) const
lock decorations at the end of the algorithm
Gaudi::Property< unsigned int > m_SelTrkMaxCutoff
Gaudi::Property< std::string > m_all2trksVerticesContainerName
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Read/Write Handle Keys.
StatusCode defineDummyCollections(const EventContext &ctx)
std::vector< std::pair< std::string, vertexingAlg > > m_vertexingAlgorithms
SG::WriteDecorHandleKey< xAOD::EventInfo > m_vertexingStatusKey
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
std::vector< TrackSelectionAlg > m_trackSelectionAlgs
std::size_t erase_if(T_container &container, T_Func pred)

◆ extractIncompatibleTrackPairs()

StatusCode VKalVrtAthena::VrtSecInclusive::extractIncompatibleTrackPairs ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

related to the graph method and verte finding

Definition at line 38 of file VertexingAlgs.cxx.

40 {
41
42 // Output SVs as xAOD::Vertex
43 // Needs a conversion function from WrkVrtSet to xAOD::Vertex here.
44 // The supposed form of the function will be as follows:
45
46 SG::WriteHandle<xAOD::VertexContainer> trackHandle;
47 xAOD::VertexContainer *twoTrksVertexContainer{};
49 trackHandle = SG::makeHandle( m_twoTrksVertexKey, ctx );
50 ATH_CHECK( trackHandle.record(std::make_unique<xAOD::VertexContainer>(),
51 std::make_unique<xAOD::VertexAuxContainer>()) );
52 twoTrksVertexContainer = trackHandle.ptr();
54 }
55
56 m_incomp.clear();
57
58 // Work variables
59 std::vector<const xAOD::TrackParticle*> baseTracks;
60 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
61
62 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Selected Tracks = "<< m_selectedTracks.size());
63 if( m_FillHist ) { m_hists["selTracksDist"]->Fill( m_selectedTracks.size() ); }
64
65 std::string msg;
66
67 enum recoStep { kStart, kInitVtxPosition, kImpactParamCheck, kVKalVrtFit, kChi2, kVposCut, kPatternMatch };
68
69 const double maxR { 563. }; // r = 563 mm is the TRT inner surface
70 double roughD0Cut = 100.;
71 double roughZ0Cut = 50.;
73 roughD0Cut = 1000.;
74 roughZ0Cut = 1000.;
75 }
76
77 // Truth match map
78 std::map<const xAOD::TruthVertex*, bool> matchMap;
79 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
80 // first make all 2-track vertices
81 for( auto itrk = m_selectedTracks.begin(); itrk != m_selectedTracks.end(); ++itrk ) {
82 for( auto jtrk = std::next(itrk); jtrk != m_selectedTracks.end(); ++jtrk ) {
83
84 // avoid both tracks are too close to the beam line
85
86 const int itrk_id = itrk - m_selectedTracks.begin();
87 const int jtrk_id = jtrk - m_selectedTracks.begin();
88
89 WrkVrt wrkvrt;
90 wrkvrt.selectedTrackIndices.emplace_back( itrk_id );
91 wrkvrt.selectedTrackIndices.emplace_back( jtrk_id );
92
93 // Attempt to think the combination is incompatible by default
94 m_incomp.emplace_back( itrk_id, jtrk_id );
95
97
98 const auto* cont_i = dynamic_cast<const xAOD::TrackParticleContainer*>( (*itrk)->container() );
99 const auto* cont_j = dynamic_cast<const xAOD::TrackParticleContainer*>( (*jtrk)->container() );
100
101 if ( !cont_i || !cont_j ) {
102 ATH_MSG_DEBUG(" one of the track containers is null");
103 continue;
104 }
105
106 ElementLink<xAOD::TrackParticleContainer> link_i, link_j;
107 link_i.toIndexedElement( *cont_i, (*itrk)->index() );
108 link_j.toIndexedElement( *cont_j, (*jtrk)->index() );
109
110 if (!link_i.isValid() || !link_j.isValid()) {
111 ATH_MSG_DEBUG(" link itrk (" << (*itrk)->index() << ") or jtrk (" << (*jtrk)->index() << ") is not valid");
112 }
113 else {
114 if( link_i.dataID() == link_j.dataID() ) {
115 continue;
116 }
117 }
118 }
119
120
121 if( std::abs( (*itrk)->d0() ) < m_twoTrkVtxFormingD0Cut && std::abs( (*jtrk)->d0() ) < m_twoTrkVtxFormingD0Cut ) continue;
122
123 baseTracks.clear();
124 baseTracks.emplace_back( *itrk );
125 baseTracks.emplace_back( *jtrk );
126
127 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kStart );
128
129 // new code to find initial approximate vertex
130 Amg::Vector3D initVertex;
131
132 StatusCode sc = m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );/* Fast crude estimation */
133 if( sc.isFailure() ) {
134 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation fails ");
135 continue;
136 }
137
138 if( initVertex.perp() > maxR ) {
139 continue;
140 }
141 if( m_doDisappearingTrackVertexing && initVertex.perp() <m_twoTrVrtMinRadius){
142 continue;
143 }
144 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kInitVtxPosition );
145
146 std::vector<double> impactParameters;
147 std::vector<double> impactParErrors;
148
149 if( !getSVImpactParameters( ctx, *itrk, initVertex, impactParameters, impactParErrors) ) continue;
150 const auto roughD0_itrk = impactParameters.at(TrkParameter::k_d0);
151 const auto roughZ0_itrk = impactParameters.at(TrkParameter::k_z0);
152 if( fabs( impactParameters.at(0)) > roughD0Cut || fabs( impactParameters.at(1) ) > roughZ0Cut ) {
153 continue;
154 }
155
156 if( !getSVImpactParameters( ctx, *jtrk, initVertex, impactParameters, impactParErrors) ) continue;
157 const auto roughD0_jtrk = impactParameters.at(TrkParameter::k_d0);
158 const auto roughZ0_jtrk = impactParameters.at(TrkParameter::k_z0);
159 if( fabs( impactParameters.at(0) ) > roughD0Cut || fabs( impactParameters.at(1) ) > roughZ0Cut ) {
160 continue;
161 }
162 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kImpactParamCheck );
163
164 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
165
166
167
168 // Vertex VKal Fitting
169 sc = m_fitSvc->VKalVrtFit( baseTracks,
170 dummyNeutrals,
171 wrkvrt.vertex, wrkvrt.vertexMom, wrkvrt.Charge,
172 wrkvrt.vertexCov, wrkvrt.Chi2PerTrk,
173 wrkvrt.TrkAtVrt, wrkvrt.Chi2, *state );
174
175 if( sc.isFailure() ) {
176 continue; /* No fit */
177 }
178 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kVKalVrtFit );
179
180 // Compatibility to the primary vertex.
181 Amg::Vector3D vDist = wrkvrt.vertex - m_thePV->position();
182 const double vPos = ( vDist.x()*wrkvrt.vertexMom.Px()+vDist.y()*wrkvrt.vertexMom.Py()+vDist.z()*wrkvrt.vertexMom.Pz() )/wrkvrt.vertexMom.Rho();
183 const double vPosMomAngT = ( vDist.x()*wrkvrt.vertexMom.Px()+vDist.y()*wrkvrt.vertexMom.Py() ) / vDist.perp() / wrkvrt.vertexMom.Pt();
184 const double vPosMomAng3D = ( vDist.x()*wrkvrt.vertexMom.Px()+vDist.y()*wrkvrt.vertexMom.Py()+vDist.z()*wrkvrt.vertexMom.Pz() ) / (vDist.norm() * wrkvrt.vertexMom.Rho());
185
186 double dphi1 = TVector2::Phi_mpi_pi(vDist.phi() - (*itrk)->phi());
187 double dphi2 = TVector2::Phi_mpi_pi(vDist.phi() - (*jtrk)->phi());
188
189 const double dist_fromPV = vDist.norm();
190 if( m_FillHist ) m_hists["2trkVtxDistFromPV"]->Fill( dist_fromPV );
191
192 if( m_FillNtuple ) {
193 // Fill the 2-track vertex properties to AANT
194 m_ntupleVars->get<unsigned int>( "All2TrkVrtNum" )++;
195 m_ntupleVars->get< std::vector<double> >( "All2TrkVrtMass" ) .emplace_back(wrkvrt.vertexMom.M());
196 m_ntupleVars->get< std::vector<double> >( "All2TrkVrtPt" ) .emplace_back(wrkvrt.vertexMom.Perp());
197 m_ntupleVars->get< std::vector<int> > ( "All2TrkVrtCharge" ) .emplace_back(wrkvrt.Charge);
198 m_ntupleVars->get< std::vector<double> >( "All2TrkVrtX" ) .emplace_back(wrkvrt.vertex.x());
199 m_ntupleVars->get< std::vector<double> >( "All2TrkVrtY" ) .emplace_back(wrkvrt.vertex.y());
200 m_ntupleVars->get< std::vector<double> >( "All2TrkVrtZ" ) .emplace_back(wrkvrt.vertex.z());
201 m_ntupleVars->get< std::vector<double> >( "All2TrkVrtChiSq" ) .emplace_back(wrkvrt.Chi2);
202 }
203
204
205 // Create a xAOD::Vertex instance
207
209 vertex = new xAOD::Vertex;
210 twoTrksVertexContainer->emplace_back( vertex );
211
212 for( const auto *trk: baseTracks ) {
213
214 // Acquire link to the track
215 ElementLink<xAOD::TrackParticleContainer> trackElementLink( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), trk->index() );
216
217 // Register link to the vertex
218 vertex->addTrackAtVertex( trackElementLink, 1. );
219 }
220
221 vertex->setVertexType( xAOD::VxType::SecVtx );
222 vertex->setPosition( wrkvrt.vertex );
223 vertex->setFitQuality( wrkvrt.Chi2, 1 ); // Ndof is always 1
224
225 static const SG::Accessor<float> massAcc("mass");
226 static const SG::Accessor<float> pTAcc("pT");
227 static const SG::Accessor<float> chargeAcc("charge");
228 static const SG::Accessor<float> vPosAcc("vPos");
229 static const SG::Accessor<bool> isFakeAcc("isFake");
230 massAcc(*vertex) = wrkvrt.vertexMom.M();
231 pTAcc(*vertex) = wrkvrt.vertexMom.Perp();
232 chargeAcc(*vertex) = wrkvrt.Charge;
233 vPosAcc(*vertex) = vPos;
234 isFakeAcc(*vertex) = true;
235 }
236
237
239
240 uint8_t trkiBLHit,trkjBLHit;
241 if( !((*itrk)->summaryValue( trkiBLHit,xAOD::numberOfInnermostPixelLayerHits))) trkiBLHit=0;
242 if( !((*jtrk)->summaryValue( trkjBLHit,xAOD::numberOfInnermostPixelLayerHits))) trkjBLHit=0;
243
244 if( m_FillNtuple ) m_ntupleVars->get< std::vector<int> >( "All2TrkSumBLHits" ).emplace_back( trkiBLHit + trkjBLHit );
245
246 // track chi2 cut
247 if( m_FillHist ) m_hists["2trkChi2Dist"]->Fill( log10( wrkvrt.Chi2 ) );
248
249 if( wrkvrt.fitQuality() > m_SelVrtChi2Cut) {
250 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": failed to pass chi2 threshold." );
251 continue; /* Bad Chi2 */
252 }
253 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kChi2 );
254
255
256 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": attempting form vertex from ( " << itrk_id << ", " << jtrk_id << " )." );
257 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": candidate vertex: "
258 << " isGood = " << (wrkvrt.isGood? "true" : "false")
259 << ", #ntrks = " << wrkvrt.nTracksTotal()
260 << ", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
261 << ", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
262 << ", chi2/ndof = " << wrkvrt.fitQuality()
263 << ", (r, z) = (" << wrkvrt.vertex.perp()
264 <<", " << wrkvrt.vertex.z() << ")" );
265
266 for( const auto* truthVertex : m_tracingTruthVertices ) {
267 Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
268 Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
269
270 const auto distance = vReco - vTruth;
271
272 AmgSymMatrix(3) cov;
273 cov.fillSymmetric( 0, 0, wrkvrt.vertexCov.at(0) );
274 cov.fillSymmetric( 1, 0, wrkvrt.vertexCov.at(1) );
275 cov.fillSymmetric( 1, 1, wrkvrt.vertexCov.at(2) );
276 cov.fillSymmetric( 2, 0, wrkvrt.vertexCov.at(3) );
277 cov.fillSymmetric( 2, 1, wrkvrt.vertexCov.at(4) );
278 cov.fillSymmetric( 2, 2, wrkvrt.vertexCov.at(5) );
279
280 const double s2 = distance.transpose() * cov.inverse() * distance;
281
282 if( distance.norm() < 2.0 || s2 < 100. ) {
283 ATH_MSG_DEBUG ( " > " << __FUNCTION__ << ": truth-matched candidate! : signif^2 = " << s2 );
284 matchMap.emplace( truthVertex, true );
285 }
286 }
287
288 if( m_FillHist ) {
289 static_cast<TH2F*>( m_hists["vPosDist"] )->Fill( wrkvrt.vertex.perp(), vPos );
290 static_cast<TH2F*>( m_hists["vPosMomAngTDist"] )->Fill( wrkvrt.vertex.perp(), vPosMomAngT );
291 m_hists["vPosMomAngT"] ->Fill( vPosMomAngT );
292 m_hists["vPosMomAng3D"] ->Fill( vPosMomAng3D );
293 }
294
295 if( m_doTwoTrSoftBtag ){
296 if(dist_fromPV < m_twoTrVrtMinDistFromPV ){
297 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the 2tr vertex min distance from PV cut." );
298 continue;
299 }
300
301 if( vPosMomAng3D < m_twoTrVrtAngleCut ){
302 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vertex angle cut." );
303 continue;
304 }
305 }
306
308 if( cos( dphi1 ) < -0.8 && cos( dphi2 ) < -0.8 ) {
309 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vPos cut. (both tracks are opposite against the vertex pos)" );
310 continue;
311 }
312 if (m_doTightPVcompatibilityCut && (cos( dphi1 ) < -0.8 || cos( dphi2 ) < -0.8)){
313 ATH_MSG_DEBUG(" > "<< __FUNCTION__ << ": failed to pass the tightened vPos cut. (at least one track is opposite against the vertex pos)" );
314 continue;
315 }
316 if( vPosMomAngT < -0.8 ) {
317 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vPos cut. (pos-mom directions are opposite)" );
318 continue;
319 }
320 if( vPos < m_pvCompatibilityCut ) {
321 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vPos cut." );
322 continue;
323 }
324 }
325 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kVposCut );
326
327 // fake rejection cuts with track hit pattern consistencies
329 if( !this->passedFakeReject( wrkvrt.vertex, (*itrk), (*jtrk) ) ) {
330
331 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass fake rejection algorithm." );
332 continue;
333 }
334 }
335 if( m_FillHist ) m_hists["incompMonitor"]->Fill( kPatternMatch );
336
337 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": passed fake rejection." );
338
339 if( m_FillNtuple ) {
340 // Fill AANT for vertices after fake rejection
341 m_ntupleVars->get< unsigned int >( "AfFakVrtNum" )++;
342 m_ntupleVars->get< std::vector<double> >( "AfFakVrtMass" ) .emplace_back(wrkvrt.vertexMom.M());
343 m_ntupleVars->get< std::vector<double> >( "AfFakVrtPt" ) .emplace_back(wrkvrt.vertexMom.Perp());
344 m_ntupleVars->get< std::vector<int> > ( "AfFakVrtCharge" ) .emplace_back(wrkvrt.Charge);
345 m_ntupleVars->get< std::vector<double> >( "AfFakVrtX" ) .emplace_back(wrkvrt.vertex.x());
346 m_ntupleVars->get< std::vector<double> >( "AfFakVrtY" ) .emplace_back(wrkvrt.vertex.y());
347 m_ntupleVars->get< std::vector<double> >( "AfFakVrtZ" ) .emplace_back(wrkvrt.vertex.z());
348 m_ntupleVars->get< std::vector<double> >( "AfFakVrtChiSq" ) .emplace_back(wrkvrt.Chi2);
349 }
350
351 // The vertex passed the quality cut: overwrite isFake to false
352 if( m_FillIntermediateVertices && vertex ) {
353 static const SG::Accessor<bool> isFakeAcc("isFake");
354 isFakeAcc(*vertex) = false;
355 }
356
357
358 // Now this vertex passed all criteria and considred to be a compatible vertices.
359 // Therefore the track pair is removed from the incompatibility list.
360 m_incomp.pop_back();
361
362 wrkvrt.isGood = true;
363
364 workVerticesContainer->emplace_back( wrkvrt );
365
366 msg += Form(" (%d, %d), ", itrk_id, jtrk_id );
367
368 if( m_FillHist ) {
369 m_hists["initVertexDispD0"]->Fill( roughD0_itrk, initVertex.perp() );
370 m_hists["initVertexDispD0"]->Fill( roughD0_jtrk, initVertex.perp() );
371 m_hists["initVertexDispZ0"]->Fill( roughZ0_itrk, initVertex.z() );
372 m_hists["initVertexDispZ0"]->Fill( roughZ0_jtrk, initVertex.z() );
373 }
374
375 }
376 }
377
378
379 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": compatible track pairs = " << msg );
380
381 if( m_FillNtuple ) m_ntupleVars->get<unsigned int>( "SizeIncomp" ) = m_incomp.size();
382
383 if( m_FillHist ) {
384 for( auto& pair: matchMap ) {
385 if( pair.second ) m_hists["nMatchedTruths"]->Fill( 1, pair.first->perp() );
386 }
387 }
388
389 return StatusCode::SUCCESS;
390 }
void fillSymmetric(size_t i, size_t j, Scalar value)
method to fill elements for a symmetric matrix
#define AmgSymMatrix(dim)
if(pathvar)
value_type emplace_back(value_type pElem)
Add an element to the end of the collection.
pointer_type ptr()
Dereference the pointer.
Gaudi::Property< double > m_pvCompatibilityCut
Gaudi::Property< double > m_SelVrtChi2Cut
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< bool > m_doTightPVcompatibilityCut
Gaudi::Property< bool > m_doPVcompatibilityCut
Gaudi::Property< double > m_twoTrVrtMinDistFromPV
Gaudi::Property< double > m_twoTrVrtMinRadius
Gaudi::Property< double > m_twoTrkVtxFormingD0Cut
Gaudi::Property< bool > m_doTwoTrSoftBtag
Gaudi::Property< bool > m_removeFakeVrtLate
Gaudi::Property< bool > m_removeFakeVrt
Gaudi::Property< bool > m_doDisappearingTrackVertexing
std::vector< std::pair< int, int > > m_incomp
Gaudi::Property< double > m_twoTrVrtAngleCut
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
@ SecVtx
Secondary vertex.
Vertex_v1 Vertex
Define the latest version of the vertex class.
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ extrapolatedPattern()

VrtSecInclusive::ExtrapolatedPattern * VKalVrtAthena::VrtSecInclusive::extrapolatedPattern ( const xAOD::TrackParticle * trk,
enum Trk::PropDirection direction )
private

Definition at line 971 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

971 {
972
973 auto* pattern = new ExtrapolatedPattern;
974 const EventContext& ctx = Gaudi::Hive::currentContext();
975 std::vector<std::unique_ptr<Trk::TrackParameters>> paramsVector =
976 m_extrapolator->extrapolateBlindly(ctx, trk->perigeeParameters(), direction);
977
979
980 auto nDisabled = 0;
981
982 for( auto& params : paramsVector ) {
983
984 const TVector3 position( params->position().x(), params->position().y(), params->position().z() );
985
986 if( prevPos == position ) {
987 continue;
988 }
989
990 prevPos = position;
991
992 const auto* detElement = params->associatedSurface().associatedDetectorElement();
993
994 if( detElement ) {
995
996 enum { Pixel = 1, SCT = 2 };
997
998 const auto& id = detElement->identify();
999 Flag good = false;
1000
1001 if( m_atlasId->is_pixel(id) ) {
1002
1003 auto idHash = m_pixelId->wafer_hash( id );
1004 good = m_pixelCondSummaryTool->isGood( idHash, ctx );
1005
1006 pattern->emplace_back( std::make_tuple( position, Pixel, m_pixelId->barrel_ec(id), m_pixelId->layer_disk(id), good ) );
1007
1008 } else if( m_atlasId->is_sct(id) ) {
1009
1010 auto idHash = m_sctId->wafer_hash( id );
1011 good = m_sctCondSummaryTool->isGood( idHash, ctx );
1012
1013 pattern->emplace_back( std::make_tuple( position, SCT, m_sctId->barrel_ec(id), m_sctId->layer_disk(id), good ) );
1014
1015 }
1016
1017 if( !pattern->empty() ) {
1018
1019 ATH_MSG_VERBOSE(" >> " << __FUNCTION__ << ", track " << trk << ": position = (" << position.Perp() << ", " << position.z() << ", " << position.Phi() << "), detElement ID = " << id << ", good = " << good
1020 << ": (det, bec, layer) = (" << std::get<1>( pattern->back() ) << ", " << std::get<2>( pattern->back() ) << ", " << std::get<3>( pattern->back() ) << ")" );
1021
1022 if( !good ) nDisabled++;
1023 }
1024
1025 }
1026
1027 }
1028
1029 if( m_FillHist ) {
1030 m_hists["disabledCount"]->Fill( nDisabled );
1031 }
1032
1033 return pattern;
1034
1035 }
@ SCT
Definition RegSelEnums.h:25
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Condition service.
ToolHandle< IInDetConditionsTool > m_sctCondSummaryTool
const AtlasDetectorID * m_atlasId
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
std::vector< ExtrapolatedPoint > ExtrapolatedPattern
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
@ Pixel
Definition DetType.h:13

◆ fillAANT_SecondaryVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::fillAANT_SecondaryVertices ( xAOD::VertexContainer * vertices)
private

Definition at line 351 of file AANT_Tools.cxx.

351 {
352 //initialise accessors out of loop
353 static const SG::ConstAccessor<float> pt_wrtSVAcc("pt_wrtSV");
354 static const SG::ConstAccessor<float> eta_wrtSVAcc("eta_wrtSV");
355 static const SG::ConstAccessor<float> phi_wrtSVAcc("phi_wrtSV");
356 static const SG::ConstAccessor<float> d0_wrtSVAcc("d0_wrtSV");
357 static const SG::ConstAccessor<float> z0_wrtSVAcc("z0_wrtSV");
358 static const SG::ConstAccessor<float> errP_wrtSVAcc("errP_wrtSV");
359 static const SG::ConstAccessor<float> errd0_wrtSVAcc("errd0_wrtSV");
360 static const SG::ConstAccessor<float> errz0_wrtSVAcc("errz0_wrtSV");
361 // Loop over vertices
362 for( xAOD::Vertex *vertex : *vertices ) {
363
364 // Track Loop
365 for(size_t itrk=0; itrk<vertex->nTrackParticles(); itrk++) {
366
367 // Here trk is not const - will augment SV perigee variables in the loop.
368 const xAOD::TrackParticle* trk = vertex->trackParticle( itrk );
369
370 //
371 // add variables for each track into ntuple
372 // Add all vertices to same ntuple, and extract later in root macro
373 //
374 m_ntupleVars->get< vector<double> >( "SecVtx_TrkPt" ) .emplace_back( trk->pt() );
375 m_ntupleVars->get< vector<double> >( "SecVtx_TrkPhi" ) .emplace_back( trk->phi() );
376 m_ntupleVars->get< vector<double> >( "SecVtx_TrkEta" ) .emplace_back( trk->eta() );
377 m_ntupleVars->get< vector<double> >( "SecVtx_Trk2dIP" ) .emplace_back( trk->d0() );
378 m_ntupleVars->get< vector<double> >( "SecVtx_TrkZIP" ) .emplace_back( trk->z0() );
379 m_ntupleVars->get< vector<double> >( "SecVtx_Trkdel2dIP" ) .emplace_back( trk->definingParametersCovMatrix()(Trk::d0, Trk::d0) );
380 m_ntupleVars->get< vector<double> >( "SecVtx_TrkdelZIP" ) .emplace_back( trk->definingParametersCovMatrix()(Trk::z0, Trk::z0) );
381
382 track_summary trk_summary;
383 fillTrackSummary( trk_summary, trk );
384
385 m_ntupleVars->get< vector<int> >( "SecVtx_TrkBLay" ) .emplace_back( trk_summary.numIBLHits );
386 m_ntupleVars->get< vector<int> >( "SecVtx_TrkPixExclBLay" ) .emplace_back( trk_summary.numPixelHits - trk_summary.numIBLHits );
387 m_ntupleVars->get< vector<int> >( "SecVtx_TrkSCT" ) .emplace_back( trk_summary.numSctHits );
388
389
390 ATH_MSG_VERBOSE(" >> fillAANT_SecondaryVertices : filling track vars wrt. SV");
391 if( pt_wrtSVAcc.isAvailable(*trk) &&
392 eta_wrtSVAcc.isAvailable(*trk) &&
393 phi_wrtSVAcc.isAvailable(*trk) &&
394 d0_wrtSVAcc.isAvailable(*trk) &&
395 z0_wrtSVAcc.isAvailable(*trk) &&
396 errP_wrtSVAcc.isAvailable(*trk) &&
397 errd0_wrtSVAcc.isAvailable(*trk) &&
398 errz0_wrtSVAcc.isAvailable(*trk) ) {
399
400 m_ntupleVars->get< vector<double> >( "SecVtx_TrkPtWrtSV" ) .emplace_back( pt_wrtSVAcc(*trk) );
401 m_ntupleVars->get< vector<double> >( "SecVtx_TrkEtaWrtSV" ) .emplace_back( eta_wrtSVAcc(*trk) );
402 m_ntupleVars->get< vector<double> >( "SecVtx_TrkPhiWrtSV" ) .emplace_back( phi_wrtSVAcc(*trk) );
403 m_ntupleVars->get< vector<double> >( "SecVtx_Trk2dIPWrtSV" ) .emplace_back( d0_wrtSVAcc(*trk) );
404 m_ntupleVars->get< vector<double> >( "SecVtx_TrkZIPWrtSV" ) .emplace_back( z0_wrtSVAcc(*trk) );
405 m_ntupleVars->get< vector<double> >( "SecVtx_TrkdelPWrtSV" ) .emplace_back( errP_wrtSVAcc(*trk) );
406 m_ntupleVars->get< vector<double> >( "SecVtx_Trkdel2dIPWrtSV" ) .emplace_back( errd0_wrtSVAcc(*trk) );
407 m_ntupleVars->get< vector<double> >( "SecVtx_TrkdelZIPWrtSV" ) .emplace_back( errz0_wrtSVAcc(*trk) );
408
409 } else {
410
411 ATH_MSG_VERBOSE(" >> fillAANT_SecondaryVertices : filling track vars wrt. SV (invalid values)");
412
413 m_ntupleVars->get< vector<double> >( "SecVtx_TrkPtWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
414 m_ntupleVars->get< vector<double> >( "SecVtx_TrkEtaWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
415 m_ntupleVars->get< vector<double> >( "SecVtx_TrkPhiWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
416 m_ntupleVars->get< vector<double> >( "SecVtx_Trk2dIPWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
417 m_ntupleVars->get< vector<double> >( "SecVtx_TrkZIPWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
418 m_ntupleVars->get< vector<double> >( "SecVtx_TrkdelPWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
419 m_ntupleVars->get< vector<double> >( "SecVtx_Trkdel2dIPWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
420 m_ntupleVars->get< vector<double> >( "SecVtx_TrkdelZIPWrtSV" ) .emplace_back( AlgConsts::invalidFloat );
421
422 }
423
424 } // loop over tracks in vertex
425
426 ATH_MSG_DEBUG(" >> fillAANT_SecondaryVertices : Track loop end. ");
427
428 ATH_MSG_VERBOSE(" >> fillAANT_SecondaryVertices : filling vertex vars");
429
430 static const SG::ConstAccessor<float> massAcc("mass");
431 static const SG::ConstAccessor<float> mass_eAcc("mass_e");
432 static const SG::ConstAccessor<float> pTAcc("pT");
433 static const SG::ConstAccessor<float> pzAcc("pz");
434 static const SG::ConstAccessor<float> vtx_chargeAcc("vtx_charge");
435 static const SG::ConstAccessor<float> sumBLayHitsAcc("sumBLayHits");
436 static const SG::ConstAccessor<float> allTrksBLayHitsAcc("allTrksBLayHits");
437 static const SG::ConstAccessor<float> minOpAngAcc("minOpAng");
438
439 m_ntupleVars->get< vector<int> >( "SecVtx_NumTrks" ) .emplace_back( vertex->nTrackParticles() );
440 m_ntupleVars->get< vector<double> >( "SecVtx_Chi2" ) .emplace_back( vertex->chiSquared() );
441 m_ntupleVars->get< vector<double> >( "SecVtxX" ) .emplace_back( vertex->x() );
442 m_ntupleVars->get< vector<double> >( "SecVtxY" ) .emplace_back( vertex->y() );
443 m_ntupleVars->get< vector<double> >( "SecVtxZ" ) .emplace_back( vertex->z() );
444 m_ntupleVars->get< vector<double> >( "SecVtx_Mass" ) .emplace_back( massAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
445 m_ntupleVars->get< vector<double> >( "SecVtx_Mass_electron" ) .emplace_back( mass_eAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
446 m_ntupleVars->get< vector<double> >( "SecVtx_pT" ) .emplace_back( pTAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
447 m_ntupleVars->get< vector<double> >( "SecVtx_pZ" ) .emplace_back( pzAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
448 m_ntupleVars->get< vector<int> >( "SecVtx_Charge" ) .emplace_back( vtx_chargeAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
449 m_ntupleVars->get< vector<int> >( "SecVtx_SumBLayHits" ) .emplace_back( sumBLayHitsAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
450 m_ntupleVars->get< vector<int> >( "SecVtx_AllTrksBLayHits" ) .emplace_back( allTrksBLayHitsAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
451 m_ntupleVars->get< vector<double> >( "SecVtx_MinOpAng" ) .emplace_back( minOpAngAcc.withDefault(*vertex, AlgConsts::invalidFloat) );
452
453
454 } // loop over vertices
455
456 return StatusCode::SUCCESS;
457 }
static void fillTrackSummary(track_summary &summary, const xAOD::TrackParticle *trk)
retrieve the track hit information
struct VKalVrtAthena::VrtSecInclusive::track_summary_properties track_summary
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64

◆ fillAANT_SelectedBaseTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::fillAANT_SelectedBaseTracks ( )
private

Definition at line 263 of file AANT_Tools.cxx.

263 {
264
265 for ( const xAOD::TrackParticle* trk : m_selectedTracks ) {
266
267 if( m_FillNtuple ) {
268 uint8_t tmpT;
269 if( !(trk->summaryValue(tmpT,xAOD::numberOfPixelHits)) ) tmpT=0;
270 m_ntupleVars->get< vector<int> >( "SVTrk_PixHits" ).emplace_back( (int) tmpT);
271
272 if( !(trk->summaryValue(tmpT,xAOD::numberOfSCTHits)) ) tmpT=0;
273 m_ntupleVars->get< vector<int> >( "SVTrk_SCTHits" ).emplace_back( (int) tmpT);
274
275 if( !(trk->summaryValue(tmpT,xAOD::numberOfTRTHits)) ) tmpT=0;
276 m_ntupleVars->get< vector<int> >( "SVTrk_TRTHits" ).emplace_back( (int) tmpT);
277
278 if( !(trk->summaryValue(tmpT,xAOD::numberOfInnermostPixelLayerHits)) ) tmpT=0;
279 m_ntupleVars->get< vector<int> >( "SVTrk_BLayHits" ).emplace_back( (int) tmpT);
280 }
281
282
283 //
284 // get perigee params
285 //
286 const auto& perigee = trk->perigeeParameters();
287
288 if( m_FillNtuple ) {
289
290 double phi = perigee.parameters()[Trk::phi];
291 double theta = perigee.parameters()[Trk::theta];
292 double d0 = perigee.parameters()[Trk::d0];
293 double qOverP = perigee.parameters()[Trk::qOverP];
294 double errqOverP = (*(perigee.covariance()))(Trk::qOverP,Trk::qOverP);
295 double errd0 = (*(perigee.covariance()))(Trk::d0,Trk::d0);
296 double ptrk = (1./qOverP);
297 double pT = ptrk*sin(theta);
298 double trketa = -1.*log( tan(theta/2) );
299
300 // here we have to look at the original recotrack id to establish cross-link
301 // between "SVTrk" vars and "RecoTrk" vars:
302 static const SG::ConstAccessor<unsigned long> trk_idAcc("trk_id");
303 m_ntupleVars->get< vector<int> >( "SVTrk_id" ) .emplace_back( trk_idAcc(*trk) );
304
305 m_ntupleVars->get< vector<double> >( "SVTrk_pT" ) .emplace_back(pT);
306 m_ntupleVars->get< vector<double> >( "SVTrk_p" ) .emplace_back(ptrk);
307 m_ntupleVars->get< vector<double> >( "SVTrk_phi" ) .emplace_back(phi);
308 m_ntupleVars->get< vector<double> >( "SVTrk_eta" ) .emplace_back(trketa);
309 m_ntupleVars->get< vector<double> >( "SVTrk_2dIP" ) .emplace_back(d0);
310 m_ntupleVars->get< vector<double> >( "SVTrk_ZIP" ) .emplace_back(perigee.parameters()[Trk::z0]);
311
312 double matchProb = -1;
314 if(m_doTruth)
315 {
316 const xAOD::TruthParticle* aTemp_truth = getTrkGenParticle( trk );
317 if( aTemp_truth )
318 {
319 uniqueID = HepMC::uniqueID(aTemp_truth);
320 static const SG::ConstAccessor<float> truthMatchProbabilityAcc( "truthMatchProbability" );
321 matchProb= truthMatchProbabilityAcc( *trk );
322 }
323 }
324
325 m_ntupleVars->get< vector<int> >( "SVTrk_barcode" ) .emplace_back( uniqueID );
326 m_ntupleVars->get< vector<double> >( "SVTrk_matchPr" ) .emplace_back( matchProb );
327
328 ATH_MSG_DEBUG(" > fillAANT_SelectedBaseTracks: Sel Trk d0/pT/eta/match bc/pr "
329 << d0 << ","
330 << pT << ","
331 << trketa << ","
332 << uniqueID << ","
333 << matchProb );
334
335 double errp = ptrk*ptrk*errqOverP;
336
337 m_ntupleVars->get< vector<double> >( "SVTrk_delp" ) .emplace_back( errp );
338 m_ntupleVars->get< vector<double> >( "SVTrk_del2dIP" ) .emplace_back( errd0 );
339 m_ntupleVars->get< vector<double> >( "SVTrk_delzIP" ) .emplace_back( (*(perigee.covariance()))(Trk::z0,Trk::z0) );
340
341 }
342
343
344 } // end of selected tracks
345
346 return StatusCode::SUCCESS;
347 }
static const xAOD::TruthParticle * getTrkGenParticle(const xAOD::TrackParticle *)
Definition TruthAlgs.cxx:25
Gaudi::Property< bool > m_doTruth
int uniqueID(const T &p)
constexpr int UNDEFINED_ID
@ qOverP
perigee
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ phi
Definition ParamDefs.h:75

◆ fillTrackSummary()

void VKalVrtAthena::VrtSecInclusive::fillTrackSummary ( track_summary & summary,
const xAOD::TrackParticle * trk )
staticprivate

retrieve the track hit information

Definition at line 954 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

954 {
955 summary.numIBLHits = 0;
956 summary.numBLayerHits = 0;
957 summary.numPixelHits = 0;
958 summary.numSctHits = 0;
959 summary.numTrtHits = 0;
960
963 trk->summaryValue( summary.numPixelHits, xAOD::numberOfPixelHits );
964 trk->summaryValue( summary.numSctHits, xAOD::numberOfSCTHits );
965 trk->summaryValue( summary.numTrtHits, xAOD::numberOfTRTHits );
966 }
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ findMinVerticesNextPair()

double VKalVrtAthena::VrtSecInclusive::findMinVerticesNextPair ( std::vector< WrkVrt > * workVerticesContainer,
std::pair< unsigned, unsigned > & indexPair )
staticprivate

returns the next pair of vertices that give next-to-minimum distance significance

Definition at line 413 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

414 {
415 //
416 // Give minimal distance between nonmodifed yet vertices
417 //
418
419 indexPair.first = 0;
420 indexPair.second = 0;
421
423
424 for(unsigned iv=0; iv<workVerticesContainer->size()-1; iv++) {
425 auto& vertex = workVerticesContainer->at(iv);
426
427 if( vertex.selectedTrackIndices.size() < 2) continue; /* Bad vertex */
428 if( vertex.closestWrkVrtIndex == 0 ) continue; /* Used vertex */
429
430 if( vertex.closestWrkVrtValue < minValue ) {
431
432 unsigned jv = vertex.closestWrkVrtIndex;
433
434 // Close vertex to given [iv] one is modified already
435 if( workVerticesContainer->at(jv).closestWrkVrtIndex == 0 ) continue;
436
437 minValue = vertex.closestWrkVrtValue;
438
439 indexPair.first = iv;
440 indexPair.second = jv;
441
442 }
443 }
444
445 return minValue;
446 }
#define minValue(current, test)

◆ findMinVerticesPair()

double VKalVrtAthena::VrtSecInclusive::findMinVerticesPair ( std::vector< WrkVrt > * workVerticesContainer,
std::pair< unsigned, unsigned > & indexPair,
const AlgForVerticesPair & algorithm )
private

returns the pair of vertices that give minimum in terms of some observable (e.g.

distance, significance)

Definition at line 373 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

374 {
375 //
376 // Minimal normalized vertex-vertex distance
377 //
378
379 for( auto& workVertex : *workVerticesContainer ) {
380 workVertex.closestWrkVrtValue = AlgConsts::maxValue;
381 workVertex.closestWrkVrtIndex = 0;
382 }
383
385
386 for( auto iv = workVerticesContainer->begin(); iv != workVerticesContainer->end(); ++iv ) {
387 if( (*iv).selectedTrackIndices.size()< 2) continue; /* Bad vertices */
388
389 auto i_index = iv - workVerticesContainer->begin();
390
391 for( auto jv = std::next(iv); jv != workVerticesContainer->end(); ++jv ) {
392 if( (*jv).selectedTrackIndices.size()< 2) continue; /* Bad vertices */
393
394 auto j_index = iv - workVerticesContainer->begin();
395
396 double value = (this->*algorithm)( (*iv), (*jv) );
397
398 if( value < minValue ){
399 minValue = value;
400 indexPair.first = i_index;
401 indexPair.second = j_index;
402 }
403 if( value < (*iv).closestWrkVrtValue ) {(*iv).closestWrkVrtValue = value; (*iv).closestWrkVrtIndex = j_index; }
404 if( value < (*jv).closestWrkVrtValue ) {(*jv).closestWrkVrtValue = value; (*jv).closestWrkVrtIndex = i_index; }
405 }
406 }
407
408 return minValue;
409 }
std::string algorithm
Definition hcg.cxx:87

◆ findNtrackVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::findNtrackVertices ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

Definition at line 394 of file VertexingAlgs.cxx.

396 {
397 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": begin");
399 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": skip");
400 return StatusCode::SUCCESS;
401 }
402
403
404 const auto compSize = m_selectedTracks.size()*(m_selectedTracks.size() - 1)/2 - m_incomp.size();
405 if( m_FillHist ) { m_hists["2trkVerticesDist"]->Fill( compSize ); }
406
407 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": compatible track pair size = " << compSize );
408 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": incompatible track pair size = " << m_incomp.size() );
409
410
411 if( not m_doFastMode ) {
412
413 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": incompatibility graph finder mode" );
414
415 // clear the container
416 workVerticesContainer->clear();
417
418 // Graph method: Trk::pgraphm_()
419 // used in order to find compatible sub-graphs from the incompatible graph
420
421 // List of edgeds between imcompatible nodes
422 // This weit is the data model of imcompatible graph used in Trk::pgraphm_().
423 std::vector<long int> weit;
424
425 for( auto& pair : m_incomp ) {
426 weit.emplace_back( pair.first + 1 ); /* +1 is needed for PGRAPH due to FORTRAN-style counting */
427 weit.emplace_back( pair.second + 1 ); /* +1 is needed for PGRAPH due to FORTRAN-style counting */
428 }
429
430 // Solution of the graph method routine (minimal covering of the graph)
431 // The size of the solution is returned by NPTR (see below)
432 std::vector<long int> solution( m_selectedTracks.size() );
433
434 // Number of edges in the list is the size of incompatibility track pairs.
435 long int nEdges = m_incomp.size();
436
437 // input number of nodes in the graph.
438 long int nTracks = static_cast<long int>( m_selectedTracks.size() );
439
440 // Input variable; the threshold. Solutions shorter than nth are not returned (ignored).
441 long int nth = 2; //VK some speed up
442
443 // NPTR: I/O variable (Destructive FORTRAN Style!!!)
444 // - on input: =0 for initialization, >0 to get next solution
445 // - on output: >0 : length of the solution stored in set; =0 : no more solutions can be found
446 long int solutionSize { 0 };
447
448 // This is just a unused strawman needed for m_fitSvc->VKalVrtFit()
449 std::vector<const xAOD::TrackParticle*> baseTracks;
450 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
451
452 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
453 auto pgraph = std::make_unique<Trk::PGraph>();
454 int iterationLimit(2000);
455 // Main iteration
456 while(true) {
457
458 // Find a solution from the given set of incompatible tracks (==weit)
459 pgraph->pgraphm_( weit.data(), nEdges, nTracks, solution.data(), &solutionSize, nth);
460
461 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": Trk::pgraphm_() output: solutionSize = " << solutionSize );
462 if (0 == iterationLimit--){
463 ATH_MSG_WARNING("Iteration limit (2000) reached in VrtSecInclusive::findNtrackVertices, solution size = "<<solutionSize);
464 break;
465 }
466 if(solutionSize <= 0) break; // No more solutions ==> Exit
467 if(solutionSize == 1) continue; // i.e. single node ==> Not a good solution
468
469 baseTracks.clear();
470
471 std::string msg = "solution = [ ";
472 for( int i=0; i< solutionSize; i++) {
473 msg += Form( "%ld, ", solution[i]-1 );
474 }
475 msg += " ]";
476 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
477
478 // varaible of new vertex
479 WrkVrt wrkvrt;
480
481 // Try to compose a new vertex using the solution nodes
482 // Here the track ID is labelled with array
483 wrkvrt.isGood = true;
484 wrkvrt.selectedTrackIndices.clear();
485
486 for(long int i = 0; i<solutionSize; i++) {
487 wrkvrt.selectedTrackIndices.emplace_back(solution[i]-1);
488 baseTracks.emplace_back( m_selectedTracks.at(solution[i]-1) );
489 }
490
491 // Perform vertex fitting
492 Amg::Vector3D initVertex;
493
494 StatusCode sc = m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );/* Fast crude estimation */
495 if(sc.isFailure()) ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation fails ");
496
497 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
498
499 sc = m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
500 wrkvrt.vertex,
501 wrkvrt.vertexMom,
502 wrkvrt.Charge,
503 wrkvrt.vertexCov,
504 wrkvrt.Chi2PerTrk,
505 wrkvrt.TrkAtVrt,
506 wrkvrt.Chi2,
507 *state);
508
509 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": FoundAppVrt=" << solutionSize << ", (r, z) = " << wrkvrt.vertex.perp() << ", " << wrkvrt.vertex.z() << ", chi2/ndof = " << wrkvrt.fitQuality() );
510
511 if( sc.isFailure() ) {
512
513 if( wrkvrt.selectedTrackIndices.size() <= 2 ) {
514 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": VKalVrtFit failed in 2-trk solution ==> give up.");
515 continue;
516 }
517
518 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": VKalVrtFit failed ==> retry...");
519
520 WrkVrt tmp;
521 tmp.isGood = false;
522
523 // Create 2-trk vertex combination and find any compatible vertex
524 for( auto& itrk: wrkvrt.selectedTrackIndices ) {
525 for( auto& jtrk: wrkvrt.selectedTrackIndices ) {
526 if( itrk == jtrk ) continue;
527 if( tmp.isGood ) continue;
528
529 tmp.selectedTrackIndices.clear();
530 tmp.selectedTrackIndices.emplace_back( itrk );
531 tmp.selectedTrackIndices.emplace_back( jtrk );
532
533 baseTracks.clear();
534 baseTracks.emplace_back( m_selectedTracks.at( itrk ) );
535 baseTracks.emplace_back( m_selectedTracks.at( jtrk ) );
536
537 // Perform vertex fitting
538 Amg::Vector3D initVertex;
539
540 sc = m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );
541 if( sc.isFailure() ) ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation fails ");
542
543 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
544
545 sc = m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
546 tmp.vertex,
547 tmp.vertexMom,
548 tmp.Charge,
549 tmp.vertexCov,
550 tmp.Chi2PerTrk,
551 tmp.TrkAtVrt,
552 tmp.Chi2,
553 *state);
554
555 if( sc.isFailure() ) continue;
556
557 tmp.isGood = true;
558
559 }
560 }
561
562 if( !tmp.isGood ) {
563 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Did not find any viable vertex in all 2-trk combinations. Give up.");
564 continue;
565 }
566
567 // Now, found at least one seed 2-track vertex. ==> attempt to attach other tracks
568 for( auto& itrk: wrkvrt.selectedTrackIndices ) {
569
570 if( std::find( tmp.selectedTrackIndices.begin(), tmp.selectedTrackIndices.end(), itrk ) != tmp.selectedTrackIndices.end() ) continue;
571
572 auto backup = tmp;
573
574 tmp.selectedTrackIndices.emplace_back( itrk );
575 baseTracks.clear();
576 for( auto& jtrk : tmp.selectedTrackIndices ) { baseTracks.emplace_back( m_selectedTracks.at(jtrk) ); }
577
578 // Perform vertex fitting
579 Amg::Vector3D initVertex;
580
581 sc = m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );/* Fast crude estimation */
582 if(sc.isFailure()) ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation fails ");
583
584 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
585
586 sc = m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
587 tmp.vertex,
588 tmp.vertexMom,
589 tmp.Charge,
590 tmp.vertexCov,
591 tmp.Chi2PerTrk,
592 tmp.TrkAtVrt,
593 tmp.Chi2,
594 *state);
595
596 if( sc.isFailure() ) {
597 tmp = std::move(backup);
598 continue;
599 }
600
601 }
602
603 wrkvrt = std::move(tmp);
604 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": VKalVrtFit succeeded; register the vertex to the list.");
605 wrkvrt.isGood = true;
606 wrkvrt.closestWrkVrtIndex = AlgConsts::invalidUnsigned;
607 wrkvrt.closestWrkVrtValue = AlgConsts::maxValue;
608 workVerticesContainer->emplace_back( wrkvrt );
609
610 } else {
611
612 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": VKalVrtFit succeeded; register the vertex to the list.");
613 wrkvrt.isGood = true;
614 wrkvrt.closestWrkVrtIndex = AlgConsts::invalidUnsigned;
615 wrkvrt.closestWrkVrtValue = AlgConsts::maxValue;
616 workVerticesContainer->emplace_back( wrkvrt );
617
618 }
619
620 }
621
622
623 } else {
624
625 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": rapid finder mode" );
626
627 struct Cluster {
629 std::set<long int> tracks;
630 };
631
632 std::vector<struct Cluster> clusters;
633
634 for( auto& wrkvrt : *workVerticesContainer ) {
635
636 bool foundCluster = false;
637
638 for( auto& cluster: clusters ) {
639 if( (wrkvrt.vertex - cluster.position).norm() < 1.0 ) {
640 for( auto& itrk : wrkvrt.selectedTrackIndices ) {
641 cluster.tracks.insert( itrk );
642 }
643 foundCluster = true;
644 break;
645 }
646 }
647
648 if( !foundCluster ) {
649 Cluster c;
650 c.position = wrkvrt.vertex;
651 for( auto& itrk : wrkvrt.selectedTrackIndices ) {
652 c.tracks.insert( itrk );
653 }
654 clusters.emplace_back( c );
655 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": added a new cluster" );
656 }
657
658 }
659
660 // This is just a unused strawman needed for m_fitSvc->VKalVrtFit()
661 std::vector<const xAOD::TrackParticle*> baseTracks;
662 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
663
664 workVerticesContainer->clear();
665
666 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": found cluster size =" << clusters.size() );
667
668 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
669 for( auto& cluster : clusters ) {
670
671 // varaible of new vertex
672 WrkVrt wrkvrt;
673
674 // Try to compose a new vertex using the solution nodes
675 // Here the track ID is labelled with array
676 wrkvrt.isGood = true;
677 wrkvrt.selectedTrackIndices.clear();
678
679 for(const auto& index: cluster.tracks) {
680 wrkvrt.selectedTrackIndices.emplace_back( index );
681 baseTracks.emplace_back( m_selectedTracks.at( index ) );
682 }
683
684 // Perform vertex fitting
685 Amg::Vector3D initVertex;
686
687 StatusCode sc = m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );/* Fast crude estimation */
688 if(sc.isFailure()) ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation fails ");
689
690 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
691
692 sc = m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
693 wrkvrt.vertex,
694 wrkvrt.vertexMom,
695 wrkvrt.Charge,
696 wrkvrt.vertexCov,
697 wrkvrt.Chi2PerTrk,
698 wrkvrt.TrkAtVrt,
699 wrkvrt.Chi2,
700 *state);
701
702 if( sc.isFailure() ) {
703 continue;
704 }
705
706 workVerticesContainer->emplace_back( wrkvrt );
707 }
708
709 }
710
712 if (workVerticesContainer->size() > m_maxWrkVertices){
714 workVerticesContainer->resize(m_maxWrkVertices);
715 }
716 }
717
718 //-------------------------------------------------------
719 // Iterative cleanup algorithm
720
721 //-Remove vertices fully contained in other vertices
722 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": Remove vertices fully contained in other vertices .");
723 while( workVerticesContainer->size() > 1 ) {
724 size_t tmpN = workVerticesContainer->size();
725
726 size_t iv = 0;
727 for(; iv<tmpN-1; iv++) {
728 size_t jv = iv+1;
729 for(; jv<tmpN; jv++) {
730 const auto nTCom = nTrkCommon( workVerticesContainer, {iv, jv} );
731
732 if( nTCom == workVerticesContainer->at(iv).selectedTrackIndices.size() ) { workVerticesContainer->erase(workVerticesContainer->begin()+iv); break; }
733 else if( nTCom == workVerticesContainer->at(jv).selectedTrackIndices.size() ) { workVerticesContainer->erase(workVerticesContainer->begin()+jv); break; }
734
735 }
736 if(jv!=tmpN) break; // One vertex is erased. Restart check
737 }
738 if(iv==tmpN-1) break; // No vertex deleted
739 }
740
741 //-Identify remaining 2-track vertices with very bad Chi2 and mass (b-tagging)
742 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": Identify remaining 2-track vertices with very bad Chi2 and mass (b-tagging).");
743 for( auto& wrkvrt : *workVerticesContainer ) {
744
745 if( TMath::Prob( wrkvrt.Chi2, wrkvrt.ndof() ) < m_improveChi2ProbThreshold ) wrkvrt.isGood = false;
746 if( wrkvrt.selectedTrackIndices.size() != 2 ) continue;
747 if( m_FillHist ) m_hists["NtrkChi2Dist"]->Fill( log10( wrkvrt.fitQuality() ) );
748 }
749
750 if( m_FillNtuple) m_ntupleVars->get<unsigned int>( "NumInitSecVrt" ) = workVerticesContainer->size();
751
752 return StatusCode::SUCCESS;
753 }
Gaudi::Property< bool > m_doFastMode
Gaudi::Property< bool > m_truncateWrkVertices
static size_t nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, const std::pair< unsigned, unsigned > &pairIndex)
returns the number of tracks commonly present in both vertices
Gaudi::Property< double > m_improveChi2ProbThreshold
Gaudi::Property< size_t > m_maxWrkVertices

◆ findWorstChi2ofMaximallySharedTrack()

double VKalVrtAthena::VrtSecInclusive::findWorstChi2ofMaximallySharedTrack ( std::vector< WrkVrt > * workVerticesContainer,
std::map< long int, std::vector< long int > > & trackToVertexMap,
long int & maxSharedTrack,
long int & worstMatchingVertex )
private

Definition at line 807 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

811 {
812
813 double worstChi2 = AlgConsts::invalidFloat;
814
815 // Find the track index that has the largest shared vertices
816 auto maxSharedTrackToVertices = std::max_element( trackToVertexMap.begin(), trackToVertexMap.end(), []( auto& p1, auto& p2 ) { return p1.second.size() < p2.second.size(); } );
817
818 if( maxSharedTrackToVertices == trackToVertexMap.end() ) return worstChi2;
819
820 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": max-shared track index = " << maxSharedTrackToVertices->first << ", number of shared vertices = " << maxSharedTrackToVertices->second.size() );
821
822 if( maxSharedTrackToVertices->second.size() < 2 ) return worstChi2;
823
824 // map of vertex index and the chi2 of the track for the maxSharedTrack
825 std::map<long int, double> vrtChi2Map;
826
827 // loop over vertices for the largest shared track
828 for( auto& iv : maxSharedTrackToVertices->second ) {
829 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": loop over vertices: vertex index " << iv );
830
831 auto& wrkvrt = workVerticesContainer->at( iv );
832 auto& trackIndices = wrkvrt.selectedTrackIndices;
833
834 // find the index of the track
835 auto index = std::find_if( trackIndices.begin(), trackIndices.end(), [&]( auto& index ) { return index == maxSharedTrackToVertices->first; } );
836 if( index == trackIndices.end() ) {
837 ATH_MSG_WARNING(" >> " << __FUNCTION__ << ": index not found (algorithm inconsistent)" );
838 return worstChi2;
839 }
840
841 auto& chi2 = wrkvrt.Chi2PerTrk.at( index - trackIndices.begin() );
842
843 vrtChi2Map.emplace( std::pair<long int, double>(iv, chi2) );
844 }
845
846 auto worstVrtChi2Pair = std::max_element( vrtChi2Map.begin(), vrtChi2Map.end(), []( auto& p1, auto& p2 ) { return p1.second < p2.second; } );
847
848 if( worstVrtChi2Pair == vrtChi2Map.end() ) {
849 ATH_MSG_WARNING(" >> " << __FUNCTION__ << ": max_element of vrtChi2Map not found" );
850 return worstChi2;
851 }
852
853 maxSharedTrack = maxSharedTrackToVertices->first;
854 worstMatchingVertex = worstVrtChi2Pair->first;
855 worstChi2 = worstVrtChi2Pair->second;
856
857 return worstChi2;
858 }
double chi2(TH1 *h0, TH1 *h1)
str index
Definition DeMoScan.py:362
bool trackIndices() const
Return true if index tracking is enabled for this object.

◆ getIntersection() [1/2]

template<class Track>
void VKalVrtAthena::VrtSecInclusive::getIntersection ( Track * trk,
std::vector< IntersectionPos * > & layers,
const Trk::Perigee * per )
private

◆ getIntersection() [2/2]

template<class TrackT>
void VKalVrtAthena::VrtSecInclusive::getIntersection ( TrackT * trk,
vector< IntersectionPos * > & layers,
const Trk::Perigee * per )

Definition at line 18 of file Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h.

18 {
19 //
20 // get intersection point of track with various surfaces
21 //
22
23 //--------------------
24 // main loop
25 for( auto *layer : layers ) {
26
27 ATH_MSG_VERBOSE( " >> getIntersection(): attempt to loop " << layer->name() );
28 setIntersection( trk, layer, per );
29
30 }
31
32
33 ATH_MSG_VERBOSE( " >> getIntersection(): End of getIntersection" );
34 }
void setIntersection(Track *trk, IntersectionPos *bec, const Trk::Perigee *per)

◆ getSVImpactParameters()

bool VKalVrtAthena::VrtSecInclusive::getSVImpactParameters ( const EventContext & ctx,
const xAOD::TrackParticle * trk,
const Amg::Vector3D & vertex,
std::vector< double > & impactParameters,
std::vector< double > & impactParErrors )
private

get secondary vertex impact parameters

Definition at line 2323 of file VertexingAlgs.cxx.

2326 {
2327
2328 impactParameters.clear();
2329 impactParErrors.clear();
2330
2331 if( m_trkExtrapolator==1 ){
2332 m_fitSvc->VKalGetImpact(ctx, trk, vertex, static_cast<int>( trk->charge() ), impactParameters, impactParErrors);
2333 }
2334 else if( m_trkExtrapolator==2 ){
2335 auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(ctx, *trk, vertex );
2336 if( !sv_perigee ) return false;
2337 impactParameters.push_back(sv_perigee->parameters() [Trk::d0]);
2338 impactParameters.push_back(sv_perigee->parameters() [Trk::z0]);
2339 impactParErrors.push_back((*sv_perigee->covariance())( Trk::d0, Trk::d0 ));
2340 impactParErrors.push_back((*sv_perigee->covariance())( Trk::z0, Trk::z0 ));
2341 }
2342 else{
2343 ATH_MSG_WARNING( " > " << __FUNCTION__ << ": Unknown track extrapolator " << m_trkExtrapolator );
2344 return false;
2345 }
2346
2347 return true;
2348
2349 } // getSVImpactParameters
Gaudi::Property< int > m_trkExtrapolator
PublicToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
get a handle on the Track to Vertex tool
float charge() const
Returns the charge.

◆ getTrkGenParticle()

const xAOD::TruthParticle * VKalVrtAthena::VrtSecInclusive::getTrkGenParticle ( const xAOD::TrackParticle * trkPart)
staticprivate

Definition at line 25 of file TruthAlgs.cxx.

26 {
27 typedef ElementLink< xAOD::TruthParticleContainer > Link_t;
28 constexpr const char* NAME = "truthParticleLink";
29 static const SG::ConstAccessor< Link_t > acc (NAME);
30 if( ! acc.isAvailable( *trkPart ) ) {
31 return nullptr;
32 }
33 const Link_t& link = acc( *trkPart );
34 if( ! link.isValid() ) {
35 return nullptr;
36 }
37 return *link;
38 }
ElementLink< xAOD::TruthParticleContainer > Link_t

◆ improveVertexChi2()

double VKalVrtAthena::VrtSecInclusive::improveVertexChi2 ( const EventContext & ctx,
WrkVrt & vertex )
private

attempt to improve the vertex chi2 by removing the most-outlier track one by one until the vertex chi2 satisfies a certain condition.

Definition at line 264 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

265 {
266 //
267 // Iterate track removal until vertex get good Chi2
268 //
269
270 auto fitQuality_begin = vertex.fitQuality();
271
272 auto removeCounter = 0;
273
274 if( vertex.nTracksTotal() <= 2 ) return 0.;
275
276 {
277 WrkVrt backup = vertex;
278 StatusCode sc = refitVertexWithSuggestion( ctx, vertex, vertex.vertex );
279 if( sc.isFailure() ) {
280 vertex = std::move(backup);
281 return 0;
282 }
283 }
284
285 double chi2Probability = TMath::Prob( vertex.Chi2, vertex.ndof() );
286
287 while (chi2Probability < m_improveChi2ProbThreshold ) {
288 if( vertex.nTracksTotal() == 2 ) return chi2Probability;
289
290 WrkVrt vertex_backup = vertex;
291
292 auto maxChi2 = std::max_element( vertex.Chi2PerTrk.begin(), vertex.Chi2PerTrk.end() );
293 size_t index = maxChi2 - vertex.Chi2PerTrk.begin();
294
295
296 ATH_MSG_DEBUG( " >>> " << __FUNCTION__ << ": worst chi2 trk index = " << index << ", #trks = " << vertex.Chi2PerTrk.size() );
297
298 if( index < vertex.selectedTrackIndices.size() ) {
299 vertex.selectedTrackIndices.erase( vertex.selectedTrackIndices.begin() + index ); //remove track
300 removeCounter++;
301 } else {
302 index -= vertex.selectedTrackIndices.size();
303 if( index >= vertex.associatedTrackIndices.size() ) {
304 ATH_MSG_WARNING( " >>> " << __FUNCTION__ << ": invalid index" );
305 break;
306 }
307 vertex.associatedTrackIndices.erase( vertex.associatedTrackIndices.begin() + index ); //remove track
308 removeCounter++;
309 }
310
311 StatusCode sc = refitVertexWithSuggestion( ctx, vertex, vertex.vertex );
312
313 if( sc.isFailure() || vertex_backup.fitQuality() < vertex.fitQuality() ) {
314 vertex = std::move(vertex_backup);
315 chi2Probability = 0;
316 break;
317 }
318
319 chi2Probability = TMath::Prob( vertex.Chi2, vertex.ndof() );
320 }
321
322 auto fitQuality_end = vertex.fitQuality();
323
324 if( 0 == removeCounter ) {
325 ATH_MSG_DEBUG( " >>> " << __FUNCTION__ << ": no improvement was found." );
326 } else {
327 ATH_MSG_DEBUG( " >>> " << __FUNCTION__ << ": Removed " << removeCounter << " tracks; Fit quality improvement: " << fitQuality_begin << " ==> " << fitQuality_end );
328 }
329
330 return chi2Probability;
331 }
StatusCode refitVertexWithSuggestion(const EventContext &ctx, WrkVrt &, const Amg::Vector3D &)
refit the vertex with suggestion

◆ initEvent()

StatusCode VKalVrtAthena::VrtSecInclusive::initEvent ( )
virtual

Definition at line 296 of file VrtSecInclusive.cxx.

297 {
298
299 ATH_MSG_DEBUG("initEvent: begin");
300
301 // Clear all variables to be stored to the AANT
302 if( m_FillNtuple ) {
304 }
305
306
307 ATH_MSG_DEBUG("initEvent: from initEvent ");
308 return StatusCode::SUCCESS;
309
310 }

◆ initialize()

StatusCode VKalVrtAthena::VrtSecInclusive::initialize ( )
overridevirtual

Definition at line 60 of file VrtSecInclusive.cxx.

61 {
62 ATH_MSG_INFO("initialize: begin");
63 //
64 // first instantiate tools
65
66 // VKalVrt vertex fitter
67 if (m_fitSvc.retrieve().isFailure()) {
68 ATH_MSG_ERROR("initialize: Can't find Trk::TrkVKalVrtFitter");
69 return StatusCode::SUCCESS;
70 } else {
71 ATH_MSG_INFO("initialize: Trk::TrkVKalVrtFitter found");
72 }
73
74 //
75 // retreive tool to get trackParameters of generated Particles
76 if(m_truthToTrack.retrieve().isFailure()) {
77 ATH_MSG_INFO("initialize: Cannot retrieve Trk::TruthToTrack Tool!");
78 return StatusCode::FAILURE;
79 }
80 else {
81 ATH_MSG_INFO("initialize: Retrieved Trk::TruthToTrack Tool" << m_truthToTrack);
82
83 }
84 // extract TrackToVertex extrapolator tool
85 if ( m_trackToVertexTool.retrieve().isFailure() ) {
86 ATH_MSG_ERROR("initialize: failed to retrieve trackToVertex tool ");
87 return StatusCode::SUCCESS;
88 }
89 else {
90 ATH_MSG_INFO("initialize: Retrieved Reco::TrackToVertex Tool" << m_trackToVertexTool);
91 }
92 // extract TrackToVertexIPEstimator extrapolator tool
93 if ( m_trackToVertexIPEstimatorTool.retrieve().isFailure() ) {
94 ATH_MSG_ERROR("initialize: failed to retrieve trackToVertexIPEstimator tool ");
95 return StatusCode::SUCCESS;
96 }
97 else {
98 ATH_MSG_INFO("initialize: Retrieved Trk::TrackToVertexIPEstimator Tool" << m_trackToVertexIPEstimatorTool);
99 }
100
101 if( detStore()->retrieve(m_atlasId, "AtlasID").isFailure() ) return StatusCode::FAILURE;
102 if( detStore()->retrieve(m_pixelId, "PixelID").isFailure() ) return StatusCode::FAILURE;
103 if( detStore()->retrieve(m_sctId, "SCT_ID") .isFailure() ) return StatusCode::FAILURE;
104
105 if ( m_pixelCondSummaryTool.retrieve().isFailure() ) {
106 ATH_MSG_ERROR("initialize: failed to retrieve PixelConditionsSummaryTool");
107 return StatusCode::SUCCESS;
108 }
109 else {
110 ATH_MSG_INFO("initialize: Retrieved PixelConditionsSummaryTool" << m_pixelCondSummaryTool);
111 }
112 if ( m_sctCondSummaryTool.retrieve().isFailure() ) {
113 ATH_MSG_ERROR("initialize: failed to retrieve SCTConditionsSummaryTool");
114 return StatusCode::SUCCESS;
115 }
116 else {
117 ATH_MSG_INFO("initialize: Retrieved SCTConditionsSummaryTool" << m_sctCondSummaryTool);
118 }
119
120 ATH_CHECK( m_extrapolator.retrieve() );
121
122 // extract VertexMapper
123 if( m_doMapToLocal ) {
124 ATH_CHECK( m_vertexMapper.retrieve() );
125 }
126
127 // Track selection algorithm configuration
131
132 // if none of the above two flags are activated, use ID tracks (default)
134
136
137 }
138
139
140 // Vertexing algorithm configuration
141 m_vertexingAlgorithms.emplace_back( "extractIncompatibleTrackPairs", &VrtSecInclusive::extractIncompatibleTrackPairs );
142 m_vertexingAlgorithms.emplace_back( "findNtrackVertices", &VrtSecInclusive::findNtrackVertices );
143 m_vertexingAlgorithms.emplace_back( "rearrangeTracks", &VrtSecInclusive::rearrangeTracks );
144
146 m_vertexingAlgorithms.emplace_back( "reassembleVertices", &VrtSecInclusive::reassembleVertices );
147 }
148
150 m_vertexingAlgorithms.emplace_back( "mergeByShuffling", &VrtSecInclusive::mergeByShuffling );
151 }
152
154 m_vertexingAlgorithms.emplace_back( "mergeFinalVertices", &VrtSecInclusive::mergeFinalVertices );
155 }
156
158 m_vertexingAlgorithms.emplace_back( "associateNonSelectedTracks", &VrtSecInclusive::associateNonSelectedTracks );
159 }
160
162
163
164 // now make histograms/ntuples
165
166 ServiceHandle<ITHistSvc> hist_root("THistSvc", name());
167 ATH_CHECK( hist_root.retrieve() );
168
169 if( m_FillHist ) {
170
171 std::vector<double> rbins = { 0.1, 0.3, 0.5, 1, 2, 3, 5, 7, 10, 14, 20, 28, 38, 50, 64, 80, 100, 130, 170, 220, 280, 350, 450, 600 };
172 std::vector<double> nbins = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 20, 24, 28, 38, 50, 70, 100, 150 };
173
174 const size_t& nAlgs = m_vertexingAlgorithms.size();
175
176 ATH_MSG_INFO("initialize: Filling Histograms");
177 //
178 m_hists["trkSelCuts"] = new TH1F("trkSelCuts", ";Cut Order;Tracks", 10, -0.5, 10-0.5 );
179 m_hists["selTracksDist"] = new TH1F("selTracksDist", ";Selected Tracks;Events", 2000, -0.5, 2000-0.5 );
180 m_hists["initVertexDispD0"] = new TH2F("initVertexDispD0", ";Rough d0 wrt init [mm];r [mm];Vertices", 1000, -100, 100, rbins.size()-1, &(rbins[0]) );
181 m_hists["initVertexDispZ0"] = new TH2F("initVertexDispZ0", ";Rough z0 wrt init [mm];z [mm];Vertices", 1000, -100, 100, 100, -1000, 1000 );
182 m_hists["incompMonitor"] = new TH1F("incompMonitor", ";Setp;Track Pairs", 10, -0.5, 10-0.5 );
183 m_hists["2trkVerticesDist"] = new TH1F("2trkVerticesDist", ";2-track Vertices;Events", 1000, -0.5, 1000-0.5 );
184 m_hists["2trkChi2Dist"] = new TH1F("2trkChi2Dist", ";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
185 m_hists["NtrkChi2Dist"] = new TH1F("NtrkChi2Dist", ";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
186 m_hists["vPosDist"] = new TH2F("vPosDist", ";r;#vec{x}*#vec{p}/p_{T} [mm]", rbins.size()-1, &(rbins[0]), 200, -1000, 1000 );
187 m_hists["vPosMomAngTDist"] = new TH2F("vPosMomAngDistT", ";r;cos(#vec{r},#vec{p}_{T})", rbins.size()-1, &(rbins[0]), 200, -1.0, 1.0 );
188 m_hists["disabledCount"] = new TH1F("disabledCount", ";N_{modules};Tracks", 20, -0.5, 10-0.5 );
189 m_hists["vertexYield"] = new TH1F("vertexYield", ";Algorithm Step;Vertices", nAlgs, -0.5, nAlgs-0.5 );
190 m_hists["vertexYieldNtrk"] = new TH2F("vertexYieldNtrk", ";Ntrk;Algorithm Step;Vertices", 100, 0, 100, nAlgs, -0.5, nAlgs-0.5 );
191 m_hists["vertexYieldChi2"] = new TH2F("vertexYieldChi2", ";#chi^{2}/N_{dof};Algorithm Step;Vertices", 100, 0, 100, nAlgs, -0.5, nAlgs-0.5 );
192 m_hists["mergeType"] = new TH1F("mergeType", ";Merge Algorithm Type;Entries", 10, -0.5, 10-0.5 );
193 m_hists["associateMonitor"] = new TH1F("associateMonitor", ";Step;Vertices", 10, -0.5, 10-0.5 );
194 m_hists["shuffleMinSignif1"] = new TH1F("shuffleMinSignif1", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
195 m_hists["shuffleMinSignif2"] = new TH1F("shuffleMinSignif2", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
196 m_hists["shuffleMinSignif3"] = new TH1F("shuffleMinSignif3", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
197 m_hists["finalCutMonitor"] = new TH1F("finalCutMonitor", ";Step;Vertices", 6, -0.5, 6-0.5 );
198 m_hists["finalVtxNtrk"] = new TH1F("finalVtxNtrk", ";N_{trk};Vertices", nbins.size()-1, &(nbins[0]) );
199 m_hists["finalVtxR"] = new TH1F("finalVtxR", ";r [mm];Vertices", 600, 0, 600 );
200 m_hists["finalVtxNtrkR"] = new TH2F("finalVtxNtrkR", ";N_{trk};r [mm];Vertices", nbins.size()-1, &(nbins[0]), rbins.size()-1, &(rbins[0]) );
201 m_hists["CPUTime"] = new TH1F("CPUTime", ";Step;Accum. CPU Time [s]", 10, -0.5, 10-0.5 );
202 m_hists["nMatchedTruths"] = new TH2F("nMatchedTruths", ";Step;;r [mm];Matched truth vertices", 11, -0.5, 11-0.5, rbins.size()-1, &(rbins[0]) );
203 m_hists["vPosMomAngT"] = new TH1F("vPosMomAngT", ";cos(#vec{r},#vec{p}_{T}", 200, -1.0, 1.0 );
204 m_hists["vPosMomAng3D"] = new TH1F("vPosMomAng3D", ";cos(#vec{r},#vec{p})", 200, -1.0, 1.0 );
205 m_hists["2trkVtxDistFromPV"] = new TH1F("2trkVtDistFromPV", ";2tr vertex distance from PV;Events", 100, 0, 3 );
206
207
208 std::string histDir("/AANT/VrtSecInclusive" + m_augVerString + "/");
209
210 for( auto& pair : m_hists ) {
211 ATH_CHECK( hist_root->regHist( histDir + pair.first, pair.second ) );
212 }
213 }
214
215
216 if( m_FillNtuple ) {
217
219
220 m_tree_Vert = new TTree("tree_VrtSecInclusive","TTree of VrtSecInclusive");
221 ATH_CHECK( hist_root->regTree("/AANT/tree_VrtSecInclusive", m_tree_Vert) );
222
224
225 }
226
227 // initialize keys
228 ATH_CHECK(m_eventInfoKey.initialize());
229
230 // Instantiate and initialize our event info decorator write
231 m_vertexingStatusKey = "VrtSecInclusive_" + m_secondaryVerticesContainerName + m_augVerString + "_status";
232 ATH_CHECK( m_vertexingStatusKey.initialize() );
233
236 ATH_CHECK( m_vertexKey.initialize() );
240
242 for( auto itr = m_vertexingAlgorithms.begin(); itr!=m_vertexingAlgorithms.end(); ++itr ) {
243 const std::string& nameAlgo = itr->first;
244 std::string fullName = "VrtSecInclusive_IntermediateVertices_" + nameAlgo + m_augVerString;
245 m_intermediateVertexKey[nameAlgo] = SG::WriteHandleKey<xAOD::VertexContainer>( this, nameAlgo, fullName );
248 }
249 }
250
251
252 ATH_CHECK( m_TrackLocation.initialize() );
253 ATH_CHECK( m_MuonLocation.initialize() );
254 ATH_CHECK( m_ElectronLocation.initialize() );
255 ATH_CHECK( m_PrimVrtLocation.initialize() );
256
257 //
258 ATH_MSG_INFO("initialize: Exit VrtSecInclusive::initialize()");
259 return StatusCode::SUCCESS;
260 }
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< bool > m_doSelectIDAndGSFTracks
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonLocation
Gaudi::Property< bool > m_doMergeFinalVerticesDistance
Gaudi::Property< bool > m_doReassembleVertices
StatusCode selectTracksFromElectrons(const EventContext &ctx)
StatusCode selectTracksFromMuons(const EventContext &ctx)
PublicToolHandle< Trk::IVertexMapper > m_vertexMapper
Gaudi::Property< bool > m_doMergeByShuffling
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronLocation
StatusCode associateNonSelectedTracks(const EventContext &ctx, std::vector< WrkVrt > *)
in addition to selected tracks, associate as much tracks as possible
PublicToolHandle< Trk::ITruthToTrack > m_truthToTrack
Gaudi::Property< bool > m_doSelectTracksFromElectrons
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
virtual StatusCode initialize() override
StatusCode refitAndSelectGoodQualityVertices(const EventContext &ctx, std::vector< WrkVrt > *)
finalization of the vertex and store to xAOD::VertexContainer
StatusCode rearrangeTracks(const EventContext &ctx, std::vector< WrkVrt > *)
Gaudi::Property< bool > m_doMapToLocal
PublicToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
StatusCode selectTracksInDet(const EventContext &ctx)
Gaudi::Property< bool > m_doAssociateNonSelectedTracks
StatusCode mergeByShuffling(const EventContext &ctx, std::vector< WrkVrt > *)
attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior ...
StatusCode extractIncompatibleTrackPairs(const EventContext &ctx, std::vector< WrkVrt > *)
related to the graph method and verte finding
StatusCode findNtrackVertices(const EventContext &ctx, std::vector< WrkVrt > *)
Gaudi::Property< bool > m_doSelectTracksFromMuons
StatusCode selectInDetAndGSFTracks(const EventContext &ctx)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ lockLeptonDecorations()

void VKalVrtAthena::VrtSecInclusive::lockLeptonDecorations ( const SG::AuxVectorData * cont) const
private

Definition at line 509 of file VrtSecInclusive.cxx.

509 {
510 SG::AuxVectorData* cont_nc ATLAS_THREAD_SAFE =
511 const_cast<SG::AuxVectorData*> (cont);
512 for (const IPDecoratorType& dec : m_ipDecors) {
513 if (dec.isAvailable (*cont)) {
514 cont_nc->lockDecoration (dec.auxid());
515 }
516 }
517
518 if (m_decor_svLink) {
519 if (m_decor_svLink->isAvailable (*cont)) {
520 cont_nc->lockDecoration (m_decor_svLink->auxid());
521 }
522 }
523 }
#define ATLAS_THREAD_SAFE
SG::AuxElement::Decorator< std::vector< std::vector< float > > > IPDecoratorType

◆ lockTrackDecorations() [1/2]

StatusCode VKalVrtAthena::VrtSecInclusive::lockTrackDecorations ( bool onlySelection,
const EventContext & ctx ) const
private

Definition at line 525 of file VrtSecInclusive.cxx.

527 {
528 SG::ReadHandle<xAOD::TrackParticleContainer> trackParticleHandle = SG::makeHandle( m_TrackLocation, ctx );
529 ATH_CHECK( trackParticleHandle.isValid() );
530 const xAOD::TrackParticleContainer* trackParticleContainer = trackParticleHandle.cptr();
531 for( const xAOD::TrackParticle* trk : *trackParticleContainer ) {
532 lockTrackDecorations( trk, onlySelection );
533 }
534
535 SG::ReadHandle<xAOD::MuonContainer> muonsHandle = SG::makeHandle( m_MuonLocation, ctx );
536 ATH_CHECK( muonsHandle.isValid() );
537 const xAOD::MuonContainer* muons = muonsHandle.cptr();
538 if (muons->ownPolicy() != SG::VIEW_ELEMENTS) {
539 lockLeptonDecorations (muons);
540 }
541 for( const xAOD::Muon* muon : *muons ) {
542 if (muons->ownPolicy() == SG::VIEW_ELEMENTS) {
543 lockLeptonDecorations (muon->container());
544 }
545 if ( const xAOD::TrackParticle* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle ) ) {
546 lockTrackDecorations( trk, onlySelection );
547 }
548 }
549
550 SG::ReadHandle<xAOD::ElectronContainer> electronsHandle = SG::makeHandle( m_ElectronLocation, ctx);
551 ATH_CHECK( electronsHandle.isValid() );
552 const xAOD::ElectronContainer *electrons = electronsHandle.cptr();
553 if (electrons->ownPolicy() != SG::VIEW_ELEMENTS) {
554 lockLeptonDecorations (electrons);
555 }
556 for( const xAOD::Electron* electron : *electrons ) {
557 if (electrons->ownPolicy() == SG::VIEW_ELEMENTS) {
558 lockLeptonDecorations (electron->container());
559 }
560 if( electron->nTrackParticles() > 0 ) {
561 if (const xAOD::TrackParticle* trk = electron->trackParticle(0)) {
562 lockTrackDecorations( trk, onlySelection );
563 }
564 }
565 }
566
567 SG::ReadHandle<xAOD::TrackParticleContainer> IDtracksHandle = SG::makeHandle( m_TrackLocation, ctx );
568 ATH_CHECK( IDtracksHandle.isValid() );
569 const xAOD::TrackParticleContainer* IDtracks = IDtracksHandle.cptr();
570 for( const auto *trk : *IDtracks ) {
571 lockTrackDecorations( trk, onlySelection );
572 }
573
574 return StatusCode::SUCCESS;
575 }
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
void lockLeptonDecorations(const SG::AuxVectorData *cont) const
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Electron_v1 Electron
Definition of the current "egamma version".

◆ lockTrackDecorations() [2/2]

void VKalVrtAthena::VrtSecInclusive::lockTrackDecorations ( const xAOD::TrackParticle * trk,
bool onlySelection ) const
private

lock decorations at the end of the algorithm

Definition at line 490 of file VrtSecInclusive.cxx.

490 {
491 SG::AuxVectorData* cont_nc ATLAS_THREAD_SAFE =
492 const_cast<SG::AuxVectorData*> (trk->container());
493 cont_nc->lockDecoration (m_decor_isSelected->auxid());
494
495 if (onlySelection) return;
496
497 if (m_decor_isAssociated && m_decor_isAssociated->isAvailable (*cont_nc)) {
498 cont_nc->lockDecoration (m_decor_isAssociated->auxid());
499 }
500 if (m_decor_is_svtrk_final && m_decor_is_svtrk_final->isAvailable (*cont_nc)) {
501 cont_nc->lockDecoration (m_decor_is_svtrk_final->auxid());
502 }
503
504 for (const auto& p : m_trkDecors) {
505 cont_nc->lockDecoration (p.second.auxid());
506 }
507 }
std::map< unsigned, SG::Decorator< float > > m_trkDecors
std::optional< SG::Decorator< char > > m_decor_isSelected
std::optional< SG::Decorator< char > > m_decor_is_svtrk_final

◆ mergeByShuffling()

StatusCode VKalVrtAthena::VrtSecInclusive::mergeByShuffling ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior of the vertex reconstruction resolution

Definition at line 1316 of file VertexingAlgs.cxx.

1318 {
1319
1320 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": #verticess = " << workVerticesContainer->size() );
1321
1322 unsigned mergeCounter { 0 };
1323
1324 // First, sort WrkVrt by the track multiplicity
1325 std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt& v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
1326
1327 // Loop over vertices (small -> large Ntrk order)
1328 for( auto& wrkvrt : *workVerticesContainer ) {
1329 if( !wrkvrt.isGood ) continue;
1330 if( wrkvrt.selectedTrackIndices.size() <= 1 ) continue;
1331
1332 // Reverse iteration: large Ntrk -> small Ntrk order
1333 for( auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
1334 auto& vertexToMerge = *ritr;
1335
1336 if( !vertexToMerge.isGood ) continue;
1337 if( vertexToMerge.selectedTrackIndices.size() <= 1 ) continue;
1338 if( &wrkvrt == &vertexToMerge ) continue;
1339 if( vertexToMerge.selectedTrackIndices.size() < wrkvrt.selectedTrackIndices.size() ) continue;
1340
1341 const double& significance = significanceBetweenVertices( wrkvrt, vertexToMerge );
1342
1343 if( significance > m_mergeByShufflingMaxSignificance ) continue;
1344
1345 bool mergeFlag { false };
1346
1347 ATH_MSG_DEBUG(" > " << __FUNCTION__
1348 << ": vertex " << &wrkvrt << " #tracks = " << wrkvrt.selectedTrackIndices.size()
1349 << " --> to Merge : " << &vertexToMerge << ", #tracks = " << vertexToMerge.selectedTrackIndices.size()
1350 << " significance = " << significance );
1351
1352 double min_signif = AlgConsts::maxValue;
1353
1354 // Method 1. Assume that the solution is somewhat wrong, and the solution gets correct if it starts from the other vertex position
1355 if( m_doSuggestedRefitOnMerging && !mergeFlag ) {
1356 WrkVrt testVertex = wrkvrt;
1357 StatusCode sc = refitVertexWithSuggestion( ctx, testVertex, vertexToMerge.vertex );
1358 if( sc.isFailure() ) {
1359 //ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1360 } else {
1361
1362 const auto signif = significanceBetweenVertices( testVertex, vertexToMerge );
1363 if( signif < min_signif ) min_signif = signif;
1364
1365 if( signif < m_mergeByShufflingAllowance ) {
1366 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": method1: vertexToMerge " << &vertexToMerge << ": test signif = " << signif );
1367 mergeFlag = true;
1368
1369 }
1370
1371 if( m_FillHist && min_signif > 0. ) m_hists["shuffleMinSignif1"]->Fill( log10( min_signif ) );
1372 if( m_FillHist && mergeFlag ) { m_hists["mergeType"]->Fill( SHUFFLE1 ); }
1373 }
1374 }
1375
1376 // Method 2. magnet merging: borrowing another track from the target vertex to merge
1377 if( m_doMagnetMerging && !mergeFlag ) {
1378
1379 // Loop over tracks in vertexToMerge
1380 for( auto& index : vertexToMerge.selectedTrackIndices ) {
1381
1382 WrkVrt testVertex = wrkvrt;
1383 testVertex.selectedTrackIndices.emplace_back( index );
1384
1385 StatusCode sc = refitVertexWithSuggestion( ctx, testVertex, vertexToMerge.vertex );
1386 if( sc.isFailure() ) {
1387 //ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1388 } else {
1389
1390 const auto signif = significanceBetweenVertices( testVertex, vertexToMerge );
1391 if( signif < min_signif ) min_signif = signif;
1392
1393 if( signif < m_mergeByShufflingAllowance ) {
1394 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": method2: vertexToMerge " << &vertexToMerge << " track index " << index << ": test signif = " << signif );
1395 mergeFlag = true;
1396 }
1397
1398 }
1399 }
1400
1401 if( m_FillHist && min_signif > 0. ) m_hists["shuffleMinSignif2"]->Fill( log10( min_signif ) );
1402
1403 if( m_FillHist && mergeFlag ) { m_hists["mergeType"]->Fill( SHUFFLE2 ); }
1404 }
1405
1406 // Method 3. Attempt to force merge
1407 if( m_doWildMerging && !mergeFlag ) {
1408
1409 WrkVrt testVertex = wrkvrt;
1410
1411 for( auto& index : vertexToMerge.selectedTrackIndices ) {
1412 testVertex.selectedTrackIndices.emplace_back( index );
1413 }
1414
1415 StatusCode sc = refitVertexWithSuggestion( ctx, testVertex, vertexToMerge.vertex );
1416 if( sc.isFailure() ) {
1417 //ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1418 } else {
1419
1420 const auto signif = significanceBetweenVertices( testVertex, vertexToMerge );
1421 if( signif < min_signif ) min_signif = signif;
1422
1423 if( signif < m_mergeByShufflingAllowance ) {
1424 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": method3: vertexToMerge " << &vertexToMerge << ": test signif = " << signif );
1425 mergeFlag = true;
1426 }
1427
1428 if( m_FillHist && min_signif > 0. ) m_hists["shuffleMinSignif3"]->Fill( log10( min_signif ) );
1429 if( m_FillHist && mergeFlag ) { m_hists["mergeType"]->Fill( SHUFFLE3 ); }
1430
1431 }
1432 }
1433
1434
1435 if( mergeFlag ) {
1436 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": vertexToMerge " << &vertexToMerge << " ==> min signif = " << min_signif << " judged to merge" );
1437
1438 auto vertexToMerge_backup = vertexToMerge;
1439 auto wrkvrt_backup = wrkvrt;
1440
1441 StatusCode sc = mergeVertices( ctx, vertexToMerge, wrkvrt );
1442 if( sc.isFailure() ) {
1443 vertexToMerge = std::move(vertexToMerge_backup);
1444 wrkvrt = std::move(wrkvrt_backup);
1445 continue;
1446 }
1447
1448 improveVertexChi2( ctx, wrkvrt );
1449
1450 mergeCounter++;
1451 }
1452
1453 }
1454
1455 }
1456
1457 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1458 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Number of merges = " << mergeCounter );
1459 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1460
1461 return StatusCode::SUCCESS;
1462 }
Gaudi::Property< bool > m_doWildMerging
Gaudi::Property< double > m_mergeByShufflingAllowance
Gaudi::Property< bool > m_doSuggestedRefitOnMerging
Gaudi::Property< bool > m_doMagnetMerging
Gaudi::Property< double > m_mergeByShufflingMaxSignificance
StatusCode mergeVertices(const EventContext &ctx, WrkVrt &destination, WrkVrt &source)
the 2nd vertex is merged into the 1st vertex.
double significanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the significance (Mahalanobis distance) between two reconstructed vertices
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ mergeFinalVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::mergeFinalVertices ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

attempt to merge vertices by lookng at the distance between two vertices

Definition at line 1466 of file VertexingAlgs.cxx.

1468 {
1469
1470 unsigned mergeCounter { 0 };
1471
1472 while (true) {
1473 //
1474 // Minimal vertex-vertex distance
1475 //
1476 for( auto& wrkvrt : *workVerticesContainer) {
1477 wrkvrt.closestWrkVrtIndex = AlgConsts::invalidUnsigned;
1478 wrkvrt.closestWrkVrtValue = AlgConsts::maxValue;
1479 }
1480
1481 std::pair<unsigned, unsigned> indexPair { AlgConsts::invalidUnsigned, AlgConsts::invalidUnsigned };
1482 auto minDistance = findMinVerticesPair( workVerticesContainer, indexPair, &VrtSecInclusive::distanceBetweenVertices );
1483
1484 if( minDistance == AlgConsts::maxValue ) break;
1485 if( indexPair.first == AlgConsts::invalidUnsigned ) break;
1486 if( indexPair.second == AlgConsts::invalidUnsigned ) break;
1487
1488 auto& v1 = workVerticesContainer->at(indexPair.first);
1489 auto& v2 = workVerticesContainer->at(indexPair.second);
1490
1491 const double averageRadius = ( v1.vertex.perp() + v2.vertex.perp() ) / 2.0;
1492
1493 if( minDistance > m_VertexMergeFinalDistCut + m_VertexMergeFinalDistScaling * averageRadius ) {
1494 ATH_MSG_DEBUG( "Vertices " << indexPair.first << " and " << indexPair.second
1495 <<" are separated by distance " << minDistance );
1496 break;
1497 }
1498
1499 ATH_MSG_DEBUG( "Merging FINAL vertices " << indexPair.first << " and " << indexPair.second
1500 <<" which are separated by distance "<< minDistance );
1501
1502 StatusCode sc = mergeVertices( ctx, v1, v2 );
1503 if( sc.isFailure() ) {}
1504 if( m_FillHist ) { m_hists["mergeType"]->Fill( FINAL ); }
1505
1506 improveVertexChi2( ctx, v1 );
1507
1508 mergeCounter++;
1509
1510 }
1511
1512 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1513 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Number of merges = " << mergeCounter );
1514 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1515
1516 return StatusCode::SUCCESS;
1517
1518 } // end of mergeFinalVertices
Gaudi::Property< double > m_VertexMergeFinalDistCut
double distanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the physical distance
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.
Gaudi::Property< double > m_VertexMergeFinalDistScaling

◆ mergeVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::mergeVertices ( const EventContext & ctx,
WrkVrt & destination,
WrkVrt & source )
private

the 2nd vertex is merged into the 1st vertex.

A destructive operation.

Definition at line 451 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

452 {
453 //
454 // Merge two close vertices into one (first) and set NTr=0 for second vertex
455 //
456
457 // firstly, take a backup of the original vertices
458 auto v1_bak = v1;
459 auto v2_bak = v2;
460
461 for( auto& index : v2.selectedTrackIndices ) { v1.selectedTrackIndices.emplace_back( index ); }
462
463 // Cleaning
464 deque<long int>::iterator TransfEnd;
465 sort( v1.selectedTrackIndices.begin(), v1.selectedTrackIndices.end() );
466 TransfEnd = unique(v1.selectedTrackIndices.begin(), v1.selectedTrackIndices.end() );
467 v1.selectedTrackIndices.erase( TransfEnd, v1.selectedTrackIndices.end());
468 //
469 //----------------------------------------------------------
470 v2.selectedTrackIndices.clear(); //Clean dropped vertex
471 v2.closestWrkVrtValue = AlgConsts::maxValue; //Clean dropped vertex
472 v2.closestWrkVrtIndex = 0; //Clean dropped vertex
473 v2.isGood = false; //Clean dropped vertex
474
475 v1.closestWrkVrtValue = AlgConsts::maxValue; //Clean new vertex
476 v1.closestWrkVrtIndex = 0; //Clean new vertex
477 v1.isGood = true; //Clean new vertex
478
479 StatusCode sc = refitVertex( ctx, v1 );
480 if( sc.isFailure() ) {
481 v1 = std::move(v1_bak);
482 v2 = std::move(v2_bak);
483
484 ATH_MSG_DEBUG(" >>> " << __FUNCTION__ << ": failure in merging" );
485
486 return StatusCode::FAILURE;
487 }
488
489 return StatusCode::SUCCESS;
490 }
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.

◆ monitorVertexingAlgorithmStep()

StatusCode VKalVrtAthena::VrtSecInclusive::monitorVertexingAlgorithmStep ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer,
const std::string & name,
bool final = false )
private

monitor the intermediate status of vertexing

Definition at line 2217 of file VertexingAlgs.cxx.

2218 {
2220
2221 SG::WriteHandle<xAOD::VertexContainer> vertexHandle = SG::makeHandle( m_intermediateVertexKey[name], ctx );
2222 ATH_CHECK( vertexHandle.record(std::make_unique<xAOD::VertexContainer>(),
2223 std::make_unique<xAOD::VertexAuxContainer>()) );
2224 xAOD::VertexContainer* intermediateVertexContainer = vertexHandle.ptr();
2226
2227 for( auto& wrkvrt : *workVerticesContainer ) {
2228
2230 intermediateVertexContainer->emplace_back( vertex );
2231
2232 // Registering the vertex position to xAOD::Vertex
2233 vertex->setPosition( wrkvrt.vertex );
2234
2235 // Registering the vertex type: SV
2236 vertex->setVertexType( xAOD::VxType::SecVtx );
2237
2238 // Registering the vertex chi2 and Ndof
2239 int ndof = wrkvrt.ndof();
2240 vertex->setFitQuality( wrkvrt.Chi2, ndof );
2241
2242 // Registering the vertex covariance matrix
2243 std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
2244 vertex->setCovariance(fCov);
2245
2246 // Registering tracks comprising the vertex to xAOD::Vertex
2247 // loop over the tracks comprising the vertex
2248 for( auto trk_id : wrkvrt.selectedTrackIndices ) {
2249
2250 const xAOD::TrackParticle *trk = m_selectedTracks.at( trk_id );
2251
2252 // Acquire link the track to the vertex
2253 ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
2254
2255 // Register the link to the vertex
2256 vertex->addTrackAtVertex( link_trk, 1. );
2257
2258 }
2259
2260 for( auto trk_id : wrkvrt.associatedTrackIndices ) {
2261
2262 const xAOD::TrackParticle *trk = m_associatedTracks.at( trk_id );
2263
2264 // Acquire link the track to the vertex
2265 ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
2266
2267 // Register the link to the vertex
2268 vertex->addTrackAtVertex( link_trk, 1. );
2269
2270 }
2271 }
2272
2273 }
2274
2275
2276
2277 if( !m_FillHist ) return StatusCode::SUCCESS;
2278
2279 printWrkSet( workVerticesContainer, Form("%s (step %u)", name.c_str(), m_vertexingAlgorithmStep) );
2280
2281 unsigned count = std::count_if( workVerticesContainer->begin(), workVerticesContainer->end(),
2282 []( WrkVrt& v ) { return ( v.selectedTrackIndices.size() + v.associatedTrackIndices.size() ) >= 2; } );
2283
2284 if( m_vertexingAlgorithmStep == 0 ) {
2285
2286 const auto compSize = m_selectedTracks.size()*(m_selectedTracks.size() - 1)/2 - m_incomp.size();
2287 m_hists["vertexYield"]->Fill( m_vertexingAlgorithmStep, compSize );
2288
2289 } else {
2290
2291 m_hists["vertexYield"]->Fill( m_vertexingAlgorithmStep, count );
2292
2293 }
2294
2295 m_hists["vertexYield"]->GetXaxis()->SetBinLabel( m_vertexingAlgorithmStep+1, name.c_str() );
2296
2297 for( auto& vertex : *workVerticesContainer ) {
2298 auto ntrk = vertex.selectedTrackIndices.size() + vertex.associatedTrackIndices.size();
2299 if( vertex.isGood && ntrk >= 2 ) {
2300 static_cast<TH2F*>( m_hists["vertexYieldNtrk"] )->Fill( ntrk, m_vertexingAlgorithmStep );
2301 static_cast<TH2F*>( m_hists["vertexYieldChi2"] )->Fill( vertex.Chi2/(vertex.ndof() + AlgConsts::infinitesimal), m_vertexingAlgorithmStep );
2302 }
2303 }
2304 m_hists["vertexYieldNtrk"]->GetYaxis()->SetBinLabel( m_vertexingAlgorithmStep+1, name.c_str() );
2305 m_hists["vertexYieldChi2"]->GetYaxis()->SetBinLabel( m_vertexingAlgorithmStep+1, name.c_str() );
2306
2307
2308 if( !final ) return StatusCode::SUCCESS;
2309
2310 for( auto& vertex : *workVerticesContainer ) {
2311 auto ntrk = vertex.selectedTrackIndices.size() + vertex.associatedTrackIndices.size();
2312 if( vertex.isGood && ntrk >= 2 ) {
2313 m_hists["finalVtxNtrk"] ->Fill( ntrk );
2314 m_hists["finalVtxR"] ->Fill( vertex.vertex.perp() );
2315 static_cast<TH2F*>( m_hists["finalVtxNtrkR"] )->Fill( ntrk, vertex.vertex.perp() );
2316 }
2317 }
2318
2319 return StatusCode::SUCCESS;
2320 }
void printWrkSet(const std::vector< WrkVrt > *WrkVrtSet, const std::string &name)
print the contents of reconstructed vertices
float ndof(const U &p)

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ nTrkCommon()

size_t VKalVrtAthena::VrtSecInclusive::nTrkCommon ( std::vector< WrkVrt > * WrkVrtSet,
const std::pair< unsigned, unsigned > & pairIndex )
staticprivate

returns the number of tracks commonly present in both vertices

Definition at line 662 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

663 {
664 //
665 // Number of common tracks for 2 vertices
666 //
667
668 auto& trackIndices1 = workVerticesContainer->at( pairIndex.first ).selectedTrackIndices;
669 auto& trackIndices2 = workVerticesContainer->at( pairIndex.second ).selectedTrackIndices;
670
671 if( trackIndices1.size() < 2 ) return 0;
672 if( trackIndices2.size() < 2 ) return 0;
673
674 size_t nTrkCom = 0;
675
676 for( auto& index : trackIndices1 ) {
677 if( std::find(trackIndices2.begin(),trackIndices2.end(), index) != trackIndices2.end()) nTrkCom++;
678 }
679
680 return nTrkCom;
681 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ passedFakeReject()

bool VKalVrtAthena::VrtSecInclusive::passedFakeReject ( const Amg::Vector3D & FitVertex,
const xAOD::TrackParticle * itrk,
const xAOD::TrackParticle * jtrk )
private

Flag false if the consistituent tracks are not consistent with the vertex position.

Definition at line 2186 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2189 {
2190
2191 const bool& check_itrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( itrk, FitVertex );
2192 const bool& check_jtrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( jtrk, FitVertex );
2193
2194 return ( check_itrk && check_jtrk );
2195
2196 }
Gaudi::Property< std::string > m_checkPatternStrategy

◆ patternCheck()

bool VKalVrtAthena::VrtSecInclusive::patternCheck ( const uint32_t & pattern,
const Amg::Vector3D & vertex )
private

Definition at line 2020 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2020 {
2021 bool flag = false;
2022
2024 flag = patternCheckRun2( pattern, vertex );
2026 flag = patternCheckRun1( pattern, vertex );
2027 }
2028
2029 return flag;
2030 }
static bool patternCheckRun1(const uint32_t &pattern, const Amg::Vector3D &vertex)
static bool patternCheckRun2(const uint32_t &pattern, const Amg::Vector3D &vertex)
Gaudi::Property< int > m_geoModel
bool flag
Definition master.py:29

◆ patternCheckOuterOnly()

bool VKalVrtAthena::VrtSecInclusive::patternCheckOuterOnly ( const uint32_t & pattern,
const Amg::Vector3D & vertex )
private

Definition at line 2033 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2033 {
2034 bool flag = false;
2035
2037 flag = patternCheckRun2OuterOnly( pattern, vertex );
2039 flag = patternCheckRun1OuterOnly( pattern, vertex );
2040 }
2041
2042 return flag;
2043 }
static bool patternCheckRun1OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
static bool patternCheckRun2OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)

◆ patternCheckRun1()

bool VKalVrtAthena::VrtSecInclusive::patternCheckRun1 ( const uint32_t & pattern,
const Amg::Vector3D & vertex )
staticprivate

Definition at line 1710 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

1710 {
1711 //
1712 // rough guesses for active layers:
1713 // BeamPipe: 25.0
1714 // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
1715 // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
1716 //
1717
1718 const double rad = vertex.perp();
1719 const double absz = fabs( vertex.z() );
1720
1721 // vertex area classification
1722 enum vertexArea {
1723 insideBeamPipe,
1724
1725 insidePixelBarrel1,
1726 aroundPixelBarrel1,
1727
1728 outsidePixelBarrel1_and_insidePixelBarrel2,
1729 aroundPixelBarrel2,
1730
1731 outsidePixelBarrel2_and_insidePixelBarrel3,
1732 aroundPixelBarrel3,
1733
1734 outsidePixelBarrel3_and_insideSctBarrel0,
1735 aroundSctBarrel0,
1736
1737 outsideSctBarrel0_and_insideSctBarrel1,
1738 aroundSctBarrel1,
1739 };
1740
1741 // Mutually exclusive vertex position pattern
1742 Int_t vertex_pattern = 0;
1743 if( rad < 25.00 ) {
1744 vertex_pattern = insideBeamPipe;
1745
1746 } else if( rad < 47.7 && absz < 400.5 ) {
1747 vertex_pattern = insidePixelBarrel1;
1748
1749 } else if( rad < 54.4 && absz < 400.5 ) {
1750 vertex_pattern = aroundPixelBarrel1;
1751
1752 } else if( rad < 85.5 && absz < 400.5 ) {
1753 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1754
1755 } else if( rad < 92.2 && absz < 400.5 ) {
1756 vertex_pattern = aroundPixelBarrel2;
1757
1758 } else if( rad < 119.3 && absz < 400.5 ) {
1759 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1760
1761 } else if( rad < 126.1 && absz < 400.5 ) {
1762 vertex_pattern = aroundPixelBarrel3;
1763
1764 } else if( rad < 290 && absz < 749.0 ) {
1765 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1766
1767 } else if( rad < 315 && absz < 749.0 ) {
1768 vertex_pattern = aroundSctBarrel0;
1769
1770 } else if( rad < 360 && absz < 749.0 ) {
1771 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1772
1773 } else if( rad < 390 && absz < 749.0 ) {
1774 vertex_pattern = aroundSctBarrel1;
1775
1776 } else {
1777 }
1778
1779
1781 if( vertex_pattern == insideBeamPipe ) {
1782
1783 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1784
1785 }
1786
1787
1788 else if( vertex_pattern == insidePixelBarrel1 ) {
1789
1790 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1791 }
1792
1793
1794 else if( vertex_pattern == aroundPixelBarrel1 ) {
1795
1796 // require nothing for PixelBarrel1
1797 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1798 }
1799
1800
1801 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1802
1803 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1804 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1805 }
1806
1807
1808 else if( vertex_pattern == aroundPixelBarrel2 ) {
1809
1810 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1811 // require nothing for PixelBarrel2
1812 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1813 }
1814
1815
1816 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1817
1818 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1819 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1820 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1821 }
1822
1823 else if( vertex_pattern == aroundPixelBarrel3 ) {
1824
1825 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1826 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1827 // require nothing for PixelBarrel3
1828 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1829 }
1830
1831
1832 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1833
1834 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1835 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1836 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1837 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1838 }
1839
1840
1841 else if( vertex_pattern == aroundSctBarrel0 ) {
1842
1843 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1844 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1845 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1846 // require nothing for SctBarrel0
1847 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1848 }
1849
1850
1851 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1852
1853 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1854 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1855 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1856 if( (pattern & (1<<Trk::sctBarrel0)) ) return false;
1857 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1858 }
1859
1860
1861 else if( vertex_pattern == aroundSctBarrel1 ) {
1862 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1863 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1864 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1865 if( (pattern & (1<<Trk::sctBarrel0)) ) return false;
1866 // require nothing for SctBarrel1
1867 if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1868 }
1870
1871 return true;
1872 }

◆ patternCheckRun1OuterOnly()

bool VKalVrtAthena::VrtSecInclusive::patternCheckRun1OuterOnly ( const uint32_t & pattern,
const Amg::Vector3D & vertex )
staticprivate

Definition at line 1875 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

1875 {
1876 //
1877 // rough guesses for active layers:
1878 // BeamPipe: 25.0
1879 // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
1880 // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
1881 //
1882
1883 const double rad = vertex.perp();
1884 const double absz = fabs( vertex.z() );
1885
1886 // vertex area classification
1887 enum vertexArea {
1888 insideBeamPipe,
1889
1890 insidePixelBarrel1,
1891 aroundPixelBarrel1,
1892
1893 outsidePixelBarrel1_and_insidePixelBarrel2,
1894 aroundPixelBarrel2,
1895
1896 outsidePixelBarrel2_and_insidePixelBarrel3,
1897 aroundPixelBarrel3,
1898
1899 outsidePixelBarrel3_and_insideSctBarrel0,
1900 aroundSctBarrel0,
1901
1902 outsideSctBarrel0_and_insideSctBarrel1,
1903 aroundSctBarrel1,
1904 };
1905
1906 // Mutually exclusive vertex position pattern
1907 Int_t vertex_pattern = 0;
1908 if( rad < 25.00 ) {
1909 vertex_pattern = insideBeamPipe;
1910
1911 } else if( rad < 47.7 && absz < 400.5 ) {
1912 vertex_pattern = insidePixelBarrel1;
1913
1914 } else if( rad < 54.4 && absz < 400.5 ) {
1915 vertex_pattern = aroundPixelBarrel1;
1916
1917 } else if( rad < 85.5 && absz < 400.5 ) {
1918 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1919
1920 } else if( rad < 92.2 && absz < 400.5 ) {
1921 vertex_pattern = aroundPixelBarrel2;
1922
1923 } else if( rad < 119.3 && absz < 400.5 ) {
1924 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1925
1926 } else if( rad < 126.1 && absz < 400.5 ) {
1927 vertex_pattern = aroundPixelBarrel3;
1928
1929 } else if( rad < 290 && absz < 749.0 ) {
1930 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1931
1932 } else if( rad < 315 && absz < 749.0 ) {
1933 vertex_pattern = aroundSctBarrel0;
1934
1935 } else if( rad < 360 && absz < 749.0 ) {
1936 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1937
1938 } else if( rad < 390 && absz < 749.0 ) {
1939 vertex_pattern = aroundSctBarrel1;
1940
1941 } else {
1942 }
1943
1944
1946 if( vertex_pattern == insideBeamPipe ) {
1947
1948 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1949
1950 }
1951
1952
1953 else if( vertex_pattern == insidePixelBarrel1 ) {
1954
1955 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1956 }
1957
1958
1959 else if( vertex_pattern == aroundPixelBarrel1 ) {
1960
1961 // require nothing for PixelBarrel1
1962 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1963 }
1964
1965
1966 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1967
1968 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1969 }
1970
1971
1972 else if( vertex_pattern == aroundPixelBarrel2 ) {
1973
1974 // require nothing for PixelBarrel2
1975 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1976 }
1977
1978
1979 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1980
1981 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1982 }
1983
1984 else if( vertex_pattern == aroundPixelBarrel3 ) {
1985
1986 // require nothing for PixelBarrel3
1987 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1988 }
1989
1990
1991 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1992
1993 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1994 }
1995
1996
1997 else if( vertex_pattern == aroundSctBarrel0 ) {
1998
1999 // require nothing for SctBarrel0
2000 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
2001 }
2002
2003
2004 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
2005
2006 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
2007 }
2008
2009
2010 else if( vertex_pattern == aroundSctBarrel1 ) {
2011 // require nothing for SctBarrel1
2012 if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
2013 }
2015
2016 return true;
2017 }

◆ patternCheckRun2()

bool VKalVrtAthena::VrtSecInclusive::patternCheckRun2 ( const uint32_t & pattern,
const Amg::Vector3D & vertex )
staticprivate

Definition at line 1300 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

1300 {
1301
1302 //
1303 // rough guesses for active layers:
1304 // BeamPipe: 23.5-24.3
1305 // IBL: 31.0-38.4
1306 // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
1307 // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
1308 //
1309
1310 const double rad = vertex.perp();
1311 const double absz = fabs( vertex.z() );
1312
1313 // vertex area classification
1314 enum vertexArea {
1315 insideBeamPipe,
1316
1317 insidePixelBarrel0,
1318 aroundPixelBarrel0,
1319
1320 outsidePixelBarrel0_and_insidePixelBarrel1,
1321 aroundPixelBarrel1,
1322
1323 outsidePixelBarrel1_and_insidePixelBarrel2,
1324 aroundPixelBarrel2,
1325
1326 outsidePixelBarrel2_and_insidePixelBarrel3,
1327 aroundPixelBarrel3,
1328
1329 outsidePixelBarrel3_and_insideSctBarrel0,
1330 aroundSctBarrel0,
1331
1332 outsideSctBarrel0_and_insideSctBarrel1,
1333 aroundSctBarrel1,
1334 };
1335
1336 // Mutually exclusive vertex position pattern
1337 int vertex_pattern = 0;
1338 if( rad < 23.50 ) {
1339 vertex_pattern = insideBeamPipe;
1340
1341 } else if( rad < 31.0 && absz < 331.5 ) {
1342 vertex_pattern = insidePixelBarrel0;
1343
1344 } else if( rad < 38.4 && absz < 331.5 ) {
1345 vertex_pattern = aroundPixelBarrel0;
1346
1347 } else if( rad < 47.7 && absz < 400.5 ) {
1348 vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1349
1350 } else if( rad < 54.4 && absz < 400.5 ) {
1351 vertex_pattern = aroundPixelBarrel1;
1352
1353 } else if( rad < 85.5 && absz < 400.5 ) {
1354 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1355
1356 } else if( rad < 92.2 && absz < 400.5 ) {
1357 vertex_pattern = aroundPixelBarrel2;
1358
1359 } else if( rad < 119.3 && absz < 400.5 ) {
1360 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1361
1362 } else if( rad < 126.1 && absz < 400.5 ) {
1363 vertex_pattern = aroundPixelBarrel3;
1364
1365 } else if( rad < 290 && absz < 749.0 ) {
1366 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1367
1368 } else if( rad < 315 && absz < 749.0 ) {
1369 vertex_pattern = aroundSctBarrel0;
1370
1371 } else if( rad < 360 && absz < 749.0 ) {
1372 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1373
1374 } else if( rad < 390 && absz < 749.0 ) {
1375 vertex_pattern = aroundSctBarrel1;
1376
1377 } else {
1378 }
1379
1380 unsigned nPixelLayers { 0 };
1381 {
1382 if ( pattern & (1 << Trk::pixelBarrel0) ) nPixelLayers++;
1383 if ( pattern & (1 << Trk::pixelBarrel1) ) nPixelLayers++;
1384 if ( pattern & (1 << Trk::pixelBarrel2) ) nPixelLayers++;
1385 if ( pattern & (1 << Trk::pixelBarrel3) ) nPixelLayers++;
1386 if ( pattern & (1 << Trk::pixelEndCap0) ) nPixelLayers++;
1387 if ( pattern & (1 << Trk::pixelEndCap1) ) nPixelLayers++;
1388 if ( pattern & (1 << Trk::pixelEndCap2) ) nPixelLayers++;
1389 }
1390
1392 if( vertex_pattern == insideBeamPipe ) {
1393
1394 if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1395 if( nPixelLayers < 3 ) return false;
1396
1397
1398 } else if( vertex_pattern == insidePixelBarrel0 ) {
1399
1400 if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1401 if( nPixelLayers < 3 ) return false;
1402 }
1403
1404
1405 else if( vertex_pattern == aroundPixelBarrel0 ) {
1406
1407 // require nothing for PixelBarrel0
1408 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1409 if( nPixelLayers < 2 ) return false;
1410 }
1411
1412
1413 else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1414
1415 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1416 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1417 if( nPixelLayers < 2 ) return false;
1418 }
1419
1420
1421 else if( vertex_pattern == aroundPixelBarrel1 ) {
1422
1423 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1424 // require nothing for PixelBarrel
1425 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1426 if( nPixelLayers < 2 ) return false;
1427 }
1428
1429
1430 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1431
1432 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1433 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1434 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1435 if( nPixelLayers < 2 ) return false;
1436 }
1437
1438
1439 else if( vertex_pattern == aroundPixelBarrel2 ) {
1440
1441 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1442 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1443 // require nothing for PixelBarrel2
1444 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1445 }
1446
1447
1448 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1449
1450 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1451 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1452 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1453 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1454 }
1455
1456 else if( vertex_pattern == aroundPixelBarrel3 ) {
1457
1458 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1459 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1460 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1461 // require nothing for PixelBarrel3
1462 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1463 }
1464
1465
1466 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1467
1468 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1469 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1470 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1471 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1472 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1473 }
1474
1475
1476 else if( vertex_pattern == aroundSctBarrel0 ) {
1477
1478 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1479 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1480 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1481 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1482 // require nothing for SctBarrel0
1483 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1484 }
1485
1486
1487 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1488
1489 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1490 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1491 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1492 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1493 if( (pattern & (1<<Trk::sctBarrel0)) ) return false;
1494 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1495 }
1496
1497
1498 else if( vertex_pattern == aroundSctBarrel1 ) {
1499 if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1500 if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1501 if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1502 if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1503 if( (pattern & (1<<Trk::sctBarrel0)) ) return false;
1504 // require nothing for SctBarrel1
1505 if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1506 }
1508
1509 return true;
1510
1511 }

◆ patternCheckRun2OuterOnly()

bool VKalVrtAthena::VrtSecInclusive::patternCheckRun2OuterOnly ( const uint32_t & pattern,
const Amg::Vector3D & vertex )
staticprivate

Definition at line 1514 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

1514 {
1515
1516 //
1517 // rough guesses for active layers:
1518 // BeamPipe: 23.5-24.3
1519 // IBL: 31.0-38.4
1520 // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
1521 // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
1522 //
1523
1524 const double rad = vertex.perp();
1525 const double absz = fabs( vertex.z() );
1526
1527 // vertex area classification
1528 enum vertexArea {
1529 insideBeamPipe,
1530
1531 insidePixelBarrel0,
1532 aroundPixelBarrel0,
1533
1534 outsidePixelBarrel0_and_insidePixelBarrel1,
1535 aroundPixelBarrel1,
1536
1537 outsidePixelBarrel1_and_insidePixelBarrel2,
1538 aroundPixelBarrel2,
1539
1540 outsidePixelBarrel2_and_insidePixelBarrel3,
1541 aroundPixelBarrel3,
1542
1543 outsidePixelBarrel3_and_insideSctBarrel0,
1544 aroundSctBarrel0,
1545
1546 outsideSctBarrel0_and_insideSctBarrel1,
1547 aroundSctBarrel1,
1548 };
1549
1550 // Mutually exclusive vertex position pattern
1551 int vertex_pattern = 0;
1552 if( rad < 23.50 ) {
1553 vertex_pattern = insideBeamPipe;
1554
1555 } else if( rad < 31.0 && absz < 331.5 ) {
1556 vertex_pattern = insidePixelBarrel0;
1557
1558 } else if( rad < 38.4 && absz < 331.5 ) {
1559 vertex_pattern = aroundPixelBarrel0;
1560
1561 } else if( rad < 47.7 && absz < 400.5 ) {
1562 vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1563
1564 } else if( rad < 54.4 && absz < 400.5 ) {
1565 vertex_pattern = aroundPixelBarrel1;
1566
1567 } else if( rad < 85.5 && absz < 400.5 ) {
1568 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1569
1570 } else if( rad < 92.2 && absz < 400.5 ) {
1571 vertex_pattern = aroundPixelBarrel2;
1572
1573 } else if( rad < 119.3 && absz < 400.5 ) {
1574 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1575
1576 } else if( rad < 126.1 && absz < 400.5 ) {
1577 vertex_pattern = aroundPixelBarrel3;
1578
1579 } else if( rad < 290 && absz < 749.0 ) {
1580 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1581
1582 } else if( rad < 315 && absz < 749.0 ) {
1583 vertex_pattern = aroundSctBarrel0;
1584
1585 } else if( rad < 360 && absz < 749.0 ) {
1586 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1587
1588 } else if( rad < 390 && absz < 749.0 ) {
1589 vertex_pattern = aroundSctBarrel1;
1590
1591 } else {
1592 }
1593
1594
1595 unsigned nPixelLayers { 0 };
1596 {
1597 nPixelLayers += ( pattern & (1 << Trk::pixelBarrel0) );
1598 nPixelLayers += ( pattern & (1 << Trk::pixelBarrel1) );
1599 nPixelLayers += ( pattern & (1 << Trk::pixelBarrel2) );
1600 nPixelLayers += ( pattern & (1 << Trk::pixelBarrel3) );
1601 nPixelLayers += ( pattern & (1 << Trk::pixelEndCap0) );
1602 nPixelLayers += ( pattern & (1 << Trk::pixelEndCap1) );
1603 nPixelLayers += ( pattern & (1 << Trk::pixelEndCap2) );
1604 }
1605
1607 if( vertex_pattern == insideBeamPipe ) {
1608
1609 if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1610 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1611 if( nPixelLayers < 3 ) return false;
1612
1613 } else if( vertex_pattern == insidePixelBarrel0 ) {
1614
1615 if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1616 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1617 if( nPixelLayers < 3 ) return false;
1618
1619 }
1620
1621
1622 else if( vertex_pattern == aroundPixelBarrel0 ) {
1623
1624 // require nothing for PixelBarrel0
1625 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1626 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1627 if( nPixelLayers < 3 ) return false;
1628 }
1629
1630
1631 else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1632
1633 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1634 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1635 if( nPixelLayers < 3 ) return false;
1636 }
1637
1638
1639 else if( vertex_pattern == aroundPixelBarrel1 ) {
1640
1641 // require nothing for PixelBarrel1
1642 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1643 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1644 if( nPixelLayers < 2 ) return false;
1645 }
1646
1647
1648 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1649
1650 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1651 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1652 if( nPixelLayers < 2 ) return false;
1653 }
1654
1655
1656 else if( vertex_pattern == aroundPixelBarrel2 ) {
1657
1658 // require nothing for PixelBarrel2
1659 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1660 }
1661
1662
1663 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1664
1665 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1666 }
1667
1668 else if( vertex_pattern == aroundPixelBarrel3 ) {
1669
1670 // require nothing for PixelBarrel3
1671 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1672 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1673 }
1674
1675
1676 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1677
1678 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1679 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1680 }
1681
1682
1683 else if( vertex_pattern == aroundSctBarrel0 ) {
1684
1685 // require nothing for SctBarrel0
1686 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1687 if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1688 }
1689
1690
1691 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1692
1693 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1694 if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1695 }
1696
1697
1698 else if( vertex_pattern == aroundSctBarrel1 ) {
1699 // require nothing for SctBarrel1
1700 if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1701 if( ! (pattern & (1<<Trk::sctBarrel3)) ) return false;
1702 }
1704
1705 return true;
1706
1707 }

◆ printWrkSet()

void VKalVrtAthena::VrtSecInclusive::printWrkSet ( const std::vector< WrkVrt > * WrkVrtSet,
const std::string & name )
private

print the contents of reconstructed vertices

Definition at line 862 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

863 {
864 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": ===============================================================" );
865 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": " << name << ": #vertices = " << workVerticesContainer->size() );
866
867 std::set<const xAOD::TrackParticle*> usedTracks;
868
869 auto concatenateIndicesToString = []( auto indices, auto& collection ) -> std::string {
870 if( 0 == indices.size() ) return "";
871 return std::accumulate( std::next(indices.begin()), indices.end(), std::to_string( indices.at(0) ),
872 [&collection]( const std::string& str, auto& index ) { return str + ", " + std::to_string( collection.at(index)->index() ); } );
873 };
874
875 std::map<const xAOD::TruthVertex*, bool> previous;
876
877 for( auto& pair : m_matchMap ) { previous.emplace( pair.first, pair.second ); }
878
879 m_matchMap.clear();
880 for( const auto* truthVertex : m_tracingTruthVertices ) { m_matchMap.emplace( truthVertex, false ); }
881
882 for(size_t iv=0; iv<workVerticesContainer->size(); iv++) {
883 const auto& wrkvrt = workVerticesContainer->at(iv);
884
885 if( wrkvrt.nTracksTotal() < 2 ) continue;
886
887 std::string sels = concatenateIndicesToString( wrkvrt.selectedTrackIndices, m_selectedTracks );
888 std::string assocs = concatenateIndicesToString( wrkvrt.associatedTrackIndices, m_associatedTracks );
889
890 for( const auto& index : wrkvrt.selectedTrackIndices ) { usedTracks.insert( m_selectedTracks.at(index) ); }
891 for( const auto& index : wrkvrt.associatedTrackIndices ) { usedTracks.insert( m_associatedTracks.at(index) ); }
892
893 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": " << name << " vertex [" << iv << "]: " << &wrkvrt
894 << ", isGood = " << (wrkvrt.isGood? "true" : "false")
895 << ", #ntrks(tot, sel, assoc) = (" << wrkvrt.nTracksTotal() << ", " << wrkvrt.selectedTrackIndices.size() << ", " << wrkvrt.associatedTrackIndices.size() << "), "
896 << ", chi2/ndof = " << wrkvrt.fitQuality()
897 << ", (r, z) = (" << wrkvrt.vertex.perp()
898 << ", " << wrkvrt.vertex.z() << ")"
899 << ", sels = { " << sels << " }"
900 << ", assocs = { " << assocs << " }" );
901
902 // Truth match condition
903 for( const auto* truthVertex : m_tracingTruthVertices ) {
904
905
906 Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
907 Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
908
909 const auto distance = vReco - vTruth;
910
911 AmgSymMatrix(3) cov;
912 cov.fillSymmetric( 0, 0, wrkvrt.vertexCov.at(0) );
913 cov.fillSymmetric( 1, 0, wrkvrt.vertexCov.at(1) );
914 cov.fillSymmetric( 1, 1, wrkvrt.vertexCov.at(2) );
915 cov.fillSymmetric( 2, 0, wrkvrt.vertexCov.at(3) );
916 cov.fillSymmetric( 2, 1, wrkvrt.vertexCov.at(4) );
917 cov.fillSymmetric( 2, 2, wrkvrt.vertexCov.at(5) );
918
919 const double s2 = distance.transpose() * cov.inverse() * distance;
920
921 if( distance.norm() < 2.0 || s2 < 100. ) m_matchMap.at( truthVertex ) = true;
922
923 }
924
925 }
926
927 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": number of used tracks = " << usedTracks.size() );
928
929 if( !previous.empty() && previous.size() == m_matchMap.size() ) {
930 for( auto& pair : m_matchMap ) {
931 if( previous.find( pair.first ) == previous.end() ) continue;
932 if( pair.second != previous.at( pair.first ) ) {
933 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": Match flag has changed: (r, z) = (" << pair.first->perp() << ", " << pair.first->z() << ")" );
934 }
935 }
936 }
937
938 if( m_FillHist ) {
939 for( auto& pair : m_matchMap ) {
940 if( pair.second ) m_hists["nMatchedTruths"]->Fill( m_vertexingAlgorithmStep+2, pair.first->perp() );
941 }
942 }
943
944 std::string msg;
945 for( const auto* trk : usedTracks ) { msg += Form("%ld, ", trk->index() ); }
946
947 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": used tracks = " << msg );
948 ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": ===============================================================" );
949
950 }
size_t size() const
Number of registered mappings.
static const Attributes_t empty
std::map< const xAOD::TruthVertex *, bool > m_matchMap
@ previous
Definition BinningData.h:34
std::pair< long int, long int > indices

◆ processPrimaryVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::processPrimaryVertices ( )
private

Definition at line 686 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

686 {
687
688 //--------------------------------------------------------
689 // Primary vertex extraction from TES
690 //
691
692 ATH_CHECK( evtStore()->retrieve( m_primaryVertices, "PrimaryVertices") );
693
694 if( m_FillNtuple ) m_ntupleVars->get<unsigned int>( "NumPV" ) = 0;
695 m_thePV = nullptr;
696
697 ATH_MSG_DEBUG( "processPrimaryVertices(): pv_size = " << m_primaryVertices->size() );
698
699 // Loop over PV container and get number of tracks of each PV
700
701 for( const auto *vertex : *m_primaryVertices ) {
702
703 // Hide (2015-04-21): xAOD::Vertex may contain several types of vertices
704 // e.g. if VertexType==NoVtx, this is a dummy vertex.
705 // We only need to extract primary vertices here, and skip otherwise.
706
707 if( xAOD::VxType::PriVtx != vertex->vertexType() ) continue;
708
709 // Not considering pile-up; pick-up the first PV
710 m_thePV = vertex;
711
712 if( m_FillNtuple ) {
713
714 if( 0 == m_ntupleVars->get<unsigned int>( "NumPV" ) ) {
715
716 m_ntupleVars->get<double>( "PVX" ) = vertex->x();
717 m_ntupleVars->get<double>( "PVY" ) = vertex->y();
718 m_ntupleVars->get<double>( "PVZ" ) = vertex->z();
719 m_ntupleVars->get<unsigned int>( "PVType" ) = vertex->vertexType();
720
721 // number of tracks associated to the PV
722 m_ntupleVars->get<unsigned int>( "NTrksPV" ) = vertex->nTrackParticles();
723 }
724
725 m_ntupleVars->get<unsigned int>( "NumPV" )++;
726
727 m_ntupleVars->get< vector<int> > ( "NdofTrksPV" ) .emplace_back( vertex->numberDoF() );
728 m_ntupleVars->get< vector<double> >( "PVZpile" ) .emplace_back( vertex->position().z() );
729 }
730
731 ATH_MSG_DEBUG("PrimVertex x/y/z/nDOF "
732 << vertex->x() << ","
733 << vertex->y() << ","
734 << vertex->z() << ","
735 << vertex->numberDoF() );
736
737 }
738
739 // Use the dummy PV if no PV is composed
740 if( !m_thePV ) {
741 ATH_MSG_DEBUG("No Reconstructed PV was found. Using the dummy PV instead.");
742 for( const auto *vertex : *m_primaryVertices ) {
743 if( xAOD::VxType::NoVtx != vertex->vertexType() ) continue;
744
745 if( m_FillNtuple ) {
746 // Not considering pile-up; pick-up the first PV
747 if( 0 == m_ntupleVars->get<unsigned int>( "NumPV" ) ) {
748 m_thePV = vertex;
749
750 m_ntupleVars->get<double>( "PVX" ) = vertex->x();
751 m_ntupleVars->get<double>( "PVY" ) = vertex->y();
752 m_ntupleVars->get<double>( "PVZ" ) = vertex->z();
753 m_ntupleVars->get<unsigned int>( "PVType" ) = vertex->vertexType();
754
755 // number of tracks associated to the PV
756 m_ntupleVars->get<unsigned int>( "NTrksPV" ) = vertex->nTrackParticles();
757 }
758 }
759 }
760 }
761
762 // if thePV is null, the PV is not found.
763 if( !m_thePV ) {
764 ATH_MSG_DEBUG("No PV is found in the PV collection!");
765 return StatusCode::FAILURE;
766 }
767
768 ATH_MSG_DEBUG(" Primary vertex successful. thePV = " << m_thePV );
769
770 return StatusCode::SUCCESS;
771 }
const xAOD::VertexContainer * m_primaryVertices
@ PriVtx
Primary vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.

◆ rearrangeTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::rearrangeTracks ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

Definition at line 757 of file VertexingAlgs.cxx.

759 {
761 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": skip");
762 return StatusCode::SUCCESS;
763 }
764 //
765 // Rearrangement of solutions
766 //
767
768 std::vector<long int> processedTracks;
769
770 unsigned mergeCounter { 0 };
771 unsigned brokenCounter { 0 };
772 unsigned removeTrackCounter { 0 };
773
774 while( true ) {
775
776 // worstChi2: unit in [chi2 per track]
777 long int maxSharedTrack;
778 long int worstMatchingVertex;
779 std::pair<unsigned, unsigned> indexPair { AlgConsts::invalidUnsigned, AlgConsts::invalidUnsigned };
780
781
782 // trackToVertexMap has IDs of each track which can contain array of vertices.
783 // e.g. TrkInVrt->at( track_id ).size() gives the number of vertices which use the track [track_id].
784
785 std::map<long int, std::vector<long int> > trackToVertexMap;
786
787 // Fill trackToVertexMap with vertex IDs of each track
788 trackClassification( workVerticesContainer, trackToVertexMap );
789
790
791 auto worstChi2 = findWorstChi2ofMaximallySharedTrack( workVerticesContainer, trackToVertexMap, maxSharedTrack, worstMatchingVertex );
792
793 if( worstChi2 == AlgConsts::invalidFloat ) {
794 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": no shared tracks are found --> exit the while loop." );
795 break;
796 }
797
798 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vertex [" << worstMatchingVertex << "]: maximally shared track index = " << maxSharedTrack
799 << ", multiplicity = " << trackToVertexMap.at( maxSharedTrack ).size()
800 << ", worst chi2_trk = " << worstChi2 );
801
802 //Choice of action
803 if( worstChi2 < m_TrackDetachCut ) {
804
805 // Here, the max-shared track is well-associated and cannot be detached.
806 // The closest vertex should be merged.
807
808 std::vector< std::pair<unsigned, unsigned> > badPairs;
809
810 while( true ) {
811
812 // find the closest vertices pair that share the track of interest
813 double minSignificance { AlgConsts::maxValue };
814 unsigned nShared { 0 };
815
816 {
817 auto& vrtList = trackToVertexMap.at( maxSharedTrack );
818
819 auto nGood = std::count_if( vrtList.begin(), vrtList.end(), [&]( auto& v ) { return workVerticesContainer->at(v).isGood; } );
820 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": size of good vertices = " << nGood );
821
822 std::vector< std::tuple< std::pair<unsigned, unsigned>, double, unsigned> > significanceTuple;
823 enum { kIndexPair, kSignificance, kNshared };
824
825 for( auto ivrt = vrtList.begin(); ivrt != vrtList.end(); ++ivrt ) {
826 for( auto jvrt = std::next( ivrt ); jvrt != vrtList.end(); ++jvrt ) {
827 auto pair = std::pair<unsigned, unsigned>( *ivrt, *jvrt );
828
829 if( !( workVerticesContainer->at(*ivrt).isGood ) ) continue;
830 if( !( workVerticesContainer->at(*jvrt).isGood ) ) continue;
831
832 // skip known bad pairs
833 if( std::find( badPairs.begin(), badPairs.end(), pair ) != badPairs.end() ) continue;
834
835 auto signif = significanceBetweenVertices( workVerticesContainer->at( *ivrt ), workVerticesContainer->at( *jvrt ) );
836
837 auto& ivrtTrks = workVerticesContainer->at(*ivrt).selectedTrackIndices;
838 auto& jvrtTrks = workVerticesContainer->at(*jvrt).selectedTrackIndices;
839
840 auto nSharedTracks = std::count_if( ivrtTrks.begin(), ivrtTrks.end(),
841 [&]( auto& index ) {
842 return std::find( jvrtTrks.begin(), jvrtTrks.end(), index ) != jvrtTrks.end();
843 } );
844
845 significanceTuple.emplace_back( pair, signif, nSharedTracks );
846 }
847 }
848
849 if( significanceTuple.empty() ) {
850 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": no vertex pairs are found --> exit the while loop." );
851 break;
852 }
853
854 auto minSignificanceTuple = std::min_element( significanceTuple.begin(), significanceTuple.end(), [&]( auto& t1, auto&t2 ) { return std::get<kSignificance>(t1) < std::get<kSignificance>(t2); } );
855
856 indexPair = std::get<kIndexPair> ( *minSignificanceTuple );
857 minSignificance = std::get<kSignificance> ( *minSignificanceTuple );
858 nShared = std::get<kNshared> ( *minSignificanceTuple );
859 }
860
861 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": minSignificance = " << minSignificance );
862
863 if( minSignificance < m_VertexMergeCut || nShared >= 2 ) {
864
865 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": attempt to merge vertices " << indexPair.first << " and " << indexPair.second );
866
867 WrkVrt vertex_backup1 = workVerticesContainer->at( indexPair.first );
868 WrkVrt vertex_backup2 = workVerticesContainer->at( indexPair.second );
869
870 StatusCode sc = mergeVertices( ctx, workVerticesContainer->at( indexPair.first ), workVerticesContainer->at( indexPair.second ) );
871
872 if( m_FillHist ) { m_hists["mergeType"]->Fill( RECONSTRUCT_NTRK ); }
873
874 if( sc.isFailure() ) {
875 // revert to the original
876 workVerticesContainer->at( indexPair.first ) = std::move(vertex_backup1);
877 workVerticesContainer->at( indexPair.second ) = std::move(vertex_backup2);
878 badPairs.emplace_back( indexPair );
879 }
880
881 // The second vertex is merged to the first.
882 // Explicity flag the second vertex is invalid.
883 workVerticesContainer->at( indexPair.second ).isGood = false;
884
885 // Now the vertex is merged and the bad pair record is outdated.
886 badPairs.clear();
887
888 mergeCounter++;
889
890 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Merged vertices " << indexPair.first << " and " << indexPair.second << ". merged vertex multiplicity = " << workVerticesContainer->at( indexPair.first ).selectedTrackIndices.size() );
891
892 } else {
893
894 // Here, the significance between closest vertices sharing the track is sufficiently distant
895 // and cannot be merged, while the track-association chi2 is small as well.
896 // In order to resolve the ambiguity anyway, remove the track from the worst-associated vertex.
897
898 auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
899
900 auto end = std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&]( auto& index ) { return index == maxSharedTrack; } );
901 wrkvrt.selectedTrackIndices.erase( end, wrkvrt.selectedTrackIndices.end() );
902
903 removeTrackCounter++;
904
905 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": removed track " << maxSharedTrack << " from vertex " << worstMatchingVertex );
906
907 if( wrkvrt.selectedTrackIndices.size() < 2 ) {
908 wrkvrt.isGood = false;
909 brokenCounter++;
910 break;
911 }
912
913 StatusCode sc = refitVertex( ctx, wrkvrt );
914 if( sc.isFailure() ) {
915 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
916 }
917
918 break;
919
920 }
921 }
922
923 } else {
924
925 // Here, a bad track association is detected
926 // The track is detached from the worst-associated vertex and refit.
927
928 auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
929
930 auto end = std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&]( auto& index ) { return index == maxSharedTrack; } );
931 wrkvrt.selectedTrackIndices.erase( end, wrkvrt.selectedTrackIndices.end() );
932
933 if( wrkvrt.nTracksTotal() >=2 ) {
934
935 auto wrkvrt_backup = wrkvrt;
936 StatusCode sc = refitVertex( ctx, wrkvrt );
937 if( sc.isFailure() ) {
938 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
939 wrkvrt = std::move(wrkvrt_backup);
940 }
941
942 } else {
943 wrkvrt.isGood = false;
944 brokenCounter++;
945 }
946
947 removeTrackCounter++;
948
949 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": removed track " << maxSharedTrack << " from vertex " << worstMatchingVertex );
950
951 }
952
953 }
954
955 //
956 // Try to improve vertices with big Chi2
957 for( auto& wrkvrt : *workVerticesContainer ) {
958
959 if(!wrkvrt.isGood ) continue; //don't work on wrkvrt which is already bad
960 if( wrkvrt.selectedTrackIndices.size() < 3 ) continue;
961
962 WrkVrt backup = wrkvrt;
963 improveVertexChi2( ctx, wrkvrt );
964 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = std::move(backup);
965
966 if( wrkvrt.nTracksTotal() < 2 ) wrkvrt.isGood = false;
967
968 }
969
970 if( m_FillNtuple ) {
971 m_ntupleVars->get<unsigned int>( "NumRearrSecVrt" )=workVerticesContainer->size();
972 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Size of Solution Set: "<< m_ntupleVars->get<unsigned int>( "NumRearrSecVrt" ));
973 }
974
975 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
976 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Number of merges = " << mergeCounter << ", Number of track removal = " << removeTrackCounter << ", broken vertices = " << brokenCounter );
977 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
978
979 return StatusCode::SUCCESS;
980 }
void trackClassification(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &)
double findWorstChi2ofMaximallySharedTrack(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &, long int &, long int &)
Gaudi::Property< double > m_TrackDetachCut
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.

◆ reassembleVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::reassembleVertices ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

attempt to merge vertices when all tracks of a vertex A is close to vertex B in terms of impact parameter

Definition at line 984 of file VertexingAlgs.cxx.

986 {
987 // Here, the supposed issue is that, the position of the reconstructed vertex may be significantly
988 // displaced from its truth position, even if the constituent tracks are all from that truth.
989 // The fundamental reason of this is speculated that the VKalVrt vertex fitting could fall in
990 // a local minimum. This function attempts to improve the situation, given that N-track vertices
991 // are already reconstructed, by attempting to asociate a track of a small multiplicity vertex
992 // to another large multiplicity vertex.
993
994 unsigned reassembleCounter { 0 };
995
996 // First, sort WrkVrt by the track multiplicity
997 std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt& v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
998
999 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": #vertices = " << workVerticesContainer->size() );
1000 // Loop over vertices (small -> large Ntrk order)
1001 for( auto& wrkvrt : *workVerticesContainer ) {
1002 if( !wrkvrt.isGood ) continue;
1003 if( wrkvrt.selectedTrackIndices.size() <= 1 ) continue;
1004
1005 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": vertex " << &wrkvrt << " #tracks = " << wrkvrt.selectedTrackIndices.size() );
1006 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": candidate vertex: "
1007 << " isGood = " << (wrkvrt.isGood? "true" : "false")
1008 << ", #ntrks = " << wrkvrt.nTracksTotal()
1009 << ", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
1010 << ", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
1011 << ", chi2/ndof = " << wrkvrt.fitQuality()
1012 << ", (r, z) = (" << wrkvrt.vertex.perp()
1013 <<", " << wrkvrt.vertex.z() << ")" );
1014
1015 std::map<unsigned, std::vector<WrkVrt>::reverse_iterator> mergiableVertex;
1016 std::set<std::vector<WrkVrt>::reverse_iterator> mergiableVerticesSet;
1017
1018 for( auto& index : wrkvrt.selectedTrackIndices ) {
1019
1020 const xAOD::TrackParticle* trk = m_selectedTracks.at( index );
1021
1022 mergiableVertex[index] = workVerticesContainer->rend();
1023
1024 std::vector<double> distances;
1025
1026 // Reverse iteration: large Ntrk -> small Ntrk order
1027 for( auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
1028 auto& targetVertex = *ritr;
1029
1030 if( &wrkvrt == &targetVertex ) continue;
1031 if( wrkvrt.selectedTrackIndices.size() >= targetVertex.selectedTrackIndices.size() ) continue;
1032
1033 // Get the closest approach
1034 std::vector<double> impactParameters;
1035 std::vector<double> impactParErrors;
1036
1037 if( !getSVImpactParameters(ctx,trk,targetVertex.vertex,impactParameters,impactParErrors) ) continue;
1038
1039 const auto& distance = hypot( impactParameters.at(0), impactParameters.at(1) );
1040 distances.emplace_back( distance );
1041
1042 if( std::abs( impactParameters.at(0) ) > m_reassembleMaxImpactParameterD0 ) continue;
1043 if( std::abs( impactParameters.at(1) ) > m_reassembleMaxImpactParameterZ0 ) continue;
1044
1045 mergiableVertex[index] = ritr;
1046 mergiableVerticesSet.emplace( ritr );
1047
1048 }
1049
1050 auto min_distance = !distances.empty() ? *(std::min_element( distances.begin(), distances.end() )) : AlgConsts::invalidFloat;
1051
1052 if( mergiableVertex[index] == workVerticesContainer->rend() ) {
1053 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": track " << trk << " --> none : min distance = " << min_distance );
1054 } else {
1055 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": track " << trk << " --> " << &( *(mergiableVertex[index]) ) << " --> size = " << mergiableVertex[index]->selectedTrackIndices.size() << ": min distance = " << min_distance );
1056 }
1057
1058 }
1059
1060 size_t count_mergiable = std::count_if( mergiableVertex.begin(), mergiableVertex.end(),
1061 [&](const std::pair<unsigned, std::vector<WrkVrt>::reverse_iterator>& p ) {
1062 return p.second != workVerticesContainer->rend(); } );
1063
1064 if( mergiableVerticesSet.size() == 1 && count_mergiable == wrkvrt.selectedTrackIndices.size() ) {
1065
1066 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": identified a unique association destination vertex" );
1067
1068 WrkVrt& destination = *( mergiableVertex.begin()->second );
1069 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": destination #tracks before merging = " << destination.selectedTrackIndices.size() );
1070
1071 StatusCode sc = mergeVertices( ctx, destination, wrkvrt );
1072 if( sc.isFailure() ) {
1073 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failure in vertex merging" );
1074 }
1075
1076 improveVertexChi2( ctx, destination );
1077
1078 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": merged destination vertex: "
1079 << " isGood = " << (destination.isGood? "true" : "false")
1080 << ", #ntrks = " << destination.nTracksTotal()
1081 << ", #selectedTracks = " << destination.selectedTrackIndices.size()
1082 << ", #associatedTracks = " << destination.associatedTrackIndices.size()
1083 << ", chi2/ndof = " << destination.fitQuality()
1084 << ", (r, z) = (" << destination.vertex.perp()
1085 <<", " << destination.vertex.z() << ")" );
1086
1087 if( m_FillHist ) { m_hists["mergeType"]->Fill( REASSEMBLE ); }
1088
1089 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": destination #tracks after merging = " << destination.selectedTrackIndices.size() );
1090
1091 reassembleCounter++;
1092
1093 }
1094
1095 }
1096
1097 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1098 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": reassembled vertices = " << reassembleCounter );
1099 ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1100
1101 return StatusCode::SUCCESS;
1102 }
Gaudi::Property< double > m_reassembleMaxImpactParameterZ0
Gaudi::Property< double > m_reassembleMaxImpactParameterD0

◆ refitAndSelectGoodQualityVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::refitAndSelectGoodQualityVertices ( const EventContext & ctx,
std::vector< WrkVrt > * workVerticesContainer )
private

finalization of the vertex and store to xAOD::VertexContainer

Definition at line 1523 of file VertexingAlgs.cxx.

1525 {
1526 // Output SVs as xAOD::Vertex
1527 // Needs a conversion function from workVerticesContainer to xAOD::Vertex here.
1528 // The supposed form of the function will be as follows:
1529
1530 try {
1531 SG::WriteHandle<xAOD::VertexContainer> secVtxHandle = SG::makeHandle( m_vertexKey, ctx );
1532 ATH_CHECK( secVtxHandle.record( std::make_unique<xAOD::VertexContainer>(),
1533 std::make_unique<xAOD::VertexAuxContainer>() ) );
1534 xAOD::VertexContainer *secondaryVertexContainer = secVtxHandle.ptr();
1536
1537 enum { kPt, kEta, kPhi, kD0, kZ0, kErrP, kErrD0, kErrZ0, kChi2SV };
1538 if( m_trkDecors.empty() ) {
1539 m_trkDecors.emplace( kPt, SG::AuxElement::Decorator<float>("pt_wrtSV" + m_augVerString) );
1540 m_trkDecors.emplace( kEta, SG::AuxElement::Decorator<float>("eta_wrtSV" + m_augVerString) );
1541 m_trkDecors.emplace( kPhi, SG::AuxElement::Decorator<float>("phi_wrtSV" + m_augVerString) );
1542 m_trkDecors.emplace( kD0, SG::AuxElement::Decorator<float>("d0_wrtSV" + m_augVerString) );
1543 m_trkDecors.emplace( kZ0, SG::AuxElement::Decorator<float>("z0_wrtSV" + m_augVerString) );
1544 m_trkDecors.emplace( kErrP, SG::AuxElement::Decorator<float>("errP_wrtSV" + m_augVerString) );
1545 m_trkDecors.emplace( kErrD0, SG::AuxElement::Decorator<float>("errd0_wrtSV" + m_augVerString) );
1546 m_trkDecors.emplace( kErrZ0, SG::AuxElement::Decorator<float>("errz0_wrtSV" + m_augVerString) );
1547 m_trkDecors.emplace( kChi2SV, SG::AuxElement::Decorator<float>("chi2_toSV" + m_augVerString) );
1548 }
1549 if( !m_decor_is_svtrk_final ) {
1550 m_decor_is_svtrk_final.emplace ( "is_svtrk_final" + m_augVerString );
1551 }
1552
1553 std::map<const WrkVrt*, const xAOD::Vertex*> wrkvrtLinkMap;
1554
1555 //----------------------------------------------------------
1556
1557 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": input #vertices = " << workVerticesContainer->size() );
1558
1559 // Loop over vertices
1560 for( auto& wrkvrt : *workVerticesContainer ) {
1561
1562 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": candidate vertex: "
1563 << " isGood = " << (wrkvrt.isGood? "true" : "false")
1564 << ", #ntrks = " << wrkvrt.nTracksTotal()
1565 << ", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
1566 << ", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
1567 << ", chi2/ndof = " << wrkvrt.Chi2 / ( wrkvrt.ndof() + AlgConsts::infinitesimal )
1568 << ", (r, z) = (" << wrkvrt.vertex.perp()
1569 <<", " << wrkvrt.vertex.z() << ")" );
1570
1571 if( m_FillHist ) m_hists["finalCutMonitor"]->Fill( 0 );
1572
1574 removeInconsistentTracks( wrkvrt );
1575 }
1576
1577 if( wrkvrt.nTracksTotal() < 2 ) {
1578 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": ntrk < 2 --> rejected." );
1579 continue; /* Bad vertices */
1580 }
1581
1582 if( m_FillHist ) m_hists["finalCutMonitor"]->Fill( 1 );
1583
1584
1585 // Remove track if the vertex is inner than IBL and the track does not have pixel hits!
1586 if( wrkvrt.vertex.perp() < 31.0 ) {
1587
1588 // for selected tracks
1589 wrkvrt.selectedTrackIndices.erase( std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1590 [&]( auto& index ) {
1591 auto* trk = m_selectedTracks.at( index );
1592 uint8_t nPixelHits { 0 }; trk->summaryValue( nPixelHits, xAOD::numberOfPixelHits );
1593 return ( nPixelHits < 3 );
1594 } ),
1595 wrkvrt.selectedTrackIndices.end() );
1596
1597 // for associated tracks
1598 wrkvrt.associatedTrackIndices.erase( std::remove_if( wrkvrt.associatedTrackIndices.begin(), wrkvrt.associatedTrackIndices.end(),
1599 [&]( auto& index ) {
1600 auto* trk = m_associatedTracks.at( index );
1601 uint8_t nPixelHits { 0 }; trk->summaryValue( nPixelHits, xAOD::numberOfPixelHits );
1602 return ( nPixelHits < 3 );
1603 } ),
1604 wrkvrt.associatedTrackIndices.end() );
1605
1606 auto statusCode = refitVertex( ctx, wrkvrt );
1607 if( statusCode.isFailure() ) {}
1608
1609 }
1610
1611
1612 if( m_doFinalImproveChi2 ) {
1613
1614 WrkVrt backup = wrkvrt;
1615
1616 improveVertexChi2( ctx, wrkvrt );
1617
1618 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = std::move(backup);
1619
1620 }
1621
1622 // If the number of remaining tracks is less than 2, drop.
1623 if( wrkvrt.nTracksTotal() < 2 ) continue;
1624
1625 // Select only vertices with keeping more than 2 selectedTracks
1626 if( wrkvrt.selectedTrackIndices.size() < 2 ) continue;
1627
1628
1629 if( m_FillHist ) m_hists["finalCutMonitor"]->Fill( 2 );
1630
1631
1632 {
1633 WrkVrt backup = wrkvrt;
1634
1635 StatusCode sc = refitVertex( ctx, wrkvrt );
1636 if( sc.isFailure() ) {
1637
1638 auto indices = wrkvrt.associatedTrackIndices;
1639
1640 wrkvrt.associatedTrackIndices.clear();
1641 sc = refitVertex( ctx, wrkvrt );
1642 if( sc.isFailure() ) {
1643 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1644 wrkvrt = backup;
1645 }
1646 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1647
1648 for( auto& index : indices ) {
1649 backup = wrkvrt;
1650 wrkvrt.associatedTrackIndices.emplace_back( index );
1651 sc = refitVertex( ctx, wrkvrt );
1652 if( sc.isFailure() || TMath::Prob( wrkvrt.Chi2, wrkvrt.ndof() ) < m_improveChi2ProbThreshold ) {
1653 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1654 wrkvrt = backup;
1655 continue;
1656 }
1657 }
1658
1659 } else {
1660 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1661 }
1662 }
1663
1664 if( m_FillHist ) m_hists["finalCutMonitor"]->Fill( 3 );
1665
1666 //
1667 // Store good vertices into StoreGate
1668 //
1669 if( m_FillNtuple ) m_ntupleVars->get<unsigned int>( "NumSecVrt" )++;
1670
1671 TLorentzVector sumP4_pion;
1672 TLorentzVector sumP4_electron;
1673 TLorentzVector sumP4_proton;
1674
1675 // Pre-check before storing vertex if the SV perigee is available
1676 bool good_flag = true;
1677
1678 std::map<const std::deque<long int>*, const std::vector<const xAOD::TrackParticle*>&> indicesSet
1679 = {
1680 { &(wrkvrt.selectedTrackIndices), m_selectedTracks },
1681 { &(wrkvrt.associatedTrackIndices), m_associatedTracks }
1682 };
1683
1684 for( auto& pair : indicesSet ) {
1685
1686 const auto* indices = pair.first;
1687 const auto& tracks = pair.second;
1688
1689 for( const auto& itrk : *indices ) {
1690 const auto* trk = tracks.at( itrk );
1691 auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(ctx, *trk, wrkvrt.vertex );
1692 if( !sv_perigee ) {
1693 ATH_MSG_INFO(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": Failed in obtaining the SV perigee!" );
1694 good_flag = false;
1695 }
1696 }
1697
1698 }
1699
1700 if( !good_flag ) {
1701 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": sv perigee could not be obtained --> rejected" );
1702 continue;
1703 }
1704
1705 if( m_FillHist ) m_hists["finalCutMonitor"]->Fill( 4 );
1706
1707
1708 std::vector<const xAOD::TrackParticle*> tracks;
1709 std::vector< std::pair<const xAOD::TrackParticle*, double> > trackChi2Pairs;
1710
1711 {
1712
1713 for( auto& pair : indicesSet ) {
1714 for( const auto& index : *pair.first ) tracks.emplace_back( pair.second.at( index ) );
1715 }
1716
1717 auto trkitr = tracks.begin();
1718 auto chi2itr = wrkvrt.Chi2PerTrk.begin();
1719
1720 for( ; ( trkitr!=tracks.end() && chi2itr!=wrkvrt.Chi2PerTrk.end() ); ++trkitr, ++chi2itr ) {
1721 trackChi2Pairs.emplace_back( *trkitr, *chi2itr );
1722 }
1723
1724 }
1725
1726
1727 TLorentzVector sumP4_selected;
1728
1729 bool badIPflag { false };
1730
1731 // loop over vertex tracks
1732 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Track loop: size = " << tracks.size() );
1733 for( auto& pair : trackChi2Pairs ) {
1734
1735 const auto* trk = pair.first;
1736 const auto& chi2AtSV = pair.second;
1737
1738 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": start." );
1739
1740 track_summary trk_summary;
1741 fillTrackSummary( trk_summary, trk );
1742
1743 //
1744 // calculate mass/pT of tracks and track parameters
1745 //
1746
1747 double trk_pt = trk->pt();
1748 double trk_eta = trk->eta();
1749 double trk_phi = trk->phi();
1750
1751 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": in vrt chg/pt/phi/eta = "
1752 << trk->charge() <<","
1753 <<trk_pt<<","
1754 <<trk_phi<<","
1755 <<trk_eta);
1756
1758 // Get the perigee of the track at the vertex
1759 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": Get the prigee of the track at the vertex." );
1760
1761 auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(ctx, *trk, wrkvrt.vertex );
1762 if( !sv_perigee ) {
1763 ATH_MSG_WARNING(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": Failed in obtaining the SV perigee!" );
1764
1765 for( auto& pair : m_trkDecors ) {
1766 pair.second( *trk ) = AlgConsts::invalidFloat;
1767 }
1768 (*m_decor_is_svtrk_final)( *trk ) = true;
1769 continue;
1770 }
1771
1772 double qOverP_wrtSV = sv_perigee->parameters() [Trk::qOverP];
1773 double theta_wrtSV = sv_perigee->parameters() [Trk::theta];
1774 double p_wrtSV = 1.0 / std::abs( qOverP_wrtSV );
1775 double pt_wrtSV = p_wrtSV * sin( theta_wrtSV );
1776 double eta_wrtSV = -log( tan( theta_wrtSV/2. ) );
1777 double phi_wrtSV = sv_perigee->parameters() [Trk::phi];
1778 double d0_wrtSV = sv_perigee->parameters() [Trk::d0];
1779 double z0_wrtSV = sv_perigee->parameters() [Trk::z0];
1780 double errd0_wrtSV = (*sv_perigee->covariance())( Trk::d0, Trk::d0 );
1781 double errz0_wrtSV = (*sv_perigee->covariance())( Trk::z0, Trk::z0 );
1782 double errP_wrtSV = (*sv_perigee->covariance())( Trk::qOverP, Trk::qOverP );
1783
1784 // xAOD::Track augmentation
1785 ( m_trkDecors.at(kPt) )( *trk ) = pt_wrtSV;
1786 ( m_trkDecors.at(kEta) )( *trk ) = eta_wrtSV;
1787 ( m_trkDecors.at(kPhi) )( *trk ) = phi_wrtSV;
1788 ( m_trkDecors.at(kD0) )( *trk ) = d0_wrtSV;
1789 ( m_trkDecors.at(kZ0) )( *trk ) = z0_wrtSV;
1790 ( m_trkDecors.at(kErrP) )( *trk ) = errP_wrtSV;
1791 ( m_trkDecors.at(kErrD0) )( *trk ) = errd0_wrtSV;
1792 ( m_trkDecors.at(kErrZ0) )( *trk ) = errz0_wrtSV;
1793 ( m_trkDecors.at(kChi2SV))( *trk ) = chi2AtSV;
1794
1795 (*m_decor_is_svtrk_final)( *trk ) = true;
1796
1797 TLorentzVector p4wrtSV_pion;
1798 TLorentzVector p4wrtSV_electron;
1799 TLorentzVector p4wrtSV_proton;
1800
1801 p4wrtSV_pion .SetPtEtaPhiM( pt_wrtSV, eta_wrtSV, phi_wrtSV, PhysConsts::mass_chargedPion );
1802 p4wrtSV_electron.SetPtEtaPhiM( pt_wrtSV, eta_wrtSV, phi_wrtSV, PhysConsts::mass_electron );
1803
1804 // for selected tracks only
1805 const SG::ConstAccessor<char> is_associatedAcc("is_associated" + m_augVerString);
1806 if( is_associatedAcc.isAvailable(*trk) ) {
1807 if( !is_associatedAcc(*trk) ) {
1808 sumP4_selected += p4wrtSV_pion;
1809 }
1810 } else {
1811 sumP4_selected += p4wrtSV_pion;
1812 }
1813
1814 sumP4_pion += p4wrtSV_pion;
1815 sumP4_electron += p4wrtSV_electron;
1816 sumP4_proton += p4wrtSV_proton;
1817
1818 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": end." );
1819 } // loop over tracks in vertex
1820
1821 ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": Track loop end. ");
1822
1823 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Final Sec.Vertex=" << wrkvrt.nTracksTotal() <<", "
1824 <<wrkvrt.vertex.perp() <<", "<<wrkvrt.vertex.z() <<", "
1825 <<wrkvrt.vertex.phi() <<", mass = "<< sumP4_pion.M() << "," << sumP4_electron.M() );
1826
1827 // Save the perigee parameters for the first two tracks
1828 float perigee_x_trk1 = 0.0;
1829 float perigee_y_trk1 = 0.0;
1830 float perigee_z_trk1 = 0.0;
1831 float perigee_x_trk2 = 0.0;
1832 float perigee_y_trk2 = 0.0;
1833 float perigee_z_trk2 = 0.0;
1834 float perigee_px_trk1 = 0.0;
1835 float perigee_py_trk1 = 0.0;
1836 float perigee_pz_trk1 = 0.0;
1837 float perigee_px_trk2 = 0.0;
1838 float perigee_py_trk2 = 0.0;
1839 float perigee_pz_trk2 = 0.0;
1840 float perigee_cov_xx_trk1 = 0.0;
1841 float perigee_cov_xy_trk1 = 0.0;
1842 float perigee_cov_xz_trk1 = 0.0;
1843 float perigee_cov_yy_trk1 = 0.0;
1844 float perigee_cov_yz_trk1 = 0.0;
1845 float perigee_cov_zz_trk1 = 0.0;
1846 float perigee_cov_xx_trk2 = 0.0;
1847 float perigee_cov_xy_trk2 = 0.0;
1848 float perigee_cov_xz_trk2 = 0.0;
1849 float perigee_cov_yy_trk2 = 0.0;
1850 float perigee_cov_yz_trk2 = 0.0;
1851 float perigee_cov_zz_trk2 = 0.0;
1852 float perigee_d0_trk1 = 0.0;
1853 float perigee_d0_trk2 = 0.0;
1854 float perigee_z0_trk1 = 0.0;
1855 float perigee_z0_trk2 = 0.0;
1856 float perigee_qOverP_trk1 = 0.0;
1857 float perigee_qOverP_trk2 = 0.0;
1858 float perigee_theta_trk1 = 0.0;
1859 float perigee_theta_trk2 = 0.0;
1860 float perigee_phi_trk1 = 0.0;
1861 float perigee_phi_trk2 = 0.0;
1862 int perigee_charge_trk1 = 0;
1863 int perigee_charge_trk2 = 0;
1864 float perigee_distance = 9999.0;
1865
1866 Amg::Vector3D vDist = wrkvrt.vertex - m_thePV->position();
1867 float vPos = (vDist.x() * wrkvrt.vertexMom.Px() + vDist.y() * wrkvrt.vertexMom.Py() + vDist.z() * wrkvrt.vertexMom.Pz()) / wrkvrt.vertexMom.Rho();
1868 float vPosMomAngT = (vDist.x() * wrkvrt.vertexMom.Px() + vDist.y() * wrkvrt.vertexMom.Py()) / vDist.perp() / wrkvrt.vertexMom.Pt();
1869 float vPosMomAng3D = (vDist.x() * wrkvrt.vertexMom.Px() + vDist.y() * wrkvrt.vertexMom.Py() + vDist.z() * wrkvrt.vertexMom.Pz()) / (vDist.norm() * wrkvrt.vertexMom.Rho());
1870 float dphi_trk1 = 0.0;
1871 float dphi_trk2 = 0.0;
1872
1874 // Process track1
1875 const auto* track1 = trackChi2Pairs[0].first;
1876 dphi_trk1 = TVector2::Phi_mpi_pi(vDist.phi() - track1->phi());
1877 auto sv_perigee1 = m_trackToVertexTool->perigeeAtVertex(ctx, *track1, wrkvrt.vertex);
1878 if (sv_perigee1) {
1879 perigee_x_trk1 = sv_perigee1->position().x();
1880 perigee_y_trk1 = sv_perigee1->position().y();
1881 perigee_z_trk1 = sv_perigee1->position().z();
1882 perigee_px_trk1 = sv_perigee1->momentum().x();
1883 perigee_py_trk1 = sv_perigee1->momentum().y();
1884 perigee_pz_trk1 = sv_perigee1->momentum().z();
1885 perigee_cov_xx_trk1 = (*sv_perigee1->covariance())(0, 0);
1886 perigee_cov_xy_trk1 = (*sv_perigee1->covariance())(0, 1);
1887 perigee_cov_xz_trk1 = (*sv_perigee1->covariance())(0, 2);
1888 perigee_cov_yy_trk1 = (*sv_perigee1->covariance())(1, 1);
1889 perigee_cov_yz_trk1 = (*sv_perigee1->covariance())(1, 2);
1890 perigee_cov_zz_trk1 = (*sv_perigee1->covariance())(2, 2);
1891 perigee_d0_trk1 = sv_perigee1->parameters()[Trk::d0];
1892 perigee_z0_trk1 = sv_perigee1->parameters()[Trk::z0];
1893 perigee_qOverP_trk1 = sv_perigee1->parameters()[Trk::qOverP];
1894 perigee_theta_trk1 = sv_perigee1->parameters()[Trk::theta];
1895 perigee_phi_trk1 = sv_perigee1->parameters()[Trk::phi];
1896 perigee_charge_trk1 = sv_perigee1->parameters()[Trk::qOverP] > 0 ? 1 : -1;
1897 }else{
1898 ATH_MSG_DEBUG("Failed to obtain perigee for track1 at vertex.");
1899 }
1900
1901 //Process track2
1902 const auto* track2 = trackChi2Pairs[1].first;
1903 dphi_trk2 = TVector2::Phi_mpi_pi(vDist.phi() - track2->phi());
1904 auto sv_perigee2 = m_trackToVertexTool->perigeeAtVertex(ctx, *track2, wrkvrt.vertex);
1905 if (sv_perigee2) {
1906 perigee_x_trk2 = sv_perigee2->position().x();
1907 perigee_y_trk2 = sv_perigee2->position().y();
1908 perigee_z_trk2 = sv_perigee2->position().z();
1909 perigee_px_trk2 = sv_perigee2->momentum().x();
1910 perigee_py_trk2 = sv_perigee2->momentum().y();
1911 perigee_pz_trk2 = sv_perigee2->momentum().z();
1912 perigee_cov_xx_trk2 = (*sv_perigee2->covariance())(0, 0);
1913 perigee_cov_xy_trk2 = (*sv_perigee2->covariance())(0, 1);
1914 perigee_cov_xz_trk2 = (*sv_perigee2->covariance())(0, 2);
1915 perigee_cov_yy_trk2 = (*sv_perigee2->covariance())(1, 1);
1916 perigee_cov_yz_trk2 = (*sv_perigee2->covariance())(1, 2);
1917 perigee_cov_zz_trk2 = (*sv_perigee2->covariance())(2, 2);
1918 perigee_d0_trk2 = sv_perigee2->parameters()[Trk::d0];
1919 perigee_z0_trk2 = sv_perigee2->parameters()[Trk::z0];
1920 perigee_qOverP_trk2 = sv_perigee2->parameters()[Trk::qOverP];
1921 perigee_theta_trk2 = sv_perigee2->parameters()[Trk::theta];
1922 perigee_phi_trk2 = sv_perigee2->parameters()[Trk::phi];
1923 perigee_charge_trk2 = sv_perigee2->parameters()[Trk::qOverP] > 0 ? 1 : -1;
1924 }else{
1925 ATH_MSG_DEBUG("Failed to obtain perigee for track2 at vertex.");
1926 }
1927
1928 if(sv_perigee1 && sv_perigee2){
1929 perigee_distance = sqrt(
1930 (perigee_x_trk1 - perigee_x_trk2) * (perigee_x_trk1 - perigee_x_trk2) +
1931 (perigee_y_trk1 - perigee_y_trk2) * (perigee_y_trk1 - perigee_y_trk2) +
1932 (perigee_z_trk1 - perigee_z_trk2) * (perigee_z_trk1 - perigee_z_trk2)
1933 );
1934 }
1935 if(perigee_distance > m_twoTrVrtMaxPerigeeDist) continue;
1936 }
1937
1938 //
1939 // calculate opening angle between all 2-track pairs, and store the minimum
1940 //
1941 double minOpAng = AlgConsts::invalidFloat;
1942 std::vector<double> opAngles;
1943
1944 for( auto itr1 = tracks.begin(); itr1 != tracks.end(); ++itr1 ) {
1945 for( auto itr2 = std::next( itr1 ); itr2 != tracks.end(); ++itr2 ) {
1946 const auto& p1 = (*itr1)->p4().Vect();
1947 const auto& p2 = (*itr2)->p4().Vect();
1948 auto cos = p1 * p2 / p1.Mag() / p2.Mag();
1949 opAngles.emplace_back( cos );
1950 }
1951 }
1952 minOpAng = *( std::max_element( opAngles.begin(), opAngles.end() ) );
1953 if( m_FillNtuple ) m_ntupleVars->get< vector<double> >( "SecVtx_MinOpAng" ).emplace_back(minOpAng);
1954
1955
1956 if( m_FillHist ) m_hists["finalCutMonitor"]->Fill( 5 );
1957
1958 if( badIPflag ) {
1959 ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Bad impact parameter signif wrt SV was flagged." );
1960 }
1961
1963
1964 bool oneLepMatchTrack = false;
1965 for (const auto *trk: tracks) {
1966 if ( std::find(m_leptonicTracks.begin(), m_leptonicTracks.end(), trk) != m_leptonicTracks.end() ) {
1967 oneLepMatchTrack = true;
1968 break;
1969 }
1970 }
1971
1972 // If there are no tracks matched to leptons, do not save the container to the output.
1973 if (!oneLepMatchTrack) continue;
1974 }
1975
1977 // Data filling to xAOD container
1978
1979 wrkvrt.isGood = true;
1980
1981 // Firstly store the new vertex to the container before filling properties.
1982 // (This is the feature of xAOD.)
1984 secondaryVertexContainer->emplace_back( vertex );
1985
1986 // Registering the vertex position to xAOD::Vertex
1987 vertex->setPosition( wrkvrt.vertex );
1988
1989 // Registering the vertex type: SV
1990 vertex->setVertexType( xAOD::VxType::SecVtx );
1991
1992 // Registering the vertex chi2 and Ndof
1993 // Here, we register the core chi2 of the core (before track association)
1994 vertex->setFitQuality( wrkvrt.Chi2_core, wrkvrt.ndof_core() );
1995
1996 // Registering the vertex covariance matrix
1997 std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
1998 vertex->setCovariance(fCov);
1999
2000 // Registering the vertex momentum and charge
2001 static const SG::Accessor<float> vtx_pxAcc("vtx_px");
2002 static const SG::Accessor<float> vtx_pyAcc("vtx_py");
2003 static const SG::Accessor<float> vtx_pzAcc("vtx_pz");
2004 static const SG::Accessor<float> vtx_massAcc("vtx_mass");
2005 static const SG::Accessor<float> vtx_chargeAcc("vtx_charge");
2006 static const SG::Accessor<float> chi2_coreAcc("chi2_core");
2007 static const SG::Accessor<float> ndof_coreAcc("ndof_core");
2008 static const SG::Accessor<float> chi2_assocAcc("chi2_assoc");
2009 static const SG::Accessor<float> ndof_assocAcc("ndof_assoc");
2010 static const SG::Accessor<float> massAcc("mass");
2011 static const SG::Accessor<float> mass_eAcc("mass_e");
2012 static const SG::Accessor<float> mass_selectedTracksAcc("mass_selectedTracks");
2013 static const SG::Accessor<float> minOpAngAcc("minOpAng");
2014 static const SG::Accessor<int> num_trksAcc("num_trks");
2015 static const SG::Accessor<int> num_selectedTracksAcc("num_selectedTracks");
2016 static const SG::Accessor<int> num_associatedTracksAcc("num_associatedTracks");
2017 static const SG::Accessor<float> dCloseVrtAcc("dCloseVrt");
2018
2019 vtx_pxAcc(*vertex) = wrkvrt.vertexMom.Px();
2020 vtx_pyAcc(*vertex) = wrkvrt.vertexMom.Py();
2021 vtx_pzAcc(*vertex) = wrkvrt.vertexMom.Pz();
2022
2023 vtx_massAcc(*vertex) = wrkvrt.vertexMom.M();
2024 vtx_chargeAcc(*vertex) = wrkvrt.Charge;
2025
2026 chi2_coreAcc(*vertex) = wrkvrt.Chi2_core;
2027 ndof_coreAcc(*vertex) = wrkvrt.ndof_core();
2028 chi2_assocAcc(*vertex) = wrkvrt.Chi2;
2029 ndof_assocAcc(*vertex) = wrkvrt.ndof();
2030 // Other SV properties
2031 massAcc(*vertex) = sumP4_pion.M();
2032 mass_eAcc(*vertex) = sumP4_electron.M();
2033 mass_selectedTracksAcc(*vertex) = sumP4_selected.M();
2034 minOpAngAcc(*vertex) = minOpAng;
2035 num_trksAcc(*vertex) = wrkvrt.nTracksTotal();
2036 num_selectedTracksAcc(*vertex) = wrkvrt.selectedTrackIndices.size();
2037 num_associatedTracksAcc(*vertex) = wrkvrt.associatedTrackIndices.size();
2038 dCloseVrtAcc(*vertex) = wrkvrt.closestWrkVrtValue;
2039
2040 // Registering the vertex momentum and charge
2042 static const SG::Accessor<float> perigee_x_trk1Acc("perigee_x_trk1");
2043 static const SG::Accessor<float> perigee_y_trk1Acc("perigee_y_trk1");
2044 static const SG::Accessor<float> perigee_z_trk1Acc("perigee_z_trk1");
2045 static const SG::Accessor<float> perigee_x_trk2Acc("perigee_x_trk2");
2046 static const SG::Accessor<float> perigee_y_trk2Acc("perigee_y_trk2");
2047 static const SG::Accessor<float> perigee_z_trk2Acc("perigee_z_trk2");
2048 static const SG::Accessor<float> perigee_px_trk1Acc("perigee_px_trk1");
2049 static const SG::Accessor<float> perigee_py_trk1Acc("perigee_py_trk1");
2050 static const SG::Accessor<float> perigee_pz_trk1Acc("perigee_pz_trk1");
2051 static const SG::Accessor<float> perigee_px_trk2Acc("perigee_px_trk2");
2052 static const SG::Accessor<float> perigee_py_trk2Acc("perigee_py_trk2");
2053 static const SG::Accessor<float> perigee_pz_trk2Acc("perigee_pz_trk2");
2054 static const SG::Accessor<float> perigee_cov_xx_trk1Acc("perigee_cov_xx_trk1");
2055 static const SG::Accessor<float> perigee_cov_xy_trk1Acc("perigee_cov_xy_trk1");
2056 static const SG::Accessor<float> perigee_cov_xz_trk1Acc("perigee_cov_xz_trk1");
2057 static const SG::Accessor<float> perigee_cov_yy_trk1Acc("perigee_cov_yy_trk1");
2058 static const SG::Accessor<float> perigee_cov_yz_trk1Acc("perigee_cov_yz_trk1");
2059 static const SG::Accessor<float> perigee_cov_zz_trk1Acc("perigee_cov_zz_trk1");
2060 static const SG::Accessor<float> perigee_cov_xx_trk2Acc("perigee_cov_xx_trk2");
2061 static const SG::Accessor<float> perigee_cov_xy_trk2Acc("perigee_cov_xy_trk2");
2062 static const SG::Accessor<float> perigee_cov_xz_trk2Acc("perigee_cov_xz_trk2");
2063 static const SG::Accessor<float> perigee_cov_yy_trk2Acc("perigee_cov_yy_trk2");
2064 static const SG::Accessor<float> perigee_cov_yz_trk2Acc("perigee_cov_yz_trk2");
2065 static const SG::Accessor<float> perigee_cov_zz_trk2Acc("perigee_cov_zz_trk2");
2066 static const SG::Accessor<float> perigee_d0_trk1Acc("perigee_d0_trk1");
2067 static const SG::Accessor<float> perigee_d0_trk2Acc("perigee_d0_trk2");
2068 static const SG::Accessor<float> perigee_z0_trk1Acc("perigee_z0_trk1");
2069 static const SG::Accessor<float> perigee_z0_trk2Acc("perigee_z0_trk2");
2070 static const SG::Accessor<float> perigee_qOverP_trk1Acc("perigee_qOverP_trk1");
2071 static const SG::Accessor<float> perigee_qOverP_trk2Acc("perigee_qOverP_trk2");
2072 static const SG::Accessor<float> perigee_theta_trk1Acc("perigee_theta_trk1");
2073 static const SG::Accessor<float> perigee_theta_trk2Acc("perigee_theta_trk2");
2074 static const SG::Accessor<float> perigee_phi_trk1Acc("perigee_phi_trk1");
2075 static const SG::Accessor<float> perigee_phi_trk2Acc("perigee_phi_trk2");
2076 static const SG::Accessor<int> perigee_charge_trk1Acc("perigee_charge_trk1");
2077 static const SG::Accessor<int> perigee_charge_trk2Acc("perigee_charge_trk2");
2078 static const SG::Accessor<float> vPosAcc("vPos");
2079 static const SG::Accessor<float> vPosMomAngTAcc("vPosMomAngT");
2080 static const SG::Accessor<float> vPosMomAng3DAcc("vPosMomAng3D");
2081 static const SG::Accessor<float> dphi_trk1Acc("dphi_trk1");
2082 static const SG::Accessor<float> dphi_trk2Acc("dphi_trk2");
2083 perigee_x_trk1Acc(*vertex) = perigee_x_trk1;
2084 perigee_y_trk1Acc(*vertex) = perigee_y_trk1;
2085 perigee_z_trk1Acc(*vertex) = perigee_z_trk1;
2086 perigee_x_trk2Acc(*vertex) = perigee_x_trk2;
2087 perigee_y_trk2Acc(*vertex) = perigee_y_trk2;
2088 perigee_z_trk2Acc(*vertex) = perigee_z_trk2;
2089 perigee_px_trk1Acc(*vertex) = perigee_px_trk1;
2090 perigee_py_trk1Acc(*vertex) = perigee_py_trk1;
2091 perigee_pz_trk1Acc(*vertex) = perigee_pz_trk1;
2092 perigee_px_trk2Acc(*vertex) = perigee_px_trk2;
2093 perigee_py_trk2Acc(*vertex) = perigee_py_trk2;
2094 perigee_pz_trk2Acc(*vertex) = perigee_pz_trk2;
2095 perigee_cov_xx_trk1Acc(*vertex) = perigee_cov_xx_trk1;
2096 perigee_cov_xy_trk1Acc(*vertex) = perigee_cov_xy_trk1;
2097 perigee_cov_xz_trk1Acc(*vertex) = perigee_cov_xz_trk1;
2098 perigee_cov_yy_trk1Acc(*vertex) = perigee_cov_yy_trk1;
2099 perigee_cov_yz_trk1Acc(*vertex) = perigee_cov_yz_trk1;
2100 perigee_cov_zz_trk1Acc(*vertex) = perigee_cov_zz_trk1;
2101 perigee_cov_xx_trk2Acc(*vertex) = perigee_cov_xx_trk2;
2102 perigee_cov_xy_trk2Acc(*vertex) = perigee_cov_xy_trk2;
2103 perigee_cov_xz_trk2Acc(*vertex) = perigee_cov_xz_trk2;
2104 perigee_cov_yy_trk2Acc(*vertex) = perigee_cov_yy_trk2;
2105 perigee_cov_yz_trk2Acc(*vertex) = perigee_cov_yz_trk2;
2106 perigee_cov_zz_trk2Acc(*vertex) = perigee_cov_zz_trk2;
2107 perigee_d0_trk1Acc(*vertex) = perigee_d0_trk1;
2108 perigee_d0_trk2Acc(*vertex) = perigee_d0_trk2;
2109 perigee_z0_trk1Acc(*vertex) = perigee_z0_trk1;
2110 perigee_z0_trk2Acc(*vertex) = perigee_z0_trk2;
2111 perigee_qOverP_trk1Acc(*vertex) = perigee_qOverP_trk1;
2112 perigee_qOverP_trk2Acc(*vertex) = perigee_qOverP_trk2;
2113 perigee_theta_trk1Acc(*vertex) = perigee_theta_trk1;
2114 perigee_theta_trk2Acc(*vertex) = perigee_theta_trk2;
2115 perigee_phi_trk1Acc(*vertex) = perigee_phi_trk1;
2116 perigee_phi_trk2Acc(*vertex) = perigee_phi_trk2;
2117 perigee_charge_trk1Acc(*vertex) = perigee_charge_trk1;
2118 perigee_charge_trk2Acc(*vertex) = perigee_charge_trk2;
2119 vPosAcc(*vertex) = vPos;
2120 vPosMomAngTAcc(*vertex) = vPosMomAngT;
2121 vPosMomAng3DAcc(*vertex) = vPosMomAng3D;
2122 dphi_trk1Acc(*vertex) = dphi_trk1;
2123 dphi_trk2Acc(*vertex) = dphi_trk2;
2124 }
2125
2126 // Registering tracks comprising the vertex to xAOD::Vertex
2127 // loop over the tracks comprising the vertex
2128 for( auto trk_id : wrkvrt.selectedTrackIndices ) {
2129
2130 const xAOD::TrackParticle *trk = m_selectedTracks.at( trk_id );
2131
2132 // Acquire link the track to the vertex
2133 ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
2134
2135 // Register the link to the vertex
2136 vertex->addTrackAtVertex( link_trk, 1. );
2137
2138 }
2139
2140 for( auto trk_id : wrkvrt.associatedTrackIndices ) {
2141
2142 const xAOD::TrackParticle *trk = m_associatedTracks.at( trk_id );
2143
2144 // Acquire link the track to the vertex
2145 ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
2146
2147 // Register the link to the vertex
2148 vertex->addTrackAtVertex( link_trk, 1. );
2149
2150 }
2151
2152
2153 if( m_doMapToLocal ) {
2154 // Obtain the local mapping of the reconstructed vertex
2155 Trk::MappedVertex mappedVtx = m_vertexMapper->mapToLocal( wrkvrt.vertex );
2156 static const SG::Accessor<int> local_identifierHashAcc("local_identifierHash");
2157 static const SG::Accessor<int> local_layerIndexAcc("local_layerIndex");
2158 static const SG::Accessor<float> local_posXAcc("local_posX");
2159 static const SG::Accessor<float> local_posYAcc("local_posY");
2160 static const SG::Accessor<float> local_posZAcc("local_posZ");
2161 if( mappedVtx.valid ) {
2162 local_identifierHashAcc(*vertex) = mappedVtx.identifierHash;
2163 local_layerIndexAcc(*vertex) = mappedVtx.layerIndex;
2164 local_posXAcc(*vertex) = mappedVtx.localPosition.x();
2165 local_posYAcc(*vertex) = mappedVtx.localPosition.y();
2166 local_posZAcc(*vertex) = mappedVtx.localPosition.z();
2167 } else {
2168 local_identifierHashAcc(*vertex) = AlgConsts::invalidInt;
2169 local_layerIndexAcc(*vertex) = AlgConsts::invalidInt;
2170 local_posXAcc(*vertex) = AlgConsts::invalidFloat;
2171 local_posYAcc(*vertex) = AlgConsts::invalidFloat;
2172 local_posZAcc(*vertex) = AlgConsts::invalidFloat;
2173 }
2174 }
2175
2176
2177 // For MC, try to trace down to the truth particles,
2178 // and depending on the topology, categorize the label of the reconstructed vertex.
2179 if( m_doTruth ) {
2181 }
2182
2183 // Keep the link between wrkvrt and vertex for later use
2184 wrkvrtLinkMap[&wrkvrt] = vertex;
2185
2186
2187 } // loop over vertices
2188
2189 if( m_FillNtuple ) {
2190 ATH_CHECK( fillAANT_SecondaryVertices( secondaryVertexContainer ) );
2191 }
2192
2193
2194 // Post process -- Additional augmentations
2197
2198 } catch (const std::out_of_range& e) {
2199
2200 ATH_MSG_WARNING( " > " << __FUNCTION__ << ": out of range error is detected: " << e.what() );
2201
2202 return StatusCode::SUCCESS;
2203
2204 } catch( ... ) {
2205
2206 ATH_MSG_WARNING( " > " << __FUNCTION__ << ": some other error is detected." );
2207
2208 return StatusCode::SUCCESS;
2209
2210 }
2211
2212 return StatusCode::SUCCESS;
2213 }
Gaudi::Property< bool > m_doRemoveNonLeptonVertices
Gaudi::Property< double > m_twoTrVrtMaxPerigeeDist
StatusCode augmentDVimpactParametersToLeptons(const EventContext &ctx, const std::string &containerName)
StatusCode categorizeVertexTruthTopology(xAOD::Vertex *vertex)
Definition TruthAlgs.cxx:43
void removeInconsistentTracks(WrkVrt &)
Remove inconsistent tracks from vertices.
Gaudi::Property< bool > m_doFinalImproveChi2
StatusCode fillAANT_SecondaryVertices(xAOD::VertexContainer *)
Gaudi::Property< bool > m_doAugmentDVimpactParametersToElectrons
Gaudi::Property< bool > m_doAugmentDVimpactParametersToMuons
Amg::Vector3D localPosition

◆ refitVertex() [1/2]

StatusCode VKalVrtAthena::VrtSecInclusive::refitVertex ( const EventContext & ctx,
WrkVrt & workVertex )
private

refit the vertex.

Definition at line 495 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

497 {
498 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
499 return refitVertex (workVertex, *state);
500 }

◆ refitVertex() [2/2]

StatusCode VKalVrtAthena::VrtSecInclusive::refitVertex ( WrkVrt & workVertex,
Trk::IVKalState & istate )
private

Definition at line 505 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

507 {
508
509 //
510 vector<const xAOD::NeutralParticle*> dummyNeutrals;
511
512 int nth = workVertex.selectedTrackIndices.size();
513
514 if(nth<2) {
515 workVertex.isGood = false;
516 return StatusCode::SUCCESS;
517 }
518
519 vector<const xAOD::TrackParticle*> ListBaseTracks;
520
521 workVertex.Chi2PerTrk.clear();
522
523 for( const auto& index : workVertex.selectedTrackIndices ) {
524 ListBaseTracks.emplace_back( m_selectedTracks.at( index ) );
525 workVertex.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
526 }
527
528 for( const auto& index : workVertex.associatedTrackIndices ) {
529 ListBaseTracks.emplace_back( m_associatedTracks.at( index ) );
530 workVertex.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
531 }
532
533 auto& vertexPos = workVertex.vertex;
534
535 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), istate );
536
537 ATH_MSG_VERBOSE( " >>> refitVertex: ListBaseTracks.size = " << ListBaseTracks.size()
538 << ", #selectedBaseTracks = " << workVertex.selectedTrackIndices.size()
539 << ", #assocTracks = " << workVertex.associatedTrackIndices.size() );
540 for( const auto *trk : ListBaseTracks ) {
541 ATH_MSG_VERBOSE( " >>> refitVertex: track index = " << trk->index() );
542 }
543
544 ATH_MSG_VERBOSE( " >>> refitVertex: m_fitSvc is reset." );
545
546 Amg::Vector3D initVertex;
547
548 StatusCode sc = m_fitSvc->VKalVrtFitFast( ListBaseTracks, initVertex, istate );/* Fast crude estimation */
549 if(sc.isFailure()) ATH_MSG_DEBUG(" >>> refitVertex: fast crude estimation failed.");
550 ATH_MSG_VERBOSE( " >>> refitVertex: Fast VKalVrtFit succeeded. vertex (r,z) = (" << initVertex.perp() << ", " << initVertex.z() << ", " << ")" );
551
552 if( vtxVtxDistance( initVertex, vertexPos ) > 10. ) {
553
554 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), istate );
555
556 } else {
557
558 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), istate );
559
560 }
561
562 ATH_MSG_VERBOSE( " >>> refitVertex: approx vertex is set. Now going to perform fitting..." );
563
564 StatusCode SC=m_fitSvc->VKalVrtFit(ListBaseTracks,dummyNeutrals,
565 workVertex.vertex,
566 workVertex.vertexMom,
567 workVertex.Charge,
568 workVertex.vertexCov,
569 workVertex.Chi2PerTrk,
570 workVertex.TrkAtVrt,
571 workVertex.Chi2,
572 istate);
573
574 auto& cov = workVertex.vertexCov;
575
576 if(SC.isFailure()) ATH_MSG_DEBUG(" >>> refitVertex: SC in refitVertex returned failure ");
577 ATH_MSG_VERBOSE(" >>> refitVertex "<<SC<<", "<<ListBaseTracks.size()<<","<<workVertex.Chi2PerTrk.size());
578 ATH_MSG_VERBOSE( " >>> refitVertex: succeeded in fitting. New vertex pos (r,z) = (" << vertexPos.perp() << ", " << vertexPos.z() << ")" );
579 ATH_MSG_VERBOSE( " >>> refitVertex: New vertex cov = (" << cov.at(0) << ", " << cov.at(1) << ", " << cov.at(2) << ", " << cov.at(3) << ", " << cov.at(4) << ", " << cov.at(5) << ")" );
580
581 return SC;
582 }
const float SC[NC]
Cross sections for Carbon.

◆ refitVertexWithSuggestion() [1/2]

StatusCode VKalVrtAthena::VrtSecInclusive::refitVertexWithSuggestion ( const EventContext & ctx,
WrkVrt & workVertex,
const Amg::Vector3D & suggestedPosition )
private

refit the vertex with suggestion

Definition at line 585 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

586 {
587 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState(ctx);
588 return refitVertexWithSuggestion (workVertex, suggestedPosition, *state);
589 }

◆ refitVertexWithSuggestion() [2/2]

StatusCode VKalVrtAthena::VrtSecInclusive::refitVertexWithSuggestion ( WrkVrt & workVertex,
const Amg::Vector3D & suggestedPosition,
Trk::IVKalState & istate )
private

Definition at line 593 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

596 {
597
598 //
599 vector<const xAOD::NeutralParticle*> dummyNeutrals;
600
601 int nth = workVertex.selectedTrackIndices.size();
602
603 if(nth<2) {
604 workVertex.isGood = false;
605 return StatusCode::SUCCESS;
606 }
607
608 vector<const xAOD::TrackParticle*> ListBaseTracks;
609
610 workVertex.Chi2PerTrk.clear();
611
612 for( const auto& index : workVertex.selectedTrackIndices ) {
613 ListBaseTracks.emplace_back( m_selectedTracks.at( index ) );
614 workVertex.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
615 }
616
617 for( const auto& index : workVertex.associatedTrackIndices ) {
618 ListBaseTracks.emplace_back( m_associatedTracks.at( index ) );
619 workVertex.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
620 }
621
622 auto& vertexPos = workVertex.vertex;
623
624 m_fitSvc->setApproximateVertex( suggestedPosition.x(), suggestedPosition.y(), suggestedPosition.z(), istate );
625
626 ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ <<": ListBaseTracks.size = " << ListBaseTracks.size()
627 << ", #selectedBaseTracks = " << workVertex.selectedTrackIndices.size()
628 << ", #assocTracks = " << workVertex.associatedTrackIndices.size() );
629 for( const auto *trk : ListBaseTracks ) {
630 ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ << ": track index = " << trk->index() );
631 }
632
633 ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ << ": m_fitSvc is reset." );
634
635 ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ << ": approx vertex is set. Now going to perform fitting..." );
636
637 StatusCode SC=m_fitSvc->VKalVrtFit(ListBaseTracks,dummyNeutrals,
638 workVertex.vertex,
639 workVertex.vertexMom,
640 workVertex.Charge,
641 workVertex.vertexCov,
642 workVertex.Chi2PerTrk,
643 workVertex.TrkAtVrt,
644 workVertex.Chi2,
645 istate);
646
647 auto& cov = workVertex.vertexCov;
648
649 if( SC.isFailure() ) ATH_MSG_VERBOSE(" >>> " << __FUNCTION__ << ": SC in refitVertex returned failure ");
650 ATH_MSG_VERBOSE(" >>> " << __FUNCTION__ << ": "<<SC<<", "<<ListBaseTracks.size()<<","<<workVertex.Chi2PerTrk.size());
651
652 if( SC.isSuccess() ) {
653 ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ << ": succeeded in fitting. New vertex pos = (" << vertexPos.x() << ", " << vertexPos.y() << ", " << vertexPos.z() << ")" );
654 ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ << ": New vertex cov = (" << cov.at(0) << ", " << cov.at(1) << ", " << cov.at(2) << ", " << cov.at(3) << ", " << cov.at(4) << ", " << cov.at(5) << ")" );
655 }
656
657 return SC;
658 }

◆ removeInconsistentTracks()

void VKalVrtAthena::VrtSecInclusive::removeInconsistentTracks ( WrkVrt & wrkvrt)
private

Remove inconsistent tracks from vertices.

Definition at line 2200 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2201 {
2202
2203 const auto& vertex = wrkvrt.vertex;
2204
2205 std::map< std::deque<long int>*, std::vector<const xAOD::TrackParticle*>& > indexMap
2206 {
2207 { &(wrkvrt.selectedTrackIndices), m_selectedTracks }, { &(wrkvrt.associatedTrackIndices), m_associatedTracks }
2208 };
2209
2210 for( auto& pair : indexMap ) {
2211
2212 auto* indices = pair.first;
2213 auto& tracks = pair.second;
2214
2215 auto newEnd = std::remove_if( indices->begin(), indices->end(),
2216 [&]( auto& index ) {
2217 bool isConsistent = (this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( tracks.at(index), vertex );
2218 return !isConsistent;
2219 } );
2220
2221 indices->erase( newEnd, indices->end() );
2222
2223 }
2224
2225 }

◆ removeTrackFromVertex()

void VKalVrtAthena::VrtSecInclusive::removeTrackFromVertex ( std::vector< WrkVrt > * workVerticesContainer,
std::vector< std::deque< long int > > * TrkInVrt,
const long int & trackIndexToRemove,
const long int & SelectedVertex )
staticprivate

Definition at line 336 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

340 {
341
342 auto& wrkvrt = workVerticesContainer->at(SelectedVertex);
343 auto& tracks = wrkvrt.selectedTrackIndices;
344
345 {
346 auto end = std::remove_if( tracks.begin(), tracks.end(), [&](long int index) { return index == trackIndexToRemove; } );
347 tracks.erase( end, tracks.end() );
348 }
349
350 {
351 for( auto& trks : *TrkInVrt ) {
352 auto end = std::remove_if( trks.begin(), trks.end(), [&](long int index) { return index == trackIndexToRemove; } );
353 trks.erase( end, trks.end() );
354 }
355 }
356
357
358 // Check if track is removed from two-track vertex => then sharing of track left should also be decreased
359 if( wrkvrt.selectedTrackIndices.size() == 1 ) {
360
361 const auto& leftTrackIndex = *( tracks.begin() );
362 auto& list = TrkInVrt->at(leftTrackIndex);
363 auto end = std::remove_if( list.begin(), list.end(), [&](long int index) { return index == trackIndexToRemove; } );
364 list.erase( end, list.end() );
365
366 }
367
368 }
list(name, path='/')
Definition histSizes.py:38

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ selectInDetAndGSFTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::selectInDetAndGSFTracks ( const EventContext & ctx)
private

Definition at line 303 of file TrackSelectionAlgs.cxx.

303 {
304 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": begin" );
305
306 //--------------------------------------------------------
307 // Extract tracks from xAOD::TrackParticle container
308 //
309
310 SG::ReadHandle<xAOD::TrackParticleContainer> IDtracksHandle = SG::makeHandle( m_TrackLocation, ctx );
311 ATH_CHECK( IDtracksHandle.isValid() );
312 const xAOD::TrackParticleContainer* IDtracks = IDtracksHandle.cptr();
313
314 SG::ReadHandle<xAOD::ElectronContainer> electronsHandle = SG::makeHandle( m_ElectronLocation, ctx );
315 ATH_CHECK(electronsHandle.isValid() );
316 const xAOD::ElectronContainer *electrons = electronsHandle.cptr();
317
318 SG::ReadHandle<xAOD::MuonContainer> muonsHandle = SG::makeHandle( m_MuonLocation, ctx );
319 ATH_CHECK( muonsHandle.isValid() );
320 const xAOD::MuonContainer* muons = muonsHandle.cptr();
321
322 std::vector<const xAOD::TrackParticle*> IDTrksFromEls;
323
324 // Loop over electrons to select all GSF tracks
325 for( const auto *electron : *electrons ) {
326 if( 0 == electron->nTrackParticles() ) { continue; }
327 // The first track is the best-matched GSF track
328 const auto* el_trk = electron->trackParticle(0);
329 selectTrack( el_trk );
330 m_leptonicTracks.emplace_back(el_trk);
331 IDTrksFromEls.emplace_back(xAOD::EgammaHelpers::getOriginalTrackParticle(electron));
332 }
333
334 // Loop over ID tracks to select all non-el tracks
335 for( const auto *trk : *IDtracks ) {
336 // do not select ID track if matched to an electron
337 if ( std::find(IDTrksFromEls.begin(), IDTrksFromEls.end(), trk) != IDTrksFromEls.end() ) { continue; }
338 selectTrack( trk );
339 }
340
341 // Loop over muons to book-keep all ID tracks matched to muons
342 for (const auto *muon : *muons) {
343 if (m_doRemoveCaloTaggedMuons && muon->muonType() == xAOD::Muon::MuonType::CaloTagged) { continue; }
344 const auto* mu_trk = muon->trackParticle( xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle );
345 if(!mu_trk) { continue; }
346 m_leptonicTracks.emplace_back(mu_trk);
347 }
348
349 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total ID tracks = " << IDtracks->size() );
350 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total electrons = " << electrons->size() );
351 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks.size() );
352
353 return StatusCode::SUCCESS;
354 }
Gaudi::Property< bool > m_doRemoveCaloTaggedMuons
void selectTrack(const xAOD::TrackParticle *)
Vertexing Algorithm Member Functions.
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.

◆ selectTrack()

void VKalVrtAthena::VrtSecInclusive::selectTrack ( const xAOD::TrackParticle * trk)
private

Vertexing Algorithm Member Functions.

select tracks which become seeds for vertex finding

Definition at line 136 of file TrackSelectionAlgs.cxx.

136 {
137
138 if( !m_decor_isSelected ) {
139 m_decor_isSelected.emplace( "is_selected" + m_augVerString );
140 }
141
142 // Setup cut functions
144
145 // These cuts are optional. Specified by JobProperty
152 //if( m_do_d0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0signifCut ); // not implemented yet
153 //if( m_do_z0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0signifCut ); // not implemented yet
154
155 // These cuts are used by default
160
161 }
162
163 if( std::find( m_selectedTracks.begin(), m_selectedTracks.end(), trk ) != m_selectedTracks.end() ) return;
164
165 std::vector<bool> cutBits;
166
167 cutBits.reserve(m_trackSelectionFuncs.size());
168 for( auto func : m_trackSelectionFuncs ) cutBits.emplace_back( (this->*func)( trk ) );
169
170 if( m_FillHist ) {
171 m_hists["trkSelCuts"]->Fill( 0 );
172 for( size_t ibit = 0; ibit < cutBits.size(); ibit++) {
173 if( cutBits.at(ibit) ) {
174 m_hists["trkSelCuts"]->Fill( ibit+1 );
175 } else {
176 break;
177 }
178 }
179 }
180
181 // Good track should not find any false bit
182 bool isGood_standard = ( std::find( cutBits.begin(), cutBits.end(), false ) == cutBits.end() );
183
184 if( isGood_standard ) {
185
186 // Store the selected track to the new m_selectedTracks
187 // Here we firstly need to register the empty pointer to the m_selectedTracks,
188 // then need to do deep copy after then. This is the feature of xAOD.
189
191
192 if( m_doTruth ) {
193
194 const xAOD::TruthParticle *truth = getTrkGenParticle(trk);
195
196 if ( truth ) {
197 uniqueID = HepMC::uniqueID(truth);
198 }
199
200 }
201
202 (*m_decor_isSelected)( *trk ) = true;
204 const xAOD::TrackParticle *id_tr{};
206 if (id_tr) { (*m_decor_isSelected)( *id_tr ) = true; }
207 }
208
209 m_selectedTracks.emplace_back( trk );
210
211 if( m_FillNtuple ) m_ntupleVars->get< vector<int> >( "SelTrk_uniqueID" ).emplace_back(uniqueID);
212
213 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": Track index " << trk->index() << " has been selected." );
214 ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": Track index " << trk->index()
215 << " parameter:"
216 << " pt = " << trk->pt()
217 << " eta = " << trk->eta()
218 << " d0 = " << trk->d0()
219 << " z0 = " << trk->z0() << "." );
220
221 }
222
223 }
bool selectTrack_pTCut(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_do_d0Cut
Gaudi::Property< bool > m_do_z0errCut
Gaudi::Property< bool > m_do_d0errCut
bool selectTrack_chi2Cut(const xAOD::TrackParticle *) const
bool selectTrack_notPVassociated(const xAOD::TrackParticle *) const
track-by-track selection strategies
Gaudi::Property< bool > m_do_PVvetoCut
bool selectTrack_hitPatternTight(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_passThroughTrackSelection
bool selectTrack_d0errCut(const xAOD::TrackParticle *) const
bool selectTrack_hitPattern(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_doSelectTracksWithLRTCuts
Gaudi::Property< bool > m_do_z0Cut
std::vector< CutFunc > m_trackSelectionFuncs
bool selectTrack_LRTR3Cut(const xAOD::TrackParticle *) const
bool selectTrack_d0Cut(const xAOD::TrackParticle *) const
bool selectTrack_z0Cut(const xAOD::TrackParticle *) const
bool selectTrack_z0errCut(const xAOD::TrackParticle *) const
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...

◆ selectTrack_chi2Cut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_chi2Cut ( const xAOD::TrackParticle * trk) const
private

Definition at line 35 of file TrackSelectionAlgs.cxx.

35{ return trk->chiSquared() / (trk->numberDoF()+AlgConsts::infinitesimal) < m_TrkChi2Cut; }
Gaudi::Property< double > m_TrkChi2Cut
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
float chiSquared() const
Returns the of the overall track fit.

◆ selectTrack_d0Cut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_d0Cut ( const xAOD::TrackParticle * trk) const
private

Definition at line 28 of file TrackSelectionAlgs.cxx.

28{ return ( fabs( trk->d0() ) > m_d0TrkPVDstMinCut && fabs( trk->d0() ) < m_d0TrkPVDstMaxCut ); }
Gaudi::Property< double > m_d0TrkPVDstMinCut
Gaudi::Property< double > m_d0TrkPVDstMaxCut

◆ selectTrack_d0errCut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_d0errCut ( const xAOD::TrackParticle * trk) const
private

Definition at line 30 of file TrackSelectionAlgs.cxx.

30{ const double cov11 = trk->definingParametersCovMatrix()(0,0); return cov11 < m_d0TrkErrorCut*m_d0TrkErrorCut; }
Gaudi::Property< double > m_d0TrkErrorCut

◆ selectTrack_d0signifCut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_d0signifCut ( const xAOD::TrackParticle * )
staticprivate

Definition at line 32 of file TrackSelectionAlgs.cxx.

32{ return true; }

◆ selectTrack_hitPattern()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_hitPattern ( const xAOD::TrackParticle * trk) const
private

Definition at line 38 of file TrackSelectionAlgs.cxx.

38 {
39
40 uint8_t PixelHits = 0;
41 uint8_t SCTHits = 0;
42 uint8_t BLayHits = 0;
43 uint8_t PixShare = 0;
44 uint8_t SCTShare = 0;
45 uint8_t TRTHits = 0;
46
47 if( !(trk->summaryValue( PixelHits, xAOD::numberOfPixelHits ) ) ) PixelHits =0;
48 if( !(trk->summaryValue( SCTHits, xAOD::numberOfSCTHits ) ) ) SCTHits =0;
49 if( !(trk->summaryValue( BLayHits, xAOD::numberOfInnermostPixelLayerHits ) ) ) BLayHits =0;
50 if( !(trk->summaryValue( PixShare, xAOD::numberOfPixelSharedHits ) ) ) PixShare =0;
51 if( !(trk->summaryValue( SCTShare, xAOD::numberOfSCTSharedHits ) ) ) SCTShare =0;
52 if( !(trk->summaryValue( TRTHits, xAOD::numberOfTRTHits ) ) ) TRTHits =0;
53
54 uint8_t SharedHits = PixShare + SCTShare;
55
56 // do Pixel/SCT/SiHits only if we exclude StandAlone TRT hits
57 if( !m_SAloneTRT ) {
58 if(PixelHits < m_CutPixelHits) return false;
59 if(SCTHits < m_CutSctHits) return false;
60 if((PixelHits+SCTHits) < m_CutSiHits) return false;
61 if(BLayHits < m_CutBLayHits) return false;
62 if(SharedHits > m_CutSharedHits) return false;
63 }
64
65 // The folloing part reproduces the track selection in RPVDixpVrt
66 if( m_doTRTPixCut ) {
67 if(TRTHits == 0 && PixelHits < 2) return false;
68 }
69
70 if( PixelHits == 0 && SCTHits < 6 ) return false;
71
72 return true;
73 }
Gaudi::Property< bool > m_SAloneTRT
Gaudi::Property< bool > m_doTRTPixCut
Gaudi::Property< int > m_CutSiHits
Gaudi::Property< int > m_CutBLayHits
Gaudi::Property< int > m_CutSharedHits
Gaudi::Property< int > m_CutSctHits
Gaudi::Property< int > m_CutPixelHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].

◆ selectTrack_hitPatternTight()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_hitPatternTight ( const xAOD::TrackParticle * trk) const
private

Definition at line 76 of file TrackSelectionAlgs.cxx.

76 {
77 uint8_t PixelHits = 0;
78 uint8_t SCTHits = 0;
79 uint8_t TRTHits = 0;
80
81 if( !(trk->summaryValue( PixelHits, xAOD::numberOfPixelHits ) ) ) PixelHits =0;
82 if( !(trk->summaryValue( SCTHits, xAOD::numberOfSCTHits ) ) ) SCTHits =0;
83 if( !(trk->summaryValue( TRTHits, xAOD::numberOfTRTHits ) ) ) TRTHits =0;
84
85 if( trk->pt() > 20.e3 ) return true;
86
87 if( SCTHits < m_CutTightSCTHits ) return false;
88
89 if( fabs( trk->eta() ) < 1.7 ) {
90 if( TRTHits < m_CutTightTRTHits ) return false;
91 }
92
93 return true;
94 }
Gaudi::Property< int > m_CutTightTRTHits
Gaudi::Property< int > m_CutTightSCTHits

◆ selectTrack_LRTR3Cut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_LRTR3Cut ( const xAOD::TrackParticle * trk) const
private

Definition at line 102 of file TrackSelectionAlgs.cxx.

102 {
103 uint8_t npix = 0;
105 uint8_t nsct = 0;
107 uint8_t nSiHits = npix + nsct ;
109 trk->summaryValue(nSCTHoles, xAOD::numberOfSCTHoles);
110
111 double dTheta = std::fabs(TMath::ATan2(std::fabs(trk->d0()),trk->z0())-2*std::atan(std::exp(-1*trk->eta())));
112 bool geometric_cut = dTheta < 1. || std::fabs(trk->z0()) < 200. ;
113
114 bool z0_cut = trk->z0() <= 500. ;
115 bool chi2_cut = (trk->chiSquared()/ (trk->numberDoF()+AlgConsts::infinitesimal)) <= 9. ;
116 bool NSiHits_cut = nSiHits >=8 ;
117 bool NSCTHits_cut = nsct >= 7 ;
118 bool NSCTHoles_cut = nSCTHoles <= 1;
119
120 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": z0_cut, chi2_cut, NSiHits_cut, NSCTHits_cut, NSCTHoles_cut = " <<z0_cut<<", "<<chi2_cut<<", "<<NSiHits_cut<<", "<<NSCTHits_cut<<", "<< NSCTHoles_cut );
121 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": npix, nsct, nSiHits, nSCTHoles, dTheta, z0, d0, chi2 = " <<unsigned(npix)<<", "<<unsigned(nsct)<<", "<<unsigned(nSiHits)<<", "<<unsigned(nSCTHoles)<<", "<< dTheta<<", "<< trk->z0()<<", "<< trk->d0()<<", " <<trk->chiSquared() ) ;
122
123 const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco = trk->patternRecoInfo();
124 bool isLRT = patternReco.test(49) ;
125 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Track is LRT = " << isLRT ) ;
126 if (isLRT) { // apply all cuts to LRT tracks
127 return (z0_cut && chi2_cut && NSiHits_cut && NSCTHits_cut && NSCTHoles_cut && geometric_cut);
128 }
129 else{ // not LRT track; only apply SiHit cut
130 return NSiHits_cut ;
131 }
132 }
std::bitset< NumberOfTrackRecoInfo > patternRecoInfo() const
Access method for pattern recognition algorithm.
float nSCTHoles(const U &p)
float nSiHits(const U &p)
@ numberOfSCTHoles
number of SCT holes [unit8_t].

◆ selectTrack_notPVassociated()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_notPVassociated ( const xAOD::TrackParticle * trk) const
private

track-by-track selection strategies

Definition at line 97 of file TrackSelectionAlgs.cxx.

97 {
99 }
bool isAssociatedToVertices(const xAOD::TrackParticle *trk, const xAOD::VertexContainer *vertices)

◆ selectTrack_pTCut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_pTCut ( const xAOD::TrackParticle * trk) const
private

Definition at line 34 of file TrackSelectionAlgs.cxx.

34{ return trk->pt() > m_TrkPtCut; }
Gaudi::Property< double > m_TrkPtCut

◆ selectTrack_z0Cut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_z0Cut ( const xAOD::TrackParticle * trk) const
private

Definition at line 29 of file TrackSelectionAlgs.cxx.

29{ return ( fabs( trk->z0() ) > m_z0TrkPVDstMinCut && fabs( trk->z0() ) < m_z0TrkPVDstMaxCut ); }
Gaudi::Property< double > m_z0TrkPVDstMaxCut
Gaudi::Property< double > m_z0TrkPVDstMinCut

◆ selectTrack_z0errCut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_z0errCut ( const xAOD::TrackParticle * trk) const
private

Definition at line 31 of file TrackSelectionAlgs.cxx.

31{ const double cov22 = trk->definingParametersCovMatrix()(1,1); return cov22 < m_z0TrkErrorCut*m_z0TrkErrorCut; }
Gaudi::Property< double > m_z0TrkErrorCut

◆ selectTrack_z0signifCut()

bool VKalVrtAthena::VrtSecInclusive::selectTrack_z0signifCut ( const xAOD::TrackParticle * )
staticprivate

Definition at line 33 of file TrackSelectionAlgs.cxx.

33{ return true; }

◆ selectTracksFromElectrons()

StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksFromElectrons ( const EventContext & ctx)
private

Definition at line 280 of file TrackSelectionAlgs.cxx.

280 {
281 SG::ReadHandle<xAOD::ElectronContainer> electronsHandle = SG::makeHandle( m_ElectronLocation, ctx );
282 ATH_CHECK( electronsHandle.isValid() );
283 const xAOD::ElectronContainer *electrons = electronsHandle.cptr();
284
285 for( const auto *const electron : *electrons ) {
286 if( 0 == electron->nTrackParticles() ) continue;
287
288 // The first track is the best-matched track
289 const auto* trk = electron->trackParticle(0);
290
291 if( !trk ) continue;
292 selectTrack( trk );
293 }
294
295 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total electrons = " << electrons->size() );
296 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks.size() );
297
298 return StatusCode::SUCCESS;
299 }

◆ selectTracksFromMuons()

StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksFromMuons ( const EventContext & ctx)
private

Definition at line 254 of file TrackSelectionAlgs.cxx.

254 {
255 SG::ReadHandle<xAOD::MuonContainer> muonHandle = SG::makeHandle( m_MuonLocation, ctx );
256 ATH_CHECK( muonHandle.isValid() );
257 const xAOD::MuonContainer* muons = muonHandle.cptr();
258
259
260 for( const auto *const muon : *muons ) {
261 const auto* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
262
263 if( !trk ) continue;
264 // remove calo-tagged muons when selecting muons
266 if (muon->muonType() == xAOD::Muon::MuonType::CaloTagged) continue;
267 }
268 selectTrack( trk );
269
270 }
271
272 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total muons = " << muons->size() );
273 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks.size() );
274
275 return StatusCode::SUCCESS;
276 }

◆ selectTracksInDet()

StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksInDet ( const EventContext & ctx)
private

Definition at line 226 of file TrackSelectionAlgs.cxx.

226 {
227 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": begin" );
228
229 //--------------------------------------------------------
230 // Extract tracks from xAOD::TrackParticle container
231 //
232
233 SG::ReadHandle<xAOD::TrackParticleContainer> trackHandle = SG::makeHandle( m_TrackLocation, ctx );
234 ATH_CHECK( trackHandle.isValid() );
235 const xAOD::TrackParticleContainer* trackParticleContainer = trackHandle.cptr();
236
237 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Extracted xAOD::TrackParticle number=" << trackParticleContainer->size() );
238
239 if( m_FillNtuple )
240 m_ntupleVars->get<unsigned int>( "NumAllTrks" ) = static_cast<int>( trackParticleContainer->size() );
241
242
243 // Loop over tracks
244 for( const auto *trk : *trackParticleContainer ) { selectTrack( trk ); }
245
246 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total ID tracks = " << trackParticleContainer->size() );
247 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks.size() );
248
249 return StatusCode::SUCCESS;
250 }
size_type size() const noexcept
Returns the number of elements in the collection.

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ setIntersection() [1/2]

template<class Track>
void VKalVrtAthena::VrtSecInclusive::setIntersection ( Track * trk,
IntersectionPos * bec,
const Trk::Perigee * per )
private

◆ setIntersection() [2/2]

template<class TrackT>
void VKalVrtAthena::VrtSecInclusive::setIntersection ( TrackT * trk,
IntersectionPos * layer,
const Trk::Perigee * per )

Definition at line 40 of file Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h.

43 {
44 const EventContext& ctx = Gaudi::Hive::currentContext();
45 std::unique_ptr<Trk::TrackParameters> Output;
46
47 if( layer->bec() == IntersectionPos::barrel ) {
48
49 IntersectionPos_barrel *barrel = dynamic_cast<IntersectionPos_barrel*>( layer );
50
51 ATH_MSG_VERBOSE( " >>> setIntersection: name = " << barrel->name() << ", Radius = " << barrel->radius() );
52
53 Amg::Transform3D trnsf;
54 trnsf.setIdentity();
55 Trk::CylinderSurface surfBorder(trnsf, barrel->radius(), 300000.); //
56 Output = m_extrapolator->extrapolateDirectly(ctx, *per,surfBorder,Trk::anyDirection,true,Trk::pion);
57
58 barrel->x()->push_back( Output? Output->position().x() : -10000 );
59 barrel->y()->push_back( Output? Output->position().y() : -10000 );
60 barrel->z()->push_back( Output? Output->position().z() : -10000 );
61
62
63 } else if( layer->bec() == IntersectionPos::endcap ) {
64
65 IntersectionPos_endcap *endcap = dynamic_cast<IntersectionPos_endcap*>( layer );
66
67 ATH_MSG_VERBOSE( " >>> setIntersection: name = " << endcap->name() <<
68 ", zpos = " << endcap->zpos() <<
69 ", Rmin = " << endcap->rmin() <<
70 ", Rmax = " << endcap->rmax() );
71
72 Amg::Transform3D trnsf;
73 trnsf.setIdentity();
74 trnsf.translate( Amg::Vector3D(0.,0.,endcap->zpos()) );
75 Trk::DiscSurface surfBorder(trnsf, endcap->rmin(), endcap->rmax() );
76 Output = m_extrapolator->extrapolateDirectly(ctx, *per, surfBorder, Trk::anyDirection, true, Trk::pion);
77
78 endcap->x()->push_back( Output? Output->position().x() : -10000 );
79 endcap->y()->push_back( Output? Output->position().y() : -10000 );
80 endcap->z()->push_back( Output? Output->position().z() : -10000 );
81
82 }
83
84
85 if( Output ) {
86 trk->template auxdecor<float>( Form("intersection_%s_x", layer->name().c_str()) ) = Output->position().x();
87 trk->template auxdecor<float>( Form("intersection_%s_y", layer->name().c_str()) ) = Output->position().y();
88 trk->template auxdecor<float>( Form("intersection_%s_z", layer->name().c_str()) ) = Output->position().z();
89 }
90 }
Eigen::Affine3d Transform3D
@ anyDirection

◆ setupNtuple()

StatusCode VKalVrtAthena::VrtSecInclusive::setupNtuple ( )
private

Definition at line 218 of file AANT_Tools.cxx.

218 {
219
220 m_ntupleVars->branchNtuple( m_tree_Vert );
221
222 return StatusCode::SUCCESS;
223 }

◆ setupNtupleVariables()

StatusCode VKalVrtAthena::VrtSecInclusive::setupNtupleVariables ( )
private

Definition at line 28 of file AANT_Tools.cxx.

28 {
29
30 m_ntupleVars->addNewVar<unsigned int> ( "RunNumber" );
31 m_ntupleVars->addNewVar<unsigned int> ( "Event" );
32 m_ntupleVars->addNewVar<unsigned int> ( "Time" );
33 m_ntupleVars->addNewVar<unsigned int> ( "LumiBlock" );
34 m_ntupleVars->addNewVar<unsigned int> ( "BCID" );
35 m_ntupleVars->addNewVar<unsigned int> ( "LVL1ID" );
36
37 m_ntupleVars->addNewVar<unsigned int> ( "NumAllTrks" );
38 m_ntupleVars->addNewVar<unsigned int> ( "NumSelTrks" );
39 m_ntupleVars->addNewVar<unsigned int> ( "SizeIncomp" );
40
41 m_ntupleVars->addNewVar<unsigned int> ( "NumPV" );
42 m_ntupleVars->addNewVar<unsigned int> ( "NTrksPV" );
43 m_ntupleVars->addNewVar<unsigned int> ( "PVType" );
44 m_ntupleVars->addNewVar<double> ( "PVX" );
45 m_ntupleVars->addNewVar<double> ( "PVY" );
46 m_ntupleVars->addNewVar<double> ( "PVZ" );
47
48 m_ntupleVars->addNewVar< vector<int> > ( "NdofTrksPV" );
49 m_ntupleVars->addNewVar< vector<double> > ( "PVZpile" );
50
51 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_id" );
52 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_pT" );
53 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_2dIPPV" );
54 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_ZIPPV" );
55 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_2dIP" );
56 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_ZIP" );
57 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_phi" );
58 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_eta" );
59 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_chi2" );
60 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_eta" );
61 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_BLayHits" );
62 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_PixHits" );
63 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_SCTHits" );
64 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_TRTHits" );
65 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_PixBar1" );
66 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_PixBar2" );
67 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_barcode" ); // FIXME barcode-based
68 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_matchPr" );
69 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_2dIPErr" );
70 m_ntupleVars->addNewVar< vector<double> > ( "RecoTrk_ZIPErr" );
71 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_PixShare" );
72 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_SCTShare" );
73 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_TrkAuth" );
74 m_ntupleVars->addNewVar< vector<int> > ( "RecoTrk_TrkLowPt" );
75
76 m_ntupleVars->addNewVar< vector<int> > ( "SelTrk_barcode" ); // FIXME barcode-based
77
78 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_id" );
79 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_pT" );
80 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_p" );
81 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_phi" );
82 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_eta" );
83 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_2dIP" );
84 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_ZIP" );
85 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_delp" );
86 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_del2dIP" );
87 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_delzIP" );
88 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_eta" );
89 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_BLayHits" );
90 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_PixHits" );
91 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_SCTHits" );
92 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_TRTHits" );
93 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_barcode" ); // FIXME barcode-based
94 m_ntupleVars->addNewVar< vector<double> > ( "SVTrk_matchPr" );
95 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_TrkAuth" );
96 m_ntupleVars->addNewVar< vector<int> > ( "SVTrk_TrkLowPt" );
97
98 m_ntupleVars->addNewVar< unsigned int > ( "All2TrkVrtNum" );
99 m_ntupleVars->addNewVar< vector<double> > ( "All2TrkVrtMass" );
100 m_ntupleVars->addNewVar< vector<double> > ( "All2TrkVrtPt" );
101 m_ntupleVars->addNewVar< vector<int> > ( "All2TrkVrtCharge" );
102 m_ntupleVars->addNewVar< vector<int> > ( "All2TrkSumBLHits" );
103 m_ntupleVars->addNewVar< vector<double> > ( "All2TrkVrtX" );
104 m_ntupleVars->addNewVar< vector<double> > ( "All2TrkVrtY" );
105 m_ntupleVars->addNewVar< vector<double> > ( "All2TrkVrtZ" );
106 m_ntupleVars->addNewVar< vector<double> > ( "All2TrkVrtChiSq" );
107
108 m_ntupleVars->addNewVar< unsigned int > ( "AfFakVrtNum" );
109 m_ntupleVars->addNewVar< vector<double> > ( "AfFakVrtMass" );
110 m_ntupleVars->addNewVar< vector<double> > ( "AfFakVrtPt" );
111 m_ntupleVars->addNewVar< vector<int> > ( "AfFakVrtCharge" );
112 m_ntupleVars->addNewVar< vector<double> > ( "AfFakVrtX" );
113 m_ntupleVars->addNewVar< vector<double> > ( "AfFakVrtY" );
114 m_ntupleVars->addNewVar< vector<double> > ( "AfFakVrtZ" );
115 m_ntupleVars->addNewVar< vector<double> > ( "AfFakVrtChiSq" );
116
117 m_ntupleVars->addNewVar< unsigned int > ( "NumInitSecVrt" );
118 m_ntupleVars->addNewVar< unsigned int > ( "NumRearrSecVrt" );
119 m_ntupleVars->addNewVar< unsigned int > ( "NumSecVrt" );
120 m_ntupleVars->addNewVar< vector<double> > ( "SecVtxX" );
121 m_ntupleVars->addNewVar< vector<double> > ( "SecVtxY" );
122 m_ntupleVars->addNewVar< vector<double> > ( "SecVtxZ" );
123 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_NumTrks" );
124 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Mass" );
125 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Mass_electron" );
126 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Chi2" );
127 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_pT" );
128 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_pZ" );
129 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_Charge" );
130 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_SumBLayHits" );
131 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_AllTrksBLayHits" );
132 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_MinOpAng" );
133
134 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkPt" );
135 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkPhi" );
136 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkEta" );
137 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_TrkBLay" );
138 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_TrkPixExclBLay" );
139 m_ntupleVars->addNewVar< vector<int> > ( "SecVtx_TrkSCT" );
140 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Trk2dIP" );
141 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkZIP" );
142 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkdelP" );
143 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Trkdel2dIP" );
144 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkdelZIP" );
145 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkPtWrtSV" );
146 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkPhiWrtSV" );
147 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkEtaWrtSV" );
148 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Trk2dIPWrtSV" );
149 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkZIPWrtSV" );
150 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkdelPWrtSV" );
151 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_Trkdel2dIPWrtSV" );
152 m_ntupleVars->addNewVar< vector<double> > ( "SecVtx_TrkdelZIPWrtSV" );
153
154 m_ntupleVars->addNewVar<double> ( "Truth_SV1X" );
155 m_ntupleVars->addNewVar<double> ( "Truth_SV1Y" );
156 m_ntupleVars->addNewVar<double> ( "Truth_SV1Z" );
157 m_ntupleVars->addNewVar<double> ( "Truth_PiEta" );
158 m_ntupleVars->addNewVar<double> ( "Truth_PiPhi" );
159 m_ntupleVars->addNewVar<double> ( "Truth_PiPt" );
160 m_ntupleVars->addNewVar<int> ( "Truth_PiInt" );
161 m_ntupleVars->addNewVar<int> ( "Truth_nSVHiPt" );
162 m_ntupleVars->addNewVar<int> ( "Truth_nSVLoPt" );
163 m_ntupleVars->addNewVar<int> ( "Truth_nSVGe1HiPt" );
164
165 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllVtxType" );
166 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVX" );
167 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVY" );
168 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVZ" );
169 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVTrk1Pt" );
170 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVTrk2Pt" );
171 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVTrk3Pt" );
172 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVTrk4Pt" );
173 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVTrk5Pt" );
174 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVNumTrks" );
175 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVNumReTrks" );
176 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVCharge" );
177 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVSumTrksPt" );
178 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVSumTrksPz" );
179 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVHasLifetime" );
180 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVStrangeBaryon" );
181 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVIncomingPid" );
182 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllSVNumIncident" );
183 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVPtIncident" );
184 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVPzIncident" );
185 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllSVMinOpAng" );
186
187 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrk2dIP" );
188 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrkZIP" );
189 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrkPt" );
190 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrkEta" );
191 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrkPhi" );
192 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrkR" );
193 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllTrkZ" );
194 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllTrkBC" );
195
196 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllRefitSt" );
197 m_ntupleVars->addNewVar< vector<int> > ( "Truth_AllRefitNTrk" );
198 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllRefitChi2" );
199 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllRefitSVX" );
200 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllRefitSVY" );
201 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllRefitSVZ" );
202 m_ntupleVars->addNewVar< vector<double> > ( "Truth_AllRefitMass" );
203
204 return StatusCode::SUCCESS;
205 }

◆ significanceBetweenVertices()

double VKalVrtAthena::VrtSecInclusive::significanceBetweenVertices ( const WrkVrt & v1,
const WrkVrt & v2 ) const
private

calculate the significance (Mahalanobis distance) between two reconstructed vertices

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

60 {
61 try {
62 const auto distance = v2.vertex - v1.vertex;
63 AmgSymMatrix(3) sumCov;
64
65 sumCov.fillSymmetric(0, 0, v1.vertexCov.at(0) + v2.vertexCov.at(0));
66 sumCov.fillSymmetric(1, 0, v1.vertexCov.at(1) + v2.vertexCov.at(1));
67 sumCov.fillSymmetric(1, 1, v1.vertexCov.at(2) + v2.vertexCov.at(2));
68 sumCov.fillSymmetric(2, 0, v1.vertexCov.at(3) + v2.vertexCov.at(3));
69 sumCov.fillSymmetric(2, 1, v1.vertexCov.at(4) + v2.vertexCov.at(4));
70 sumCov.fillSymmetric(2, 2, v1.vertexCov.at(5) + v2.vertexCov.at(5));
71
72 const double s2 = distance.transpose() * sumCov.inverse() * distance;
73
74 return s2 > 0. ? sqrt( s2 ) : AlgConsts::maxValue;
75 } catch(...) {
76 ATH_MSG_WARNING( " >>> " << __FUNCTION__ << ": detected covariance matrix broken exception" );
78 }
79 }
#define maxValue(current, test)

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ trackClassification()

void VKalVrtAthena::VrtSecInclusive::trackClassification ( std::vector< WrkVrt > * workVerticesContainer,
std::map< long int, std::vector< long int > > & trackToVertexMap )
private

Definition at line 775 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

776 {
777 // Fill TrkInVrt with vertex IDs of each track
778
779 trackToVertexMap.clear();
780
781 for( size_t iv = 0; iv<workVerticesContainer->size(); iv++ ) {
782
783 WrkVrt& vertex = workVerticesContainer->at(iv);
784
785 auto& trackIndices = vertex.selectedTrackIndices;
786 if( !vertex.isGood ) continue;
787 if( trackIndices.size() < 2 ) continue;
788
789 for( auto& index : trackIndices ) {
790 trackToVertexMap[index].emplace_back( iv );
791 }
792 }
793
794 for( auto& pair: trackToVertexMap ) {
795 std::string msg = Form("track index [%ld]: vertices = (", pair.first);
796 for( auto& v : pair.second ) {
797 msg += Form("%ld, ", v);
798 }
799 msg += ")";
800 if( pair.second.size() >=2 ) ATH_MSG_VERBOSE(" >> " << __FUNCTION__ << ": " << msg );
801 }
802
803 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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 }

Member Data Documentation

◆ m_all2trksVerticesContainerName

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_all2trksVerticesContainerName {this, "All2trkVerticesContainerName", "All2TrksVertices"}
private

Definition at line 121 of file VrtSecInclusive.h.

121{this, "All2trkVerticesContainerName", "All2TrksVertices"};

◆ m_associateChi2Cut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_associateChi2Cut {this, "associateChi2Cut", 20.}
private

Definition at line 214 of file VrtSecInclusive.h.

214{this, "associateChi2Cut", 20.};

◆ m_associatedTracks

std::vector<const xAOD::TrackParticle*> VKalVrtAthena::VrtSecInclusive::m_associatedTracks
private

Definition at line 261 of file VrtSecInclusive.h.

◆ m_associateMaxD0Signif

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_associateMaxD0Signif {this, "associateMaxD0Signif", 5.}
private

Definition at line 211 of file VrtSecInclusive.h.

211{this, "associateMaxD0Signif", 5.}; // wrt. DV in unit of sigma

◆ m_associateMaxZ0Signif

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_associateMaxZ0Signif {this, "associateMaxZ0Signif", 5.}
private

Definition at line 212 of file VrtSecInclusive.h.

212{this, "associateMaxZ0Signif", 5.}; // wrt. DV in unit of sigma

◆ m_associateMinDistanceToPV

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_associateMinDistanceToPV {this, "associateMinDistanceToPV", 0.5}
private

Definition at line 210 of file VrtSecInclusive.h.

210{this, "associateMinDistanceToPV", 0.5};

◆ m_associatePtCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_associatePtCut {this, "associatePtCut", 0.}
private

Definition at line 213 of file VrtSecInclusive.h.

213{this, "associatePtCut", 0.}; // in [MeV]

◆ m_atlasId

const AtlasDetectorID* VKalVrtAthena::VrtSecInclusive::m_atlasId {}
private

Definition at line 283 of file VrtSecInclusive.h.

283{};

◆ m_augVerString

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_augVerString {this, "AugmentingVersionString", "_VSI"}
private

Definition at line 118 of file VrtSecInclusive.h.

118{this, "AugmentingVersionString", "_VSI"};

◆ m_BeamPosition

std::vector<double> VKalVrtAthena::VrtSecInclusive::m_BeamPosition
private

Definition at line 263 of file VrtSecInclusive.h.

◆ m_checkPatternStrategy

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_checkPatternStrategy {this, "CheckHitPatternStrategy", "Classical", "Either Classical or Extrapolation"}
private

Definition at line 287 of file VrtSecInclusive.h.

287{this, "CheckHitPatternStrategy", "Classical", "Either Classical or Extrapolation"};

◆ m_CutBLayHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutBLayHits {this, "CutBLayHits", 0}
private

Definition at line 170 of file VrtSecInclusive.h.

170{this, "CutBLayHits", 0};

◆ m_CutPixelHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutPixelHits {this, "CutPixelHits", 0}
private

Definition at line 168 of file VrtSecInclusive.h.

168{this, "CutPixelHits", 0};

◆ m_CutSctHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutSctHits {this, "CutSctHits", 0}
private

Definition at line 167 of file VrtSecInclusive.h.

167{this, "CutSctHits", 0};

◆ m_CutSharedHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutSharedHits {this, "CutSharedHits", 0}
private

Definition at line 171 of file VrtSecInclusive.h.

171{this, "CutSharedHits", 0};

◆ m_CutSiHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutSiHits {this, "CutSiHits", 0}
private

Definition at line 169 of file VrtSecInclusive.h.

169{this, "CutSiHits", 0};

◆ m_CutTightSCTHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutTightSCTHits {this, "CutTightSCTHits", 7}
private

Definition at line 173 of file VrtSecInclusive.h.

173{this, "CutTightSCTHits", 7};

◆ m_CutTightTRTHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutTightTRTHits {this, "CutTightTRTHits", 20}
private

Definition at line 174 of file VrtSecInclusive.h.

174{this, "CutTightTRTHits", 20};

◆ m_CutTRTHits

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_CutTRTHits {this, "CutTRTHits", 0}
private

Definition at line 172 of file VrtSecInclusive.h.

172{this, "CutTRTHits", 0}; // Kazuki

◆ m_d0TrkErrorCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_d0TrkErrorCut {this, "TrkA0ErrCut", 10000}
private

Definition at line 157 of file VrtSecInclusive.h.

157{this, "TrkA0ErrCut", 10000}; // in [mm]

◆ m_d0TrkPVDstMaxCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_d0TrkPVDstMaxCut {this, "a0TrkPVDstMaxCut", 1000.}
private

Definition at line 152 of file VrtSecInclusive.h.

152{this, "a0TrkPVDstMaxCut", 1000.}; // in [mm]

◆ m_d0TrkPVDstMinCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_d0TrkPVDstMinCut {this, "a0TrkPVDstMinCut", 0. }
private

Definition at line 151 of file VrtSecInclusive.h.

151{this, "a0TrkPVDstMinCut", 0. }; // in [mm]

◆ m_d0TrkPVSignifCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_d0TrkPVSignifCut {this, "a0TrkPVSignifCut", 0.}
private

Definition at line 153 of file VrtSecInclusive.h.

153{this, "a0TrkPVSignifCut", 0.}; // in [mm]

◆ m_decor_is_svtrk_final

std::optional< SG::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_is_svtrk_final
private

Definition at line 294 of file VrtSecInclusive.h.

◆ m_decor_isAssociated

std::optional< SG::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_isAssociated
private

Definition at line 293 of file VrtSecInclusive.h.

◆ m_decor_isSelected

std::optional< SG::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_isSelected
private

Definition at line 292 of file VrtSecInclusive.h.

◆ m_decor_svLink

std::optional< VertexELType > VKalVrtAthena::VrtSecInclusive::m_decor_svLink
private

Definition at line 309 of file VrtSecInclusive.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_do_d0Cut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_d0Cut {this, "do_d0Cut", true}
private

Definition at line 143 of file VrtSecInclusive.h.

143{this, "do_d0Cut", true};

◆ m_do_d0errCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_d0errCut {this, "do_d0errCut", false}
private

Definition at line 145 of file VrtSecInclusive.h.

145{this, "do_d0errCut", false};

◆ m_do_d0signifCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_d0signifCut {this, "do_d0signifCut", false}
private

Definition at line 147 of file VrtSecInclusive.h.

147{this, "do_d0signifCut", false};

◆ m_do_PVvetoCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_PVvetoCut {this, "do_PVvetoCut", true}
private

Definition at line 142 of file VrtSecInclusive.h.

142{this, "do_PVvetoCut", true};

◆ m_do_z0Cut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_z0Cut {this, "do_z0Cut", true}
private

Definition at line 144 of file VrtSecInclusive.h.

144{this, "do_z0Cut", true};

◆ m_do_z0errCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_z0errCut {this, "do_z0errCut", false}
private

Definition at line 146 of file VrtSecInclusive.h.

146{this, "do_z0errCut", false};

◆ m_do_z0signifCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_do_z0signifCut {this, "do_z0signifCut", false}
private

Definition at line 148 of file VrtSecInclusive.h.

148{this, "do_z0signifCut", false};

◆ m_doAssociateNonSelectedTracks

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doAssociateNonSelectedTracks {this, "doAssociateNonSelectedTracks", false}
private

Definition at line 190 of file VrtSecInclusive.h.

190{this, "doAssociateNonSelectedTracks", false};

◆ m_doAugmentDVimpactParametersToElectrons

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doAugmentDVimpactParametersToElectrons {this, "doAugmentDVimpactParametersToElectrons", false}
private

Definition at line 243 of file VrtSecInclusive.h.

243{this, "doAugmentDVimpactParametersToElectrons", false}; // potentially useful for analyses involving electrons

◆ m_doAugmentDVimpactParametersToMuons

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doAugmentDVimpactParametersToMuons {this, "doAugmentDVimpactParametersToMuons", false}
private

Definition at line 242 of file VrtSecInclusive.h.

242{this, "doAugmentDVimpactParametersToMuons", false}; // potentially useful for DV + muon search

◆ m_doDisappearingTrackVertexing

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doDisappearingTrackVertexing {this, "doDisappearingTrackVertexing", false}
private

Definition at line 231 of file VrtSecInclusive.h.

231{this, "doDisappearingTrackVertexing", false};

◆ m_doFastMode

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doFastMode {this, "DoFastMode", false}
private

Definition at line 135 of file VrtSecInclusive.h.

135{this, "DoFastMode", false}; // flag for running in rapid finder mode instead of using graph

◆ m_doFinalImproveChi2

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doFinalImproveChi2 {this, "doFinalImproveChi2", false}
private

Definition at line 191 of file VrtSecInclusive.h.

191{this, "doFinalImproveChi2", false};

◆ m_doIntersectionPos

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doIntersectionPos {this, "DoIntersectionPos", false}
private

Definition at line 129 of file VrtSecInclusive.h.

129{this, "DoIntersectionPos", false};

◆ m_doMagnetMerging

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doMagnetMerging {this, "doMagnetMerging", true}
private

Definition at line 187 of file VrtSecInclusive.h.

187{this, "doMagnetMerging", true}; // sub-option of doMergeByShuffling-2

◆ m_doMapToLocal

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doMapToLocal {this, "DoMapToLocal", false}
private

Definition at line 130 of file VrtSecInclusive.h.

130{this, "DoMapToLocal", false};

◆ m_doMergeByShuffling

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doMergeByShuffling {this, "doMergeByShuffling", false}
private

Definition at line 185 of file VrtSecInclusive.h.

185{this, "doMergeByShuffling", false};

◆ m_doMergeFinalVerticesDistance

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doMergeFinalVerticesDistance {this, "doMergeFinalVerticesDistance", false}
private

Definition at line 189 of file VrtSecInclusive.h.

189{this, "doMergeFinalVerticesDistance", false}; // Kazuki

◆ m_doPVcompatibilityCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doPVcompatibilityCut {this, "DoPVcompatibility", true}
private

Definition at line 180 of file VrtSecInclusive.h.

180{this, "DoPVcompatibility", true};

◆ m_doReassembleVertices

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doReassembleVertices {this, "doReassembleVertices", false}
private

Definition at line 184 of file VrtSecInclusive.h.

184{this, "doReassembleVertices", false};

◆ m_doRemoveCaloTaggedMuons

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doRemoveCaloTaggedMuons {this, "doRemoveCaloTaggedMuons", false}
private

Definition at line 225 of file VrtSecInclusive.h.

225{this, "doRemoveCaloTaggedMuons", false};

◆ m_doRemoveNonLeptonVertices

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doRemoveNonLeptonVertices {this, "doRemoveNonLeptonVertices", false}
private

Definition at line 228 of file VrtSecInclusive.h.

228{this, "doRemoveNonLeptonVertices", false};

◆ m_doSelectIDAndGSFTracks

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doSelectIDAndGSFTracks {this, "doSelectIDAndGSFTracks", false}
private

Definition at line 227 of file VrtSecInclusive.h.

227{this, "doSelectIDAndGSFTracks", false};

◆ m_doSelectTracksFromElectrons

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doSelectTracksFromElectrons {this, "doSelectTracksFromElectrons", false}
private

Definition at line 226 of file VrtSecInclusive.h.

226{this, "doSelectTracksFromElectrons", false};

◆ m_doSelectTracksFromMuons

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doSelectTracksFromMuons {this, "doSelectTracksFromMuons", false}
private

Definition at line 224 of file VrtSecInclusive.h.

224{this, "doSelectTracksFromMuons", false};

◆ m_doSelectTracksWithLRTCuts

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doSelectTracksWithLRTCuts {this, "doSelectTracksWithLRTCuts", false}
private

Definition at line 239 of file VrtSecInclusive.h.

239{this, "doSelectTracksWithLRTCuts", false};

◆ m_doSuggestedRefitOnMerging

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doSuggestedRefitOnMerging {this, "doSuggestedRefitOnMerging", true}
private

Definition at line 186 of file VrtSecInclusive.h.

186{this, "doSuggestedRefitOnMerging", true};

◆ m_doTightPVcompatibilityCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doTightPVcompatibilityCut {this, "DoTightPVcompatibility", false}
private

Definition at line 181 of file VrtSecInclusive.h.

181{this, "DoTightPVcompatibility", false};

◆ m_doTRTPixCut

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doTRTPixCut {this, "doTRTPixCut", false, "mode for R-hadron displaced vertex"}
private

Definition at line 166 of file VrtSecInclusive.h.

166{this, "doTRTPixCut", false, "mode for R-hadron displaced vertex"}; // Kazuki

◆ m_doTruth

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doTruth {this, "DoTruth", false}
private

Definition at line 125 of file VrtSecInclusive.h.

125{this, "DoTruth", false};

◆ m_doTwoTrSoftBtag

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doTwoTrSoftBtag {this, "DoTwoTrSoftBtag", false}
private

Definition at line 199 of file VrtSecInclusive.h.

199{this, "DoTwoTrSoftBtag", false};

◆ m_doWildMerging

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_doWildMerging {this, "doWildMerging", true}
private

Definition at line 188 of file VrtSecInclusive.h.

188{this, "doWildMerging", true}; // sub-option of doMergeByShuffling-3

◆ m_ElectronLocation

SG::ReadHandleKey<xAOD::ElectronContainer> VKalVrtAthena::VrtSecInclusive::m_ElectronLocation {this, "ElectronLocation", "Electrons"}
private

Definition at line 114 of file VrtSecInclusive.h.

114{this, "ElectronLocation", "Electrons"};

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> VKalVrtAthena::VrtSecInclusive::m_eventInfoKey {this,"EventInfoKey", "EventInfo", "EventInfo name"}
private

Read/Write Handle Keys.

Definition at line 298 of file VrtSecInclusive.h.

298{this,"EventInfoKey", "EventInfo", "EventInfo name"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_extrapolatedPatternBank

PatternBank VKalVrtAthena::VrtSecInclusive::m_extrapolatedPatternBank
private

Definition at line 372 of file VrtSecInclusive.h.

◆ m_extrapolator

PublicToolHandle<Trk::IExtrapolator> VKalVrtAthena::VrtSecInclusive::m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
private

Definition at line 276 of file VrtSecInclusive.h.

276{this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};

◆ m_extrapPV

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_extrapPV {this, "ExtrapPV", false}
private

Definition at line 131 of file VrtSecInclusive.h.

131{this, "ExtrapPV", false}; //extrapolate reco and prim truth trks to PV (for testing only)

◆ m_FillHist

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_FillHist {this, "FillHist", false}
private

Definition at line 126 of file VrtSecInclusive.h.

126{this, "FillHist", false};

◆ m_FillIntermediateVertices

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_FillIntermediateVertices {this, "FillIntermediateVertices", false}
private

Definition at line 128 of file VrtSecInclusive.h.

128{this, "FillIntermediateVertices", false};

◆ m_FillNtuple

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_FillNtuple {this, "FillNtuple", false}
private

Definition at line 127 of file VrtSecInclusive.h.

127{this, "FillNtuple", false};

◆ m_fitSvc

ToolHandle<Trk::ITrkVKalVrtFitter> VKalVrtAthena::VrtSecInclusive::m_fitSvc {this, "VertexFitterTool", "Trk::TrkVKalVrtFitter", " Private TrkVKalVrtFitter"}
private

Definition at line 270 of file VrtSecInclusive.h.

270{this, "VertexFitterTool", "Trk::TrkVKalVrtFitter", " Private TrkVKalVrtFitter"}; // VKalVrtFitter tool

◆ m_geoModel

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_geoModel {this, "GeoModel", VKalVrtAthena::GeoModel::Run2}
private

Definition at line 110 of file VrtSecInclusive.h.

110{this, "GeoModel", VKalVrtAthena::GeoModel::Run2};

◆ m_hists

std::map<std::string, TH1*> VKalVrtAthena::VrtSecInclusive::m_hists
private

Definition at line 321 of file VrtSecInclusive.h.

◆ m_ImpactWrtBL

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_ImpactWrtBL {this, "ImpactWrtBL", true}
private

Definition at line 150 of file VrtSecInclusive.h.

150{this, "ImpactWrtBL", true}; // false option is going to be deprecated

◆ m_improveChi2ProbThreshold

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_improveChi2ProbThreshold {this, "improveChi2ProbThreshold", 1.e-4}
private

Definition at line 221 of file VrtSecInclusive.h.

221{this, "improveChi2ProbThreshold", 1.e-4};

◆ m_incomp

std::vector< std::pair<int, int> > VKalVrtAthena::VrtSecInclusive::m_incomp
private

Definition at line 374 of file VrtSecInclusive.h.

◆ m_intermediateVertexKey

std::map<std::string, SG::WriteHandleKey<xAOD::VertexContainer> > VKalVrtAthena::VrtSecInclusive::m_intermediateVertexKey
private

Definition at line 301 of file VrtSecInclusive.h.

◆ m_ipDecors

std::vector< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_ipDecors
private

Definition at line 306 of file VrtSecInclusive.h.

◆ m_leptonicTracks

std::vector<const xAOD::TrackParticle*> VKalVrtAthena::VrtSecInclusive::m_leptonicTracks
private

Definition at line 262 of file VrtSecInclusive.h.

◆ m_matchMap

std::map<const xAOD::TruthVertex*, bool> VKalVrtAthena::VrtSecInclusive::m_matchMap
private

Definition at line 377 of file VrtSecInclusive.h.

◆ m_maxWrkVertices

Gaudi::Property<size_t> VKalVrtAthena::VrtSecInclusive::m_maxWrkVertices {this, "MaxNumberOfWorkingVertices", 1500}
private

Definition at line 208 of file VrtSecInclusive.h.

208{this, "MaxNumberOfWorkingVertices", 1500};

◆ m_mcEventContainerName

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_mcEventContainerName {this, "MCEventContainer", "TruthEvents"}
private

Definition at line 117 of file VrtSecInclusive.h.

117{this, "MCEventContainer", "TruthEvents"};

◆ m_mcTrkResolution

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_mcTrkResolution {this, "MCTrackResolution", 0.06}
private

Definition at line 246 of file VrtSecInclusive.h.

246{this, "MCTrackResolution", 0.06}; // see getTruth for explanation

◆ m_mergeByShufflingAllowance

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_mergeByShufflingAllowance {this, "mergeByShufflingAllowance", 4.}
private

Definition at line 219 of file VrtSecInclusive.h.

219{this, "mergeByShufflingAllowance", 4.}; // in unit of sigma

◆ m_mergeByShufflingMaxSignificance

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_mergeByShufflingMaxSignificance {this, "mergeByShufflingMaxSignificance", 100.}
private

Definition at line 218 of file VrtSecInclusive.h.

218{this, "mergeByShufflingMaxSignificance", 100.}; // in unit of sigma

◆ m_MuonLocation

SG::ReadHandleKey<xAOD::MuonContainer> VKalVrtAthena::VrtSecInclusive::m_MuonLocation {this, "MuonLocation", "Muons"}
private

Definition at line 113 of file VrtSecInclusive.h.

113{this, "MuonLocation", "Muons"};

◆ m_ntupleVars

std::unique_ptr<NtupleVars> VKalVrtAthena::VrtSecInclusive::m_ntupleVars
private

Definition at line 318 of file VrtSecInclusive.h.

◆ m_passThroughTrackSelection

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_passThroughTrackSelection {this, "PassThroughTrackSelection", false }
private

Definition at line 133 of file VrtSecInclusive.h.

133{this, "PassThroughTrackSelection", false };

◆ m_patternStrategyFuncs

std::map<std::string, PatternStrategyFunc> VKalVrtAthena::VrtSecInclusive::m_patternStrategyFuncs
private

Definition at line 289 of file VrtSecInclusive.h.

◆ m_pixelCondSummaryTool

ToolHandle<IInDetConditionsTool> VKalVrtAthena::VrtSecInclusive::m_pixelCondSummaryTool {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}
private

Condition service.

Definition at line 280 of file VrtSecInclusive.h.

280{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"};

◆ m_pixelId

const PixelID* VKalVrtAthena::VrtSecInclusive::m_pixelId {}
private

Definition at line 284 of file VrtSecInclusive.h.

284{};

◆ m_primaryVertices

const xAOD::VertexContainer* VKalVrtAthena::VrtSecInclusive::m_primaryVertices {}
private

Definition at line 258 of file VrtSecInclusive.h.

258{};

◆ m_PrimVrtLocation

SG::ReadHandleKey<xAOD::VertexContainer> VKalVrtAthena::VrtSecInclusive::m_PrimVrtLocation {this, "PrimVrtLocation", "PrimaryVertices"}
private

Definition at line 115 of file VrtSecInclusive.h.

115{this, "PrimVrtLocation", "PrimaryVertices"};

◆ m_pvCompatibilityCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_pvCompatibilityCut {this, "PVcompatibilityCut", -20.}
private

Definition at line 192 of file VrtSecInclusive.h.

192{this, "PVcompatibilityCut", -20.}; // in [mm]

◆ m_reassembleMaxImpactParameterD0

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_reassembleMaxImpactParameterD0 {this, "reassembleMaxImpactParameterD0", 1.}
private

Definition at line 216 of file VrtSecInclusive.h.

216{this, "reassembleMaxImpactParameterD0", 1.}; // wrt. DV in [mm]

◆ m_reassembleMaxImpactParameterZ0

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_reassembleMaxImpactParameterZ0 {this, "reassembleMaxImpactParameterZ0", 5.}
private

Definition at line 217 of file VrtSecInclusive.h.

217{this, "reassembleMaxImpactParameterZ0", 5.}; // wrt. DV in [mm]

◆ m_removeFakeVrt

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_removeFakeVrt {this, "RemoveFake2TrkVrt", true}
private

Definition at line 182 of file VrtSecInclusive.h.

182{this, "RemoveFake2TrkVrt", true};

◆ m_removeFakeVrtLate

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_removeFakeVrtLate {this, "DoDelayedFakeReject", false}
private

Definition at line 183 of file VrtSecInclusive.h.

183{this, "DoDelayedFakeReject", false};

◆ m_SAloneTRT

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_SAloneTRT {this, "DoSAloneTRT", false}
private

Definition at line 139 of file VrtSecInclusive.h.

139{this, "DoSAloneTRT", false}; // SAlone = "standalone"

◆ m_sctCondSummaryTool

ToolHandle<IInDetConditionsTool> VKalVrtAthena::VrtSecInclusive::m_sctCondSummaryTool {this, "InDetSCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT conditions summary"}
private

Definition at line 281 of file VrtSecInclusive.h.

281{this, "InDetSCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT conditions summary"};

◆ m_sctId

const SCT_ID* VKalVrtAthena::VrtSecInclusive::m_sctId {}
private

Definition at line 285 of file VrtSecInclusive.h.

285{};

◆ m_secondaryVerticesContainerName

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_secondaryVerticesContainerName {this, "SecondaryVerticesContainerName", "SecondaryVertices"}
private

Definition at line 122 of file VrtSecInclusive.h.

122{this, "SecondaryVerticesContainerName", "SecondaryVertices"};

◆ m_selectedTracks

std::vector<const xAOD::TrackParticle*> VKalVrtAthena::VrtSecInclusive::m_selectedTracks
private

Definition at line 260 of file VrtSecInclusive.h.

◆ m_SelTrkMaxCutoff

Gaudi::Property<unsigned int> VKalVrtAthena::VrtSecInclusive::m_SelTrkMaxCutoff {this, "SelTrkMaxCutoff", 50}
private

Definition at line 138 of file VrtSecInclusive.h.

138{this, "SelTrkMaxCutoff", 50}; // max number of tracks

◆ m_SelVrtChi2Cut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_SelVrtChi2Cut {this, "SelVrtChi2Cut", 4.5}
private

Definition at line 193 of file VrtSecInclusive.h.

193{this, "SelVrtChi2Cut", 4.5}; // in terms of chi2 / ndof

◆ m_thePV

const xAOD::Vertex* VKalVrtAthena::VrtSecInclusive::m_thePV {}
private

Definition at line 259 of file VrtSecInclusive.h.

259{};

◆ m_tracingTruthVertices

std::vector<const xAOD::TruthVertex*> VKalVrtAthena::VrtSecInclusive::m_tracingTruthVertices
private

Definition at line 567 of file VrtSecInclusive.h.

◆ m_TrackDetachCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_TrackDetachCut {this, "TrackDetachCut", 6}
private

Definition at line 197 of file VrtSecInclusive.h.

197{this, "TrackDetachCut", 6};

◆ m_TrackLocation

SG::ReadHandleKey<xAOD::TrackParticleContainer> VKalVrtAthena::VrtSecInclusive::m_TrackLocation {this, "TrackLocation", "InDetTrackParticles"}
private

Definition at line 112 of file VrtSecInclusive.h.

112{this, "TrackLocation", "InDetTrackParticles"};

◆ m_trackSelectionAlgs

std::vector<TrackSelectionAlg> VKalVrtAthena::VrtSecInclusive::m_trackSelectionAlgs
private

Definition at line 392 of file VrtSecInclusive.h.

◆ m_trackSelectionFuncs

std::vector<CutFunc> VKalVrtAthena::VrtSecInclusive::m_trackSelectionFuncs
private

Definition at line 396 of file VrtSecInclusive.h.

◆ m_trackToVertexIPEstimatorTool

PublicToolHandle<Trk::ITrackToVertexIPEstimator> VKalVrtAthena::VrtSecInclusive::m_trackToVertexIPEstimatorTool {this, "TrackToVertexIPEstimatorTool", "Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator"}
private

Definition at line 275 of file VrtSecInclusive.h.

275{this, "TrackToVertexIPEstimatorTool", "Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator"};

◆ m_trackToVertexTool

PublicToolHandle< Reco::ITrackToVertex > VKalVrtAthena::VrtSecInclusive::m_trackToVertexTool {this, "TrackToVertexTool", "Reco::TrackToVertex"}
private

get a handle on the Track to Vertex tool

Definition at line 274 of file VrtSecInclusive.h.

274{this, "TrackToVertexTool", "Reco::TrackToVertex"};

◆ m_tree_Vert

TTree* VKalVrtAthena::VrtSecInclusive::m_tree_Vert {}
private

Definition at line 317 of file VrtSecInclusive.h.

317{};

◆ m_TrkChi2Cut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_TrkChi2Cut {this, "TrkChi2Cut", 3.}
private

Definition at line 162 of file VrtSecInclusive.h.

162{this, "TrkChi2Cut", 3.}; // in terms of chi2 / ndof

◆ m_trkDecors

std::map< unsigned, SG::Decorator<float> > VKalVrtAthena::VrtSecInclusive::m_trkDecors
private

Definition at line 295 of file VrtSecInclusive.h.

◆ m_trkExtrapolator

Gaudi::Property<int> VKalVrtAthena::VrtSecInclusive::m_trkExtrapolator {this, "TrkExtrapolator", 2}
private

Definition at line 177 of file VrtSecInclusive.h.

177{this, "TrkExtrapolator", 2};

◆ m_TrkPtCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_TrkPtCut {this, "TrkPtCut", 1000.}
private

Definition at line 163 of file VrtSecInclusive.h.

163{this, "TrkPtCut", 1000.}; // low pT threshold. in [MeV]

◆ m_truncateWrkVertices

Gaudi::Property<bool> VKalVrtAthena::VrtSecInclusive::m_truncateWrkVertices {this, "TruncateListOfWorkingVertices", true}
private

Definition at line 207 of file VrtSecInclusive.h.

207{this, "TruncateListOfWorkingVertices", true};

◆ m_truthParticleContainerName

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_truthParticleContainerName {this, "McParticleContainer", "TruthParticles"}
private

Definition at line 116 of file VrtSecInclusive.h.

116{this, "McParticleContainer", "TruthParticles"};

◆ m_truthParticleFilter

Gaudi::Property<std::string> VKalVrtAthena::VrtSecInclusive::m_truthParticleFilter {this, "TruthParticleFilter", "Rhadron"}
private

Definition at line 119 of file VrtSecInclusive.h.

119{this, "TruthParticleFilter", "Rhadron"};// Either "", "Kshort", "Rhadron", "HNL", "HadInt", "Bhadron"

◆ m_truthToTrack

PublicToolHandle<Trk::ITruthToTrack> VKalVrtAthena::VrtSecInclusive::m_truthToTrack {this, "TruthToTrack", "Trk::TruthToTrack/InDetTruthToTrack"}
private

Definition at line 271 of file VrtSecInclusive.h.

271{this, "TruthToTrack", "Trk::TruthToTrack/InDetTruthToTrack"}; // tool to create trkParam from genPart

◆ m_TruthTrkLen

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_TruthTrkLen {this, "TruthTrkLen", 1000}
private

Definition at line 247 of file VrtSecInclusive.h.

247{this, "TruthTrkLen", 1000}; // in [mm]

◆ m_twoTrksVertexKey

SG::WriteHandleKey<xAOD::VertexContainer> VKalVrtAthena::VrtSecInclusive::m_twoTrksVertexKey {this, "TwoTracksVertexKey", "", "Two Tracks Vertex key"}
private

Definition at line 300 of file VrtSecInclusive.h.

300{this, "TwoTracksVertexKey", "", "Two Tracks Vertex key"};

◆ m_twoTrkVtxFormingD0Cut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_twoTrkVtxFormingD0Cut {this, "twoTrkVtxFormingD0Cut", 1.}
private

Definition at line 159 of file VrtSecInclusive.h.

159{this, "twoTrkVtxFormingD0Cut", 1.}; // in [mm]

◆ m_twoTrVrtAngleCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_twoTrVrtAngleCut {this, "TwoTrVrtAngleCut", -10}
private

Definition at line 200 of file VrtSecInclusive.h.

200{this, "TwoTrVrtAngleCut", -10};

◆ m_twoTrVrtMaxPerigeeDist

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_twoTrVrtMaxPerigeeDist {this, "twoTrVrtMaxPerigeeDist", 50}
private

Definition at line 232 of file VrtSecInclusive.h.

232{this, "twoTrVrtMaxPerigeeDist", 50}; // in [mm]

◆ m_twoTrVrtMinDistFromPV

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_twoTrVrtMinDistFromPV {this, "TwoTrVrtMinDistFromPVCut", 0.}
private

Definition at line 201 of file VrtSecInclusive.h.

201{this, "TwoTrVrtMinDistFromPVCut", 0.};

◆ m_twoTrVrtMinRadius

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_twoTrVrtMinRadius {this, "twoTrVrtMinRadius", 50}
private

Definition at line 233 of file VrtSecInclusive.h.

233{this, "twoTrVrtMinRadius", 50}; // in [mm]

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexCollectionsDefinitions

std::unordered_map<std::string, bool> VKalVrtAthena::VrtSecInclusive::m_vertexCollectionsDefinitions
private

Definition at line 583 of file VrtSecInclusive.h.

◆ m_vertexingAlgorithms

std::vector< std::pair<std::string, vertexingAlg> > VKalVrtAthena::VrtSecInclusive::m_vertexingAlgorithms
private

Definition at line 440 of file VrtSecInclusive.h.

◆ m_vertexingAlgorithmStep

unsigned VKalVrtAthena::VrtSecInclusive::m_vertexingAlgorithmStep = 0U
private

Definition at line 441 of file VrtSecInclusive.h.

◆ m_vertexingStatus

int VKalVrtAthena::VrtSecInclusive::m_vertexingStatus = 0
private

Definition at line 255 of file VrtSecInclusive.h.

◆ m_vertexingStatusKey

SG::WriteDecorHandleKey<xAOD::EventInfo> VKalVrtAthena::VrtSecInclusive::m_vertexingStatusKey {this, "VertexingStatusKey", m_eventInfoKey, ""}
private

Definition at line 303 of file VrtSecInclusive.h.

303{this, "VertexingStatusKey", m_eventInfoKey, ""};

◆ m_vertexKey

SG::WriteHandleKey<xAOD::VertexContainer> VKalVrtAthena::VrtSecInclusive::m_vertexKey {this, "VertexKey", "", "Vertex key"}
private

Definition at line 299 of file VrtSecInclusive.h.

299{this, "VertexKey", "", "Vertex key"};

◆ m_vertexMapper

PublicToolHandle<Trk::IVertexMapper> VKalVrtAthena::VrtSecInclusive::m_vertexMapper {this, "VertexMapper", ""}
private

Definition at line 277 of file VrtSecInclusive.h.

277{this, "VertexMapper", ""};

◆ m_VertexMergeCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_VertexMergeCut {this, "VertexMergeCut", 3}
private

Definition at line 196 of file VrtSecInclusive.h.

196{this, "VertexMergeCut", 3};

◆ m_VertexMergeFinalDistCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_VertexMergeFinalDistCut {this, "VertexMergeFinalDistCut", 1.}
private

Definition at line 194 of file VrtSecInclusive.h.

194{this, "VertexMergeFinalDistCut", 1.}; // in [mm] // Kazuki

◆ m_VertexMergeFinalDistScaling

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_VertexMergeFinalDistScaling {this, "VertexMergeFinalDistScaling", 0.}
private

Definition at line 195 of file VrtSecInclusive.h.

195{this, "VertexMergeFinalDistScaling", 0.}; // in [1/mm]

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z0TrkErrorCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_z0TrkErrorCut {this, "TrkZErrCut", 20000}
private

Definition at line 158 of file VrtSecInclusive.h.

158{this, "TrkZErrCut", 20000}; // in [mm]

◆ m_z0TrkPVDstMaxCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_z0TrkPVDstMaxCut {this, "zTrkPVDstMaxCut", 1000.}
private

Definition at line 155 of file VrtSecInclusive.h.

155{this, "zTrkPVDstMaxCut", 1000.}; // in [mm]

◆ m_z0TrkPVDstMinCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_z0TrkPVDstMinCut {this, "zTrkPVDstMinCut", 0.}
private

Definition at line 154 of file VrtSecInclusive.h.

154{this, "zTrkPVDstMinCut", 0.}; // in [mm]

◆ m_z0TrkPVSignifCut

Gaudi::Property<double> VKalVrtAthena::VrtSecInclusive::m_z0TrkPVSignifCut {this, "zTrkPVSignifCut", 0.}
private

Definition at line 156 of file VrtSecInclusive.h.

156{this, "zTrkPVSignifCut", 0.}; // in unit of sigma

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