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

#include <VrtSecInclusive.h>

Inheritance diagram for VKalVrtAthena::VrtSecInclusive:

Classes

struct  track_summary_properties
struct  WrkVrt

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 () override
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 const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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

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 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 (WrkVrt &)
 refit the vertex.
StatusCode refitVertex (WrkVrt &, Trk::IVKalState &istate)
StatusCode refitVertexWithSuggestion (WrkVrt &, const Amg::Vector3D &)
 refit the vertex with suggestion
StatusCode refitVertexWithSuggestion (WrkVrt &, const Amg::Vector3D &, Trk::IVKalState &istate)
double improveVertexChi2 (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 (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 (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 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
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

using VKalVrtAthena::VrtSecInclusive::ExtrapolatedPoint = std::tuple<const TVector3, Detector, Bec, Layer, Flag>
private

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

◆ 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()
Default 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)
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 1107 of file VertexingAlgs.cxx.

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

45 {
46
47 enum vertexCatogory_tracks {
48 allTruthAssociated,
49 hasFakeTracks,
50 allFakeTracks
51 };
52
53 enum vertexCategory_vertex {
54 uniqueTruthVertex,
55 multipleTruthVertices,
56 noTruthVertex
57 };
58
59
60 // std::multiset allows to have multiplicity of the element
61 multiset<const xAOD::TruthVertex*> truth_vertices;
62
63 // std::multiset doesn't allow to have multiplicity of the element
64 set<const xAOD::TruthVertex*> truth_vertices_types;
65
66 vector<const xAOD::TrackParticle*> reco_tracks; // associated with truth and has prodVtx
67 vector<const xAOD::TrackParticle*> orphan_tracks; // associated with truth, but does not have prodVtx
68 vector<const xAOD::TrackParticle*> fake_tracks; // no association with truth ( fake )
69
70 // loop over tracks
71 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): loop over tracks" );
72 for( size_t itrk=0; itrk<vertex->nTrackParticles(); itrk++ ) {
73 const auto *trk = vertex->trackParticle( itrk );
74
75 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): track loop itrk = " << itrk );
76 typedef ElementLink<xAOD::TruthParticleContainer> truthLink;
77 static const SG::ConstAccessor< truthLink > truthParticleLinkAcc( "truthParticleLink" );
78 const truthLink& link = truthParticleLinkAcc(*trk);
79
80 if ( ! link ) {
81 fake_tracks.emplace_back( trk );
82 continue;
83 }
84
85 const xAOD::TruthParticle *truth = *link;
86 if( ! truth->hasProdVtx() ) {
87 orphan_tracks.emplace_back( trk );
88 continue;
89 }
90
91 reco_tracks.emplace_back( trk );
92
93 truth_vertices_types .insert( truth->prodVtx() );
94 truth_vertices .insert( truth->prodVtx() );
95
96 }
97
98
99 // Add truth track pattern to the reco vertex
100 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Add truth track pattern to the reco vertex" );
101 const static SG::Accessor<char> trkpatAcc( "truth_trk_pattern" );
102 if( reco_tracks.size() == vertex->nTrackParticles() ) {
103 trkpatAcc( *vertex ) = allTruthAssociated;
104 } else if( fake_tracks.size() == vertex->nTrackParticles() ) {
105 trkpatAcc( *vertex ) = allFakeTracks;
106 } else {
107 trkpatAcc( *vertex ) = hasFakeTracks;
108 }
109
110
111 // Histogramming - counting the number of appearing truth vertices connected
112 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Histogramming - counting the number of appearing truth vertices connected" );
113 vector< tuple<const xAOD::TruthVertex*, size_t> > truth_vertex_histogram;
114 for( const auto *v : truth_vertices_types ) {
115 size_t count = truth_vertices.count( v );
116 truth_vertex_histogram.emplace_back( v, count );
117 }
118
119 // Determine the truth vertex associated to this vertex by majority decision
120 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Determine the truth vertex associated to this vertex by majority decision" );
121 tuple<const xAOD::TruthVertex*, size_t> tmp_tuple( nullptr, 0 );
122 for( const auto& t : truth_vertex_histogram ) {
123 const size_t& size_tmp = get<1>( tmp_tuple );
124 const size_t& size_this = get<1>( t );
125 if( size_tmp < size_this ) tmp_tuple = t;
126 }
127
128 // Add truth track pattern to the reco vertex
129 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Add truth track pattern to the reco vertex" );
130 char truth_vtx_pattern = 0;
131 if( truth_vertices_types.empty() ) {
132 truth_vtx_pattern = noTruthVertex;
133 } else if( truth_vertices_types.size() == 1 ) {
134 truth_vtx_pattern = uniqueTruthVertex;
135 } else {
136 truth_vtx_pattern = multipleTruthVertices;
137 }
138 static const SG::Accessor<char> vtxpatAcc( "truth_vtx_pattern" );
139 vtxpatAcc(*vertex) = truth_vtx_pattern;
140
141
142 ElementLink<xAOD::TruthVertexContainer> vtx_link;
143 if( noTruthVertex != truth_vtx_pattern ) {
144
145 // Retrieve the truth vertex container for element link
146 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Retrieve the truth vertex container for element link" );
147 const xAOD::TruthVertexContainer* truthVertexContainer{};
148 ATH_CHECK( evtStore()->retrieve( truthVertexContainer, "TruthVertices") );
149
150 // create the element link
151 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): create the element link" );
152 const auto *theVertex = get<0>( tmp_tuple );
153 if( theVertex ) {
154 // Add the truth vertex element link to the reco vertex
155 vtx_link.toIndexedElement(*truthVertexContainer,theVertex->index());
156 ATH_MSG_VERBOSE( "categorizeVertexTruthTopology(): Add the truth vertex element link to the reco vertex" );
157 }
158 }
159 // [JDC] a ElementLink decorator should be filled every event
160 // although using a null link
161 static const SG::Accessor<ElementLink<xAOD::TruthVertexContainer> >
162 linkAcc( "truth_vtx_link" );
163 linkAcc(*vertex) = vtx_link;
164
165 return StatusCode::SUCCESS;
166 }
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:130
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
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 }
MsgStream & msg() const
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
@ 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 disabledPattern += (1 << detectorType);
2160 }
2161 }
2162
2163 uint32_t hitPattern = trk->hitPattern();
2164 uint32_t modifiedPattern = disabledPattern | hitPattern;
2165
2166 std::string msg = "Disabled hit pattern: ";
2167 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
2168 msg += Form("%u", ( disabledPattern >> i ) & 1 );
2169 }
2170 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2171
2172 msg = "Recorded hit pattern: ";
2173 for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
2174 msg += Form("%u", ( hitPattern >> i ) & 1 );
2175 }
2176 ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2177
2178 return patternCheck( modifiedPattern, vertex );
2179
2180 }

◆ 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< 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< 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< 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 ( std::vector< WrkVrt > * workVerticesContainer,
const unsigned & vertexIndex )
private

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

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

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

◆ 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 2227 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

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

Definition at line 314 of file VrtSecInclusive.cxx.

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

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

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

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

◆ 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 414 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

415 {
416 //
417 // Give minimal distance between nonmodifed yet vertices
418 //
419
420 indexPair.first = 0;
421 indexPair.second = 0;
422
424
425 for(unsigned iv=0; iv<workVerticesContainer->size()-1; iv++) {
426 auto& vertex = workVerticesContainer->at(iv);
427
428 if( vertex.selectedTrackIndices.size() < 2) continue; /* Bad vertex */
429 if( vertex.closestWrkVrtIndex == 0 ) continue; /* Used vertex */
430
431 if( vertex.closestWrkVrtValue < minValue ) {
432
433 unsigned jv = vertex.closestWrkVrtIndex;
434
435 // Close vertex to given [iv] one is modified already
436 if( workVerticesContainer->at(jv).closestWrkVrtIndex == 0 ) continue;
437
438 minValue = vertex.closestWrkVrtValue;
439
440 indexPair.first = iv;
441 indexPair.second = jv;
442
443 }
444 }
445
446 return minValue;
447 }
#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 374 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

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

◆ findNtrackVertices()

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

Definition at line 395 of file VertexingAlgs.cxx.

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

◆ 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 xAOD::TrackParticle * trk,
const Amg::Vector3D & vertex,
std::vector< double > & impactParameters,
std::vector< double > & impactParErrors )
private

get secondary vertex impact parameters

Definition at line 2324 of file VertexingAlgs.cxx.

2326 {
2327
2328 impactParameters.clear();
2329 impactParErrors.clear();
2330
2331 if( m_trkExtrapolator==1 ){
2332 m_fitSvc->VKalGetImpact(trk, vertex, static_cast<int>( trk->charge() ), impactParameters, impactParErrors);
2333 }
2334 else if( m_trkExtrapolator==2 ){
2335 auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(Gaudi::Hive::currentContext(), *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 26 of file TruthAlgs.cxx.

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

◆ improveVertexChi2()

double VKalVrtAthena::VrtSecInclusive::improveVertexChi2 ( 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 265 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

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

◆ lockLeptonDecorations()

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

Definition at line 510 of file VrtSecInclusive.cxx.

510 {
511 SG::AuxVectorData* cont_nc ATLAS_THREAD_SAFE =
512 const_cast<SG::AuxVectorData*> (cont);
513 for (const IPDecoratorType& dec : m_ipDecors) {
514 if (dec.isAvailable (*cont)) {
515 cont_nc->lockDecoration (dec.auxid());
516 }
517 }
518
519 if (m_decor_svLink) {
520 if (m_decor_svLink->isAvailable (*cont)) {
521 cont_nc->lockDecoration (m_decor_svLink->auxid());
522 }
523 }
524 }
#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 526 of file VrtSecInclusive.cxx.

528 {
529 SG::ReadHandle<xAOD::TrackParticleContainer> trackParticleHandle = SG::makeHandle( m_TrackLocation, ctx );
530 ATH_CHECK( trackParticleHandle.isValid() );
531 const xAOD::TrackParticleContainer* trackParticleContainer = trackParticleHandle.cptr();
532 for( const xAOD::TrackParticle* trk : *trackParticleContainer ) {
533 lockTrackDecorations( trk, onlySelection );
534 }
535
536 SG::ReadHandle<xAOD::MuonContainer> muonsHandle = SG::makeHandle( m_MuonLocation, ctx );
537 ATH_CHECK( muonsHandle.isValid() );
538 const xAOD::MuonContainer* muons = muonsHandle.cptr();
539 if (muons->ownPolicy() != SG::VIEW_ELEMENTS) {
540 lockLeptonDecorations (muons);
541 }
542 for( const xAOD::Muon* muon : *muons ) {
543 if (muons->ownPolicy() == SG::VIEW_ELEMENTS) {
544 lockLeptonDecorations (muon->container());
545 }
546 if ( const xAOD::TrackParticle* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle ) ) {
547 lockTrackDecorations( trk, onlySelection );
548 }
549 }
550
551 SG::ReadHandle<xAOD::ElectronContainer> electronsHandle = SG::makeHandle( m_ElectronLocation, ctx);
552 ATH_CHECK( electronsHandle.isValid() );
553 const xAOD::ElectronContainer *electrons = electronsHandle.cptr();
554 if (electrons->ownPolicy() != SG::VIEW_ELEMENTS) {
555 lockLeptonDecorations (electrons);
556 }
557 for( const xAOD::Electron* electron : *electrons ) {
558 if (electrons->ownPolicy() == SG::VIEW_ELEMENTS) {
559 lockLeptonDecorations (electron->container());
560 }
561 if( electron->nTrackParticles() > 0 ) {
562 if (const xAOD::TrackParticle* trk = electron->trackParticle(0)) {
563 lockTrackDecorations( trk, onlySelection );
564 }
565 }
566 }
567
568 SG::ReadHandle<xAOD::TrackParticleContainer> IDtracksHandle = SG::makeHandle( m_TrackLocation, ctx );
569 ATH_CHECK( IDtracksHandle.isValid() );
570 const xAOD::TrackParticleContainer* IDtracks = IDtracksHandle.cptr();
571 for( const auto *trk : *IDtracks ) {
572 lockTrackDecorations( trk, onlySelection );
573 }
574
575 return StatusCode::SUCCESS;
576 }
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 491 of file VrtSecInclusive.cxx.

491 {
492 SG::AuxVectorData* cont_nc ATLAS_THREAD_SAFE =
493 const_cast<SG::AuxVectorData*> (trk->container());
494 cont_nc->lockDecoration (m_decor_isSelected->auxid());
495
496 if (onlySelection) return;
497
498 if (m_decor_isAssociated && m_decor_isAssociated->isAvailable (*cont_nc)) {
499 cont_nc->lockDecoration (m_decor_isAssociated->auxid());
500 }
501 if (m_decor_is_svtrk_final && m_decor_is_svtrk_final->isAvailable (*cont_nc)) {
502 cont_nc->lockDecoration (m_decor_is_svtrk_final->auxid());
503 }
504
505 for (const auto& p : m_trkDecors) {
506 cont_nc->lockDecoration (p.second.auxid());
507 }
508 }
const SG::AuxVectorData * container() const
Return the container holding this element.
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 1317 of file VertexingAlgs.cxx.

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

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

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

A destructive operation.

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

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

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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 2184 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

2187 {
2188
2189 const bool& check_itrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( itrk, FitVertex );
2190 const bool& check_jtrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( jtrk, FitVertex );
2191
2192 return ( check_itrk && check_jtrk );
2193
2194 }
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 }
static const Attributes_t empty
std::map< const xAOD::TruthVertex *, bool > m_matchMap
@ previous
Definition BinningData.h:32
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 758 of file VertexingAlgs.cxx.

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

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

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

refit the vertex.

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

497 {
498 std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
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 ( 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();
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 2198 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

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

◆ 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 337 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

341 {
342
343 auto& wrkvrt = workVerticesContainer->at(SelectedVertex);
344 auto& tracks = wrkvrt.selectedTrackIndices;
345
346 {
347 auto end = std::remove_if( tracks.begin(), tracks.end(), [&](long int index) { return index == trackIndexToRemove; } );
348 tracks.erase( end, tracks.end() );
349 }
350
351 {
352 for( auto& trks : *TrkInVrt ) {
353 auto end = std::remove_if( trks.begin(), trks.end(), [&](long int index) { return index == trackIndexToRemove; } );
354 trks.erase( end, trks.end() );
355 }
356 }
357
358
359 // Check if track is removed from two-track vertex => then sharing of track left should also be decreased
360 if( wrkvrt.selectedTrackIndices.size() == 1 ) {
361
362 const auto& leftTrackIndex = *( tracks.begin() );
363 auto& list = TrkInVrt->at(leftTrackIndex);
364 auto end = std::remove_if( list.begin(), list.end(), [&](long int index) { return index == trackIndexToRemove; } );
365 list.erase( end, list.end() );
366
367 }
368
369 }
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< 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< 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::CaloTagged) { continue; }
344 const auto* mu_trk = muon->trackParticle( xAOD::Muon::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::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.

◆ 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 61 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.

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

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

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

Definition at line 66 of file AthAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

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< 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< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.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< 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< 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: