ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
VKalVrtAthena::VrtSecInclusive Class Reference

#include <VrtSecInclusive.h>

Inheritance diagram for VKalVrtAthena::VrtSecInclusive:
Collaboration diagram for VKalVrtAthena::VrtSecInclusive:

Classes

struct  JobProperties
 
struct  track_summary_properties
 
struct  WrkVrt
 

Public Member Functions

 VrtSecInclusive (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor. More...
 
 ~VrtSecInclusive ()
 Default Destructor. More...
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode execute ()
 
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. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

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

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::*)()
 
using CutFunc = bool(VrtSecInclusive::*)(const xAOD::TrackParticle *) const
 track selection More...
 
using vertexingAlg = StatusCode(VrtSecInclusive::*)(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

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. More...
 
StatusCode selectTracksInDet ()
 
StatusCode selectTracksFromMuons ()
 
StatusCode selectTracksFromElectrons ()
 
StatusCode selectInDetAndGSFTracks ()
 
bool selectTrack_notPVassociated (const xAOD::TrackParticle *) const
 track-by-track selection strategies More...
 
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 (std::vector< WrkVrt > *)
 related to the graph method and verte finding More...
 
StatusCode findNtrackVertices (std::vector< WrkVrt > *)
 
StatusCode rearrangeTracks (std::vector< WrkVrt > *)
 
StatusCode reassembleVertices (std::vector< WrkVrt > *)
 attempt to merge vertices when all tracks of a vertex A is close to vertex B in terms of impact parameter More...
 
StatusCode mergeByShuffling (std::vector< WrkVrt > *)
 attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior of the vertex reconstruction resolution More...
 
StatusCode mergeFinalVertices (std::vector< WrkVrt > *)
 attempt to merge vertices by lookng at the distance between two vertices More...
 
StatusCode associateNonSelectedTracks (std::vector< WrkVrt > *)
 in addition to selected tracks, associate as much tracks as possible More...
 
StatusCode refitAndSelectGoodQualityVertices (std::vector< WrkVrt > *)
 finalization of the vertex and store to xAOD::VertexContainer More...
 
bool getSVImpactParameters (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex, std::vector< double > &impactParameters, std::vector< double > &impactParErrors)
 get secondary vertex impact parameters More...
 
void printWrkSet (const std::vector< WrkVrt > *WrkVrtSet, const std::string &name)
 print the contents of reconstructed vertices More...
 
StatusCode refitVertex (WrkVrt &)
 refit the vertex. More...
 
StatusCode refitVertex (WrkVrt &, Trk::IVKalState &istate)
 
StatusCode refitVertexWithSuggestion (WrkVrt &, const Amg::Vector3D &)
 refit the vertex with suggestion More...
 
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. More...
 
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 More...
 
double distanceBetweenVertices (const WrkVrt &, const WrkVrt &) const
 calculate the physical distance More...
 
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. More...
 
StatusCode mergeVertices (WrkVrt &destination, WrkVrt &source)
 the 2nd vertex is merged into the 1st vertex. More...
 
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. More...
 
bool checkTrackHitPatternToVertexOuterOnly (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 A classical method with hard-coded geometry. More...
 
bool checkTrackHitPatternToVertexByExtrapolation (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 New method with track extrapolation. More...
 
bool checkTrackHitPatternToVertexByExtrapolationAssist (const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
 New method with track extrapolation. More...
 
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. More...
 
void removeInconsistentTracks (WrkVrt &)
 Remove inconsistent tracks from vertices. More...
 
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 (std::vector< WrkVrt > *, const std::string &name, bool final=false)
 monitor the intermediate status of vertexing More...
 
StatusCode categorizeVertexTruthTopology (xAOD::Vertex *vertex)
 
void dumpTruthInformation ()
 
template<class LeptonFlavor >
StatusCode augmentDVimpactParametersToLeptons (const std::string &containerName)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

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 More...
 
static double findMinVerticesNextPair (std::vector< WrkVrt > *, std::pair< unsigned, unsigned > &)
 returns the next pair of vertices that give next-to-minimum distance significance More...
 
static void fillTrackSummary (track_summary &summary, const xAOD::TrackParticle *trk)
 cretrieve the track hit information More...
 
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

struct JobProperties m_jp
 
int m_vertexingStatus = 0
 
const xAOD::VertexContainerm_primaryVertices
 
const xAOD::Vertexm_thePV
 
std::unique_ptr< std::vector< const xAOD::TrackParticle * > > m_selectedTracks
 
std::unique_ptr< std::vector< const xAOD::TrackParticle * > > m_associatedTracks
 
std::unique_ptr< std::vector< const xAOD::TrackParticle * > > m_leptonicTracks
 
std::vector< double > m_BeamPosition
 
ToolHandle< Trk::ITrkVKalVrtFitterm_fitSvc
 
ToolHandle< Trk::ITruthToTrackm_truthToTrack
 
ToolHandle< Reco::ITrackToVertexm_trackToVertexTool
 get a handle on the Track to Vertex tool More...
 
ToolHandle< Trk::ITrackToVertexIPEstimatorm_trackToVertexIPEstimatorTool
 
ToolHandle< Trk::IExtrapolatorm_extrapolator
 
ToolHandle< Trk::IVertexMapperm_vertexMapper
 
ToolHandle< IInDetConditionsToolm_pixelCondSummaryTool {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}
 Condition service. More...
 
ToolHandle< IInDetConditionsToolm_sctCondSummaryTool {this, "InDetSCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT conditions summary"}
 
const AtlasDetectorIDm_atlasId = nullptr
 
const PixelIDm_pixelId = nullptr
 
const SCT_IDm_sctId = nullptr
 
std::string m_checkPatternStrategy
 
std::map< std::string, PatternStrategyFuncm_patternStrategyFuncs
 
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_isSelected
 
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_isAssociated
 
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_is_svtrk_final
 
std::map< unsigned, SG::AuxElement::Decorator< float > > m_trkDecors
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this,"EventInfoKey", "EventInfo", "EventInfo name"}
 Read/Write Handle Keys. More...
 
SG::WriteDecorHandleKey< xAOD::EventInfom_vertexingStatusKey
 
std::unique_ptr< IPDecoratorTypem_decor_d0_wrtSVs
 
std::unique_ptr< IPDecoratorTypem_decor_z0_wrtSVs
 
std::unique_ptr< IPDecoratorTypem_decor_pt_wrtSVs
 
std::unique_ptr< IPDecoratorTypem_decor_eta_wrtSVs
 
std::unique_ptr< IPDecoratorTypem_decor_phi_wrtSVs
 
std::unique_ptr< IPDecoratorTypem_decor_d0err_wrtSVs
 
std::unique_ptr< IPDecoratorTypem_decor_z0err_wrtSVs
 
std::unique_ptr< 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
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 84 of file VrtSecInclusive.h.

Member Typedef Documentation

◆ AlgForVerticesPair

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

Definition at line 479 of file VrtSecInclusive.h.

◆ Bec

Definition at line 362 of file VrtSecInclusive.h.

◆ CutFunc

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

track selection

Definition at line 392 of file VrtSecInclusive.h.

◆ Detector

Definition at line 361 of file VrtSecInclusive.h.

◆ ExtrapolatedPattern

Definition at line 366 of file VrtSecInclusive.h.

◆ ExtrapolatedPoint

Definition at line 365 of file VrtSecInclusive.h.

◆ Flag

Definition at line 364 of file VrtSecInclusive.h.

◆ IPDecoratorType

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

Definition at line 296 of file VrtSecInclusive.h.

◆ Layer

Definition at line 363 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 367 of file VrtSecInclusive.h.

◆ PatternStrategyFunc

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

Definition at line 283 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::*)()
private

Definition at line 388 of file VrtSecInclusive.h.

◆ VertexELType

Definition at line 305 of file VrtSecInclusive.h.

◆ vertexingAlg

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

Definition at line 436 of file VrtSecInclusive.h.

Member Enumeration Documentation

◆ mergeStep

Enumerator
RECONSTRUCT_NTRK 
REASSEMBLE 
SHUFFLE1 
SHUFFLE2 
SHUFFLE3 
FINAL 

Definition at line 490 of file VrtSecInclusive.h.

◆ TrkParameter

Enumerator
k_d0 
k_z0 
k_theta 
k_phi 
k_qOverP 
k_nTP 

Definition at line 433 of file VrtSecInclusive.h.

433 { k_d0=0, k_z0=1, k_theta=2, k_phi=3, k_qOverP=4 ,k_nTP=5 };

◆ TrkParameterUnc

Enumerator
k_d0d0 
k_z0z0 
k_nTPU 

Definition at line 434 of file VrtSecInclusive.h.

434 { k_d0d0=0, k_z0z0=1, k_nTPU=2 };

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 
42  m_primaryVertices ( nullptr ),
43  m_thePV ( nullptr ),
44 
45  // ToolsHandles
46  m_fitSvc ( "Trk::TrkVKalVrtFitter", this ),
47  m_truthToTrack ( "Trk::TruthToTrack/InDetTruthToTrack" ),
48  m_trackToVertexTool ( "Reco::TrackToVertex" ),
49  m_trackToVertexIPEstimatorTool ( "Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator" ),
50  m_extrapolator ( "Trk::Extrapolator/AtlasExtrapolator" ),
51  m_vertexMapper ( "" ),
52 
53  m_checkPatternStrategy ( "Classical" ),
54 
55  // Pointers of Ntuple variable vectors
56  m_tree_Vert ( nullptr ),
57  m_ntupleVars ( nullptr )
58 
59  {
60 
65 
66  this->declareProperties();
67 
68  if( m_jp.FillNtuple ) {
69  m_ntupleVars = std::make_unique<NtupleVars>( );
70  }
71 
72  }

◆ ~VrtSecInclusive()

VKalVrtAthena::VrtSecInclusive::~VrtSecInclusive ( )

Default Destructor.

Definition at line 77 of file VrtSecInclusive.cxx.

78  {
79  ATH_MSG_DEBUG("destructor called");
80  }

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  }

◆ associateNonSelectedTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::associateNonSelectedTracks ( std::vector< WrkVrt > *  workVerticesContainer)
private

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

Definition at line 1061 of file VertexingAlgs.cxx.

1062  {
1063 
1064  const xAOD::TrackParticleContainer *allTracks ( nullptr );
1065  ATH_CHECK( evtStore()->retrieve(allTracks, m_jp.TrackLocation) );
1066 
1067  const xAOD::VertexContainer *pvs (nullptr);
1068  ATH_CHECK( evtStore()->retrieve( pvs, "PrimaryVertices") );
1069 
1070  if( !m_decor_isAssociated ) m_decor_isAssociated = std::make_unique< SG::AuxElement::Decorator<char> >( "is_associated" + m_jp.augVerString );
1071 
1072  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": #verticess = " << workVerticesContainer->size() );
1073 
1074  unsigned associateCounter { 0 };
1075 
1076  // Loop over vertices
1077  for( auto& wrkvrt : *workVerticesContainer ) {
1078 
1079  if( !wrkvrt.isGood ) continue;
1080  if( wrkvrt.selectedTrackIndices.size() <= 1 ) continue;
1081 
1082  improveVertexChi2( wrkvrt );
1083 
1084  wrkvrt.Chi2_core = wrkvrt.Chi2;
1085 
1086  auto& vertexPos = wrkvrt.vertex;
1087 
1088  std::vector<double> distanceToPVs;
1089 
1090  for( const auto* pv : *pvs ) {
1091  distanceToPVs.emplace_back( VKalVrtAthena::vtxVtxDistance( vertexPos, pv->position() ) );
1092  }
1093  const auto& minDistance = *( std::min_element( distanceToPVs.begin(), distanceToPVs.end() ) );
1094 
1095  if( minDistance < m_jp.associateMinDistanceToPV ) continue;
1096 
1097 
1098  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vertex pos = (" << vertexPos.x() << ", " << vertexPos.y() << ", " << vertexPos.z() << "), "
1099  "#selected = " << wrkvrt.selectedTrackIndices.size() << ", #assoc = " << wrkvrt.associatedTrackIndices.size() );
1100 
1101  std::vector<const xAOD::TrackParticle*> candidates;
1102 
1103  // Search for candidate tracks
1104  for( auto itr = allTracks->begin(); itr != allTracks->end(); ++itr ) {
1105  const auto* trk = *itr;
1106 
1107  // If the track is already used for any DV candidate, reject.
1108  {
1109  auto result = std::find_if( workVerticesContainer->begin(), workVerticesContainer->end(),
1110  [&] ( WrkVrt& wrkvrt ) {
1111  auto found = std::find_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1112  [&]( long int index ) {
1113  // 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
1114  if (m_jp.doSelectTracksFromElectrons || m_jp.doSelectIDAndGSFTracks) {
1115  const xAOD::TrackParticle *id_tr;
1116  id_tr = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(m_selectedTracks->at(index));
1117  return trk == m_selectedTracks->at(index) or trk == id_tr;
1118  }
1119  else{
1120  return trk == m_selectedTracks->at(index);
1121  }
1122  } );
1123  return found != wrkvrt.selectedTrackIndices.end();
1124  } );
1125  if( result != workVerticesContainer->end() ) continue;
1126  }
1127 
1128  // If the track is already registered to the associated track list, reject.
1129  {
1130  auto result = std::find_if( m_associatedTracks->begin(), m_associatedTracks->end(),
1131  [&] (const auto* atrk) { return trk == atrk; } );
1132  if( result != m_associatedTracks->end() ) continue;
1133  }
1134 
1135  // Reject PV-associated tracks
1136  // if( !selectTrack_notPVassociated( trk ) ) continue;
1137 
1138  // pT selection
1139  if( trk->pt() < m_jp.associatePtCut ) continue;
1140 
1141  // chi2 selection
1142  if( trk->chiSquared() / trk->numberDoF() > m_jp.associateChi2Cut ) continue;
1143 
1144  // Hit pattern consistentcy requirement
1145  if( !checkTrackHitPatternToVertexOuterOnly( trk, vertexPos ) ) continue;
1146 
1147  // Get the closest approach
1148  std::vector<double> impactParameters;
1149  std::vector<double> impactParErrors;
1150 
1151  if( !getSVImpactParameters( trk, vertexPos, impactParameters, impactParErrors) ) continue;
1152 
1153  if( std::abs( impactParameters.at(0) ) / sqrt( impactParErrors.at(0) ) > m_jp.associateMaxD0Signif ) continue;
1154  if( std::abs( impactParameters.at(1) ) / sqrt( impactParErrors.at(1) ) > m_jp.associateMaxZ0Signif ) continue;
1155 
1156  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": trk " << trk
1157  << ": d0 to vtx = " << impactParameters.at(k_d0)
1158  << ", z0 to vtx = " << impactParameters.at(k_z0)
1159  << ", distance to vtx = " << hypot( impactParameters.at(k_d0), impactParameters.at(k_z0) ) );
1160 
1161  candidates.emplace_back( trk );
1162 
1163  }
1164 
1165  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": number of candidate tracks = " << candidates.size() );
1166 
1167  std::unique_ptr<Trk::IVKalState> state = m_fitSvc->makeState();
1168  // Attempt to add the track to the vertex and try fitting
1169  for( const auto* trk : candidates ) {
1170 
1171  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": attempting to associate track = " << trk );
1172 
1173  // Backup the current vertes status
1174  WrkVrt wrkvrt_backup = wrkvrt;
1175 
1176  m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1177 
1178  std::vector<const xAOD::TrackParticle*> baseTracks;
1179  std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
1180 
1181  wrkvrt.Chi2PerTrk.clear();
1182 
1183  for( const auto& index : wrkvrt.selectedTrackIndices ) {
1184  baseTracks.emplace_back( m_selectedTracks->at( index ) );
1185  wrkvrt.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
1186  }
1187  for( const auto& index : wrkvrt.associatedTrackIndices ) {
1188  baseTracks.emplace_back( m_associatedTracks->at( index ) );
1189  wrkvrt.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
1190  }
1191 
1192  baseTracks.emplace_back( trk );
1193  wrkvrt.Chi2PerTrk.emplace_back( AlgConsts::chi2PerTrackInitValue );
1194 
1195  Amg::Vector3D initPos;
1196 
1197  {
1198  StatusCode sc = m_fitSvc->VKalVrtFitFast( baseTracks, initPos, *state );/* Fast crude estimation */
1199 
1200  if( sc.isFailure() ) ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": fast crude estimation failed.");
1201 
1202  const auto& diffPos = initPos - vertexPos;
1203 
1204  if( diffPos.norm() > 10. ) {
1205 
1206  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": approx vertex as original" );
1207  m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1208 
1209  } else {
1210 
1211  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": approx vertex set to (" << initPos.x() << ", " << initPos.y() << ", " << initPos.z() << ")" );
1212  m_fitSvc->setApproximateVertex( initPos.x(), initPos.y(), initPos.z(), *state );
1213 
1214  }
1215  }
1216 
1217 
1218  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": now vertex fitting..." );
1219 
1220  StatusCode sc = m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
1221  wrkvrt.vertex,
1222  wrkvrt.vertexMom,
1223  wrkvrt.Charge,
1224  wrkvrt.vertexCov,
1225  wrkvrt.Chi2PerTrk,
1226  wrkvrt.TrkAtVrt,
1227  wrkvrt.Chi2,
1228  *state);
1229 
1230  if( sc.isFailure() ) {
1231  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": VKalVrtFit failure. Revert to backup");
1232  wrkvrt = wrkvrt_backup;
1233 
1234  if( m_jp.FillHist ) m_hists["associateMonitor"]->Fill( 1 );
1235 
1236  continue;
1237  }
1238 
1239 
1240  if( m_jp.FillHist ) m_hists["associateMonitor"]->Fill( 0 );
1241 
1242  auto& cov = wrkvrt.vertexCov;
1243 
1244  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": succeeded in associating. New vertex pos = (" << vertexPos.perp() << ", " << vertexPos.z() << ", " << vertexPos.perp()*vertexPos.phi() << ")" );
1245  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) << ")" );
1246 
1247  associateCounter++;
1248 
1249  wrkvrt.associatedTrackIndices.emplace_back( m_associatedTracks->size() );
1250 
1251  m_associatedTracks->emplace_back( trk );
1252  (*m_decor_isAssociated)( *trk ) = true;
1253 
1254  }
1255 
1256  }
1257 
1258  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1259  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": total associated number of tracks = " << associateCounter );
1260  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1261 
1262  return StatusCode::SUCCESS;
1263  }

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

◆ 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 );
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 
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 ( nullptr );
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
162  linkAcc( "truth_vtx_link" );
163  linkAcc(*vertex) = vtx_link;
164 
165  return StatusCode::SUCCESS;
166  }

◆ checkTrackHitPatternToVertex()

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

A classical method with hard-coded geometry.

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

2179  {
2180 
2181  const uint32_t pattern = trk->hitPattern();
2182 
2183  return patternCheck( pattern, vertex );
2184 
2185  }

◆ checkTrackHitPatternToVertexByExtrapolation()

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

New method with track extrapolation.

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

1172  {
1173 
1174  if( m_extrapolatedPatternBank.find( trk ) == m_extrapolatedPatternBank.end() ) {
1175 
1176  std::unique_ptr<ExtrapolatedPattern> exPattern_along( extrapolatedPattern( trk, Trk::alongMomentum ) );
1177  std::unique_ptr<ExtrapolatedPattern> exPattern_oppos( extrapolatedPattern( trk, Trk::oppositeMomentum ) );
1178 
1179  m_extrapolatedPatternBank.emplace( trk, std::make_pair( std::move(exPattern_along), std::move(exPattern_oppos) ) );
1180 
1181  }
1182 
1183  auto& exPattern = m_extrapolatedPatternBank.at( trk );
1184 
1185  using LayerCombination = std::vector<int>;
1186 
1187  std::map<LayerCombination, unsigned> layerMap;
1188  if( layerMap.empty() ) {
1189  layerMap[ { 1, 0, 0 } ] = Trk::pixelBarrel0;
1190  layerMap[ { 1, 0, 1 } ] = Trk::pixelBarrel1;
1191  layerMap[ { 1, 0, 2 } ] = Trk::pixelBarrel2;
1192  layerMap[ { 1, 0, 3 } ] = Trk::pixelBarrel3;
1193 
1194  layerMap[ { 1, 2, 0 } ] = Trk::pixelEndCap0;
1195  layerMap[ { 1, 2, 1 } ] = Trk::pixelEndCap1;
1196  layerMap[ { 1, 2, 2 } ] = Trk::pixelEndCap2;
1197  layerMap[ { 1,-2, 0 } ] = Trk::pixelEndCap0;
1198  layerMap[ { 1,-2, 1 } ] = Trk::pixelEndCap1;
1199  layerMap[ { 1,-2, 2 } ] = Trk::pixelEndCap2;
1200 
1201  layerMap[ { 2, 0, 0 } ] = Trk::sctBarrel0;
1202  layerMap[ { 2, 0, 1 } ] = Trk::sctBarrel1;
1203  layerMap[ { 2, 0, 2 } ] = Trk::sctBarrel2;
1204  layerMap[ { 2, 0, 3 } ] = Trk::sctBarrel3;
1205 
1206  layerMap[ { 2, 2, 0 } ] = Trk::sctEndCap0;
1207  layerMap[ { 2, 2, 1 } ] = Trk::sctEndCap1;
1208  layerMap[ { 2, 2, 2 } ] = Trk::sctEndCap2;
1209  layerMap[ { 2, 2, 3 } ] = Trk::sctEndCap3;
1210  layerMap[ { 2, 2, 4 } ] = Trk::sctEndCap4;
1211  layerMap[ { 2, 2, 5 } ] = Trk::sctEndCap5;
1212  layerMap[ { 2, 2, 6 } ] = Trk::sctEndCap6;
1213  layerMap[ { 2, 2, 7 } ] = Trk::sctEndCap7;
1214  layerMap[ { 2, 2, 8 } ] = Trk::sctEndCap8;
1215  layerMap[ { 2,-2, 0 } ] = Trk::sctEndCap0;
1216  layerMap[ { 2,-2, 1 } ] = Trk::sctEndCap1;
1217  layerMap[ { 2,-2, 2 } ] = Trk::sctEndCap2;
1218  layerMap[ { 2,-2, 3 } ] = Trk::sctEndCap3;
1219  layerMap[ { 2,-2, 4 } ] = Trk::sctEndCap4;
1220  layerMap[ { 2,-2, 5 } ] = Trk::sctEndCap5;
1221  layerMap[ { 2,-2, 6 } ] = Trk::sctEndCap6;
1222  layerMap[ { 2,-2, 7 } ] = Trk::sctEndCap7;
1223  layerMap[ { 2,-2, 8 } ] = Trk::sctEndCap8;
1224  }
1225 
1226  enum { position=0, detector=1, bec=2, layer=3, isGood=4 };
1227 
1228  // Lambda!
1229  auto getDetectorType = [&]( const ExtrapolatedPoint& point ) -> unsigned {
1230 
1231  const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
1232 
1233  for( auto& pair : layerMap ) {
1234  if( pair.first == comb ) {
1235  return pair.second;
1236  }
1237  }
1238 
1240  };
1241 
1242  enum { kShouldNotHaveHit, kShouldHaveHit, kMayHaveHit };
1243  std::vector<unsigned> expectedHitPattern(Trk::numberOfDetectorTypes, kShouldNotHaveHit);
1244 
1245  auto minExpectedRadius = AlgConsts::maxValue;
1246 
1247  // Loop over extrapolated points (along direction)
1248  auto& exPattern_along = *( exPattern.first );
1249 
1250  for( auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
1251  if( std::next( itr ) == exPattern_along.end() ) continue;
1252 
1253  const auto& point = *itr;
1254  const auto& nextPoint = *( std::next( itr ) );
1255 
1256  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": isGood = " << std::get<isGood>( point ) );
1257 
1258  const auto& thisPos = std::get<position>( point );
1259  const auto& nextPos = std::get<position>( nextPoint );
1260 
1261  auto sectionVector = nextPos - thisPos;
1262  auto vertexVector = TVector3( vertex.x(), vertex.y(), vertex.z() ) - thisPos;
1263 
1264 
1265  const auto& detectorType = getDetectorType( point );
1266 
1267  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": detType = " << detectorType );
1268 
1269  if( detectorType == AlgConsts::invalidUnsigned ) continue;
1270  if( detectorType >= Trk::numberOfDetectorTypes ) continue;
1271 
1272  // if the vertex is nearby (within 10 mm), the hit may be presnet ("X")
1273  if( vertexVector.Mag() < 10. ) {
1274  expectedHitPattern.at( detectorType ) = kMayHaveHit;
1275  continue;
1276  }
1277 
1278  // if the front-end module is not active, then the hit is not expected,
1279  // which means the hit may be present
1280  if( !static_cast<bool>(std::get<isGood>( point )) ) {
1281  expectedHitPattern.at( detectorType ) = kMayHaveHit;
1282  continue;
1283  }
1284 
1285  // if the inner product of the above two vectors is positive,
1286  // then point is inner than the vertex.
1287  // Else, the point is outer than the vertex and expect to have hits
1288  // when the track is originated from the vertex.
1289 
1290  if( sectionVector.Mag() == 0. ) continue;
1291 
1292  ATH_MSG_VERBOSE( " > " << __FUNCTION__
1293  << ": hitPos = (" << thisPos.Perp() << ", " << thisPos.z() << ", " << thisPos.Phi() << ")"
1294  << ", sectionVec = (" << sectionVector.Perp() << ", " << sectionVector.z() << ", " << sectionVector.Phi() << ")"
1295  << ", vertexVec = (" << vertexVector.Perp() << ", " << vertexVector.z() << ", " << vertexVector.Phi() << ")"
1296  << ", cos(s,v) = " << sectionVector * vertexVector / ( sectionVector.Mag() * vertexVector.Mag() + AlgConsts::infinitesimal ) );
1297 
1298  if( sectionVector * vertexVector > 0. ) continue;
1299 
1300  if( minExpectedRadius > thisPos.Perp() ) minExpectedRadius = thisPos.Perp();
1301 
1302  // now, the hit is expected to present.
1303 
1304  expectedHitPattern.at( detectorType ) = kShouldHaveHit;
1305  }
1306 
1307  // Loop over extrapolated points (opposite direction)
1308  auto& exPattern_oppos = *( exPattern.second );
1309  bool oppositeFlag = false;
1310 
1311  for( auto itr = exPattern_oppos.begin(); itr != exPattern_oppos.end(); ++itr ) {
1312  if( std::next( itr ) == exPattern_oppos.end() ) continue;
1313 
1314  const auto& point = *itr;
1315  const auto& nextPoint = *( std::next( itr ) );
1316 
1317  const auto& thisPos = std::get<position>( point );
1318  const auto& nextPos = std::get<position>( nextPoint );
1319 
1320  auto sectionVector = nextPos - thisPos;
1321  auto vertexVector = TVector3( vertex.x(), vertex.y(), vertex.z() ) - thisPos;
1322 
1323  const auto& detectorType = getDetectorType( point );
1324 
1325  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": detType = " << detectorType );
1326 
1327  ATH_MSG_DEBUG( " > " << __FUNCTION__
1328  << ": hitPos = (" << thisPos.Perp() << ", " << thisPos.z() << ", " << thisPos.Phi() << ")"
1329  << ", vertex = (" << vertex.perp() << ", " << vertex.z() << ", " << vertex.phi() << ")"
1330  << ", cos(s,v) = " << sectionVector * vertexVector / ( sectionVector.Mag() * vertexVector.Mag() + AlgConsts::infinitesimal ) );
1331 
1332  if( detectorType == AlgConsts::invalidUnsigned ) continue;
1333  if( detectorType >= Trk::numberOfDetectorTypes ) continue;
1334 
1335  if( sectionVector * vertexVector < 0. ) {
1336  oppositeFlag = true;
1337  }
1338  }
1339 
1340  // If the first expected point's radius is smaller than the vertex radius,
1341  // it's the case that the vertex was reconstructed in the opposite phi-direction
1342  // to the track outgoing direction. Such a case should be rejected.
1343  // bool oppositeFlag = ( minExpectedRadius < vertex.perp() );
1344 
1345  std::string msg = "Expected hit pattern: ";
1346  for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
1347  msg += Form("%s", expectedHitPattern.at(i) < kMayHaveHit? Form("%u", expectedHitPattern.at(i)) : "X" );
1348  }
1349  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
1350 
1351  msg = "Recorded hit pattern: ";
1352  for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
1353  msg += Form("%u", ( trk->hitPattern() >> i ) & 1 );
1354  }
1355  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
1356 
1357  std::vector<unsigned> matchedLayers;
1358 
1359  for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
1360  const unsigned recordedPattern = ( (trk->hitPattern()>>i) & 1 );
1361 
1362  if( expectedHitPattern.at(i) == kMayHaveHit ) {
1363  matchedLayers.emplace_back( i );
1364  } else if( expectedHitPattern.at(i) == kShouldHaveHit ) {
1365  if( expectedHitPattern.at(i) != recordedPattern ) {
1366  break;
1367  } else {
1368  matchedLayers.emplace_back( i );
1369  }
1370  } else {
1371  if( expectedHitPattern.at(i) != recordedPattern ) {
1372  break;
1373  }
1374  }
1375 
1376  }
1377 
1378  uint8_t PixelHits = 0;
1379  uint8_t SctHits = 0;
1380  uint8_t TRTHits = 0;
1381  if( !(trk->summaryValue( PixelHits, xAOD::numberOfPixelHits ) ) ) PixelHits =0;
1382  if( !(trk->summaryValue( SctHits, xAOD::numberOfSCTHits ) ) ) SctHits =0;
1383  if( !(trk->summaryValue( TRTHits, xAOD::numberOfTRTHits ) ) ) TRTHits =0;
1384 
1385  auto dphi = trk->phi() - vertex.phi();
1386  while( dphi > TMath::Pi() ) dphi -= TMath::TwoPi();
1387  while( dphi < -TMath::Pi() ) dphi += TMath::TwoPi();
1388 
1389  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vtx phi = " << vertex.phi() << ", track phi = " << trk->phi() << ", dphi = " << dphi
1390  << ", oppositeFlag = " << oppositeFlag
1391  << ", nPixelHits = " << static_cast<int>(PixelHits)
1392  << ", nSCTHits = " << static_cast<int>(SctHits)
1393  << ", nTRTHits = " << static_cast<int>(TRTHits)
1394  << ", nMatchedLayers = " << matchedLayers.size() );
1395 
1396  if( PixelHits == 0 && vertex.perp() > 300. ) {
1397  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vertex r > 300 mm, w/o no pixel hits" );
1398  }
1399 
1400 
1401  // Requires the first 2 layers with the hit matches.
1402  if( matchedLayers.size() < 2 ) return false;
1403 
1404  // In case of the first matched layer is not within pixel barrel, requires the first 4 layers with the hit match
1405  if( matchedLayers.at(0) >= Trk::pixelEndCap0 ) {
1406  if( matchedLayers.size() < 4 ) return false;
1407  }
1408 
1409  // Sometimes the vertex is reconstructed at the opposite phi direction.
1410  // In this case, the pattern match may pass.
1411  // This can be avoided by requiring that the
1412  if( oppositeFlag ) return false;
1413 
1414  // The following condition should apply for vertices outer than IBL.
1415  if( false /*matchedLayers.at(0) > Trk::pixelBarrel0*/ ) {
1416 
1417  // If the dphi (defined above) is opposite, reject.
1418  if( fabs( dphi ) > TMath::Pi()/2.0 ) return false;
1419 
1420  // If the track is not within the forward hemisphere to the vertex, reject.
1421  TVector3 trkP; trkP.SetPtEtaPhi( trk->pt(), trk->eta(), trk->phi() );
1422  TVector3 vtx; vtx.SetXYZ( vertex.x(), vertex.y(), vertex.z() );
1423  if( trkP.Dot( vtx ) < 0. ) return false;
1424 
1425  }
1426 
1427  return true;
1428  }

◆ checkTrackHitPatternToVertexByExtrapolationAssist()

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

New method with track extrapolation.

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

2201  {
2202 
2203  if( m_extrapolatedPatternBank.find( trk ) == m_extrapolatedPatternBank.end() ) {
2204 
2205  std::unique_ptr<ExtrapolatedPattern> exPattern_along( extrapolatedPattern( trk, Trk::alongMomentum ) );
2206 
2207  m_extrapolatedPatternBank.emplace( trk, std::make_pair( std::move(exPattern_along), nullptr ) );
2208 
2209  }
2210 
2211  if( vertex.perp() < 31.0 ) {
2212  double dphi = trk->phi() - vertex.phi();
2213  while( dphi > TMath::Pi() ) { dphi -= TMath::TwoPi(); }
2214  while( dphi < -TMath::Pi() ) { dphi += TMath::TwoPi(); }
2215  if( cos(dphi) < -0.8 ) return false;
2216  }
2217 
2218  auto& exPattern = m_extrapolatedPatternBank.at( trk );
2219 
2220  using LayerCombination = std::vector<int>;
2221 
2222  std::map<LayerCombination, unsigned> layerMap;
2223  if( layerMap.empty() ) {
2224  layerMap[ { 1, 0, 0 } ] = Trk::pixelBarrel0;
2225  layerMap[ { 1, 0, 1 } ] = Trk::pixelBarrel1;
2226  layerMap[ { 1, 0, 2 } ] = Trk::pixelBarrel2;
2227  layerMap[ { 1, 0, 3 } ] = Trk::pixelBarrel3;
2228 
2229  layerMap[ { 1, 2, 0 } ] = Trk::pixelEndCap0;
2230  layerMap[ { 1, 2, 1 } ] = Trk::pixelEndCap1;
2231  layerMap[ { 1, 2, 2 } ] = Trk::pixelEndCap2;
2232  layerMap[ { 1,-2, 0 } ] = Trk::pixelEndCap0;
2233  layerMap[ { 1,-2, 1 } ] = Trk::pixelEndCap1;
2234  layerMap[ { 1,-2, 2 } ] = Trk::pixelEndCap2;
2235 
2236  layerMap[ { 2, 0, 0 } ] = Trk::sctBarrel0;
2237  layerMap[ { 2, 0, 1 } ] = Trk::sctBarrel1;
2238  layerMap[ { 2, 0, 2 } ] = Trk::sctBarrel2;
2239  layerMap[ { 2, 0, 3 } ] = Trk::sctBarrel3;
2240 
2241  layerMap[ { 2, 2, 0 } ] = Trk::sctEndCap0;
2242  layerMap[ { 2, 2, 1 } ] = Trk::sctEndCap1;
2243  layerMap[ { 2, 2, 2 } ] = Trk::sctEndCap2;
2244  layerMap[ { 2, 2, 3 } ] = Trk::sctEndCap3;
2245  layerMap[ { 2, 2, 4 } ] = Trk::sctEndCap4;
2246  layerMap[ { 2, 2, 5 } ] = Trk::sctEndCap5;
2247  layerMap[ { 2, 2, 6 } ] = Trk::sctEndCap6;
2248  layerMap[ { 2, 2, 7 } ] = Trk::sctEndCap7;
2249  layerMap[ { 2, 2, 8 } ] = Trk::sctEndCap8;
2250  layerMap[ { 2,-2, 0 } ] = Trk::sctEndCap0;
2251  layerMap[ { 2,-2, 1 } ] = Trk::sctEndCap1;
2252  layerMap[ { 2,-2, 2 } ] = Trk::sctEndCap2;
2253  layerMap[ { 2,-2, 3 } ] = Trk::sctEndCap3;
2254  layerMap[ { 2,-2, 4 } ] = Trk::sctEndCap4;
2255  layerMap[ { 2,-2, 5 } ] = Trk::sctEndCap5;
2256  layerMap[ { 2,-2, 6 } ] = Trk::sctEndCap6;
2257  layerMap[ { 2,-2, 7 } ] = Trk::sctEndCap7;
2258  layerMap[ { 2,-2, 8 } ] = Trk::sctEndCap8;
2259  }
2260 
2261  enum { position=0, detector=1, bec=2, layer=3, isGood=4 };
2262 
2263  // Lambda!
2264  auto getDetectorType = [&]( const ExtrapolatedPoint& point ) -> unsigned {
2265 
2266  const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
2267 
2268  for( auto& pair : layerMap ) {
2269  if( pair.first == comb ) {
2270  return pair.second;
2271  }
2272  }
2273 
2275  };
2276 
2277  uint32_t disabledPattern { 0 };
2278 
2279  // Loop over extrapolated points (along direction)
2280  auto& exPattern_along = *( exPattern.first );
2281 
2282  for( auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
2283  if( std::next( itr ) == exPattern_along.end() ) continue;
2284 
2285  const auto& point = *itr;
2286 
2287  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": isGood = " << std::get<isGood>( point ) );
2288 
2289  if( !std::get<isGood>( point ) ) {
2290  const auto& detectorType = getDetectorType( point );
2291  disabledPattern += (1 << detectorType);
2292  }
2293  }
2294 
2295  uint32_t hitPattern = trk->hitPattern();
2296  uint32_t modifiedPattern = disabledPattern | hitPattern;
2297 
2298  std::string msg = "Disabled hit pattern: ";
2299  for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
2300  msg += Form("%u", ( disabledPattern >> i ) & 1 );
2301  }
2302  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2303 
2304  msg = "Recorded hit pattern: ";
2305  for( unsigned i=0; i<Trk::numberOfDetectorTypes; i++) {
2306  msg += Form("%u", ( hitPattern >> i ) & 1 );
2307  }
2308  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2309 
2310  return patternCheck( modifiedPattern, vertex );
2311 
2312  }

◆ checkTrackHitPatternToVertexOuterOnly()

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

A classical method with hard-coded geometry.

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

2190  {
2191 
2192  const uint32_t pattern = trk->hitPattern();
2193 
2195 
2196  }

◆ 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() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperties()

void VKalVrtAthena::VrtSecInclusive::declareProperties ( )
private

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

686  {
687 
689 
690  declareProperty("TrackLocation", m_jp.TrackLocation = "InDetTrackParticles" );
691  declareProperty("MuonLocation", m_jp.MuonLocation = "Muons" );
692  declareProperty("ElectronLocation", m_jp.ElectronLocation = "Electrons" );
693  declareProperty("PrimVrtLocation", m_jp.PrimVrtLocation = "PrimaryVertices" );
694  declareProperty("McParticleContainer", m_jp.truthParticleContainerName = "TruthParticles" );
695  declareProperty("MCEventContainer", m_jp.mcEventContainerName = "TruthEvents" );
696  declareProperty("AugmentingVersionString", m_jp.augVerString = "" );
697  declareProperty("TruthParticleFilter", m_jp.truthParticleFilter = "Rhadron" ); // Either "", "Kshort", "Rhadron", "HNL", "HadInt", "Bhadron"
698 
699  declareProperty("All2trkVerticesContainerName", m_jp.all2trksVerticesContainerName = "All2TrksVertices" );
700  declareProperty("SecondaryVerticesContainerName", m_jp.secondaryVerticesContainerName = "SecondaryVertices" );
701 
702  declareProperty("FillHist", m_jp.FillHist = false );
703  declareProperty("FillNtuple", m_jp.FillNtuple = false );
704  declareProperty("FillIntermediateVertices", m_jp.FillIntermediateVertices = false );
705  declareProperty("DoIntersectionPos", m_jp.doIntersectionPos = false );
706  declareProperty("DoMapToLocal", m_jp.doMapToLocal = false );
707  declareProperty("DoTruth", m_jp.doTruth = false );
708  declareProperty("DoPVcompatibility", m_jp.doPVcompatibilityCut = true );
709  declareProperty("DoTightPVcompatibility", m_jp.doTightPVcompatibilityCut = false );
710  declareProperty("RemoveFake2TrkVrt", m_jp.removeFakeVrt = true );
711  declareProperty("DoDelayedFakeReject", m_jp.removeFakeVrtLate = false );
712  declareProperty("CheckHitPatternStrategy", m_checkPatternStrategy = "Classical" ); // Either Classical or Extrapolation
713  declareProperty("MCTrackResolution", m_jp.mcTrkResolution = 0.06 ); // see getTruth for explanation
714  declareProperty("TruthTrkLen", m_jp.TruthTrkLen = 1000 ); // in [mm]
715  declareProperty("ExtrapPV", m_jp.extrapPV = false ); // Leave false. only for testing
716  declareProperty("PassThroughTrackSelection", m_jp.passThroughTrackSelection = false );
717  declareProperty("DoFastMode", m_jp.doFastMode = false );
718 
719 
720  declareProperty("DoTwoTrSoftBtag", m_jp.doTwoTrSoftBtag = false );
721  declareProperty("TwoTrVrtAngleCut", m_jp.twoTrVrtAngleCut = -10 );
722  declareProperty("TwoTrVrtMinDistFromPVCut", m_jp.twoTrVrtMinDistFromPV = 0. );
723 
724  declareProperty("TruncateListOfWorkingVertices", m_jp.truncateWrkVertices = true );
725  declareProperty("MaxNumberOfWorkingVertices", m_jp.maxWrkVertices = 1500 );
726 
727  // default values are set upstream - check top of file
728  declareProperty("do_PVvetoCut", m_jp.do_PVvetoCut = true );
729  declareProperty("do_d0Cut", m_jp.do_d0Cut = true );
730  declareProperty("do_z0Cut", m_jp.do_z0Cut = true );
731  declareProperty("do_d0errCut", m_jp.do_d0errCut = false );
732  declareProperty("do_z0errCut", m_jp.do_z0errCut = false );
733  declareProperty("do_d0signifCut", m_jp.do_d0signifCut = false );
734  declareProperty("do_z0signifCut", m_jp.do_z0signifCut = false );
735 
736  declareProperty("ImpactWrtBL", m_jp.ImpactWrtBL = true ); // false option is going to be deprecated
737  declareProperty("a0TrkPVDstMinCut", m_jp.d0TrkPVDstMinCut = 0. ); // in [mm]
738  declareProperty("a0TrkPVDstMaxCut", m_jp.d0TrkPVDstMaxCut = 1000. ); // in [mm]
739  declareProperty("a0TrkPVSignifCut", m_jp.d0TrkPVSignifCut = 0. ); // in [mm]
740  declareProperty("twoTrkVtxFormingD0Cut", m_jp.twoTrkVtxFormingD0Cut = 1. ); // in [mm]
741  declareProperty("zTrkPVDstMinCut", m_jp.z0TrkPVDstMinCut = 0. ); // in [mm]
742  declareProperty("zTrkPVDstMaxCut", m_jp.z0TrkPVDstMaxCut = 1000. ); // in [mm]
743  declareProperty("zTrkPVSignifCut", m_jp.z0TrkPVSignifCut = 0. ); // in unit of sigma
744  declareProperty("TrkA0ErrCut", m_jp.d0TrkErrorCut = 10000 ); // in [mm]
745  declareProperty("TrkZErrCut", m_jp.z0TrkErrorCut = 20000 ); // in [mm]
746 
747  declareProperty("SelTrkMaxCutoff", m_jp.SelTrkMaxCutoff = 50 ); // max number of tracks
748  declareProperty("TrkPtCut", m_jp.TrkPtCut = 1000. ); // low pT threshold. in [MeV]
749  declareProperty("TrkChi2Cut", m_jp.TrkChi2Cut = 3. ); // in terms of chi2 / ndof
750  declareProperty("PVcompatibilityCut", m_jp.pvCompatibilityCut = -20. ); // in [mm]
751  declareProperty("SelVrtChi2Cut", m_jp.SelVrtChi2Cut = 4.5 ); // in terms of chi2 / ndof
752 
753  declareProperty("CutSctHits", m_jp.CutSctHits = 0 );
754  declareProperty("CutPixelHits", m_jp.CutPixelHits = 0 );
755  declareProperty("CutSiHits", m_jp.CutSiHits = 0 );
756  declareProperty("DoSAloneTRT", m_jp.SAloneTRT = false ); // SAlone = "standalone"
757  declareProperty("CutBLayHits", m_jp.CutBLayHits = 0 );
758  declareProperty("CutSharedHits", m_jp.CutSharedHits = 0 );
759  declareProperty("doTRTPixCut", m_jp.doTRTPixCut = false ); // mode for R-hadron displaced vertex
760  declareProperty("CutTRTHits", m_jp.CutTRTHits = 0 );
761  declareProperty("CutTightSCTHits", m_jp.CutTightSCTHits = 7 );
762  declareProperty("CutTightTRTHits", m_jp.CutTightTRTHits = 20 );
763 
764  declareProperty("TrkExtrapolator", m_jp.trkExtrapolator = 2 );
765 
766  declareProperty("doReassembleVertices", m_jp.doReassembleVertices = false );
767  declareProperty("doMergeByShuffling", m_jp.doMergeByShuffling = false );
768  declareProperty("doSuggestedRefitOnMerging", m_jp.doSuggestedRefitOnMerging = true ); // sub-option of doMergeByShuffling-1
769  declareProperty("doMagnetMerging", m_jp.doMagnetMerging = true ); // sub-option of doMergeByShuffling-2
770  declareProperty("doWildMerging", m_jp.doWildMerging = true ); // sub-option of doMergeByShuffling-3
771  declareProperty("doMergeFinalVerticesDistance", m_jp.doMergeFinalVerticesDistance = false );
772  declareProperty("doAssociateNonSelectedTracks", m_jp.doAssociateNonSelectedTracks = false );
773  declareProperty("doFinalImproveChi2", m_jp.doFinalImproveChi2 = false );
774 
775  declareProperty("VertexMergeCut", m_jp.VertexMergeCut = 3 );
776  declareProperty("TrackDetachCut", m_jp.TrackDetachCut = 6 );
777  declareProperty("associateMinDistanceToPV", m_jp.associateMinDistanceToPV = 0.5 );
778  declareProperty("associateMaxD0Signif", m_jp.associateMaxD0Signif = 5. ); // wrt. DV in unit of sigma
779  declareProperty("associateMaxZ0Signif", m_jp.associateMaxZ0Signif = 5. ); // wrt. DV in unit of sigma
780  declareProperty("associatePtCut", m_jp.associatePtCut = 0. ); // in [MeV]
781  declareProperty("associateChi2Cut", m_jp.associateChi2Cut = 20. );
782  declareProperty("reassembleMaxImpactParameterD0", m_jp.reassembleMaxImpactParameterD0 = 1. ); // wrt. DV in [mm]
783  declareProperty("reassembleMaxImpactParameterZ0", m_jp.reassembleMaxImpactParameterZ0 = 5. ); // wrt. DV in [mm]
784  declareProperty("mergeByShufflingMaxSignificance", m_jp.mergeByShufflingMaxSignificance = 100. ); // in unit of sigma
785  declareProperty("mergeByShufflingAllowance", m_jp.mergeByShufflingAllowance = 4. ); // in unit of sigma
786  declareProperty("VertexMergeFinalDistCut", m_jp.VertexMergeFinalDistCut = 1. ); // in [mm]
787  declareProperty("VertexMergeFinalDistScaling", m_jp.VertexMergeFinalDistScaling = 0. ); // in [1/mm]
788  declareProperty("improveChi2ProbThreshold", m_jp.improveChi2ProbThreshold = 1.e-4 );
789 
790  // A test implementation for muon vertices
791  declareProperty("doSelectTracksFromMuons", m_jp.doSelectTracksFromMuons = false );
792  declareProperty("doRemoveCaloTaggedMuons", m_jp.doRemoveCaloTaggedMuons = false );
793  declareProperty("doSelectTracksFromElectrons", m_jp.doSelectTracksFromElectrons = false );
794  declareProperty("doSelectIDAndGSFTracks", m_jp.doSelectIDAndGSFTracks = false );
795  declareProperty("doRemoveNonLeptonVertices", m_jp.doRemoveNonLeptonVertices = false );
796 
797  // Select tracks with additonal LRT Cuts (inspiried by Run 3 LRT optimization studies)
798  declareProperty("doSelectTracksWithLRTCuts", m_jp.doSelectTracksWithLRTCuts = false );
799 
800  // Additional dressing option
801  declareProperty("doAugmentDVimpactParametersToMuons", m_jp.doAugmentDVimpactParametersToMuons = false );
802  declareProperty("doAugmentDVimpactParametersToElectrons", m_jp.doAugmentDVimpactParametersToElectrons = false );
803 
804  // Additional ToolHandles
805  declareProperty("VertexFitterTool", m_fitSvc, " Private TrkVKalVrtFitter" );
806  declareProperty("Extrapolator", m_extrapolator );
807  declareProperty("TrackToVertexTool", m_trackToVertexTool );
808  declareProperty("TrackToVertexIPEstimatorTool", m_trackToVertexIPEstimatorTool );
809  declareProperty("VertexMapper", m_vertexMapper );
810  declareProperty("TruthToTrack", m_truthToTrack );
811 
812  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

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

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

◆ dumpTruthInformation()

void VKalVrtAthena::VrtSecInclusive::dumpTruthInformation ( )
private

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

2359  {
2360 
2361  const xAOD::EventInfo* eventInfo { nullptr };
2362  const xAOD::TruthParticleContainer* truthParticles { nullptr };
2363  const xAOD::TruthVertexContainer* truthVertices { nullptr };
2364 
2365  auto sc0 = evtStore()->retrieve( eventInfo, "EventInfo" );
2366  if( sc0.isFailure() ) { return; }
2367 
2368  if( !eventInfo->eventType( xAOD::EventInfo::IS_SIMULATION ) ) {
2369  return;
2370  }
2371 
2372  auto sc1 = evtStore()->retrieve( truthParticles, "TruthParticles" );
2373  if( sc1.isFailure() ) { return; }
2374 
2375  auto sc2 = evtStore()->retrieve( truthVertices, "TruthVertices" );
2376  if( sc2.isFailure() ) { return; }
2377 
2378  if( !truthParticles ) { return; }
2379  if( !truthVertices ) { return; }
2380 
2381  m_tracingTruthVertices.clear();
2382 
2383  std::vector<const xAOD::TruthParticle*> truthSvTracks;
2384 
2385  // truth particle selection functions
2386 
2387  auto selectNone = [](const xAOD::TruthVertex*) ->bool { return false; };
2388 
2389  auto selectRhadron = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2390  if( truthVertex->nIncomingParticles() != 1 ) return false;
2391  if( !truthVertex->incomingParticle(0) ) return false;
2392  if( abs(truthVertex->incomingParticle(0)->pdgId()) < 1000000 ) return false;
2393  if( abs(truthVertex->incomingParticle(0)->pdgId()) > 1000000000 ) return false; // Nuclear codes, e.g. deuteron
2394  // neutralino in daughters
2395  bool hasNeutralino = false;
2396  for( unsigned ip = 0; ip < truthVertex->nOutgoingParticles(); ip++ ) {
2397  const auto* p = truthVertex->outgoingParticle(ip);
2398  if( abs( p->pdgId() ) == 1000022 ) {
2399  hasNeutralino = true;
2400  break;
2401  }
2402  }
2403  return hasNeutralino;
2404  };
2405 
2406  auto selectHNL = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2407  if( truthVertex->nIncomingParticles() != 1 ) return false;
2408  if( !truthVertex->incomingParticle(0) ) return false;
2409  if( abs(truthVertex->incomingParticle(0)->pdgId()) != 50 ) return false;
2410  return true;
2411  };
2412 
2413  auto selectHiggs = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2414  if( truthVertex->nIncomingParticles() != 1 ) return false;
2415  if( !truthVertex->incomingParticle(0) ) return false;
2416  if( abs(truthVertex->incomingParticle(0)->pdgId()) != 36 ) return false;
2417  return true;
2418  };
2419 
2420  auto selectKshort = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2421  if( truthVertex->nIncomingParticles() != 1 ) return false;
2422  if( !truthVertex->incomingParticle(0) ) return false;
2423  if( abs(truthVertex->incomingParticle(0)->pdgId()) != 310 ) return false;
2424  return true;
2425  };
2426 
2427  auto selectBhadron = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2428  if( truthVertex->nIncomingParticles() != 1 ) return false;
2429  if( !truthVertex->incomingParticle(0) ) return false;
2430  if( abs(truthVertex->incomingParticle(0)->pdgId()) <= 500 || abs(truthVertex->incomingParticle(0)->pdgId()) >= 600 ) return false;
2431  return true;
2432  };
2433 
2434  auto selectHadInt = [](const xAOD::TruthVertex* truthVertex ) -> bool {
2435  if( truthVertex->nIncomingParticles() != 1 ) return false;
2436  if( !truthVertex->incomingParticle(0) ) return false;
2437 
2438  const auto* parent = truthVertex->incomingParticle(0);
2439  if( parent->isLepton() ) return false;
2440 
2441  TLorentzVector p4sum_in;
2442  TLorentzVector p4sum_out;
2443  for( unsigned ip = 0; ip < truthVertex->nIncomingParticles(); ip++ ) {
2444  const auto* particle = truthVertex->incomingParticle(ip);
2445  TLorentzVector p4; p4.SetPtEtaPhiM( particle->pt(), particle->eta(), particle->phi(), particle->m() );
2446  p4sum_in += p4;
2447  }
2448  for( unsigned ip = 0; ip < truthVertex->nOutgoingParticles(); ip++ ) {
2449  const auto* particle = truthVertex->outgoingParticle(ip);
2450  TLorentzVector p4; p4.SetPtEtaPhiM( particle->pt(), particle->eta(), particle->phi(), particle->m() );
2451  p4sum_out += p4;
2452  }
2453  return p4sum_out.E() - p4sum_in.E() >= 100.;
2454  };
2455 
2456 
2457 
2458  using ParticleSelectFunc = bool (*)(const xAOD::TruthVertex*);
2459  std::map<std::string, ParticleSelectFunc> selectFuncs { { "", selectNone },
2460  { "Kshort", selectKshort },
2461  { "Bhadron", selectBhadron },
2462  { "Rhadron", selectRhadron },
2463  { "HNL", selectHNL },
2464  { "Higgs", selectHiggs },
2465  { "HadInt", selectHadInt } };
2466 
2467 
2468  if( selectFuncs.find( m_jp.truthParticleFilter ) == selectFuncs.end() ) {
2469  ATH_MSG_WARNING( " > " << __FUNCTION__ << ": invalid function specification: " << m_jp.truthParticleFilter );
2470  return;
2471  }
2472 
2473  auto selectFunc = selectFuncs.at( m_jp.truthParticleFilter );
2474 
2475  // loop over truth vertices
2476  for( const auto *truthVertex : *truthVertices ) {
2477  if( selectFunc( truthVertex ) ) {
2478  m_tracingTruthVertices.emplace_back( truthVertex );
2479  std::string msg;
2480  msg += Form("pdgId = %d, (r, z) = (%.2f, %.2f), ", truthVertex->incomingParticle(0)->pdgId(), truthVertex->perp(), truthVertex->z());
2481  msg += Form("nOutgoing = %lu, ", truthVertex->nOutgoingParticles() );
2482  msg += Form("mass = %.3f GeV, pt = %.3f GeV", truthVertex->incomingParticle(0)->m()/1.e3, truthVertex->incomingParticle(0)->pt()/1.e3 );
2483  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": " << msg );
2484  }
2485  }
2486 
2487  if( m_jp.FillHist ) {
2488  for( const auto* truthVertex : m_tracingTruthVertices ) {
2489  m_hists["nMatchedTruths"]->Fill( 0., truthVertex->perp() );
2490  }
2491  }
2492 
2493  }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode VKalVrtAthena::VrtSecInclusive::execute ( )
virtual

Definition at line 294 of file VrtSecInclusive.cxx.

295  {
296  //
297  ATH_MSG_DEBUG("VrtSecInclusive execute()");
298 
299  m_vertexingStatus = -1;
300 
302  if (!eventInfo.isValid()) {
303  ATH_MSG_ERROR ("Could not retrieve EventInfo");
304  return StatusCode::FAILURE;
305  }
306 
308 
309  // clear ntuple variables
310  StatusCode sc = this->initEvent();
311  if(sc.isFailure()) {
312  ATH_MSG_WARNING("Problem in initEvent ");
313  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
314  return StatusCode::SUCCESS;
315  }
316 
317  // add event level info to ntuple
318  if( m_jp.FillNtuple ) sc = addEventInfo();
319 
320  if (sc.isFailure() ) {
321  ATH_MSG_WARNING("Failure in getEventInfo() ");
322  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
323  return StatusCode::SUCCESS;
324  }
325 
326 
328  //
329  // Setup StoreGate Variables
330  //
331 
332  // Check Return StatusCode::Failure if the user-specified container names have duplication.
333  {
334  std::vector<std::string> userContainerNames { m_jp.secondaryVerticesContainerName, m_jp.all2trksVerticesContainerName };
335  std::set<std::string> userContainerNamesSet;
336  for( auto& name : userContainerNames ) userContainerNamesSet.insert( name );
337  if( userContainerNamesSet.size() != userContainerNames.size() ) {
338  ATH_MSG_ERROR( " > " << __FUNCTION__ << ": detected duplicated user-specified container name. Please check your job property" );
339  return StatusCode::FAILURE;
340  }
341  }
342 
343  auto *secondaryVertexContainer = new xAOD::VertexContainer;
344  auto *secondaryVertexAuxContainer = new xAOD::VertexAuxContainer;
345 
346  secondaryVertexContainer ->setStore( secondaryVertexAuxContainer );
347 
348  ATH_CHECK( evtStore()->record( secondaryVertexContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName + m_jp.augVerString ) );
349  ATH_CHECK( evtStore()->record( secondaryVertexAuxContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName + m_jp.augVerString + "Aux." ) );
350 
352  auto *twoTrksVertexContainer = new xAOD::VertexContainer;
353  auto *twoTrksVertexAuxContainer = new xAOD::VertexAuxContainer;
354 
355  twoTrksVertexContainer ->setStore( twoTrksVertexAuxContainer );
356 
357  ATH_CHECK( evtStore()->record( twoTrksVertexContainer, "VrtSecInclusive_" + m_jp.all2trksVerticesContainerName + m_jp.augVerString ) );
358  ATH_CHECK( evtStore()->record( twoTrksVertexAuxContainer, "VrtSecInclusive_" + m_jp.all2trksVerticesContainerName + m_jp.augVerString + "Aux." ) );
359 
360  for( auto itr = m_vertexingAlgorithms.begin(); itr!=m_vertexingAlgorithms.end(); ++itr ) {
361 
362  auto& name = itr->first;
363 
364  auto *intermediateVertexContainer = new xAOD::VertexContainer;
365  auto *intermediateVertexAuxContainer = new xAOD::VertexAuxContainer;
366 
367  intermediateVertexContainer ->setStore( intermediateVertexAuxContainer );
368 
369  ATH_CHECK( evtStore()->record( intermediateVertexContainer, "VrtSecInclusive_IntermediateVertices_" + name + m_jp.augVerString ) );
370  ATH_CHECK( evtStore()->record( intermediateVertexAuxContainer, "VrtSecInclusive_IntermediateVertices_" + name + m_jp.augVerString + "Aux." ) );
371  }
372 
373  }
374 
376 
377 
378  // Later use elsewhere in the algorithm
379  m_selectedTracks = std::make_unique<std::vector<const xAOD::TrackParticle*>> ( );
380  m_associatedTracks = std::make_unique<std::vector<const xAOD::TrackParticle*>>( );
381  m_leptonicTracks = std::make_unique<std::vector<const xAOD::TrackParticle*>> ( );
382 
384 
386  //
387  // now start algorithm
388  //
389 
390  //--------------------------------------------------------
391  // Primary vertex processing
392  //
393  sc = this->processPrimaryVertices(); // fetch the 1st primary reconstructed vertex
394 
395  if( sc.isFailure() or !m_thePV ) {
396 
397  ATH_MSG_WARNING("processPrimaryVertices() failed");
398  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
399  return StatusCode::SUCCESS;
400  }
401 
402  // Perform track selection and store it to selectedBaseTracks
403  try {
404 
405  for( auto alg : m_trackSelectionAlgs ) {
406  ATH_CHECK( (this->*alg)() );
407  }
408 
409  } catch( ... ) {
410 
411  ATH_MSG_WARNING( " > " << __FUNCTION__ << ": some other error is detected in the track selection scope." );
412 
413  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
414  return StatusCode::SUCCESS;
415 
416  }
417 
418 
419  if( m_jp.FillNtuple )
420  m_ntupleVars->get<unsigned int>( "NumSelTrks" ) = static_cast<int>( m_selectedTracks->size() );
421 
422  // fill information about selected tracks in AANT
424 
425  //-------------------------------------------------------
426  // Skip the event if the number of selected tracks is more than m_jp.SelTrkMaxCutoff
427  if( m_selectedTracks->size() < 2 ) {
428  ATH_MSG_DEBUG( "execute: Too few (<2) selected reco tracks. Terminated reconstruction." );
429  m_vertexingStatus = 1;
430  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
431  return StatusCode::SUCCESS;
432  }
433 
434  if( m_selectedTracks->size() > m_jp.SelTrkMaxCutoff ) {
435  ATH_MSG_INFO( "execute: Too many selected reco tracks. Terminated reconstruction." );
436  m_vertexingStatus = 2;
437  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
438  return StatusCode::SUCCESS;
439  }
440 
441  //-------------------------------------------------------
442  // Core part of Vertexing
443  //
444 
445  try {
446 
448 
449  // set of vertices created in the following while loop.
450  auto* workVerticesContainer = new std::vector<WrkVrt>;
451 
452  // the main sequence of the main vertexing algorithms
453  // see initialize() what kind of algorithms exist.
454  for( auto itr = m_vertexingAlgorithms.begin(); itr!=m_vertexingAlgorithms.end(); ++itr ) {
455 
456  auto& name = itr->first;
457  auto alg = itr->second;
458 
459  auto t_start = std::chrono::system_clock::now();
460 
461  ATH_CHECK( (this->*alg)( workVerticesContainer ) );
462 
463  auto t_end = std::chrono::system_clock::now();
464 
465  if( m_jp.FillHist ) {
466  auto sec = std::chrono::duration_cast<std::chrono::microseconds>( t_end - t_start ).count();
467  m_hists["CPUTime"]->Fill( m_vertexingAlgorithmStep, sec/1.e6 );
468  }
469 
470  auto end = std::remove_if( workVerticesContainer->begin(), workVerticesContainer->end(),
471  []( WrkVrt& wrkvrt ) {
472  return ( !wrkvrt.isGood || wrkvrt.nTracksTotal() < 2 ); }
473  );
474 
475  workVerticesContainer->erase( end, workVerticesContainer->end() );
476 
477  ATH_CHECK( monitorVertexingAlgorithmStep( workVerticesContainer, name, std::next( itr ) == m_vertexingAlgorithms.end() ) );
478 
480 
481  }
482 
483  delete workVerticesContainer;
484 
485  } catch(std::exception& e) {
486 
487  ATH_MSG_WARNING( " > " << __FUNCTION__ << ": exception detected in the vertexing scope: " << e.what() );
488  m_vertexingStatus = 4;
489 
490  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
491  return StatusCode::SUCCESS;
492 
493  }
494 
495  m_vertexingStatus = 0;
496  vertexingStatusDecor(*eventInfo) = m_vertexingStatus;
497 
498  // Fill AANT
499  if( m_jp.FillNtuple ) {
500  m_tree_Vert->Fill();
502  }
503 
504 
505  ATH_MSG_VERBOSE( "execute: process done." );
506  // end
507  return StatusCode::SUCCESS;
508 
509  }

◆ extractIncompatibleTrackPairs()

StatusCode VKalVrtAthena::VrtSecInclusive::extractIncompatibleTrackPairs ( std::vector< WrkVrt > *  workVerticesContainer)
private

related to the graph method and verte finding

Definition at line 39 of file VertexingAlgs.cxx.

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

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

◆ extrapolatedPattern()

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

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

1103  {
1104 
1105  auto* pattern = new ExtrapolatedPattern;
1106  const EventContext& ctx = Gaudi::Hive::currentContext();
1107  std::vector<std::unique_ptr<Trk::TrackParameters>> paramsVector =
1108  m_extrapolator->extrapolateBlindly(ctx, trk->perigeeParameters(), direction);
1109 
1111 
1112  auto nDisabled = 0;
1113 
1114  for( auto& params : paramsVector ) {
1115 
1116  const TVector3 position( params->position().x(), params->position().y(), params->position().z() );
1117 
1118  if( prevPos == position ) {
1119  continue;
1120  }
1121 
1122  prevPos = position;
1123 
1124  const auto* detElement = params->associatedSurface().associatedDetectorElement();
1125 
1126  if( detElement ) {
1127 
1128  enum { Pixel = 1, SCT = 2 };
1129 
1130  const auto& id = detElement->identify();
1131  Flag good = false;
1132 
1133  if( m_atlasId->is_pixel(id) ) {
1134 
1135  auto idHash = m_pixelId->wafer_hash( id );
1136  good = m_pixelCondSummaryTool->isGood( idHash, ctx );
1137 
1138  pattern->emplace_back( std::make_tuple( position, Pixel, m_pixelId->barrel_ec(id), m_pixelId->layer_disk(id), good ) );
1139 
1140  } else if( m_atlasId->is_sct(id) ) {
1141 
1142  auto idHash = m_sctId->wafer_hash( id );
1143  good = m_sctCondSummaryTool->isGood( idHash, ctx );
1144 
1145  pattern->emplace_back( std::make_tuple( position, SCT, m_sctId->barrel_ec(id), m_sctId->layer_disk(id), good ) );
1146 
1147  }
1148 
1149  if( !pattern->empty() ) {
1150 
1151  ATH_MSG_VERBOSE(" >> " << __FUNCTION__ << ", track " << trk << ": position = (" << position.Perp() << ", " << position.z() << ", " << position.Phi() << "), detElement ID = " << id << ", good = " << good
1152  << ": (det, bec, layer) = (" << std::get<1>( pattern->back() ) << ", " << std::get<2>( pattern->back() ) << ", " << std::get<3>( pattern->back() ) << ")" );
1153 
1154  if( !good ) nDisabled++;
1155  }
1156 
1157  }
1158 
1159  }
1160 
1161  if( m_jp.FillHist ) {
1162  m_hists["disabledCount"]->Fill( nDisabled );
1163  }
1164 
1165  return pattern;
1166 
1167  }

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

◆ 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_jp.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_jp.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;
313  int barcode = HepMC::UNDEFINED_ID; // FIXME barcode-based
314  if(m_jp.doTruth)
315  {
316  const xAOD::TruthParticle* aTemp_truth = getTrkGenParticle( trk );
317  if( aTemp_truth )
318  {
319  barcode = HepMC::barcode(aTemp_truth); // FIXME barcode-based
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( barcode ); // FIXME barcode-based
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  << barcode << "," // FIXME barcode-based
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  }

◆ fillTrackSummary()

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

cretrieve the track hit information

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

1086  {
1087  summary.numIBLHits = 0;
1088  summary.numBLayerHits = 0;
1089  summary.numPixelHits = 0;
1090  summary.numSctHits = 0;
1091  summary.numTrtHits = 0;
1092 
1095  trk->summaryValue( summary.numPixelHits, xAOD::numberOfPixelHits );
1096  trk->summaryValue( summary.numSctHits, xAOD::numberOfSCTHits );
1097  trk->summaryValue( summary.numTrtHits, xAOD::numberOfTRTHits );
1098  }

◆ finalize()

StatusCode VKalVrtAthena::VrtSecInclusive::finalize ( )
virtual

Definition at line 268 of file VrtSecInclusive.cxx.

269  {
270 
271  ATH_MSG_INFO("finalize: VrtSecInclusive finalize()");
272  return StatusCode::SUCCESS;
273  }

◆ 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 
423  double minValue = AlgConsts::maxValue;
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  }

◆ 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 
385  double minValue = AlgConsts::maxValue;
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  }

◆ findNtrackVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::findNtrackVertices ( std::vector< WrkVrt > *  workVerticesContainer)
private

Definition at line 360 of file VertexingAlgs.cxx.

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

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

943  {
944 
945  double worstChi2 = AlgConsts::invalidFloat;
946 
947  // Find the track index that has the largest shared vertices
948  auto maxSharedTrackToVertices = std::max_element( trackToVertexMap.begin(), trackToVertexMap.end(), []( auto& p1, auto& p2 ) { return p1.second.size() < p2.second.size(); } );
949 
950  if( maxSharedTrackToVertices == trackToVertexMap.end() ) return worstChi2;
951 
952  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": max-shared track index = " << maxSharedTrackToVertices->first << ", number of shared vertices = " << maxSharedTrackToVertices->second.size() );
953 
954  if( maxSharedTrackToVertices->second.size() < 2 ) return worstChi2;
955 
956  // map of vertex index and the chi2 of the track for the maxSharedTrack
957  std::map<long int, double> vrtChi2Map;
958 
959  // loop over vertices for the largest shared track
960  for( auto& iv : maxSharedTrackToVertices->second ) {
961  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": loop over vertices: vertex index " << iv );
962 
963  auto& wrkvrt = workVerticesContainer->at( iv );
964  auto& trackIndices = wrkvrt.selectedTrackIndices;
965 
966  // find the index of the track
967  auto index = std::find_if( trackIndices.begin(), trackIndices.end(), [&]( auto& index ) { return index == maxSharedTrackToVertices->first; } );
968  if( index == trackIndices.end() ) {
969  ATH_MSG_WARNING(" >> " << __FUNCTION__ << ": index not found (algorithm inconsistent)" );
970  return worstChi2;
971  }
972 
973  auto& chi2 = wrkvrt.Chi2PerTrk.at( index - trackIndices.begin() );
974 
975  vrtChi2Map.emplace( std::pair<long int, double>(iv, chi2) );
976  }
977 
978  auto worstVrtChi2Pair = std::max_element( vrtChi2Map.begin(), vrtChi2Map.end(), []( auto& p1, auto& p2 ) { return p1.second < p2.second; } );
979 
980  if( worstVrtChi2Pair == vrtChi2Map.end() ) {
981  ATH_MSG_WARNING(" >> " << __FUNCTION__ << ": max_element of vrtChi2Map not found" );
982  return worstChi2;
983  }
984 
985  maxSharedTrack = maxSharedTrackToVertices->first;
986  worstMatchingVertex = worstVrtChi2Pair->first;
987  worstChi2 = worstVrtChi2Pair->second;
988 
989  return worstChi2;
990  }

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

◆ 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 2077 of file VertexingAlgs.cxx.

2079  {
2080 
2081  impactParameters.clear();
2082  impactParErrors.clear();
2083 
2084  if( m_jp.trkExtrapolator==1 ){
2085  m_fitSvc->VKalGetImpact(trk, vertex, static_cast<int>( trk->charge() ), impactParameters, impactParErrors);
2086  }
2087  else if( m_jp.trkExtrapolator==2 ){
2088  auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(Gaudi::Hive::currentContext(), *trk, vertex );
2089  if( !sv_perigee ) return false;
2090  impactParameters.push_back(sv_perigee->parameters() [Trk::d0]);
2091  impactParameters.push_back(sv_perigee->parameters() [Trk::z0]);
2092  impactParErrors.push_back((*sv_perigee->covariance())( Trk::d0, Trk::d0 ));
2093  impactParErrors.push_back((*sv_perigee->covariance())( Trk::z0, Trk::z0 ));
2094  }
2095  else{
2096  ATH_MSG_WARNING( " > " << __FUNCTION__ << ": Unknown track extrapolator " << m_jp.trkExtrapolator );
2097  return false;
2098  }
2099 
2100  return true;
2101 
2102  } // getSVImpactParameters

◆ getTrkGenParticle()

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

Definition at line 26 of file TruthAlgs.cxx.

27  {
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;
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_jp.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 
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  }

◆ initEvent()

StatusCode VKalVrtAthena::VrtSecInclusive::initEvent ( )
virtual

Definition at line 276 of file VrtSecInclusive.cxx.

277  {
278 
279  ATH_MSG_DEBUG("initEvent: begin");
280 
281  // Clear all variables to be stored to the AANT
282  if( m_jp.FillNtuple ) {
284  }
285 
286 
287  ATH_MSG_DEBUG("initEvent: from initEvent ");
288  return StatusCode::SUCCESS;
289 
290  }

◆ initialize()

StatusCode VKalVrtAthena::VrtSecInclusive::initialize ( )
virtual

Definition at line 84 of file VrtSecInclusive.cxx.

85  {
86  ATH_MSG_INFO("initialize: begin");
87  //
88  // first instantiate tools
89 
90  // VKalVrt vertex fitter
91  if (m_fitSvc.retrieve().isFailure()) {
92  ATH_MSG_ERROR("initialize: Can't find Trk::TrkVKalVrtFitter");
93  return StatusCode::SUCCESS;
94  } else {
95  ATH_MSG_INFO("initialize: Trk::TrkVKalVrtFitter found");
96  }
97 
98  //
99  // retreive tool to get trackParameters of generated Particles
100  if(m_truthToTrack.retrieve().isFailure()) {
101  ATH_MSG_INFO("initialize: Cannot retrieve Trk::TruthToTrack Tool!");
102  return StatusCode::FAILURE;
103  }
104  else {
105  ATH_MSG_INFO("initialize: Retrieved Trk::TruthToTrack Tool" << m_truthToTrack);
106 
107  }
108  // extract TrackToVertex extrapolator tool
109  if ( m_trackToVertexTool.retrieve().isFailure() ) {
110  ATH_MSG_ERROR("initialize: failed to retrieve trackToVertex tool ");
111  return StatusCode::SUCCESS;
112  }
113  else {
114  ATH_MSG_INFO("initialize: Retrieved Reco::TrackToVertex Tool" << m_trackToVertexTool);
115  }
116  // extract TrackToVertexIPEstimator extrapolator tool
117  if ( m_trackToVertexIPEstimatorTool.retrieve().isFailure() ) {
118  ATH_MSG_ERROR("initialize: failed to retrieve trackToVertexIPEstimator tool ");
119  return StatusCode::SUCCESS;
120  }
121  else {
122  ATH_MSG_INFO("initialize: Retrieved Trk::TrackToVertexIPEstimator Tool" << m_trackToVertexIPEstimatorTool);
123  }
124 
125  if( detStore()->retrieve(m_atlasId, "AtlasID").isFailure() ) return StatusCode::FAILURE;
126  if( detStore()->retrieve(m_pixelId, "PixelID").isFailure() ) return StatusCode::FAILURE;
127  if( detStore()->retrieve(m_sctId, "SCT_ID") .isFailure() ) return StatusCode::FAILURE;
128 
129  if ( m_pixelCondSummaryTool.retrieve().isFailure() ) {
130  ATH_MSG_ERROR("initialize: failed to retrieve PixelConditionsSummaryTool");
131  return StatusCode::SUCCESS;
132  }
133  else {
134  ATH_MSG_INFO("initialize: Retrieved PixelConditionsSummaryTool" << m_pixelCondSummaryTool);
135  }
136  if ( m_sctCondSummaryTool.retrieve().isFailure() ) {
137  ATH_MSG_ERROR("initialize: failed to retrieve SCTConditionsSummaryTool");
138  return StatusCode::SUCCESS;
139  }
140  else {
141  ATH_MSG_INFO("initialize: Retrieved SCTConditionsSummaryTool" << m_sctCondSummaryTool);
142  }
143 
144  ATH_CHECK( m_extrapolator.retrieve() );
145 
146  // extract VertexMapper
147  if( m_jp.doMapToLocal ) {
148  ATH_CHECK( m_vertexMapper.retrieve() );
149  }
150 
151  // Track selection algorithm configuration
155 
156  // if none of the above two flags are activated, use ID tracks (default)
158 
160 
161  }
162 
163 
164  // Vertexing algorithm configuration
165  m_vertexingAlgorithms.emplace_back( "extractIncompatibleTrackPairs", &VrtSecInclusive::extractIncompatibleTrackPairs );
166  m_vertexingAlgorithms.emplace_back( "findNtrackVertices", &VrtSecInclusive::findNtrackVertices );
167  m_vertexingAlgorithms.emplace_back( "rearrangeTracks", &VrtSecInclusive::rearrangeTracks );
168 
169  if( m_jp.doReassembleVertices ) {
170  m_vertexingAlgorithms.emplace_back( "reassembleVertices", &VrtSecInclusive::reassembleVertices );
171  }
172 
173  if( m_jp.doMergeByShuffling ) {
174  m_vertexingAlgorithms.emplace_back( "mergeByShuffling", &VrtSecInclusive::mergeByShuffling );
175  }
176 
178  m_vertexingAlgorithms.emplace_back( "mergeFinalVertices", &VrtSecInclusive::mergeFinalVertices );
179  }
180 
182  m_vertexingAlgorithms.emplace_back( "associateNonSelectedTracks", &VrtSecInclusive::associateNonSelectedTracks );
183  }
184 
186 
187 
188  // now make histograms/ntuples
189 
190  ServiceHandle<ITHistSvc> hist_root("THistSvc", name());
191  ATH_CHECK( hist_root.retrieve() );
192 
193  if( m_jp.FillHist ) {
194 
195  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 };
196  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 };
197 
198  const size_t& nAlgs = m_vertexingAlgorithms.size();
199 
200  ATH_MSG_INFO("initialize: Filling Histograms");
201  //
202  m_hists["trkSelCuts"] = new TH1F("trkSelCuts", ";Cut Order;Tracks", 10, -0.5, 10-0.5 );
203  m_hists["selTracksDist"] = new TH1F("selTracksDist", ";Selected Tracks;Events", 2000, -0.5, 2000-0.5 );
204  m_hists["initVertexDispD0"] = new TH2F("initVertexDispD0", ";Rough d0 wrt init [mm];r [mm];Vertices", 1000, -100, 100, rbins.size()-1, &(rbins[0]) );
205  m_hists["initVertexDispZ0"] = new TH2F("initVertexDispZ0", ";Rough z0 wrt init [mm];z [mm];Vertices", 1000, -100, 100, 100, -1000, 1000 );
206  m_hists["incompMonitor"] = new TH1F("incompMonitor", ";Setp;Track Pairs", 10, -0.5, 10-0.5 );
207  m_hists["2trkVerticesDist"] = new TH1F("2trkVerticesDist", ";2-track Vertices;Events", 1000, -0.5, 1000-0.5 );
208  m_hists["2trkChi2Dist"] = new TH1F("2trkChi2Dist", ";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
209  m_hists["NtrkChi2Dist"] = new TH1F("NtrkChi2Dist", ";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
210  m_hists["vPosDist"] = new TH2F("vPosDist", ";r;#vec{x}*#vec{p}/p_{T} [mm]", rbins.size()-1, &(rbins[0]), 200, -1000, 1000 );
211  m_hists["vPosMomAngTDist"] = new TH2F("vPosMomAngDistT", ";r;cos(#vec{r},#vec{p}_{T})", rbins.size()-1, &(rbins[0]), 200, -1.0, 1.0 );
212  m_hists["disabledCount"] = new TH1F("disabledCount", ";N_{modules};Tracks", 20, -0.5, 10-0.5 );
213  m_hists["vertexYield"] = new TH1F("vertexYield", ";Algorithm Step;Vertices", nAlgs, -0.5, nAlgs-0.5 );
214  m_hists["vertexYieldNtrk"] = new TH2F("vertexYieldNtrk", ";Ntrk;Algorithm Step;Vertices", 100, 0, 100, nAlgs, -0.5, nAlgs-0.5 );
215  m_hists["vertexYieldChi2"] = new TH2F("vertexYieldChi2", ";#chi^{2}/N_{dof};Algorithm Step;Vertices", 100, 0, 100, nAlgs, -0.5, nAlgs-0.5 );
216  m_hists["mergeType"] = new TH1F("mergeType", ";Merge Algorithm Type;Entries", 10, -0.5, 10-0.5 );
217  m_hists["associateMonitor"] = new TH1F("associateMonitor", ";Step;Vertices", 10, -0.5, 10-0.5 );
218  m_hists["shuffleMinSignif1"] = new TH1F("shuffleMinSignif1", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
219  m_hists["shuffleMinSignif2"] = new TH1F("shuffleMinSignif2", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
220  m_hists["shuffleMinSignif3"] = new TH1F("shuffleMinSignif3", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
221  m_hists["finalCutMonitor"] = new TH1F("finalCutMonitor", ";Step;Vertices", 6, -0.5, 6-0.5 );
222  m_hists["finalVtxNtrk"] = new TH1F("finalVtxNtrk", ";N_{trk};Vertices", nbins.size()-1, &(nbins[0]) );
223  m_hists["finalVtxR"] = new TH1F("finalVtxR", ";r [mm];Vertices", 600, 0, 600 );
224  m_hists["finalVtxNtrkR"] = new TH2F("finalVtxNtrkR", ";N_{trk};r [mm];Vertices", nbins.size()-1, &(nbins[0]), rbins.size()-1, &(rbins[0]) );
225  m_hists["CPUTime"] = new TH1F("CPUTime", ";Step;Accum. CPU Time [s]", 10, -0.5, 10-0.5 );
226  m_hists["nMatchedTruths"] = new TH2F("nMatchedTruths", ";Step;;r [mm];Matched truth vertices", 11, -0.5, 11-0.5, rbins.size()-1, &(rbins[0]) );
227  m_hists["vPosMomAngT"] = new TH1F("vPosMomAngT", ";cos(#vec{r},#vec{p}_{T}", 200, -1.0, 1.0 );
228  m_hists["vPosMomAng3D"] = new TH1F("vPosMomAng3D", ";cos(#vec{r},#vec{p})", 200, -1.0, 1.0 );
229  m_hists["2trkVtxDistFromPV"] = new TH1F("2trkVtDistFromPV", ";2tr vertex distance from PV;Events", 100, 0, 3 );
230 
231 
232  std::string histDir("/AANT/VrtSecInclusive" + m_jp.augVerString + "/");
233 
234  for( auto& pair : m_hists ) {
235  ATH_CHECK( hist_root->regHist( histDir + pair.first, pair.second ) );
236  }
237  }
238 
239 
240  if( m_jp.FillNtuple ) {
241 
243 
244  m_tree_Vert = new TTree("tree_VrtSecInclusive","TTree of VrtSecInclusive");
245  ATH_CHECK( hist_root->regTree("/AANT/tree_VrtSecInclusive", m_tree_Vert) );
246 
247  ATH_CHECK( setupNtuple() );
248 
249  }
250 
251  // initialize keys
253 
254  // Instantiate and initialize our event info decorator write
256  this->declare(m_vertexingStatusKey);
257  m_vertexingStatusKey.setOwner(&(*this));
259 
260  //
261  ATH_MSG_INFO("initialize: Exit VrtSecInclusive::initialize()");
262  return StatusCode::SUCCESS;
263  }

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

◆ mergeByShuffling()

StatusCode VKalVrtAthena::VrtSecInclusive::mergeByShuffling ( 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 1267 of file VertexingAlgs.cxx.

1268  {
1269 
1270  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": #verticess = " << workVerticesContainer->size() );
1271 
1272  unsigned mergeCounter { 0 };
1273 
1274  // First, sort WrkVrt by the track multiplicity
1275  std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt& v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
1276 
1277  // Loop over vertices (small -> large Ntrk order)
1278  for( auto& wrkvrt : *workVerticesContainer ) {
1279  if( !wrkvrt.isGood ) continue;
1280  if( wrkvrt.selectedTrackIndices.size() <= 1 ) continue;
1281 
1282  // Reverse iteration: large Ntrk -> small Ntrk order
1283  for( auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
1284  auto& vertexToMerge = *ritr;
1285 
1286  if( !vertexToMerge.isGood ) continue;
1287  if( vertexToMerge.selectedTrackIndices.size() <= 1 ) continue;
1288  if( &wrkvrt == &vertexToMerge ) continue;
1289  if( vertexToMerge.selectedTrackIndices.size() < wrkvrt.selectedTrackIndices.size() ) continue;
1290 
1291  const double& significance = significanceBetweenVertices( wrkvrt, vertexToMerge );
1292 
1293  if( significance > m_jp.mergeByShufflingMaxSignificance ) continue;
1294 
1295  bool mergeFlag { false };
1296 
1297  ATH_MSG_DEBUG(" > " << __FUNCTION__
1298  << ": vertex " << &wrkvrt << " #tracks = " << wrkvrt.selectedTrackIndices.size()
1299  << " --> to Merge : " << &vertexToMerge << ", #tracks = " << vertexToMerge.selectedTrackIndices.size()
1300  << " significance = " << significance );
1301 
1302  double min_signif = AlgConsts::maxValue;
1303 
1304  // Method 1. Assume that the solution is somewhat wrong, and the solution gets correct if it starts from the other vertex position
1305  if( m_jp.doSuggestedRefitOnMerging && !mergeFlag ) {
1306  WrkVrt testVertex = wrkvrt;
1307  StatusCode sc = refitVertexWithSuggestion( testVertex, vertexToMerge.vertex );
1308  if( sc.isFailure() ) {
1309  //ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1310  } else {
1311 
1312  const auto signif = significanceBetweenVertices( testVertex, vertexToMerge );
1313  if( signif < min_signif ) min_signif = signif;
1314 
1315  if( signif < m_jp.mergeByShufflingAllowance ) {
1316  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": method1: vertexToMerge " << &vertexToMerge << ": test signif = " << signif );
1317  mergeFlag = true;
1318 
1319  }
1320 
1321  if( m_jp.FillHist && min_signif > 0. ) m_hists["shuffleMinSignif1"]->Fill( log10( min_signif ) );
1322  if( m_jp.FillHist && mergeFlag ) { m_hists["mergeType"]->Fill( SHUFFLE1 ); }
1323  }
1324  }
1325 
1326  // Method 2. magnet merging: borrowing another track from the target vertex to merge
1327  if( m_jp.doMagnetMerging && !mergeFlag ) {
1328 
1329  // Loop over tracks in vertexToMerge
1330  for( auto& index : vertexToMerge.selectedTrackIndices ) {
1331 
1332  WrkVrt testVertex = wrkvrt;
1333  testVertex.selectedTrackIndices.emplace_back( index );
1334 
1335  StatusCode sc = refitVertexWithSuggestion( testVertex, vertexToMerge.vertex );
1336  if( sc.isFailure() ) {
1337  //ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1338  } else {
1339 
1340  const auto signif = significanceBetweenVertices( testVertex, vertexToMerge );
1341  if( signif < min_signif ) min_signif = signif;
1342 
1343  if( signif < m_jp.mergeByShufflingAllowance ) {
1344  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": method2: vertexToMerge " << &vertexToMerge << " track index " << index << ": test signif = " << signif );
1345  mergeFlag = true;
1346  }
1347 
1348  }
1349  }
1350 
1351  if( m_jp.FillHist && min_signif > 0. ) m_hists["shuffleMinSignif2"]->Fill( log10( min_signif ) );
1352 
1353  if( m_jp.FillHist && mergeFlag ) { m_hists["mergeType"]->Fill( SHUFFLE2 ); }
1354  }
1355 
1356  // Method 3. Attempt to force merge
1357  if( m_jp.doWildMerging && !mergeFlag ) {
1358 
1359  WrkVrt testVertex = wrkvrt;
1360 
1361  for( auto& index : vertexToMerge.selectedTrackIndices ) {
1362  testVertex.selectedTrackIndices.emplace_back( index );
1363  }
1364 
1365  StatusCode sc = refitVertexWithSuggestion( testVertex, vertexToMerge.vertex );
1366  if( sc.isFailure() ) {
1367  //ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1368  } else {
1369 
1370  const auto signif = significanceBetweenVertices( testVertex, vertexToMerge );
1371  if( signif < min_signif ) min_signif = signif;
1372 
1373  if( signif < m_jp.mergeByShufflingAllowance ) {
1374  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": method3: vertexToMerge " << &vertexToMerge << ": test signif = " << signif );
1375  mergeFlag = true;
1376  }
1377 
1378  if( m_jp.FillHist && min_signif > 0. ) m_hists["shuffleMinSignif3"]->Fill( log10( min_signif ) );
1379  if( m_jp.FillHist && mergeFlag ) { m_hists["mergeType"]->Fill( SHUFFLE3 ); }
1380 
1381  }
1382  }
1383 
1384 
1385  if( mergeFlag ) {
1386  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": vertexToMerge " << &vertexToMerge << " ==> min signif = " << min_signif << " judged to merge" );
1387 
1388  auto vertexToMerge_backup = vertexToMerge;
1389  auto wrkvrt_backup = wrkvrt;
1390 
1391  StatusCode sc = mergeVertices( vertexToMerge, wrkvrt );
1392  if( sc.isFailure() ) {
1393  vertexToMerge = vertexToMerge_backup;
1394  wrkvrt = wrkvrt_backup;
1395  continue;
1396  }
1397 
1398  improveVertexChi2( wrkvrt );
1399 
1400  mergeCounter++;
1401  }
1402 
1403  }
1404 
1405  }
1406 
1407  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1408  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Number of merges = " << mergeCounter );
1409  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1410 
1411  return StatusCode::SUCCESS;
1412  }

◆ mergeFinalVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::mergeFinalVertices ( std::vector< WrkVrt > *  workVerticesContainer)
private

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

Definition at line 1416 of file VertexingAlgs.cxx.

1417  {
1418 
1419  unsigned mergeCounter { 0 };
1420 
1421  while (true) {
1422  //
1423  // Minimal vertex-vertex distance
1424  //
1425  for( auto& wrkvrt : *workVerticesContainer) {
1426  wrkvrt.closestWrkVrtIndex = AlgConsts::invalidUnsigned;
1427  wrkvrt.closestWrkVrtValue = AlgConsts::maxValue;
1428  }
1429 
1430  std::pair<unsigned, unsigned> indexPair { AlgConsts::invalidUnsigned, AlgConsts::invalidUnsigned };
1431  auto minDistance = findMinVerticesPair( workVerticesContainer, indexPair, &VrtSecInclusive::distanceBetweenVertices );
1432 
1433  if( minDistance == AlgConsts::maxValue ) break;
1434  if( indexPair.first == AlgConsts::invalidUnsigned ) break;
1435  if( indexPair.second == AlgConsts::invalidUnsigned ) break;
1436 
1437  auto& v1 = workVerticesContainer->at(indexPair.first);
1438  auto& v2 = workVerticesContainer->at(indexPair.second);
1439 
1440  const double averageRadius = ( v1.vertex.perp() + v2.vertex.perp() ) / 2.0;
1441 
1442  if( minDistance > m_jp.VertexMergeFinalDistCut + m_jp.VertexMergeFinalDistScaling * averageRadius ) {
1443  ATH_MSG_DEBUG( "Vertices " << indexPair.first << " and " << indexPair.second
1444  <<" are separated by distance " << minDistance );
1445  break;
1446  }
1447 
1448  ATH_MSG_DEBUG( "Merging FINAL vertices " << indexPair.first << " and " << indexPair.second
1449  <<" which are separated by distance "<< minDistance );
1450 
1451  StatusCode sc = mergeVertices( v1, v2 );
1452  if( sc.isFailure() ) {}
1453  if( m_jp.FillHist ) { m_hists["mergeType"]->Fill( FINAL ); }
1454 
1455  improveVertexChi2( v1 );
1456 
1457  mergeCounter++;
1458 
1459  }
1460 
1461  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1462  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Number of merges = " << mergeCounter );
1463  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1464 
1465  return StatusCode::SUCCESS;
1466 
1467  } // end of mergeFinalVertices

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

◆ monitorVertexingAlgorithmStep()

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

monitor the intermediate status of vertexing

Definition at line 1970 of file VertexingAlgs.cxx.

1970  {
1971 
1973 
1974  const xAOD::TrackParticleContainer* trackParticleContainer ( nullptr );
1975  ATH_CHECK( evtStore()->retrieve( trackParticleContainer, m_jp.TrackLocation) );
1976 
1977  xAOD::VertexContainer* intermediateVertexContainer { nullptr };
1978 
1979  ATH_CHECK( evtStore()->retrieve( intermediateVertexContainer, "VrtSecInclusive_IntermediateVertices_" + name + m_jp.augVerString ) );
1980 
1981  for( auto& wrkvrt : *workVerticesContainer ) {
1982 
1984  intermediateVertexContainer->emplace_back( vertex );
1985 
1986  // Registering the vertex position to xAOD::Vertex
1987  vertex->setPosition( wrkvrt.vertex );
1988 
1989  // Registering the vertex type: SV
1990  vertex->setVertexType( xAOD::VxType::SecVtx );
1991 
1992  // Registering the vertex chi2 and Ndof
1993  int ndof = wrkvrt.ndof();
1994  vertex->setFitQuality( wrkvrt.Chi2, ndof );
1995 
1996  // Registering the vertex covariance matrix
1997  std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
1998  vertex->setCovariance(fCov);
1999 
2000  // Registering tracks comprising the vertex to xAOD::Vertex
2001  // loop over the tracks comprising the vertex
2002  for( auto trk_id : wrkvrt.selectedTrackIndices ) {
2003 
2004  const xAOD::TrackParticle *trk = m_selectedTracks->at( trk_id );
2005 
2006  // Acquire link the track to the vertex
2007  ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
2008 
2009  // Register the link to the vertex
2010  vertex->addTrackAtVertex( link_trk, 1. );
2011 
2012  }
2013 
2014  for( auto trk_id : wrkvrt.associatedTrackIndices ) {
2015 
2016  const xAOD::TrackParticle *trk = m_associatedTracks->at( trk_id );
2017 
2018  // Acquire link the track to the vertex
2019  ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
2020 
2021  // Register the link to the vertex
2022  vertex->addTrackAtVertex( link_trk, 1. );
2023 
2024  }
2025  }
2026 
2027  }
2028 
2029 
2030 
2031  if( !m_jp.FillHist ) return StatusCode::SUCCESS;
2032 
2033  printWrkSet( workVerticesContainer, Form("%s (step %u)", name.c_str(), m_vertexingAlgorithmStep) );
2034 
2035  unsigned count = std::count_if( workVerticesContainer->begin(), workVerticesContainer->end(),
2036  []( WrkVrt& v ) { return ( v.selectedTrackIndices.size() + v.associatedTrackIndices.size() ) >= 2; } );
2037 
2038  if( m_vertexingAlgorithmStep == 0 ) {
2039 
2040  const auto compSize = m_selectedTracks->size()*(m_selectedTracks->size() - 1)/2 - m_incomp.size();
2041  m_hists["vertexYield"]->Fill( m_vertexingAlgorithmStep, compSize );
2042 
2043  } else {
2044 
2045  m_hists["vertexYield"]->Fill( m_vertexingAlgorithmStep, count );
2046 
2047  }
2048 
2049  m_hists["vertexYield"]->GetXaxis()->SetBinLabel( m_vertexingAlgorithmStep+1, name.c_str() );
2050 
2051  for( auto& vertex : *workVerticesContainer ) {
2052  auto ntrk = vertex.selectedTrackIndices.size() + vertex.associatedTrackIndices.size();
2053  if( vertex.isGood && ntrk >= 2 ) {
2054  dynamic_cast<TH2F*>( m_hists["vertexYieldNtrk"] )->Fill( ntrk, m_vertexingAlgorithmStep );
2055  dynamic_cast<TH2F*>( m_hists["vertexYieldChi2"] )->Fill( vertex.Chi2/(vertex.ndof() + AlgConsts::infinitesimal), m_vertexingAlgorithmStep );
2056  }
2057  }
2058  m_hists["vertexYieldNtrk"]->GetYaxis()->SetBinLabel( m_vertexingAlgorithmStep+1, name.c_str() );
2059  m_hists["vertexYieldChi2"]->GetYaxis()->SetBinLabel( m_vertexingAlgorithmStep+1, name.c_str() );
2060 
2061 
2062  if( !final ) return StatusCode::SUCCESS;
2063 
2064  for( auto& vertex : *workVerticesContainer ) {
2065  auto ntrk = vertex.selectedTrackIndices.size() + vertex.associatedTrackIndices.size();
2066  if( vertex.isGood && ntrk >= 2 ) {
2067  m_hists["finalVtxNtrk"] ->Fill( ntrk );
2068  m_hists["finalVtxR"] ->Fill( vertex.vertex.perp() );
2069  dynamic_cast<TH2F*>( m_hists["finalVtxNtrkR"] )->Fill( ntrk, vertex.vertex.perp() );
2070  }
2071  }
2072 
2073  return StatusCode::SUCCESS;
2074  }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

2319  {
2320 
2321  const bool& check_itrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( itrk, FitVertex );
2322  const bool& check_jtrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( jtrk, FitVertex );
2323 
2324  return ( check_itrk && check_jtrk );
2325 
2326  }

◆ patternCheck()

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

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

2152  {
2153  bool flag = false;
2154 
2157  } else if( m_jp.geoModel == VKalVrtAthena::GeoModel::Run1 ) {
2159  }
2160 
2161  return flag;
2162  }

◆ patternCheckOuterOnly()

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

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

2165  {
2166  bool flag = false;
2167 
2170  } else if( m_jp.geoModel == VKalVrtAthena::GeoModel::Run1 ) {
2172  }
2173 
2174  return flag;
2175  }

◆ patternCheckRun1()

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

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

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

◆ patternCheckRun1OuterOnly()

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

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

2007  {
2008  //
2009  // rough guesses for active layers:
2010  // BeamPipe: 25.0
2011  // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
2012  // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
2013  //
2014 
2015  const double rad = vertex.perp();
2016  const double absz = fabs( vertex.z() );
2017 
2018  // vertex area classification
2019  enum vertexArea {
2020  insideBeamPipe,
2021 
2022  insidePixelBarrel1,
2023  aroundPixelBarrel1,
2024 
2025  outsidePixelBarrel1_and_insidePixelBarrel2,
2026  aroundPixelBarrel2,
2027 
2028  outsidePixelBarrel2_and_insidePixelBarrel3,
2029  aroundPixelBarrel3,
2030 
2031  outsidePixelBarrel3_and_insideSctBarrel0,
2032  aroundSctBarrel0,
2033 
2034  outsideSctBarrel0_and_insideSctBarrel1,
2035  aroundSctBarrel1,
2036  };
2037 
2038  // Mutually exclusive vertex position pattern
2039  Int_t vertex_pattern = 0;
2040  if( rad < 25.00 ) {
2041  vertex_pattern = insideBeamPipe;
2042 
2043  } else if( rad < 47.7 && absz < 400.5 ) {
2044  vertex_pattern = insidePixelBarrel1;
2045 
2046  } else if( rad < 54.4 && absz < 400.5 ) {
2047  vertex_pattern = aroundPixelBarrel1;
2048 
2049  } else if( rad < 85.5 && absz < 400.5 ) {
2050  vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
2051 
2052  } else if( rad < 92.2 && absz < 400.5 ) {
2053  vertex_pattern = aroundPixelBarrel2;
2054 
2055  } else if( rad < 119.3 && absz < 400.5 ) {
2056  vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
2057 
2058  } else if( rad < 126.1 && absz < 400.5 ) {
2059  vertex_pattern = aroundPixelBarrel3;
2060 
2061  } else if( rad < 290 && absz < 749.0 ) {
2062  vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
2063 
2064  } else if( rad < 315 && absz < 749.0 ) {
2065  vertex_pattern = aroundSctBarrel0;
2066 
2067  } else if( rad < 360 && absz < 749.0 ) {
2068  vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
2069 
2070  } else if( rad < 390 && absz < 749.0 ) {
2071  vertex_pattern = aroundSctBarrel1;
2072 
2073  } else {
2074  }
2075 
2076 
2078  if( vertex_pattern == insideBeamPipe ) {
2079 
2080  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
2081 
2082  }
2083 
2084 
2085  else if( vertex_pattern == insidePixelBarrel1 ) {
2086 
2087  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
2088  }
2089 
2090 
2091  else if( vertex_pattern == aroundPixelBarrel1 ) {
2092 
2093  // require nothing for PixelBarrel1
2094  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
2095  }
2096 
2097 
2098  else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
2099 
2100  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
2101  }
2102 
2103 
2104  else if( vertex_pattern == aroundPixelBarrel2 ) {
2105 
2106  // require nothing for PixelBarrel2
2107  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
2108  }
2109 
2110 
2111  else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
2112 
2113  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
2114  }
2115 
2116  else if( vertex_pattern == aroundPixelBarrel3 ) {
2117 
2118  // require nothing for PixelBarrel3
2119  if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
2120  }
2121 
2122 
2123  else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
2124 
2125  if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
2126  }
2127 
2128 
2129  else if( vertex_pattern == aroundSctBarrel0 ) {
2130 
2131  // require nothing for SctBarrel0
2132  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
2133  }
2134 
2135 
2136  else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
2137 
2138  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
2139  }
2140 
2141 
2142  else if( vertex_pattern == aroundSctBarrel1 ) {
2143  // require nothing for SctBarrel1
2144  if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
2145  }
2147 
2148  return true;
2149  }

◆ patternCheckRun2()

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

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

1432  {
1433 
1434  //
1435  // rough guesses for active layers:
1436  // BeamPipe: 23.5-24.3
1437  // IBL: 31.0-38.4
1438  // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
1439  // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
1440  //
1441 
1442  const double rad = vertex.perp();
1443  const double absz = fabs( vertex.z() );
1444 
1445  // vertex area classification
1446  enum vertexArea {
1447  insideBeamPipe,
1448 
1449  insidePixelBarrel0,
1450  aroundPixelBarrel0,
1451 
1452  outsidePixelBarrel0_and_insidePixelBarrel1,
1453  aroundPixelBarrel1,
1454 
1455  outsidePixelBarrel1_and_insidePixelBarrel2,
1456  aroundPixelBarrel2,
1457 
1458  outsidePixelBarrel2_and_insidePixelBarrel3,
1459  aroundPixelBarrel3,
1460 
1461  outsidePixelBarrel3_and_insideSctBarrel0,
1462  aroundSctBarrel0,
1463 
1464  outsideSctBarrel0_and_insideSctBarrel1,
1465  aroundSctBarrel1,
1466  };
1467 
1468  // Mutually exclusive vertex position pattern
1469  int vertex_pattern = 0;
1470  if( rad < 23.50 ) {
1471  vertex_pattern = insideBeamPipe;
1472 
1473  } else if( rad < 31.0 && absz < 331.5 ) {
1474  vertex_pattern = insidePixelBarrel0;
1475 
1476  } else if( rad < 38.4 && absz < 331.5 ) {
1477  vertex_pattern = aroundPixelBarrel0;
1478 
1479  } else if( rad < 47.7 && absz < 400.5 ) {
1480  vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1481 
1482  } else if( rad < 54.4 && absz < 400.5 ) {
1483  vertex_pattern = aroundPixelBarrel1;
1484 
1485  } else if( rad < 85.5 && absz < 400.5 ) {
1486  vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1487 
1488  } else if( rad < 92.2 && absz < 400.5 ) {
1489  vertex_pattern = aroundPixelBarrel2;
1490 
1491  } else if( rad < 119.3 && absz < 400.5 ) {
1492  vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1493 
1494  } else if( rad < 126.1 && absz < 400.5 ) {
1495  vertex_pattern = aroundPixelBarrel3;
1496 
1497  } else if( rad < 290 && absz < 749.0 ) {
1498  vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1499 
1500  } else if( rad < 315 && absz < 749.0 ) {
1501  vertex_pattern = aroundSctBarrel0;
1502 
1503  } else if( rad < 360 && absz < 749.0 ) {
1504  vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1505 
1506  } else if( rad < 390 && absz < 749.0 ) {
1507  vertex_pattern = aroundSctBarrel1;
1508 
1509  } else {
1510  }
1511 
1512  unsigned nPixelLayers { 0 };
1513  {
1514  if ( pattern & (1 << Trk::pixelBarrel0) ) nPixelLayers++;
1515  if ( pattern & (1 << Trk::pixelBarrel1) ) nPixelLayers++;
1516  if ( pattern & (1 << Trk::pixelBarrel2) ) nPixelLayers++;
1517  if ( pattern & (1 << Trk::pixelBarrel3) ) nPixelLayers++;
1518  if ( pattern & (1 << Trk::pixelEndCap0) ) nPixelLayers++;
1519  if ( pattern & (1 << Trk::pixelEndCap1) ) nPixelLayers++;
1520  if ( pattern & (1 << Trk::pixelEndCap2) ) nPixelLayers++;
1521  }
1522 
1524  if( vertex_pattern == insideBeamPipe ) {
1525 
1526  if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1527  if( nPixelLayers < 3 ) return false;
1528 
1529 
1530  } else if( vertex_pattern == insidePixelBarrel0 ) {
1531 
1532  if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1533  if( nPixelLayers < 3 ) return false;
1534  }
1535 
1536 
1537  else if( vertex_pattern == aroundPixelBarrel0 ) {
1538 
1539  // require nothing for PixelBarrel0
1540  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1541  if( nPixelLayers < 2 ) return false;
1542  }
1543 
1544 
1545  else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1546 
1547  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1548  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1549  if( nPixelLayers < 2 ) return false;
1550  }
1551 
1552 
1553  else if( vertex_pattern == aroundPixelBarrel1 ) {
1554 
1555  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1556  // require nothing for PixelBarrel
1557  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1558  if( nPixelLayers < 2 ) return false;
1559  }
1560 
1561 
1562  else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1563 
1564  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1565  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1566  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1567  if( nPixelLayers < 2 ) return false;
1568  }
1569 
1570 
1571  else if( vertex_pattern == aroundPixelBarrel2 ) {
1572 
1573  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1574  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1575  // require nothing for PixelBarrel2
1576  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1577  }
1578 
1579 
1580  else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1581 
1582  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1583  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1584  if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1585  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1586  }
1587 
1588  else if( vertex_pattern == aroundPixelBarrel3 ) {
1589 
1590  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1591  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1592  if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1593  // require nothing for PixelBarrel3
1594  if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1595  }
1596 
1597 
1598  else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1599 
1600  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1601  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1602  if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1603  if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1604  if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1605  }
1606 
1607 
1608  else if( vertex_pattern == aroundSctBarrel0 ) {
1609 
1610  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1611  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1612  if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1613  if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1614  // require nothing for SctBarrel0
1615  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1616  }
1617 
1618 
1619  else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1620 
1621  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1622  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1623  if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1624  if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1625  if( (pattern & (1<<Trk::sctBarrel0)) ) return false;
1626  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1627  }
1628 
1629 
1630  else if( vertex_pattern == aroundSctBarrel1 ) {
1631  if( (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1632  if( (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1633  if( (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1634  if( (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1635  if( (pattern & (1<<Trk::sctBarrel0)) ) return false;
1636  // require nothing for SctBarrel1
1637  if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1638  }
1640 
1641  return true;
1642 
1643  }

◆ patternCheckRun2OuterOnly()

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

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

1646  {
1647 
1648  //
1649  // rough guesses for active layers:
1650  // BeamPipe: 23.5-24.3
1651  // IBL: 31.0-38.4
1652  // Pix0 (BLayer): 47.7-54.4, Pix1: 85.5-92.2, Pix2: 119.3-126.1
1653  // Sct0: 290-315, Sct1: 360-390, Sct2: 430-460, Sct3:500-530
1654  //
1655 
1656  const double rad = vertex.perp();
1657  const double absz = fabs( vertex.z() );
1658 
1659  // vertex area classification
1660  enum vertexArea {
1661  insideBeamPipe,
1662 
1663  insidePixelBarrel0,
1664  aroundPixelBarrel0,
1665 
1666  outsidePixelBarrel0_and_insidePixelBarrel1,
1667  aroundPixelBarrel1,
1668 
1669  outsidePixelBarrel1_and_insidePixelBarrel2,
1670  aroundPixelBarrel2,
1671 
1672  outsidePixelBarrel2_and_insidePixelBarrel3,
1673  aroundPixelBarrel3,
1674 
1675  outsidePixelBarrel3_and_insideSctBarrel0,
1676  aroundSctBarrel0,
1677 
1678  outsideSctBarrel0_and_insideSctBarrel1,
1679  aroundSctBarrel1,
1680  };
1681 
1682  // Mutually exclusive vertex position pattern
1683  int vertex_pattern = 0;
1684  if( rad < 23.50 ) {
1685  vertex_pattern = insideBeamPipe;
1686 
1687  } else if( rad < 31.0 && absz < 331.5 ) {
1688  vertex_pattern = insidePixelBarrel0;
1689 
1690  } else if( rad < 38.4 && absz < 331.5 ) {
1691  vertex_pattern = aroundPixelBarrel0;
1692 
1693  } else if( rad < 47.7 && absz < 400.5 ) {
1694  vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1695 
1696  } else if( rad < 54.4 && absz < 400.5 ) {
1697  vertex_pattern = aroundPixelBarrel1;
1698 
1699  } else if( rad < 85.5 && absz < 400.5 ) {
1700  vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1701 
1702  } else if( rad < 92.2 && absz < 400.5 ) {
1703  vertex_pattern = aroundPixelBarrel2;
1704 
1705  } else if( rad < 119.3 && absz < 400.5 ) {
1706  vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1707 
1708  } else if( rad < 126.1 && absz < 400.5 ) {
1709  vertex_pattern = aroundPixelBarrel3;
1710 
1711  } else if( rad < 290 && absz < 749.0 ) {
1712  vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1713 
1714  } else if( rad < 315 && absz < 749.0 ) {
1715  vertex_pattern = aroundSctBarrel0;
1716 
1717  } else if( rad < 360 && absz < 749.0 ) {
1718  vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1719 
1720  } else if( rad < 390 && absz < 749.0 ) {
1721  vertex_pattern = aroundSctBarrel1;
1722 
1723  } else {
1724  }
1725 
1726 
1727  unsigned nPixelLayers { 0 };
1728  {
1729  nPixelLayers += ( pattern & (1 << Trk::pixelBarrel0) );
1730  nPixelLayers += ( pattern & (1 << Trk::pixelBarrel1) );
1731  nPixelLayers += ( pattern & (1 << Trk::pixelBarrel2) );
1732  nPixelLayers += ( pattern & (1 << Trk::pixelBarrel3) );
1733  nPixelLayers += ( pattern & (1 << Trk::pixelEndCap0) );
1734  nPixelLayers += ( pattern & (1 << Trk::pixelEndCap1) );
1735  nPixelLayers += ( pattern & (1 << Trk::pixelEndCap2) );
1736  }
1737 
1739  if( vertex_pattern == insideBeamPipe ) {
1740 
1741  if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1742  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1743  if( nPixelLayers < 3 ) return false;
1744 
1745  } else if( vertex_pattern == insidePixelBarrel0 ) {
1746 
1747  if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false;
1748  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1749  if( nPixelLayers < 3 ) return false;
1750 
1751  }
1752 
1753 
1754  else if( vertex_pattern == aroundPixelBarrel0 ) {
1755 
1756  // require nothing for PixelBarrel0
1757  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1758  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1759  if( nPixelLayers < 3 ) return false;
1760  }
1761 
1762 
1763  else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1764 
1765  if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false;
1766  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1767  if( nPixelLayers < 3 ) return false;
1768  }
1769 
1770 
1771  else if( vertex_pattern == aroundPixelBarrel1 ) {
1772 
1773  // require nothing for PixelBarrel1
1774  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1775  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1776  if( nPixelLayers < 2 ) return false;
1777  }
1778 
1779 
1780  else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1781 
1782  if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false;
1783  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1784  if( nPixelLayers < 2 ) return false;
1785  }
1786 
1787 
1788  else if( vertex_pattern == aroundPixelBarrel2 ) {
1789 
1790  // require nothing for PixelBarrel2
1791  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1792  }
1793 
1794 
1795  else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1796 
1797  if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false;
1798  }
1799 
1800  else if( vertex_pattern == aroundPixelBarrel3 ) {
1801 
1802  // require nothing for PixelBarrel3
1803  if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1804  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1805  }
1806 
1807 
1808  else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1809 
1810  if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false;
1811  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1812  }
1813 
1814 
1815  else if( vertex_pattern == aroundSctBarrel0 ) {
1816 
1817  // require nothing for SctBarrel0
1818  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1819  if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1820  }
1821 
1822 
1823  else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1824 
1825  if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false;
1826  if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1827  }
1828 
1829 
1830  else if( vertex_pattern == aroundSctBarrel1 ) {
1831  // require nothing for SctBarrel1
1832  if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false;
1833  if( ! (pattern & (1<<Trk::sctBarrel3)) ) return false;
1834  }
1836 
1837  return true;
1838 
1839  }

◆ printWrkSet()

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

print the contents of reconstructed vertices

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

995  {
996  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": ===============================================================" );
997  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": " << name << ": #vertices = " << workVerticesContainer->size() );
998 
999  std::set<const xAOD::TrackParticle*> usedTracks;
1000 
1001  auto concatenateIndicesToString = []( auto indices, auto& collection ) -> std::string {
1002  if( 0 == indices.size() ) return "";
1003  return std::accumulate( std::next(indices.begin()), indices.end(), std::to_string( indices.at(0) ),
1004  [&collection]( const std::string& str, auto& index ) { return str + ", " + std::to_string( collection.at(index)->index() ); } );
1005  };
1006 
1007  std::map<const xAOD::TruthVertex*, bool> previous;
1008 
1009  for( auto& pair : m_matchMap ) { previous.emplace( pair.first, pair.second ); }
1010 
1011  m_matchMap.clear();
1012  for( const auto* truthVertex : m_tracingTruthVertices ) { m_matchMap.emplace( truthVertex, false ); }
1013 
1014  for(size_t iv=0; iv<workVerticesContainer->size(); iv++) {
1015  const auto& wrkvrt = workVerticesContainer->at(iv);
1016 
1017  if( wrkvrt.nTracksTotal() < 2 ) continue;
1018 
1019  std::string sels = concatenateIndicesToString( wrkvrt.selectedTrackIndices, *m_selectedTracks );
1020  std::string assocs = concatenateIndicesToString( wrkvrt.associatedTrackIndices, *m_associatedTracks );
1021 
1022  for( const auto& index : wrkvrt.selectedTrackIndices ) { usedTracks.insert( m_selectedTracks->at(index) ); }
1023  for( const auto& index : wrkvrt.associatedTrackIndices ) { usedTracks.insert( m_associatedTracks->at(index) ); }
1024 
1025  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": " << name << " vertex [" << iv << "]: " << &wrkvrt
1026  << ", isGood = " << (wrkvrt.isGood? "true" : "false")
1027  << ", #ntrks(tot, sel, assoc) = (" << wrkvrt.nTracksTotal() << ", " << wrkvrt.selectedTrackIndices.size() << ", " << wrkvrt.associatedTrackIndices.size() << "), "
1028  << ", chi2/ndof = " << wrkvrt.fitQuality()
1029  << ", (r, z) = (" << wrkvrt.vertex.perp()
1030  << ", " << wrkvrt.vertex.z() << ")"
1031  << ", sels = { " << sels << " }"
1032  << ", assocs = { " << assocs << " }" );
1033 
1034  // Truth match condition
1035  for( const auto* truthVertex : m_tracingTruthVertices ) {
1036 
1037 
1038  Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
1039  Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
1040 
1041  const auto distance = vReco - vTruth;
1042 
1043  AmgSymMatrix(3) cov;
1044  cov.fillSymmetric( 0, 0, wrkvrt.vertexCov.at(0) );
1045  cov.fillSymmetric( 1, 0, wrkvrt.vertexCov.at(1) );
1046  cov.fillSymmetric( 1, 1, wrkvrt.vertexCov.at(2) );
1047  cov.fillSymmetric( 2, 0, wrkvrt.vertexCov.at(3) );
1048  cov.fillSymmetric( 2, 1, wrkvrt.vertexCov.at(4) );
1049  cov.fillSymmetric( 2, 2, wrkvrt.vertexCov.at(5) );
1050 
1051  const double s2 = distance.transpose() * cov.inverse() * distance;
1052 
1053  if( distance.norm() < 2.0 || s2 < 100. ) m_matchMap.at( truthVertex ) = true;
1054 
1055  }
1056 
1057  }
1058 
1059  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": number of used tracks = " << usedTracks.size() );
1060 
1061  if( !previous.empty() && previous.size() == m_matchMap.size() ) {
1062  for( auto& pair : m_matchMap ) {
1063  if( previous.find( pair.first ) == previous.end() ) continue;
1064  if( pair.second != previous.at( pair.first ) ) {
1065  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": Match flag has changed: (r, z) = (" << pair.first->perp() << ", " << pair.first->z() << ")" );
1066  }
1067  }
1068  }
1069 
1070  if( m_jp.FillHist ) {
1071  for( auto& pair : m_matchMap ) {
1072  if( pair.second ) m_hists["nMatchedTruths"]->Fill( m_vertexingAlgorithmStep+2, pair.first->perp() );
1073  }
1074  }
1075 
1076  std::string msg;
1077  for( const auto* trk : usedTracks ) { msg += Form("%ld, ", trk->index() ); }
1078 
1079  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": used tracks = " << msg );
1080  ATH_MSG_DEBUG( " >> " << __FUNCTION__ << ": ===============================================================" );
1081 
1082  }

◆ processPrimaryVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::processPrimaryVertices ( )
private

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

818  {
819 
820  //--------------------------------------------------------
821  // Primary vertex extraction from TES
822  //
823 
824  ATH_CHECK( evtStore()->retrieve( m_primaryVertices, "PrimaryVertices") );
825 
826  if( m_jp.FillNtuple ) m_ntupleVars->get<unsigned int>( "NumPV" ) = 0;
827  m_thePV = nullptr;
828 
829  ATH_MSG_DEBUG( "processPrimaryVertices(): pv_size = " << m_primaryVertices->size() );
830 
831  // Loop over PV container and get number of tracks of each PV
832 
833  for( const auto *vertex : *m_primaryVertices ) {
834 
835  // Hide (2015-04-21): xAOD::Vertex may contain several types of vertices
836  // e.g. if VertexType==NoVtx, this is a dummy vertex.
837  // We only need to extract primary vertices here, and skip otherwise.
838 
839  if( xAOD::VxType::PriVtx != vertex->vertexType() ) continue;
840 
841  // Not considering pile-up; pick-up the first PV
842  m_thePV = vertex;
843 
844  if( m_jp.FillNtuple ) {
845 
846  if( 0 == m_ntupleVars->get<unsigned int>( "NumPV" ) ) {
847 
848  m_ntupleVars->get<double>( "PVX" ) = vertex->x();
849  m_ntupleVars->get<double>( "PVY" ) = vertex->y();
850  m_ntupleVars->get<double>( "PVZ" ) = vertex->z();
851  m_ntupleVars->get<unsigned int>( "PVType" ) = vertex->vertexType();
852 
853  // number of tracks associated to the PV
854  m_ntupleVars->get<unsigned int>( "NTrksPV" ) = vertex->nTrackParticles();
855  }
856 
857  m_ntupleVars->get<unsigned int>( "NumPV" )++;
858 
859  m_ntupleVars->get< vector<int> > ( "NdofTrksPV" ) .emplace_back( vertex->numberDoF() );
860  m_ntupleVars->get< vector<double> >( "PVZpile" ) .emplace_back( vertex->position().z() );
861  }
862 
863  ATH_MSG_DEBUG("PrimVertex x/y/z/nDOF "
864  << vertex->x() << ","
865  << vertex->y() << ","
866  << vertex->z() << ","
867  << vertex->numberDoF() );
868 
869  }
870 
871  // Use the dummy PV if no PV is composed
872  if( !m_thePV ) {
873  ATH_MSG_DEBUG("No Reconstructed PV was found. Using the dummy PV instead.");
874  for( const auto *vertex : *m_primaryVertices ) {
875  if( xAOD::VxType::NoVtx != vertex->vertexType() ) continue;
876 
877  if( m_jp.FillNtuple ) {
878  // Not considering pile-up; pick-up the first PV
879  if( 0 == m_ntupleVars->get<unsigned int>( "NumPV" ) ) {
880  m_thePV = vertex;
881 
882  m_ntupleVars->get<double>( "PVX" ) = vertex->x();
883  m_ntupleVars->get<double>( "PVY" ) = vertex->y();
884  m_ntupleVars->get<double>( "PVZ" ) = vertex->z();
885  m_ntupleVars->get<unsigned int>( "PVType" ) = vertex->vertexType();
886 
887  // number of tracks associated to the PV
888  m_ntupleVars->get<unsigned int>( "NTrksPV" ) = vertex->nTrackParticles();
889  }
890  }
891  }
892  }
893 
894  // if thePV is null, the PV is not found.
895  if( !m_thePV ) {
896  ATH_MSG_DEBUG("No PV is found in the PV collection!");
897  return StatusCode::FAILURE;
898  }
899 
900  ATH_MSG_DEBUG(" Primary vertex successful. thePV = " << m_thePV );
901 
902  return StatusCode::SUCCESS;
903  }

◆ rearrangeTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::rearrangeTracks ( std::vector< WrkVrt > *  workVerticesContainer)
private

Definition at line 717 of file VertexingAlgs.cxx.

718  {
719 
720  //
721  // Rearrangement of solutions
722  //
723 
724  std::vector<long int> processedTracks;
725 
726  unsigned mergeCounter { 0 };
727  unsigned brokenCounter { 0 };
728  unsigned removeTrackCounter { 0 };
729 
730  while( true ) {
731 
732  // worstChi2: unit in [chi2 per track]
733  long int maxSharedTrack;
734  long int worstMatchingVertex;
735  std::pair<unsigned, unsigned> indexPair { AlgConsts::invalidUnsigned, AlgConsts::invalidUnsigned };
736 
737 
738  // trackToVertexMap has IDs of each track which can contain array of vertices.
739  // e.g. TrkInVrt->at( track_id ).size() gives the number of vertices which use the track [track_id].
740 
741  std::map<long int, std::vector<long int> > trackToVertexMap;
742 
743  // Fill trackToVertexMap with vertex IDs of each track
744  trackClassification( workVerticesContainer, trackToVertexMap );
745 
746 
747  auto worstChi2 = findWorstChi2ofMaximallySharedTrack( workVerticesContainer, trackToVertexMap, maxSharedTrack, worstMatchingVertex );
748 
749  if( worstChi2 == AlgConsts::invalidFloat ) {
750  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": no shared tracks are found --> exit the while loop." );
751  break;
752  }
753 
754  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": vertex [" << worstMatchingVertex << "]: maximally shared track index = " << maxSharedTrack
755  << ", multiplicity = " << trackToVertexMap.at( maxSharedTrack ).size()
756  << ", worst chi2_trk = " << worstChi2 );
757 
758  //Choice of action
759  if( worstChi2 < m_jp.TrackDetachCut ) {
760 
761  // Here, the max-shared track is well-associated and cannot be detached.
762  // The closest vertex should be merged.
763 
764  std::vector< std::pair<unsigned, unsigned> > badPairs;
765 
766  while( true ) {
767 
768  // find the closest vertices pair that share the track of interest
769  double minSignificance { AlgConsts::maxValue };
770  unsigned nShared { 0 };
771 
772  {
773  auto& vrtList = trackToVertexMap.at( maxSharedTrack );
774 
775  auto nGood = std::count_if( vrtList.begin(), vrtList.end(), [&]( auto& v ) { return workVerticesContainer->at(v).isGood; } );
776  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": size of good vertices = " << nGood );
777 
778  std::vector< std::tuple< std::pair<unsigned, unsigned>, double, unsigned> > significanceTuple;
779  enum { kIndexPair, kSignificance, kNshared };
780 
781  for( auto ivrt = vrtList.begin(); ivrt != vrtList.end(); ++ivrt ) {
782  for( auto jvrt = std::next( ivrt ); jvrt != vrtList.end(); ++jvrt ) {
783  auto pair = std::pair<unsigned, unsigned>( *ivrt, *jvrt );
784 
785  if( !( workVerticesContainer->at(*ivrt).isGood ) ) continue;
786  if( !( workVerticesContainer->at(*jvrt).isGood ) ) continue;
787 
788  // skip known bad pairs
789  if( std::find( badPairs.begin(), badPairs.end(), pair ) != badPairs.end() ) continue;
790 
791  auto signif = significanceBetweenVertices( workVerticesContainer->at( *ivrt ), workVerticesContainer->at( *jvrt ) );
792 
793  auto& ivrtTrks = workVerticesContainer->at(*ivrt).selectedTrackIndices;
794  auto& jvrtTrks = workVerticesContainer->at(*jvrt).selectedTrackIndices;
795 
796  auto nSharedTracks = std::count_if( ivrtTrks.begin(), ivrtTrks.end(),
797  [&]( auto& index ) {
798  return std::find( jvrtTrks.begin(), jvrtTrks.end(), index ) != jvrtTrks.end();
799  } );
800 
801  significanceTuple.emplace_back( pair, signif, nSharedTracks );
802  }
803  }
804 
805  if( significanceTuple.empty() ) {
806  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": no vertex pairs are found --> exit the while loop." );
807  break;
808  }
809 
810  auto minSignificanceTuple = std::min_element( significanceTuple.begin(), significanceTuple.end(), [&]( auto& t1, auto&t2 ) { return std::get<kSignificance>(t1) < std::get<kSignificance>(t2); } );
811 
812  indexPair = std::get<kIndexPair> ( *minSignificanceTuple );
813  minSignificance = std::get<kSignificance> ( *minSignificanceTuple );
814  nShared = std::get<kNshared> ( *minSignificanceTuple );
815  }
816 
817  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": minSignificance = " << minSignificance );
818 
819  if( minSignificance < m_jp.VertexMergeCut || nShared >= 2 ) {
820 
821  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": attempt to merge vertices " << indexPair.first << " and " << indexPair.second );
822 
823  WrkVrt vertex_backup1 = workVerticesContainer->at( indexPair.first );
824  WrkVrt vertex_backup2 = workVerticesContainer->at( indexPair.second );
825 
826  StatusCode sc = mergeVertices( workVerticesContainer->at( indexPair.first ), workVerticesContainer->at( indexPair.second ) );
827 
828  if( m_jp.FillHist ) { m_hists["mergeType"]->Fill( RECONSTRUCT_NTRK ); }
829 
830  if( sc.isFailure() ) {
831  // revert to the original
832  workVerticesContainer->at( indexPair.first ) = vertex_backup1;
833  workVerticesContainer->at( indexPair.second ) = vertex_backup2;
834  badPairs.emplace_back( indexPair );
835  }
836 
837  // The second vertex is merged to the first.
838  // Explicity flag the second vertex is invalid.
839  workVerticesContainer->at( indexPair.second ).isGood = false;
840 
841  // Now the vertex is merged and the bad pair record is outdated.
842  badPairs.clear();
843 
844  mergeCounter++;
845 
846  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Merged vertices " << indexPair.first << " and " << indexPair.second << ". merged vertex multiplicity = " << workVerticesContainer->at( indexPair.first ).selectedTrackIndices.size() );
847 
848  } else {
849 
850  // Here, the significance between closest vertices sharing the track is sufficiently distant
851  // and cannot be merged, while the track-association chi2 is small as well.
852  // In order to resolve the ambiguity anyway, remove the track from the worst-associated vertex.
853 
854  auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
855 
856  auto end = std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&]( auto& index ) { return index == maxSharedTrack; } );
857  wrkvrt.selectedTrackIndices.erase( end, wrkvrt.selectedTrackIndices.end() );
858 
859  removeTrackCounter++;
860 
861  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": removed track " << maxSharedTrack << " from vertex " << worstMatchingVertex );
862 
863  if( wrkvrt.selectedTrackIndices.size() < 2 ) {
864  wrkvrt.isGood = false;
865  brokenCounter++;
866  break;
867  }
868 
869  StatusCode sc = refitVertex( wrkvrt );
870  if( sc.isFailure() ) {
871  ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
872  }
873 
874  break;
875 
876  }
877  }
878 
879  } else {
880 
881  // Here, a bad track association is detected
882  // The track is detached from the worst-associated vertex and refit.
883 
884  auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
885 
886  auto end = std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&]( auto& index ) { return index == maxSharedTrack; } );
887  wrkvrt.selectedTrackIndices.erase( end, wrkvrt.selectedTrackIndices.end() );
888 
889  if( wrkvrt.nTracksTotal() >=2 ) {
890 
891  auto wrkvrt_backup = wrkvrt;
892  StatusCode sc = refitVertex( wrkvrt );
893  if( sc.isFailure() ) {
894  ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
895  wrkvrt = wrkvrt_backup;
896  }
897 
898  } else {
899  wrkvrt.isGood = false;
900  brokenCounter++;
901  }
902 
903  removeTrackCounter++;
904 
905  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": removed track " << maxSharedTrack << " from vertex " << worstMatchingVertex );
906 
907  }
908 
909  }
910 
911  //
912  // Try to improve vertices with big Chi2
913  for( auto& wrkvrt : *workVerticesContainer ) {
914 
915  if(!wrkvrt.isGood ) continue; //don't work on wrkvrt which is already bad
916  if( wrkvrt.selectedTrackIndices.size() < 3 ) continue;
917 
918  WrkVrt backup = wrkvrt;
919  improveVertexChi2( wrkvrt );
920  if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
921 
922  if( wrkvrt.nTracksTotal() < 2 ) wrkvrt.isGood = false;
923 
924  }
925 
926  if( m_jp.FillNtuple ) {
927  m_ntupleVars->get<unsigned int>( "NumRearrSecVrt" )=workVerticesContainer->size();
928  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Size of Solution Set: "<< m_ntupleVars->get<unsigned int>( "NumRearrSecVrt" ));
929  }
930 
931  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
932  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Number of merges = " << mergeCounter << ", Number of track removal = " << removeTrackCounter << ", broken vertices = " << brokenCounter );
933  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
934 
935  return StatusCode::SUCCESS;
936  }

◆ reassembleVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::reassembleVertices ( 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 940 of file VertexingAlgs.cxx.

941  {
942  // Here, the supposed issue is that, the position of the reconstructed vertex may be significantly
943  // displaced from its truth position, even if the constituent tracks are all from that truth.
944  // The fundamental reason of this is speculated that the VKalVrt vertex fitting could fall in
945  // a local minimum. This function attempts to improve the situation, given that N-track vertices
946  // are already reconstructed, by attempting to asociate a track of a small multiplicity vertex
947  // to another large multiplicity vertex.
948 
949  unsigned reassembleCounter { 0 };
950 
951  // First, sort WrkVrt by the track multiplicity
952  std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt& v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
953 
954  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": #vertices = " << workVerticesContainer->size() );
955  // Loop over vertices (small -> large Ntrk order)
956  for( auto& wrkvrt : *workVerticesContainer ) {
957  if( !wrkvrt.isGood ) continue;
958  if( wrkvrt.selectedTrackIndices.size() <= 1 ) continue;
959 
960  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": vertex " << &wrkvrt << " #tracks = " << wrkvrt.selectedTrackIndices.size() );
961  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": candidate vertex: "
962  << " isGood = " << (wrkvrt.isGood? "true" : "false")
963  << ", #ntrks = " << wrkvrt.nTracksTotal()
964  << ", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
965  << ", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
966  << ", chi2/ndof = " << wrkvrt.fitQuality()
967  << ", (r, z) = (" << wrkvrt.vertex.perp()
968  <<", " << wrkvrt.vertex.z() << ")" );
969 
970  std::map<unsigned, std::vector<WrkVrt>::reverse_iterator> mergiableVertex;
971  std::set<std::vector<WrkVrt>::reverse_iterator> mergiableVerticesSet;
972 
973  for( auto& index : wrkvrt.selectedTrackIndices ) {
974 
975  const xAOD::TrackParticle* trk = m_selectedTracks->at( index );
976 
977  mergiableVertex[index] = workVerticesContainer->rend();
978 
979  std::vector<double> distances;
980 
981  // Reverse iteration: large Ntrk -> small Ntrk order
982  for( auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
983  auto& targetVertex = *ritr;
984 
985  if( &wrkvrt == &targetVertex ) continue;
986  if( wrkvrt.selectedTrackIndices.size() >= targetVertex.selectedTrackIndices.size() ) continue;
987 
988  // Get the closest approach
989  std::vector<double> impactParameters;
990  std::vector<double> impactParErrors;
991 
992  if( !getSVImpactParameters(trk,targetVertex.vertex,impactParameters,impactParErrors) ) continue;
993 
994  const auto& distance = hypot( impactParameters.at(0), impactParameters.at(1) );
995  distances.emplace_back( distance );
996 
997  if( std::abs( impactParameters.at(0) ) > m_jp.reassembleMaxImpactParameterD0 ) continue;
998  if( std::abs( impactParameters.at(1) ) > m_jp.reassembleMaxImpactParameterZ0 ) continue;
999 
1000  mergiableVertex[index] = ritr;
1001  mergiableVerticesSet.emplace( ritr );
1002 
1003  }
1004 
1005  auto min_distance = !distances.empty() ? *(std::min_element( distances.begin(), distances.end() )) : AlgConsts::invalidFloat;
1006 
1007  if( mergiableVertex[index] == workVerticesContainer->rend() ) {
1008  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": track " << trk << " --> none : min distance = " << min_distance );
1009  } else {
1010  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": track " << trk << " --> " << &( *(mergiableVertex[index]) ) << " --> size = " << mergiableVertex[index]->selectedTrackIndices.size() << ": min distance = " << min_distance );
1011  }
1012 
1013  }
1014 
1015  size_t count_mergiable = std::count_if( mergiableVertex.begin(), mergiableVertex.end(),
1016  [&](const std::pair<unsigned, std::vector<WrkVrt>::reverse_iterator>& p ) {
1017  return p.second != workVerticesContainer->rend(); } );
1018 
1019  if( mergiableVerticesSet.size() == 1 && count_mergiable == wrkvrt.selectedTrackIndices.size() ) {
1020 
1021  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": identified a unique association destination vertex" );
1022 
1023  WrkVrt& destination = *( mergiableVertex.begin()->second );
1024  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": destination #tracks before merging = " << destination.selectedTrackIndices.size() );
1025 
1026  StatusCode sc = mergeVertices( destination, wrkvrt );
1027  if( sc.isFailure() ) {
1028  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failure in vertex merging" );
1029  }
1030 
1031  improveVertexChi2( destination );
1032 
1033  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": merged destination vertex: "
1034  << " isGood = " << (destination.isGood? "true" : "false")
1035  << ", #ntrks = " << destination.nTracksTotal()
1036  << ", #selectedTracks = " << destination.selectedTrackIndices.size()
1037  << ", #associatedTracks = " << destination.associatedTrackIndices.size()
1038  << ", chi2/ndof = " << destination.fitQuality()
1039  << ", (r, z) = (" << destination.vertex.perp()
1040  <<", " << destination.vertex.z() << ")" );
1041 
1042  if( m_jp.FillHist ) { m_hists["mergeType"]->Fill( REASSEMBLE ); }
1043 
1044  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": destination #tracks after merging = " << destination.selectedTrackIndices.size() );
1045 
1046  reassembleCounter++;
1047 
1048  }
1049 
1050  }
1051 
1052  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1053  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": reassembled vertices = " << reassembleCounter );
1054  ATH_MSG_DEBUG(" > " << __FUNCTION__ << "----------------------------------------------" );
1055 
1056  return StatusCode::SUCCESS;
1057  }

◆ refitAndSelectGoodQualityVertices()

StatusCode VKalVrtAthena::VrtSecInclusive::refitAndSelectGoodQualityVertices ( std::vector< WrkVrt > *  workVerticesContainer)
private

finalization of the vertex and store to xAOD::VertexContainer

Definition at line 1472 of file VertexingAlgs.cxx.

1473  {
1474 
1475  // Output SVs as xAOD::Vertex
1476  // Needs a conversion function from workVerticesContainer to xAOD::Vertex here.
1477  // The supposed form of the function will be as follows:
1478 
1479  try {
1480 
1481  xAOD::VertexContainer *secondaryVertexContainer( nullptr );
1482  ATH_CHECK( evtStore()->retrieve( secondaryVertexContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName + m_jp.augVerString ) );
1483 
1484  const xAOD::TrackParticleContainer* trackParticleContainer ( nullptr );
1485  ATH_CHECK( evtStore()->retrieve( trackParticleContainer, m_jp.TrackLocation) );
1486 
1487  enum { kPt, kEta, kPhi, kD0, kZ0, kErrP, kErrD0, kErrZ0, kChi2SV };
1488  if( m_trkDecors.empty() ) {
1489  m_trkDecors.emplace( kPt, SG::AuxElement::Decorator<float>("pt_wrtSV" + m_jp.augVerString) );
1490  m_trkDecors.emplace( kEta, SG::AuxElement::Decorator<float>("eta_wrtSV" + m_jp.augVerString) );
1491  m_trkDecors.emplace( kPhi, SG::AuxElement::Decorator<float>("phi_wrtSV" + m_jp.augVerString) );
1492  m_trkDecors.emplace( kD0, SG::AuxElement::Decorator<float>("d0_wrtSV" + m_jp.augVerString) );
1493  m_trkDecors.emplace( kZ0, SG::AuxElement::Decorator<float>("z0_wrtSV" + m_jp.augVerString) );
1494  m_trkDecors.emplace( kErrP, SG::AuxElement::Decorator<float>("errP_wrtSV" + m_jp.augVerString) );
1495  m_trkDecors.emplace( kErrD0, SG::AuxElement::Decorator<float>("errd0_wrtSV" + m_jp.augVerString) );
1496  m_trkDecors.emplace( kErrZ0, SG::AuxElement::Decorator<float>("errz0_wrtSV" + m_jp.augVerString) );
1497  m_trkDecors.emplace( kChi2SV, SG::AuxElement::Decorator<float>("chi2_toSV" + m_jp.augVerString) );
1498  }
1499  if( !m_decor_is_svtrk_final ) m_decor_is_svtrk_final = std::make_unique< SG::AuxElement::Decorator<char> >( "is_svtrk_final" + m_jp.augVerString );
1500 
1501  std::map<const WrkVrt*, const xAOD::Vertex*> wrkvrtLinkMap;
1502 
1503  //----------------------------------------------------------
1504  const auto& ctx = Gaudi::Hive::currentContext();
1505 
1506  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": input #vertices = " << workVerticesContainer->size() );
1507 
1508  // Loop over vertices
1509  for( auto& wrkvrt : *workVerticesContainer ) {
1510 
1511  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": candidate vertex: "
1512  << " isGood = " << (wrkvrt.isGood? "true" : "false")
1513  << ", #ntrks = " << wrkvrt.nTracksTotal()
1514  << ", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
1515  << ", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
1516  << ", chi2/ndof = " << wrkvrt.Chi2 / ( wrkvrt.ndof() + AlgConsts::infinitesimal )
1517  << ", (r, z) = (" << wrkvrt.vertex.perp()
1518  <<", " << wrkvrt.vertex.z() << ")" );
1519 
1520  if( m_jp.FillHist ) m_hists["finalCutMonitor"]->Fill( 0 );
1521 
1523  removeInconsistentTracks( wrkvrt );
1524  }
1525 
1526  if( wrkvrt.nTracksTotal() < 2 ) {
1527  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": ntrk < 2 --> rejected." );
1528  continue; /* Bad vertices */
1529  }
1530 
1531  if( m_jp.FillHist ) m_hists["finalCutMonitor"]->Fill( 1 );
1532 
1533 
1534  // Remove track if the vertex is inner than IBL and the track does not have pixel hits!
1535  if( wrkvrt.vertex.perp() < 31.0 ) {
1536 
1537  // for selected tracks
1538  wrkvrt.selectedTrackIndices.erase( std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1539  [&]( auto& index ) {
1540  auto* trk = m_selectedTracks->at( index );
1541  uint8_t nPixelHits { 0 }; trk->summaryValue( nPixelHits, xAOD::numberOfPixelHits );
1542  return ( nPixelHits < 3 );
1543  } ),
1544  wrkvrt.selectedTrackIndices.end() );
1545 
1546  // for associated tracks
1547  wrkvrt.associatedTrackIndices.erase( std::remove_if( wrkvrt.associatedTrackIndices.begin(), wrkvrt.associatedTrackIndices.end(),
1548  [&]( auto& index ) {
1549  auto* trk = m_associatedTracks->at( index );
1550  uint8_t nPixelHits { 0 }; trk->summaryValue( nPixelHits, xAOD::numberOfPixelHits );
1551  return ( nPixelHits < 3 );
1552  } ),
1553  wrkvrt.associatedTrackIndices.end() );
1554 
1555  auto statusCode = refitVertex( wrkvrt );
1556  if( statusCode.isFailure() ) {}
1557 
1558  }
1559 
1560 
1561  if( m_jp.doFinalImproveChi2 ) {
1562 
1563  WrkVrt backup = wrkvrt;
1564 
1565  improveVertexChi2( wrkvrt );
1566 
1567  if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1568 
1569  }
1570 
1571  // If the number of remaining tracks is less than 2, drop.
1572  if( wrkvrt.nTracksTotal() < 2 ) continue;
1573 
1574  // Select only vertices with keeping more than 2 selectedTracks
1575  if( wrkvrt.selectedTrackIndices.size() < 2 ) continue;
1576 
1577 
1578  if( m_jp.FillHist ) m_hists["finalCutMonitor"]->Fill( 2 );
1579 
1580 
1581  {
1582  WrkVrt backup = wrkvrt;
1583 
1584  StatusCode sc = refitVertex( wrkvrt );
1585  if( sc.isFailure() ) {
1586 
1587  auto indices = wrkvrt.associatedTrackIndices;
1588 
1589  wrkvrt.associatedTrackIndices.clear();
1590  sc = refitVertex( wrkvrt );
1591  if( sc.isFailure() ) {
1592  ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1593  wrkvrt = backup;
1594  }
1595  if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1596 
1597  for( auto& index : indices ) {
1598  backup = wrkvrt;
1599  wrkvrt.associatedTrackIndices.emplace_back( index );
1600  sc = refitVertex( wrkvrt );
1601  if( sc.isFailure() || TMath::Prob( wrkvrt.Chi2, wrkvrt.ndof() ) < m_jp.improveChi2ProbThreshold ) {
1602  ATH_MSG_WARNING(" > " << __FUNCTION__ << ": detected vertex fitting failure!" );
1603  wrkvrt = backup;
1604  continue;
1605  }
1606  }
1607 
1608  } else {
1609  if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1610  }
1611  }
1612 
1613  if( m_jp.FillHist ) m_hists["finalCutMonitor"]->Fill( 3 );
1614 
1615  //
1616  // Store good vertices into StoreGate
1617  //
1618  if( m_jp.FillNtuple ) m_ntupleVars->get<unsigned int>( "NumSecVrt" )++;
1619 
1620  TLorentzVector sumP4_pion;
1621  TLorentzVector sumP4_electron;
1622  TLorentzVector sumP4_proton;
1623 
1624  // Pre-check before storing vertex if the SV perigee is available
1625  bool good_flag = true;
1626 
1627  std::map<const std::deque<long int>*, const std::vector<const xAOD::TrackParticle*>&> indicesSet
1628  = {
1629  { &(wrkvrt.selectedTrackIndices), *m_selectedTracks },
1630  { &(wrkvrt.associatedTrackIndices), *m_associatedTracks }
1631  };
1632 
1633  for( auto& pair : indicesSet ) {
1634 
1635  const auto* indices = pair.first;
1636  const auto& tracks = pair.second;
1637 
1638  for( const auto& itrk : *indices ) {
1639  const auto* trk = tracks.at( itrk );
1640  auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(ctx, *trk, wrkvrt.vertex );
1641  if( !sv_perigee ) {
1642  ATH_MSG_INFO(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": Failed in obtaining the SV perigee!" );
1643  good_flag = false;
1644  }
1645  }
1646 
1647  }
1648 
1649  if( !good_flag ) {
1650  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": sv perigee could not be obtained --> rejected" );
1651  continue;
1652  }
1653 
1654  if( m_jp.FillHist ) m_hists["finalCutMonitor"]->Fill( 4 );
1655 
1656 
1657  std::vector<const xAOD::TrackParticle*> tracks;
1658  std::vector< std::pair<const xAOD::TrackParticle*, double> > trackChi2Pairs;
1659 
1660  {
1661 
1662  for( auto& pair : indicesSet ) {
1663  for( const auto& index : *pair.first ) tracks.emplace_back( pair.second.at( index ) );
1664  }
1665 
1666  auto trkitr = tracks.begin();
1667  auto chi2itr = wrkvrt.Chi2PerTrk.begin();
1668 
1669  for( ; ( trkitr!=tracks.end() && chi2itr!=wrkvrt.Chi2PerTrk.end() ); ++trkitr, ++chi2itr ) {
1670  trackChi2Pairs.emplace_back( *trkitr, *chi2itr );
1671  }
1672 
1673  }
1674 
1675 
1676  TLorentzVector sumP4_selected;
1677 
1678  bool badIPflag { false };
1679 
1680  // loop over vertex tracks
1681  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Track loop: size = " << tracks.size() );
1682  for( auto& pair : trackChi2Pairs ) {
1683 
1684  const auto* trk = pair.first;
1685  const auto& chi2AtSV = pair.second;
1686 
1687  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": start." );
1688 
1689  track_summary trk_summary;
1690  fillTrackSummary( trk_summary, trk );
1691 
1692  //
1693  // calculate mass/pT of tracks and track parameters
1694  //
1695 
1696  double trk_pt = trk->pt();
1697  double trk_eta = trk->eta();
1698  double trk_phi = trk->phi();
1699 
1700  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": in vrt chg/pt/phi/eta = "
1701  << trk->charge() <<","
1702  <<trk_pt<<","
1703  <<trk_phi<<","
1704  <<trk_eta);
1705 
1707  // Get the perigee of the track at the vertex
1708  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": Get the prigee of the track at the vertex." );
1709 
1710  auto sv_perigee = m_trackToVertexTool->perigeeAtVertex(ctx, *trk, wrkvrt.vertex );
1711  if( !sv_perigee ) {
1712  ATH_MSG_WARNING(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": Failed in obtaining the SV perigee!" );
1713 
1714  for( auto& pair : m_trkDecors ) {
1715  pair.second( *trk ) = AlgConsts::invalidFloat;
1716  }
1717  (*m_decor_is_svtrk_final)( *trk ) = true;
1718  continue;
1719  }
1720 
1721  double qOverP_wrtSV = sv_perigee->parameters() [Trk::qOverP];
1722  double theta_wrtSV = sv_perigee->parameters() [Trk::theta];
1723  double p_wrtSV = 1.0 / std::abs( qOverP_wrtSV );
1724  double pt_wrtSV = p_wrtSV * sin( theta_wrtSV );
1725  double eta_wrtSV = -log( tan( theta_wrtSV/2. ) );
1726  double phi_wrtSV = sv_perigee->parameters() [Trk::phi];
1727  double d0_wrtSV = sv_perigee->parameters() [Trk::d0];
1728  double z0_wrtSV = sv_perigee->parameters() [Trk::z0];
1729  double errd0_wrtSV = (*sv_perigee->covariance())( Trk::d0, Trk::d0 );
1730  double errz0_wrtSV = (*sv_perigee->covariance())( Trk::z0, Trk::z0 );
1731  double errP_wrtSV = (*sv_perigee->covariance())( Trk::qOverP, Trk::qOverP );
1732 
1733  // xAOD::Track augmentation
1734  ( m_trkDecors.at(kPt) )( *trk ) = pt_wrtSV;
1735  ( m_trkDecors.at(kEta) )( *trk ) = eta_wrtSV;
1736  ( m_trkDecors.at(kPhi) )( *trk ) = phi_wrtSV;
1737  ( m_trkDecors.at(kD0) )( *trk ) = d0_wrtSV;
1738  ( m_trkDecors.at(kZ0) )( *trk ) = z0_wrtSV;
1739  ( m_trkDecors.at(kErrP) )( *trk ) = errP_wrtSV;
1740  ( m_trkDecors.at(kErrD0) )( *trk ) = errd0_wrtSV;
1741  ( m_trkDecors.at(kErrZ0) )( *trk ) = errz0_wrtSV;
1742  ( m_trkDecors.at(kChi2SV))( *trk ) = chi2AtSV;
1743 
1744  (*m_decor_is_svtrk_final)( *trk ) = true;
1745 
1746  TLorentzVector p4wrtSV_pion;
1747  TLorentzVector p4wrtSV_electron;
1748  TLorentzVector p4wrtSV_proton;
1749 
1750  p4wrtSV_pion .SetPtEtaPhiM( pt_wrtSV, eta_wrtSV, phi_wrtSV, PhysConsts::mass_chargedPion );
1751  p4wrtSV_electron.SetPtEtaPhiM( pt_wrtSV, eta_wrtSV, phi_wrtSV, PhysConsts::mass_electron );
1752 
1753  // for selected tracks only
1754  static const SG::ConstAccessor<char> is_associatedAcc("is_associated" + m_jp.augVerString);
1755  if( is_associatedAcc.isAvailable(*trk) ) {
1756  if( !is_associatedAcc(*trk) ) {
1757  sumP4_selected += p4wrtSV_pion;
1758  }
1759  } else {
1760  sumP4_selected += p4wrtSV_pion;
1761  }
1762 
1763  sumP4_pion += p4wrtSV_pion;
1764  sumP4_electron += p4wrtSV_electron;
1765  sumP4_proton += p4wrtSV_proton;
1766 
1767  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": > Track index " << trk->index() << ": end." );
1768  } // loop over tracks in vertex
1769 
1770  ATH_MSG_VERBOSE(" > " << __FUNCTION__ << ": Track loop end. ");
1771 
1772  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Final Sec.Vertex=" << wrkvrt.nTracksTotal() <<", "
1773  <<wrkvrt.vertex.perp() <<", "<<wrkvrt.vertex.z() <<", "
1774  <<wrkvrt.vertex.phi() <<", mass = "<< sumP4_pion.M() << "," << sumP4_electron.M() );
1775 
1776 
1777  //
1778  // calculate opening angle between all 2-track pairs, and store the minimum
1779  //
1780  double minOpAng = AlgConsts::invalidFloat;
1781  std::vector<double> opAngles;
1782 
1783  for( auto itr1 = tracks.begin(); itr1 != tracks.end(); ++itr1 ) {
1784  for( auto itr2 = std::next( itr1 ); itr2 != tracks.end(); ++itr2 ) {
1785  const auto& p1 = (*itr1)->p4().Vect();
1786  const auto& p2 = (*itr2)->p4().Vect();
1787  auto cos = p1 * p2 / p1.Mag() / p2.Mag();
1788  opAngles.emplace_back( cos );
1789  }
1790  }
1791  minOpAng = *( std::max_element( opAngles.begin(), opAngles.end() ) );
1792  if( m_jp.FillNtuple ) m_ntupleVars->get< vector<double> >( "SecVtx_MinOpAng" ).emplace_back(minOpAng);
1793 
1794 
1795  if( m_jp.FillHist ) m_hists["finalCutMonitor"]->Fill( 5 );
1796 
1797  if( badIPflag ) {
1798  ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": Bad impact parameter signif wrt SV was flagged." );
1799  }
1800 
1802 
1803  bool oneLepMatchTrack = false;
1804  for (const auto *trk: tracks) {
1805  if ( std::find(m_leptonicTracks->begin(), m_leptonicTracks->end(), trk) != m_leptonicTracks->end() ) {
1806  oneLepMatchTrack = true;
1807  break;
1808  }
1809  }
1810 
1811  // If there are no tracks matched to leptons, do not save the container to the output.
1812  if (!oneLepMatchTrack) continue;
1813  }
1814 
1816  // Data filling to xAOD container
1817 
1818  wrkvrt.isGood = true;
1819 
1820  // Firstly store the new vertex to the container before filling properties.
1821  // (This is the feature of xAOD.)
1823  secondaryVertexContainer->emplace_back( vertex );
1824 
1825  // Registering the vertex position to xAOD::Vertex
1826  vertex->setPosition( wrkvrt.vertex );
1827 
1828  // Registering the vertex type: SV
1829  vertex->setVertexType( xAOD::VxType::SecVtx );
1830 
1831  // Registering the vertex chi2 and Ndof
1832  // Here, we register the core chi2 of the core (before track association)
1833  vertex->setFitQuality( wrkvrt.Chi2_core, wrkvrt.ndof_core() );
1834 
1835  // Registering the vertex covariance matrix
1836  std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
1837  vertex->setCovariance(fCov);
1838 
1839  // Registering the vertex momentum and charge
1840  static const SG::Accessor<float> vtx_pxAcc("vtx_px");
1841  static const SG::Accessor<float> vtx_pyAcc("vtx_py");
1842  static const SG::Accessor<float> vtx_pzAcc("vtx_pz");
1843  static const SG::Accessor<float> vtx_massAcc("vtx_mass");
1844  static const SG::Accessor<float> vtx_chargeAcc("vtx_charge");
1845  static const SG::Accessor<float> chi2_coreAcc("chi2_core");
1846  static const SG::Accessor<float> ndof_coreAcc("ndof_core");
1847  static const SG::Accessor<float> chi2_assocAcc("chi2_assoc");
1848  static const SG::Accessor<float> ndof_assocAcc("ndof_assoc");
1849  static const SG::Accessor<float> massAcc("mass");
1850  static const SG::Accessor<float> mass_eAcc("mass_e");
1851  static const SG::Accessor<float> mass_selectedTracksAcc("mass_selectedTracks");
1852  static const SG::Accessor<float> minOpAngAcc("minOpAng");
1853  static const SG::Accessor<int> num_trksAcc("num_trks");
1854  static const SG::Accessor<int> num_selectedTracksAcc("num_selectedTracks");
1855  static const SG::Accessor<int> num_associatedTracksAcc("num_associatedTracks");
1856  static const SG::Accessor<float> dCloseVrtAcc("dCloseVrt");
1857 
1858  vtx_pxAcc(*vertex) = wrkvrt.vertexMom.Px();
1859  vtx_pyAcc(*vertex) = wrkvrt.vertexMom.Py();
1860  vtx_pzAcc(*vertex) = wrkvrt.vertexMom.Pz();
1861 
1862  vtx_massAcc(*vertex) = wrkvrt.vertexMom.M();
1863  vtx_chargeAcc(*vertex) = wrkvrt.Charge;
1864 
1865  chi2_coreAcc(*vertex) = wrkvrt.Chi2_core;
1866  ndof_coreAcc(*vertex) = wrkvrt.ndof_core();
1867  chi2_assocAcc(*vertex) = wrkvrt.Chi2;
1868  ndof_assocAcc(*vertex) = wrkvrt.ndof();
1869  // Other SV properties
1870  massAcc(*vertex) = sumP4_pion.M();
1871  mass_eAcc(*vertex) = sumP4_electron.M();
1872  mass_selectedTracksAcc(*vertex) = sumP4_selected.M();
1873  minOpAngAcc(*vertex) = minOpAng;
1874  num_trksAcc(*vertex) = wrkvrt.nTracksTotal();
1875  num_selectedTracksAcc(*vertex) = wrkvrt.selectedTrackIndices.size();
1876  num_associatedTracksAcc(*vertex) = wrkvrt.associatedTrackIndices.size();
1877  dCloseVrtAcc(*vertex) = wrkvrt.closestWrkVrtValue;
1878 
1879  // Registering tracks comprising the vertex to xAOD::Vertex
1880  // loop over the tracks comprising the vertex
1881  for( auto trk_id : wrkvrt.selectedTrackIndices ) {
1882 
1883  const xAOD::TrackParticle *trk = m_selectedTracks->at( trk_id );
1884 
1885  // Acquire link the track to the vertex
1886  ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
1887 
1888  // Register the link to the vertex
1889  vertex->addTrackAtVertex( link_trk, 1. );
1890 
1891  }
1892 
1893  for( auto trk_id : wrkvrt.associatedTrackIndices ) {
1894 
1895  const xAOD::TrackParticle *trk = m_associatedTracks->at( trk_id );
1896 
1897  // Acquire link the track to the vertex
1898  ElementLink<xAOD::TrackParticleContainer> link_trk( *( dynamic_cast<const xAOD::TrackParticleContainer*>( trk->container() ) ), static_cast<long unsigned int>(trk->index()) );
1899 
1900  // Register the link to the vertex
1901  vertex->addTrackAtVertex( link_trk, 1. );
1902 
1903  }
1904 
1905 
1906  if( m_jp.doMapToLocal ) {
1907  // Obtain the local mapping of the reconstructed vertex
1908  Trk::MappedVertex mappedVtx = m_vertexMapper->mapToLocal( wrkvrt.vertex );
1909  static const SG::Accessor<int> local_identifierHashAcc("local_identifierHash");
1910  static const SG::Accessor<int> local_layerIndexAcc("local_layerIndex");
1911  static const SG::Accessor<float> local_posXAcc("local_posX");
1912  static const SG::Accessor<float> local_posYAcc("local_posY");
1913  static const SG::Accessor<float> local_posZAcc("local_posZ");
1914  if( mappedVtx.valid ) {
1915  local_identifierHashAcc(*vertex) = mappedVtx.identifierHash;
1916  local_layerIndexAcc(*vertex) = mappedVtx.layerIndex;
1917  local_posXAcc(*vertex) = mappedVtx.localPosition.x();
1918  local_posYAcc(*vertex) = mappedVtx.localPosition.y();
1919  local_posZAcc(*vertex) = mappedVtx.localPosition.z();
1920  } else {
1921  local_identifierHashAcc(*vertex) = AlgConsts::invalidInt;
1922  local_layerIndexAcc(*vertex) = AlgConsts::invalidInt;
1923  local_posXAcc(*vertex) = AlgConsts::invalidFloat;
1924  local_posYAcc(*vertex) = AlgConsts::invalidFloat;
1925  local_posZAcc(*vertex) = AlgConsts::invalidFloat;
1926  }
1927  }
1928 
1929 
1930  // For MC, try to trace down to the truth particles,
1931  // and depending on the topology, categorize the label of the reconstructed vertex.
1932  if( m_jp.doTruth ) {
1934  }
1935 
1936  // Keep the link between wrkvrt and vertex for later use
1937  wrkvrtLinkMap[&wrkvrt] = vertex;
1938 
1939 
1940  } // loop over vertices
1941 
1942  if( m_jp.FillNtuple ) {
1943  ATH_CHECK( fillAANT_SecondaryVertices( secondaryVertexContainer ) );
1944  }
1945 
1946 
1947  // Post process -- Additional augmentations
1948  if( m_jp.doAugmentDVimpactParametersToMuons ) { ATH_CHECK( augmentDVimpactParametersToLeptons<xAOD::Muon> ( "Muons" ) ); }
1949  if( m_jp.doAugmentDVimpactParametersToElectrons ) { ATH_CHECK( augmentDVimpactParametersToLeptons<xAOD::Electron>( "Electrons" ) ); }
1950 
1951  } catch (const std::out_of_range& e) {
1952 
1953  ATH_MSG_WARNING( " > " << __FUNCTION__ << ": out of range error is detected: " << e.what() );
1954 
1955  return StatusCode::SUCCESS;
1956 
1957  } catch( ... ) {
1958 
1959  ATH_MSG_WARNING( " > " << __FUNCTION__ << ": some other error is detected." );
1960 
1961  return StatusCode::SUCCESS;
1962 
1963  }
1964 
1965  return StatusCode::SUCCESS;
1966  }

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

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

2331  {
2332 
2333  const auto& vertex = wrkvrt.vertex;
2334 
2335  std::map< std::deque<long int>*, std::vector<const xAOD::TrackParticle*>& > indexMap
2336  {
2337  { &(wrkvrt.selectedTrackIndices), *m_selectedTracks }, { &(wrkvrt.associatedTrackIndices), *m_associatedTracks }
2338  };
2339 
2340  for( auto& pair : indexMap ) {
2341 
2342  auto* indices = pair.first;
2343  auto& tracks = pair.second;
2344 
2345  auto newEnd = std::remove_if( indices->begin(), indices->end(),
2346  [&]( auto& index ) {
2347  bool isConsistent = (this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( tracks.at(index), vertex );
2348  return !isConsistent;
2349  } );
2350 
2351  indices->erase( newEnd, indices->end() );
2352 
2353  }
2354 
2355  }

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

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ selectInDetAndGSFTracks()

StatusCode VKalVrtAthena::VrtSecInclusive::selectInDetAndGSFTracks ( )
private

Definition at line 302 of file TrackSelectionAlgs.cxx.

302  {
303 
304  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": begin" );
305 
306  //--------------------------------------------------------
307  // Extract tracks from xAOD::TrackParticle container
308  //
309 
310  const xAOD::TrackParticleContainer* IDtracks ( nullptr );
311  ATH_CHECK( evtStore()->retrieve( IDtracks, m_jp.TrackLocation) );
312 
313  const xAOD::ElectronContainer *electrons( nullptr );
315 
316  const xAOD::MuonContainer* muons ( nullptr );
318 
319  std::vector<const xAOD::TrackParticle*> IDTrksFromEls;
320 
321  // Loop over electrons to select all GSF tracks
322  for( const auto *electron : *electrons ) {
323  if( 0 == electron->nTrackParticles() ) { continue; }
324  // The first track is the best-matched GSF track
325  const auto* el_trk = electron->trackParticle(0);
326  selectTrack( el_trk );
327  m_leptonicTracks->emplace_back(el_trk);
328  IDTrksFromEls.emplace_back(xAOD::EgammaHelpers::getOriginalTrackParticle(electron));
329  }
330 
331  // Loop over ID tracks to select all non-el tracks
332  for( const auto *trk : *IDtracks ) {
333  // do not select ID track if matched to an electron
334  if ( std::find(IDTrksFromEls.begin(), IDTrksFromEls.end(), trk) != IDTrksFromEls.end() ) { continue; }
335  selectTrack( trk );
336  }
337 
338  // Loop over muons to book-keep all ID tracks matched to muons
339  for (const auto *muon : *muons) {
340  if (m_jp.doRemoveCaloTaggedMuons && muon->muonType() == xAOD::Muon::CaloTagged) { continue; }
341  const auto* mu_trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
342  if(!mu_trk) { continue; }
343  m_leptonicTracks->emplace_back(mu_trk);
344  }
345 
346  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total ID tracks = " << IDtracks->size() );
347  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total electrons = " << electrons->size() );
348  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() );
349 
350  return StatusCode::SUCCESS;
351  }

◆ 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 ) m_decor_isSelected = std::make_unique< SG::AuxElement::Decorator< char > >( "is_selected" + m_jp.augVerString );
139 
140  // Setup cut functions
142 
143  // These cuts are optional. Specified by JobProperty
150  //if( m_jp.do_d0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0signifCut ); // not implemented yet
151  //if( m_jp.do_z0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0signifCut ); // not implemented yet
152 
153  // These cuts are used by default
158 
159  }
160 
161  if( std::find( m_selectedTracks->begin(), m_selectedTracks->end(), trk ) != m_selectedTracks->end() ) return;
162 
163  std::vector<bool> cutBits;
164 
165  cutBits.reserve(m_trackSelectionFuncs.size());
166 for( auto func : m_trackSelectionFuncs ) cutBits.emplace_back( (this->*func)( trk ) );
167 
168  if( m_jp.FillHist ) {
169  m_hists["trkSelCuts"]->Fill( 0 );
170  for( size_t ibit = 0; ibit < cutBits.size(); ibit++) {
171  if( cutBits.at(ibit) ) {
172  m_hists["trkSelCuts"]->Fill( ibit+1 );
173  } else {
174  break;
175  }
176  }
177  }
178 
179  // Good track should not find any false bit
180  bool isGood_standard = ( std::find( cutBits.begin(), cutBits.end(), false ) == cutBits.end() );
181 
182  if( isGood_standard ) {
183 
184  // Store the selected track to the new m_selectedTracks
185  // Here we firstly need to register the empty pointer to the m_selectedTracks,
186  // then need to do deep copy after then. This is the feature of xAOD.
187 
188  int barcode=HepMC::UNDEFINED_ID; // FIXME barcode-based
189 
190  if( m_jp.doTruth ) {
191 
192  const xAOD::TruthParticle *truth = getTrkGenParticle(trk);
193 
194  if ( truth ) {
195  barcode = truth->barcode(); // FIXME barcode-based
196  }
197 
198  }
199 
200  (*m_decor_isSelected)( *trk ) = true;
202  const xAOD::TrackParticle *id_tr;
204  if (id_tr != nullptr){
205  (*m_decor_isSelected)( *id_tr ) = true; }
206  }
207 
208  m_selectedTracks->emplace_back( trk );
209 
210  if( m_jp.FillNtuple ) m_ntupleVars->get< vector<int> >( "SelTrk_barcode" ).emplace_back(barcode); // will need this later // FIXME barcode-based
211 
212  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": Track index " << trk->index() << " has been selected." );
213  ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": Track index " << trk->index()
214  << " parameter:"
215  << " pt = " << trk->pt()
216  << " eta = " << trk->eta()
217  << " d0 = " << trk->d0()
218  << " z0 = " << trk->z0() << "." );
219 
220  }
221 
222  }

◆ 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_jp.TrkChi2Cut; }

◆ 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_jp.d0TrkPVDstMinCut && fabs( trk->d0() ) < m_jp.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_jp.d0TrkErrorCut*m_jp.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_jp.SAloneTRT ) {
58  if(PixelHits < m_jp.CutPixelHits) return false;
59  if(SCTHits < m_jp.CutSctHits) return false;
60  if((PixelHits+SCTHits) < m_jp.CutSiHits) return false;
61  if(BLayHits < m_jp.CutBLayHits) return false;
62  if(SharedHits > m_jp.CutSharedHits) return false;
63  }
64 
65  // The folloing part reproduces the track selection in RPVDixpVrt
66  if( m_jp.doTRTPixCut ) {
67  if(TRTHits == 0 && PixelHits < 2) return false;
68  }
69 
70  if( PixelHits == 0 && SCTHits < 6 ) return false;
71 
72  return true;
73  }

◆ 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_jp.CutTightSCTHits ) return false;
88 
89  if( fabs( trk->eta() ) < 1.7 ) {
90  if( TRTHits < m_jp.CutTightTRTHits ) return false;
91  }
92 
93  return true;
94  }

◆ 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 ;
108  uint8_t nSCTHoles=0;
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  }

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

◆ 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_jp.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_jp.z0TrkPVDstMinCut && fabs( trk->z0() ) < m_jp.z0TrkPVDstMaxCut ); }

◆ 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_jp.z0TrkErrorCut*m_jp.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 ( )
private

Definition at line 279 of file TrackSelectionAlgs.cxx.

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

◆ selectTracksFromMuons()

StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksFromMuons ( )
private

Definition at line 253 of file TrackSelectionAlgs.cxx.

253  {
254 
255  const xAOD::MuonContainer* muons ( nullptr );
257 
258 
259  for( const auto *const muon : *muons ) {
260  const auto* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
261 
262  if( !trk ) continue;
263  // remove calo-tagged muons when selecting muons
265  if (muon->muonType() == xAOD::Muon::CaloTagged) continue;
266  }
267  selectTrack( trk );
268 
269  }
270 
271  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total muons = " << muons->size() );
272  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() );
273 
274  return StatusCode::SUCCESS;
275  }

◆ selectTracksInDet()

StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksInDet ( )
private

Definition at line 225 of file TrackSelectionAlgs.cxx.

225  {
226 
227  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": begin" );
228 
229  //--------------------------------------------------------
230  // Extract tracks from xAOD::TrackParticle container
231  //
232 
233  const xAOD::TrackParticleContainer* trackParticleContainer ( nullptr );
234  ATH_CHECK( evtStore()->retrieve( trackParticleContainer, m_jp.TrackLocation) );
235 
236  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Extracted xAOD::TrackParticle number=" << trackParticleContainer->size() );
237 
238  if( m_jp.FillNtuple )
239  m_ntupleVars->get<unsigned int>( "NumAllTrks" ) = static_cast<int>( trackParticleContainer->size() );
240 
241 
242  // Loop over tracks
243  for( const auto *trk : *trackParticleContainer ) { selectTrack( trk ); }
244 
245  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total ID tracks = " << trackParticleContainer->size() );
246  ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() );
247 
248  return StatusCode::SUCCESS;
249  }

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

◆ 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" );
78  return AlgConsts::maxValue;
79  }
80  }

◆ 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, PyAthena::Alg, and AthHistogramAlgorithm.

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 }

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

908  {
909  // Fill TrkInVrt with vertex IDs of each track
910 
911  trackToVertexMap.clear();
912 
913  for( size_t iv = 0; iv<workVerticesContainer->size(); iv++ ) {
914 
915  WrkVrt& vertex = workVerticesContainer->at(iv);
916 
917  auto& trackIndices = vertex.selectedTrackIndices;
918  if( !vertex.isGood ) continue;
919  if( trackIndices.size() < 2 ) continue;
920 
921  for( auto& index : trackIndices ) {
922  trackToVertexMap[index].emplace_back( iv );
923  }
924  }
925 
926  for( auto& pair: trackToVertexMap ) {
927  std::string msg = Form("track index [%ld]: vertices = (", pair.first);
928  for( auto& v : pair.second ) {
929  msg += Form("%ld, ", v);
930  }
931  msg += ")";
932  if( pair.second.size() >=2 ) ATH_MSG_VERBOSE(" >> " << __FUNCTION__ << ": " << msg );
933  }
934 
935  }

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

Member Data Documentation

◆ m_associatedTracks

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

Definition at line 256 of file VrtSecInclusive.h.

◆ m_atlasId

const AtlasDetectorID* VKalVrtAthena::VrtSecInclusive::m_atlasId = nullptr
private

Definition at line 278 of file VrtSecInclusive.h.

◆ m_BeamPosition

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

Definition at line 258 of file VrtSecInclusive.h.

◆ m_checkPatternStrategy

std::string VKalVrtAthena::VrtSecInclusive::m_checkPatternStrategy
private

Definition at line 282 of file VrtSecInclusive.h.

◆ m_decor_d0_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_d0_wrtSVs
private

Definition at line 297 of file VrtSecInclusive.h.

◆ m_decor_d0err_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_d0err_wrtSVs
private

Definition at line 302 of file VrtSecInclusive.h.

◆ m_decor_eta_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_eta_wrtSVs
private

Definition at line 300 of file VrtSecInclusive.h.

◆ m_decor_is_svtrk_final

std::unique_ptr< SG::AuxElement::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_is_svtrk_final
private

Definition at line 289 of file VrtSecInclusive.h.

◆ m_decor_isAssociated

std::unique_ptr< SG::AuxElement::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_isAssociated
private

Definition at line 288 of file VrtSecInclusive.h.

◆ m_decor_isSelected

std::unique_ptr< SG::AuxElement::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_isSelected
private

Definition at line 287 of file VrtSecInclusive.h.

◆ m_decor_phi_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_phi_wrtSVs
private

Definition at line 301 of file VrtSecInclusive.h.

◆ m_decor_pt_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_pt_wrtSVs
private

Definition at line 299 of file VrtSecInclusive.h.

◆ m_decor_svLink

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

Definition at line 306 of file VrtSecInclusive.h.

◆ m_decor_z0_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_z0_wrtSVs
private

Definition at line 298 of file VrtSecInclusive.h.

◆ m_decor_z0err_wrtSVs

std::unique_ptr< IPDecoratorType > VKalVrtAthena::VrtSecInclusive::m_decor_z0err_wrtSVs
private

Definition at line 303 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_eventInfoKey

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

Read/Write Handle Keys.

Definition at line 293 of file VrtSecInclusive.h.

◆ 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 369 of file VrtSecInclusive.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> VKalVrtAthena::VrtSecInclusive::m_extrapolator
private

Definition at line 271 of file VrtSecInclusive.h.

◆ m_fitSvc

ToolHandle<Trk::ITrkVKalVrtFitter> VKalVrtAthena::VrtSecInclusive::m_fitSvc
private

Definition at line 265 of file VrtSecInclusive.h.

◆ m_hists

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

Definition at line 318 of file VrtSecInclusive.h.

◆ m_incomp

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

Definition at line 371 of file VrtSecInclusive.h.

◆ m_jp

struct JobProperties VKalVrtAthena::VrtSecInclusive::m_jp
private

Definition at line 95 of file VrtSecInclusive.h.

◆ m_leptonicTracks

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

Definition at line 257 of file VrtSecInclusive.h.

◆ m_matchMap

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

Definition at line 374 of file VrtSecInclusive.h.

◆ m_ntupleVars

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

Definition at line 315 of file VrtSecInclusive.h.

◆ m_patternStrategyFuncs

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

Definition at line 284 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 275 of file VrtSecInclusive.h.

◆ m_pixelId

const PixelID* VKalVrtAthena::VrtSecInclusive::m_pixelId = nullptr
private

Definition at line 279 of file VrtSecInclusive.h.

◆ m_primaryVertices

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

Definition at line 253 of file VrtSecInclusive.h.

◆ 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 276 of file VrtSecInclusive.h.

◆ m_sctId

const SCT_ID* VKalVrtAthena::VrtSecInclusive::m_sctId = nullptr
private

Definition at line 280 of file VrtSecInclusive.h.

◆ m_selectedTracks

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

Definition at line 255 of file VrtSecInclusive.h.

◆ m_thePV

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

Definition at line 254 of file VrtSecInclusive.h.

◆ m_tracingTruthVertices

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

Definition at line 563 of file VrtSecInclusive.h.

◆ m_trackSelectionAlgs

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

Definition at line 389 of file VrtSecInclusive.h.

◆ m_trackSelectionFuncs

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

Definition at line 393 of file VrtSecInclusive.h.

◆ m_trackToVertexIPEstimatorTool

ToolHandle<Trk::ITrackToVertexIPEstimator> VKalVrtAthena::VrtSecInclusive::m_trackToVertexIPEstimatorTool
private

Definition at line 270 of file VrtSecInclusive.h.

◆ m_trackToVertexTool

ToolHandle< Reco::ITrackToVertex > VKalVrtAthena::VrtSecInclusive::m_trackToVertexTool
private

get a handle on the Track to Vertex tool

Definition at line 269 of file VrtSecInclusive.h.

◆ m_tree_Vert

TTree* VKalVrtAthena::VrtSecInclusive::m_tree_Vert
private

Definition at line 314 of file VrtSecInclusive.h.

◆ m_trkDecors

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

Definition at line 290 of file VrtSecInclusive.h.

◆ m_truthToTrack

ToolHandle<Trk::ITruthToTrack> VKalVrtAthena::VrtSecInclusive::m_truthToTrack
private

Definition at line 266 of file VrtSecInclusive.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexingAlgorithms

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

Definition at line 437 of file VrtSecInclusive.h.

◆ m_vertexingAlgorithmStep

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

Definition at line 438 of file VrtSecInclusive.h.

◆ m_vertexingStatus

int VKalVrtAthena::VrtSecInclusive::m_vertexingStatus = 0
private

Definition at line 250 of file VrtSecInclusive.h.

◆ m_vertexingStatusKey

SG::WriteDecorHandleKey<xAOD::EventInfo> VKalVrtAthena::VrtSecInclusive::m_vertexingStatusKey
private

Definition at line 294 of file VrtSecInclusive.h.

◆ m_vertexMapper

ToolHandle<Trk::IVertexMapper> VKalVrtAthena::VrtSecInclusive::m_vertexMapper
private

Definition at line 272 of file VrtSecInclusive.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
VKalVrtAthena::VrtSecInclusive::JobProperties::doSelectTracksFromMuons
bool doSelectTracksFromMuons
Definition: VrtSecInclusive.h:220
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
VKalVrtAthena::VrtSecInclusive::JobProperties::extrapPV
bool extrapPV
Definition: VrtSecInclusive.h:127
Trk::pixelEndCap2
@ pixelEndCap2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:239
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
VKalVrtAthena::VrtSecInclusive::setIntersection
void setIntersection(Track *trk, IntersectionPos *bec, const Trk::Perigee *per)
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
VKalVrtAthena::VrtSecInclusive::JobProperties::TrkChi2Cut
double TrkChi2Cut
Definition: VrtSecInclusive.h:158
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
SG::WriteDecorHandleKey< xAOD::EventInfo >
used
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
xAOD::AuxContainerBase::setStore
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
Definition: AuxContainerBase.cxx:195
VKalVrtAthena::VrtSecInclusive::selectTrack_LRTR3Cut
bool selectTrack_LRTR3Cut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:102
VKalVrtAthena::VrtSecInclusive::m_hists
std::map< std::string, TH1 * > m_hists
Definition: VrtSecInclusive.h:318
VKalVrtAthena::AlgConsts::infinitesimal
constexpr double infinitesimal
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:19
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
VKalVrtAthena::VrtSecInclusive::k_qOverP
@ k_qOverP
Definition: VrtSecInclusive.h:433
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
test_pyathena.eta
eta
Definition: test_pyathena.py:10
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
VKalVrtAthena::VrtSecInclusive::distanceBetweenVertices
double distanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the physical distance
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:112
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
VKalVrtAthena::VrtSecInclusive::JobProperties::doPVcompatibilityCut
bool doPVcompatibilityCut
Definition: VrtSecInclusive.h:176
VKalVrtAthena::VrtSecInclusive::m_pixelCondSummaryTool
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Condition service.
Definition: VrtSecInclusive.h:275
VKalVrtAthena::VrtSecInclusive::JobProperties::do_d0errCut
bool do_d0errCut
Definition: VrtSecInclusive.h:141
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertexOuterOnly
bool checkTrackHitPatternToVertexOuterOnly(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2189
VKalVrtAthena::VrtSecInclusive::patternCheck
bool patternCheck(const uint32_t &pattern, const Amg::Vector3D &vertex)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2152
algorithm
std::string algorithm
Definition: hcg.cxx:82
SGout2dot.alg
alg
Definition: SGout2dot.py:243
get_generator_info.result
result
Definition: get_generator_info.py:21
maxValue
#define maxValue(current, test)
Definition: CompoundLayerMaterialCreator.h:22
VKalVrtAthena::VrtSecInclusive::m_vertexMapper
ToolHandle< Trk::IVertexMapper > m_vertexMapper
Definition: VrtSecInclusive.h:272
VKalVrtAthena::VrtSecInclusive::m_vertexingAlgorithmStep
unsigned m_vertexingAlgorithmStep
Definition: VrtSecInclusive.h:438
VKalVrtAthena::VrtSecInclusive::dumpTruthInformation
void dumpTruthInformation()
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2359
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:272
VKalVrtAthena::VrtSecInclusive::JobProperties::associateChi2Cut
double associateChi2Cut
Definition: VrtSecInclusive.h:210
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
VKalVrtAthena::VrtSecInclusive::JobProperties::passThroughTrackSelection
bool passThroughTrackSelection
Definition: VrtSecInclusive.h:129
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
VKalVrtAthena::VrtSecInclusive::selectTrack_pTCut
bool selectTrack_pTCut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:34
VKalVrtAthena::VrtSecInclusive::m_decor_d0_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_d0_wrtSVs
Definition: VrtSecInclusive.h:297
VKalVrtAthena::VrtSecInclusive::JobProperties::doSelectIDAndGSFTracks
bool doSelectIDAndGSFTracks
Definition: VrtSecInclusive.h:223
VKalVrtAthena::VrtSecInclusive::setupNtupleVariables
StatusCode setupNtupleVariables()
Definition: AANT_Tools.cxx:28
SG::Accessor< char >
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
Pixel
Definition: PixelFEUtils.h:16
Trk::sctEndCap2
@ sctEndCap2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:248
VKalVrtAthena::VrtSecInclusive::JobProperties::associateMaxD0Signif
double associateMaxD0Signif
Definition: VrtSecInclusive.h:207
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
VKalVrtAthena::VrtSecInclusive::JobProperties::doSuggestedRefitOnMerging
bool doSuggestedRefitOnMerging
Definition: VrtSecInclusive.h:182
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
VKalVrtAthena::VrtSecInclusive::k_d0
@ k_d0
Definition: VrtSecInclusive.h:433
VKalVrtAthena::VrtSecInclusive::m_decor_is_svtrk_final
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_is_svtrk_final
Definition: VrtSecInclusive.h:289
Trk::oppositeMomentum
@ oppositeMomentum
Definition: PropDirection.h:21
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
VKalVrtAthena::VrtSecInclusive::m_thePV
const xAOD::Vertex * m_thePV
Definition: VrtSecInclusive.h:254
drawFromPickle.candidates
candidates
Definition: drawFromPickle.py:271
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRTCalib_cfilter.detector
detector
Definition: TRTCalib_cfilter.py:241
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
VKalVrtAthena::VrtSecInclusive::k_phi
@ k_phi
Definition: VrtSecInclusive.h:433
VKalVrtAthena::VrtSecInclusive::improveVertexChi2
double improveVertexChi2(WrkVrt &)
attempt to improve the vertex chi2 by removing the most-outlier track one by one until the vertex chi...
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:265
VKalVrtAthena::VrtSecInclusive::JobProperties::secondaryVerticesContainerName
std::string secondaryVerticesContainerName
Definition: VrtSecInclusive.h:118
Trk::sctEndCap0
@ sctEndCap0
and 9 sct discs (on each side)
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:246
VKalVrtAthena::VrtSecInclusive::m_vertexingAlgorithms
std::vector< std::pair< std::string, vertexingAlg > > m_vertexingAlgorithms
Definition: VrtSecInclusive.h:437
VKalVrtAthena::VrtSecInclusive::JobProperties::do_z0signifCut
bool do_z0signifCut
Definition: VrtSecInclusive.h:144
VKalVrtAthena::VrtSecInclusive::findWorstChi2ofMaximallySharedTrack
double findWorstChi2ofMaximallySharedTrack(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &, long int &, long int &)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:939
VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolationAssist
bool checkTrackHitPatternToVertexByExtrapolationAssist(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2200
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
VKalVrtAthena::VrtSecInclusive::track_summary
struct VKalVrtAthena::VrtSecInclusive::track_summary_properties track_summary
VKalVrtAthena::AlgConsts::chi2PerTrackInitValue
constexpr double chi2PerTrackInitValue
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:21
Trk::MappedVertex::identifierHash
int identifierHash
Definition: IVertexMapper.h:27
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
VKalVrtAthena::VrtSecInclusive::JobProperties::do_PVvetoCut
bool do_PVvetoCut
Definition: VrtSecInclusive.h:138
VKalVrtAthena::VrtSecInclusive::m_extrapolatedPatternBank
PatternBank m_extrapolatedPatternBank
Definition: VrtSecInclusive.h:369
VKalVrtAthena::GeoModel::Run2
@ Run2
Definition: VrtSecInclusive.h:72
VKalVrtAthena::AlgConsts::invalidInt
constexpr int invalidInt
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:24
VKalVrtAthena::VrtSecInclusive::m_ntupleVars
std::unique_ptr< NtupleVars > m_ntupleVars
Definition: VrtSecInclusive.h:315
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
checkFileSG.nAlgs
nAlgs
Definition: checkFileSG.py:77
VKalVrtAthena::VrtSecInclusive::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: VrtSecInclusive.h:271
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
VKalVrtAthena::VrtSecInclusive::JobProperties::associatePtCut
double associatePtCut
Definition: VrtSecInclusive.h:209
VKalVrtAthena::VrtSecInclusive::mergeVertices
StatusCode mergeVertices(WrkVrt &destination, WrkVrt &source)
the 2nd vertex is merged into the 1st vertex.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:452
VKalVrtAthena::VrtSecInclusive::JobProperties::truthParticleContainerName
std::string truthParticleContainerName
Definition: VrtSecInclusive.h:112
test_pyathena.pt
pt
Definition: test_pyathena.py:11
VKalVrtAthena::VrtSecInclusive::patternCheckRun1
static bool patternCheckRun1(const uint32_t &pattern, const Amg::Vector3D &vertex)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:1842
VKalVrtAthena::VrtSecInclusive::associateNonSelectedTracks
StatusCode associateNonSelectedTracks(std::vector< WrkVrt > *)
in addition to selected tracks, associate as much tracks as possible
Definition: VertexingAlgs.cxx:1061
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
VKalVrtAthena::VrtSecInclusive::FINAL
@ FINAL
Definition: VrtSecInclusive.h:490
VKalVrtAthena::VrtSecInclusive::m_pixelId
const PixelID * m_pixelId
Definition: VrtSecInclusive.h:279
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Trk::sctBarrel0
@ sctBarrel0
four sct barrel layers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:241
VKalVrtAthena::VrtSecInclusive::m_decor_z0_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_z0_wrtSVs
Definition: VrtSecInclusive.h:298
xAOD::TrackParticle_v1::chiSquared
float chiSquared() const
Returns the of the overall track fit.
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
VKalVrtAthena::VrtSecInclusive::k_z0
@ k_z0
Definition: VrtSecInclusive.h:433
Trk::MappedVertex
Definition: IVertexMapper.h:23
VKalVrtAthena::VrtSecInclusive::m_associatedTracks
std::unique_ptr< std::vector< const xAOD::TrackParticle * > > m_associatedTracks
Definition: VrtSecInclusive.h:256
VKalVrtAthena::VrtSecInclusive::JobProperties::TrkPtCut
double TrkPtCut
Definition: VrtSecInclusive.h:159
VKalVrtAthena::VrtSecInclusive::getTrkGenParticle
static const xAOD::TruthParticle * getTrkGenParticle(const xAOD::TrackParticle *)
Definition: TruthAlgs.cxx:26
VKalVrtAthena::VrtSecInclusive::JobProperties::mcTrkResolution
double mcTrkResolution
Definition: VrtSecInclusive.h:237
Trk::z0
@ z0
Definition: ParamDefs.h:64
VKalVrtAthena::VrtSecInclusive::JobProperties::SelVrtChi2Cut
double SelVrtChi2Cut
Definition: VrtSecInclusive.h:189
VKalVrtAthena::VrtSecInclusive::JobProperties::twoTrVrtMinDistFromPV
double twoTrVrtMinDistFromPV
Definition: VrtSecInclusive.h:197
ReadBchFromCool.barrel
barrel
Definition: ReadBchFromCool.py:405
VKalVrtAthena::VrtSecInclusive::JobProperties::augVerString
std::string augVerString
Definition: VrtSecInclusive.h:114
athena.value
value
Definition: athena.py:124
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
VKalVrtAthena::VrtSecInclusive::reassembleVertices
StatusCode reassembleVertices(std::vector< WrkVrt > *)
attempt to merge vertices when all tracks of a vertex A is close to vertex B in terms of impact param...
Definition: VertexingAlgs.cxx:940
VKalVrtAthena::VrtSecInclusive::JobProperties::doFinalImproveChi2
bool doFinalImproveChi2
Definition: VrtSecInclusive.h:187
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
VKalVrtAthena::VrtSecInclusive::k_nTPU
@ k_nTPU
Definition: VrtSecInclusive.h:434
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
VKalVrtAthena::VrtSecInclusive::JobProperties::doRemoveCaloTaggedMuons
bool doRemoveCaloTaggedMuons
Definition: VrtSecInclusive.h:221
Trk::DiscSurface
Definition: DiscSurface.h:54
VKalVrtAthena::VrtSecInclusive::patternCheckRun2
static bool patternCheckRun2(const uint32_t &pattern, const Amg::Vector3D &vertex)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:1432
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
VKalVrtAthena::VrtSecInclusive::trackClassification
void trackClassification(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:907
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
VKalVrtAthena::VrtSecInclusive::JobProperties::CutTightTRTHits
int CutTightTRTHits
Definition: VrtSecInclusive.h:170
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
VKalVrtAthena::VrtSecInclusive::JobProperties::associateMinDistanceToPV
double associateMinDistanceToPV
Definition: VrtSecInclusive.h:206
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
VKalVrtAthena::VrtSecInclusive::JobProperties::d0TrkPVSignifCut
double d0TrkPVSignifCut
Definition: VrtSecInclusive.h:149
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
dumpTruth.statusCode
statusCode
Definition: dumpTruth.py:85
VKalVrtAthena::VrtSecInclusive::JobProperties::pvCompatibilityCut
double pvCompatibilityCut
Definition: VrtSecInclusive.h:188
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
VKalVrtAthena::VrtSecInclusive::JobProperties::removeFakeVrt
bool removeFakeVrt
Definition: VrtSecInclusive.h:178
Trk::sctEndCap5
@ sctEndCap5
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:251
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition: VertexContainer.h:14
VKalVrtAthena::VrtSecInclusive::selectTrack_hitPatternTight
bool selectTrack_hitPatternTight(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:76
VKalVrtAthena::VrtSecInclusive::JobProperties::mcEventContainerName
std::string mcEventContainerName
Definition: VrtSecInclusive.h:113
IDTPM::nPixelHits
float nPixelHits(const U &p)
Definition: TrackParametersHelper.h:354
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
VKalVrtAthena::VrtSecInclusive::rearrangeTracks
StatusCode rearrangeTracks(std::vector< WrkVrt > *)
Definition: VertexingAlgs.cxx:717
VKalVrtAthena::IntersectionPos::endcap
@ endcap
Definition: IntersectionPos.h:29
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
VKalVrtAthena::VrtSecInclusive::selectTrack_hitPattern
bool selectTrack_hitPattern(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:38
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
VKalVrtAthena::VrtSecInclusive::JobProperties::twoTrkVtxFormingD0Cut
double twoTrkVtxFormingD0Cut
Definition: VrtSecInclusive.h:155
VKalVrtAthena::VrtSecInclusive::JobProperties::doAugmentDVimpactParametersToMuons
bool doAugmentDVimpactParametersToMuons
Definition: VrtSecInclusive.h:233
VKalVrtAthena::VrtSecInclusive::JobProperties::VertexMergeCut
double VertexMergeCut
Definition: VrtSecInclusive.h:192
VKalVrtAthena::VrtSecInclusive::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Read/Write Handle Keys.
Definition: VrtSecInclusive.h:293
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::sctBarrel3
@ sctBarrel3
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:244
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
VKalVrtAthena::VrtSecInclusive::JobProperties::z0TrkPVSignifCut
double z0TrkPVSignifCut
Definition: VrtSecInclusive.h:152
VKalVrtAthena::VrtSecInclusive::JobProperties::FillIntermediateVertices
bool FillIntermediateVertices
Definition: VrtSecInclusive.h:124
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
VKalVrtAthena::VrtSecInclusive::m_truthToTrack
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
Definition: VrtSecInclusive.h:266
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
VKalVrtAthena::VrtSecInclusive::m_primaryVertices
const xAOD::VertexContainer * m_primaryVertices
Definition: VrtSecInclusive.h:253
VKalVrtAthena::VrtSecInclusive::JobProperties::doMergeByShuffling
bool doMergeByShuffling
Definition: VrtSecInclusive.h:181
Trk::MappedVertex::layerIndex
int layerIndex
Definition: IVertexMapper.h:30
xAOD::TrackParticle_v1::hitPattern
uint32_t hitPattern() const
VKalVrtAthena::VrtSecInclusive::ExtrapolatedPoint
std::tuple< const TVector3, Detector, Bec, Layer, Flag > ExtrapolatedPoint
Definition: VrtSecInclusive.h:365
VKalVrtAthena::VrtSecInclusive::selectInDetAndGSFTracks
StatusCode selectInDetAndGSFTracks()
Definition: TrackSelectionAlgs.cxx:302
VKalVrtAthena::VrtSecInclusive::m_sctCondSummaryTool
ToolHandle< IInDetConditionsTool > m_sctCondSummaryTool
Definition: VrtSecInclusive.h:276
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
VKalVrtAthena::VrtSecInclusive::JobProperties::ElectronLocation
std::string ElectronLocation
Definition: VrtSecInclusive.h:110
VKalVrtAthena::VrtSecInclusive::k_d0d0
@ k_d0d0
Definition: VrtSecInclusive.h:434
VKalVrtAthena::VrtSecInclusive::setupNtuple
StatusCode setupNtuple()
Definition: AANT_Tools.cxx:218
VKalVrtAthena::VrtSecInclusive::m_trackToVertexIPEstimatorTool
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
Definition: VrtSecInclusive.h:270
Trk::pixelEndCap0
@ pixelEndCap0
three pixel discs (on each side)
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:237
VKalVrtAthena::isAssociatedToVertices
bool isAssociatedToVertices(const xAOD::TrackParticle *trk, const xAOD::VertexContainer *vertices)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:34
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
VKalVrtAthena::VrtSecInclusive::JobProperties::CutSharedHits
int CutSharedHits
Definition: VrtSecInclusive.h:167
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
VKalVrtAthena::VrtSecInclusive::JobProperties::FillHist
bool FillHist
Definition: VrtSecInclusive.h:122
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
VKalVrtAthena::VrtSecInclusive::JobProperties::CutPixelHits
int CutPixelHits
Definition: VrtSecInclusive.h:164
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:262
python.handimod.now
now
Definition: handimod.py:675
VKalVrtAthena::VrtSecInclusive::m_fitSvc
ToolHandle< Trk::ITrkVKalVrtFitter > m_fitSvc
Definition: VrtSecInclusive.h:265
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
VKalVrtAthena::VrtSecInclusive::JobProperties::mergeByShufflingMaxSignificance
double mergeByShufflingMaxSignificance
Definition: VrtSecInclusive.h:214
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
VKalVrtAthena::VrtSecInclusive::JobProperties::do_z0Cut
bool do_z0Cut
Definition: VrtSecInclusive.h:140
VKalVrtAthena::VrtSecInclusive::JobProperties::do_z0errCut
bool do_z0errCut
Definition: VrtSecInclusive.h:142
VKalVrtAthena::VrtSecInclusive::REASSEMBLE
@ REASSEMBLE
Definition: VrtSecInclusive.h:490
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
VKalVrtAthena::VrtSecInclusive::JobProperties::SAloneTRT
bool SAloneTRT
Definition: VrtSecInclusive.h:135
VKalVrtAthena::VrtSecInclusive::JobProperties::do_d0signifCut
bool do_d0signifCut
Definition: VrtSecInclusive.h:143
VKalVrtAthena::VrtSecInclusive::JobProperties::trkExtrapolator
int trkExtrapolator
Definition: VrtSecInclusive.h:173
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
VKalVrtAthena::VrtSecInclusive::extractIncompatibleTrackPairs
StatusCode extractIncompatibleTrackPairs(std::vector< WrkVrt > *)
related to the graph method and verte finding
Definition: VertexingAlgs.cxx:39
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
VKalVrtAthena::VrtSecInclusive::JobProperties::doTwoTrSoftBtag
bool doTwoTrSoftBtag
Definition: VrtSecInclusive.h:195
VKalVrtAthena::VrtSecInclusive::findMinVerticesPair
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.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:374
xAOD::VertexAuxContainer
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
Definition: VertexAuxContainer.h:19
Trk::pixelBarrel2
@ pixelBarrel2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:234
lumiFormat.i
int i
Definition: lumiFormat.py:85
VKalVrtAthena::VrtSecInclusive::JobProperties::truncateWrkVertices
bool truncateWrkVertices
Definition: VrtSecInclusive.h:203
VKalVrtAthena::VrtSecInclusive::JobProperties::doAugmentDVimpactParametersToElectrons
bool doAugmentDVimpactParametersToElectrons
Definition: VrtSecInclusive.h:234
VKalVrtAthena::GeoModel::Run1
@ Run1
Definition: VrtSecInclusive.h:72
VKalVrtAthena::VrtSecInclusive::mergeByShuffling
StatusCode mergeByShuffling(std::vector< WrkVrt > *)
attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior ...
Definition: VertexingAlgs.cxx:1267
VKalVrtAthena::VrtSecInclusive::extrapolatedPattern
ExtrapolatedPattern * extrapolatedPattern(const xAOD::TrackParticle *, enum Trk::PropDirection)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:1103
VKalVrtAthena::VrtSecInclusive::JobProperties::reassembleMaxImpactParameterD0
double reassembleMaxImpactParameterD0
Definition: VrtSecInclusive.h:212
Trk::theta
@ theta
Definition: ParamDefs.h:66
VKalVrtAthena::VrtSecInclusive::JobProperties::all2trksVerticesContainerName
std::string all2trksVerticesContainerName
Definition: VrtSecInclusive.h:117
VKalVrtAthena::VrtSecInclusive::JobProperties::SelTrkMaxCutoff
unsigned int SelTrkMaxCutoff
Definition: VrtSecInclusive.h:134
Trk::pixelEndCap1
@ pixelEndCap1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:238
VKalVrtAthena::VrtSecInclusive::JobProperties::VertexMergeFinalDistScaling
double VertexMergeFinalDistScaling
Definition: VrtSecInclusive.h:191
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
VKalVrtAthena::VrtSecInclusive::JobProperties::do_d0Cut
bool do_d0Cut
Definition: VrtSecInclusive.h:139
xAOD::VxType::SecVtx
@ SecVtx
Secondary vertex.
Definition: TrackingPrimitives.h:572
DMTest::links
links
Definition: CLinks_v1.cxx:22
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
VKalVrtAthena::VrtSecInclusive::k_theta
@ k_theta
Definition: VrtSecInclusive.h:433
VKalVrtAthena::VrtSecInclusive::processPrimaryVertices
StatusCode processPrimaryVertices()
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:818
VKalVrtAthena::VrtSecInclusive::JobProperties::removeFakeVrtLate
bool removeFakeVrtLate
Definition: VrtSecInclusive.h:179
Trk::CylinderSurface
Definition: CylinderSurface.h:55
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
VKalVrtAthena::VrtSecInclusive::JobProperties::doFastMode
bool doFastMode
Definition: VrtSecInclusive.h:131
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
VKalVrtAthena::VrtSecInclusive::JobProperties::CutTRTHits
int CutTRTHits
Definition: VrtSecInclusive.h:168
VKalVrtAthena::VrtSecInclusive::m_trackSelectionFuncs
std::vector< CutFunc > m_trackSelectionFuncs
Definition: VrtSecInclusive.h:393
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
master.flag
bool flag
Definition: master.py:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
VKalVrtAthena::VrtSecInclusive::JobProperties::doAssociateNonSelectedTracks
bool doAssociateNonSelectedTracks
Definition: VrtSecInclusive.h:186
calibdata.exception
exception
Definition: calibdata.py:496
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
VKalVrtAthena::VrtSecInclusive::refitVertexWithSuggestion
StatusCode refitVertexWithSuggestion(WrkVrt &, const Amg::Vector3D &)
refit the vertex with suggestion
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:585
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
VKalVrtAthena::VrtSecInclusive::JobProperties::doMagnetMerging
bool doMagnetMerging
Definition: VrtSecInclusive.h:183
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::sctEndCap3
@ sctEndCap3
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:249
VKalVrtAthena::VrtSecInclusive::JobProperties::doIntersectionPos
bool doIntersectionPos
Definition: VrtSecInclusive.h:125
VKalVrtAthena::VrtSecInclusive::JobProperties::doRemoveNonLeptonVertices
bool doRemoveNonLeptonVertices
Definition: VrtSecInclusive.h:224
Trk::sctEndCap8
@ sctEndCap8
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:254
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::sctEndCap7
@ sctEndCap7
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:253
TRT_PAI_gasdata::SC
const float SC[NC]
Cross sections for Carbon.
Definition: TRT_PAI_gasdata.h:255
VKalVrtAthena::VrtSecInclusive::fillTrackSummary
static void fillTrackSummary(track_summary &summary, const xAOD::TrackParticle *trk)
cretrieve the track hit information
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:1086
VKalVrtAthena::VrtSecInclusive::selectTrack_d0Cut
bool selectTrack_d0Cut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:28
Trk::pixelBarrel3
@ pixelBarrel3
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:235
VKalVrtAthena::VrtSecInclusive::m_trackSelectionAlgs
std::vector< TrackSelectionAlg > m_trackSelectionAlgs
Definition: VrtSecInclusive.h:389
VKalVrtAthena::AlgConsts::maxValue
constexpr double maxValue
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:20
std::remove_if
std::reverse_iterator< DataModel_detail::iterator< DVL > > remove_if(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Predicate pred)
Specialization of remove_if for DataVector/List.
Definition: DVL_algorithms.h:114
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
VKalVrtAthena::VrtSecInclusive::m_vertexingStatus
int m_vertexingStatus
Definition: VrtSecInclusive.h:250
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
VKalVrtAthena::vtxVtxDistance
double vtxVtxDistance(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:55
VKalVrtAthena::VrtSecInclusive::significanceBetweenVertices
double significanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the significance (Mahalanobis distance) between two reconstructed vertices
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:61
VKalVrtAthena::VrtSecInclusive::selectTracksInDet
StatusCode selectTracksInDet()
Definition: TrackSelectionAlgs.cxx:225
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
VKalVrtAthena::VrtSecInclusive::JobProperties::mergeByShufflingAllowance
double mergeByShufflingAllowance
Definition: VrtSecInclusive.h:215
VKalVrtAthena::VrtSecInclusive::JobProperties::d0TrkPVDstMinCut
double d0TrkPVDstMinCut
Definition: VrtSecInclusive.h:147
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:270
python.compareNtuple.nGood
nGood
Definition: compareNtuple.py:55
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
xAOD::TruthParticle_v1::barcode
int barcode() const
Barcode.
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
IDTPM::nSCTHoles
float nSCTHoles(const U &p)
Definition: TrackParametersHelper.h:403
VKalVrtAthena::VrtSecInclusive::m_decor_z0err_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_z0err_wrtSVs
Definition: VrtSecInclusive.h:303
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
VKalVrtAthena::VrtSecInclusive::patternCheckOuterOnly
bool patternCheckOuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2165
VKalVrtAthena::VrtSecInclusive::refitAndSelectGoodQualityVertices
StatusCode refitAndSelectGoodQualityVertices(std::vector< WrkVrt > *)
finalization of the vertex and store to xAOD::VertexContainer
Definition: VertexingAlgs.cxx:1472
VKalVrtAthena::VrtSecInclusive::m_atlasId
const AtlasDetectorID * m_atlasId
Definition: VrtSecInclusive.h:278
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
VKalVrtAthena::VrtSecInclusive::m_patternStrategyFuncs
std::map< std::string, PatternStrategyFunc > m_patternStrategyFuncs
Definition: VrtSecInclusive.h:284
VKalVrtAthena::VrtSecInclusive::m_trackToVertexTool
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
get a handle on the Track to Vertex tool
Definition: VrtSecInclusive.h:269
VKalVrtAthena::VrtSecInclusive::JobProperties::doSelectTracksFromElectrons
bool doSelectTracksFromElectrons
Definition: VrtSecInclusive.h:222
VKalVrtAthena::VrtSecInclusive::selectTrack_z0Cut
bool selectTrack_z0Cut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:29
SCT
Definition: SCT_ChipUtils.h:14
VKalVrtAthena::VrtSecInclusive::JobProperties::geoModel
int geoModel
Definition: VrtSecInclusive.h:106
VKalVrtAthena::VrtSecInclusive::JobProperties::MuonLocation
std::string MuonLocation
Definition: VrtSecInclusive.h:109
VKalVrtAthena::VrtSecInclusive::JobProperties::doWildMerging
bool doWildMerging
Definition: VrtSecInclusive.h:184
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:56
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
VKalVrtAthena::VrtSecInclusive::selectTrack_d0errCut
bool selectTrack_d0errCut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:30
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
VKalVrtAthena::VrtSecInclusive::m_vertexingStatusKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_vertexingStatusKey
Definition: VrtSecInclusive.h:294
VKalVrtAthena::VrtSecInclusive::m_decor_pt_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_pt_wrtSVs
Definition: VrtSecInclusive.h:299
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
VKalVrtAthena::VrtSecInclusive::categorizeVertexTruthTopology
StatusCode categorizeVertexTruthTopology(xAOD::Vertex *vertex)
Definition: TruthAlgs.cxx:44
VKalVrtAthena::VrtSecInclusive::getSVImpactParameters
bool getSVImpactParameters(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex, std::vector< double > &impactParameters, std::vector< double > &impactParErrors)
get secondary vertex impact parameters
Definition: VertexingAlgs.cxx:2077
Trk::pixelBarrel1
@ pixelBarrel1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:233
VKalVrtAthena::VrtSecInclusive::SHUFFLE2
@ SHUFFLE2
Definition: VrtSecInclusive.h:490
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
xAOD::TrackParticle_v1::patternRecoInfo
std::bitset< NumberOfTrackRecoInfo > patternRecoInfo() const
Access method for pattern recognition algorithm.
Definition: TrackParticle_v1.cxx:706
VKalVrtAthena::VrtSecInclusive::k_z0z0
@ k_z0z0
Definition: VrtSecInclusive.h:434
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
VKalVrtAthena::VrtSecInclusive::Flag
int Flag
Definition: VrtSecInclusive.h:364
VKalVrtAthena::PhysConsts::mass_electron
constexpr double mass_electron
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:14
VKalVrtAthena::VrtSecInclusive::m_decor_svLink
std::unique_ptr< VertexELType > m_decor_svLink
Definition: VrtSecInclusive.h:306
python.selection.number
number
Definition: selection.py:20
Trk::sctEndCap4
@ sctEndCap4
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:250
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
VKalVrtAthena::VrtSecInclusive::refitVertex
StatusCode refitVertex(WrkVrt &)
refit the vertex.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:496
Trk::d0
@ d0
Definition: ParamDefs.h:63
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
VKalVrtAthena::VrtSecInclusive::JobProperties::improveChi2ProbThreshold
double improveChi2ProbThreshold
Definition: VrtSecInclusive.h:217
test_pyhistsvc_write.Output
Output
Definition: test_pyhistsvc_write.py:15
VKalVrtAthena::PhysConsts::mass_chargedPion
constexpr double mass_chargedPion
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:13
Trk::sctEndCap1
@ sctEndCap1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:247
VKalVrtAthena::VrtSecInclusive::ExtrapolatedPattern
std::vector< ExtrapolatedPoint > ExtrapolatedPattern
Definition: VrtSecInclusive.h:366
VKalVrtAthena::VrtSecInclusive::JobProperties::PrimVrtLocation
std::string PrimVrtLocation
Definition: VrtSecInclusive.h:111
VKalVrtAthena::VrtSecInclusive::fillAANT_SelectedBaseTracks
StatusCode fillAANT_SelectedBaseTracks()
Definition: AANT_Tools.cxx:263
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
VKalVrtAthena::VrtSecInclusive::JobProperties::CutSctHits
int CutSctHits
Definition: VrtSecInclusive.h:163
VKalVrtAthena::VrtSecInclusive::JobProperties::twoTrVrtAngleCut
double twoTrVrtAngleCut
Definition: VrtSecInclusive.h:196
VKalVrtAthena::VrtSecInclusive::JobProperties::doMapToLocal
bool doMapToLocal
Definition: VrtSecInclusive.h:126
VKalVrtAthena::VrtSecInclusive::selectTrack
void selectTrack(const xAOD::TrackParticle *)
Vertexing Algorithm Member Functions.
Definition: TrackSelectionAlgs.cxx:136
VKalVrtAthena::VrtSecInclusive::JobProperties::doMergeFinalVerticesDistance
bool doMergeFinalVerticesDistance
Definition: VrtSecInclusive.h:185
xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF
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...
Definition: ElectronxAODHelpers.cxx:22
VKalVrtAthena::VrtSecInclusive::m_decor_isSelected
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_isSelected
Definition: VrtSecInclusive.h:287
VKalVrtAthena::VrtSecInclusive::nTrkCommon
static size_t nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, const std::pair< unsigned, unsigned > &pairIndex)
returns the number of tracks commonly present in both vertices
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:662
VKalVrtAthena::VrtSecInclusive::JobProperties::doReassembleVertices
bool doReassembleVertices
Definition: VrtSecInclusive.h:180
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
VKalVrtAthena::VrtSecInclusive::m_decor_isAssociated
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_isAssociated
Definition: VrtSecInclusive.h:288
VKalVrtAthena::VrtSecInclusive::JobProperties::associateMaxZ0Signif
double associateMaxZ0Signif
Definition: VrtSecInclusive.h:208
VKalVrtAthena::VrtSecInclusive::m_selectedTracks
std::unique_ptr< std::vector< const xAOD::TrackParticle * > > m_selectedTracks
Definition: VrtSecInclusive.h:255
Trk::sctBarrel2
@ sctBarrel2
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:243
VKalVrtAthena::VrtSecInclusive::JobProperties::d0TrkErrorCut
double d0TrkErrorCut
Definition: VrtSecInclusive.h:153
VKalVrtAthena::VrtSecInclusive::selectTracksFromMuons
StatusCode selectTracksFromMuons()
Definition: TrackSelectionAlgs.cxx:253
VKalVrtAthena::VrtSecInclusive::JobProperties::doTightPVcompatibilityCut
bool doTightPVcompatibilityCut
Definition: VrtSecInclusive.h:177
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
plotIsoValidation.el_trk
el_trk
Definition: plotIsoValidation.py:166
VKalVrtAthena::VrtSecInclusive::selectTracksFromElectrons
StatusCode selectTracksFromElectrons()
Definition: TrackSelectionAlgs.cxx:279
VKalVrtAthena::VrtSecInclusive::m_incomp
std::vector< std::pair< int, int > > m_incomp
Definition: VrtSecInclusive.h:371
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
python.PyAthena.v
v
Definition: PyAthena.py:154
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertex
bool checkTrackHitPatternToVertex(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2178
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
VKalVrtAthena::VrtSecInclusive::patternCheckRun1OuterOnly
static bool patternCheckRun1OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2007
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
DeMoScan.index
string index
Definition: DeMoScan.py:364
VKalVrtAthena::VrtSecInclusive::passedFakeReject
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.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2316
VKalVrtAthena::VrtSecInclusive::JobProperties::z0TrkErrorCut
double z0TrkErrorCut
Definition: VrtSecInclusive.h:154
VKalVrtAthena::VrtSecInclusive::m_leptonicTracks
std::unique_ptr< std::vector< const xAOD::TrackParticle * > > m_leptonicTracks
Definition: VrtSecInclusive.h:257
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition: DVL_algorithms.h:135
ReadBchFromCool.good
good
Definition: ReadBchFromCool.py:433
VKalVrtAthena::AlgConsts::invalidFloat
constexpr double invalidFloat
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:23
VKalVrtAthena::VrtSecInclusive::printWrkSet
void printWrkSet(const std::vector< WrkVrt > *WrkVrtSet, const std::string &name)
print the contents of reconstructed vertices
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:994
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
VKalVrtAthena::VrtSecInclusive::patternCheckRun2OuterOnly
static bool patternCheckRun2OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:1646
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
VKalVrtAthena::VrtSecInclusive::JobProperties::truthParticleFilter
std::string truthParticleFilter
Definition: VrtSecInclusive.h:115
python.HLT.Muon.MuonRecoSequences.isLRT
def isLRT(name)
Definition: MuonRecoSequences.py:65
VKalVrtAthena::VrtSecInclusive::JobProperties::doSelectTracksWithLRTCuts
bool doSelectTracksWithLRTCuts
Definition: VrtSecInclusive.h:230
VKalVrtAthena::VrtSecInclusive::SHUFFLE3
@ SHUFFLE3
Definition: VrtSecInclusive.h:490
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
VKalVrtAthena::VrtSecInclusive::JobProperties::TrackDetachCut
double TrackDetachCut
Definition: VrtSecInclusive.h:193
VKalVrtAthena::VrtSecInclusive::declareProperties
void declareProperties()
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:686
VKalVrtAthena::VrtSecInclusive::JobProperties::CutSiHits
int CutSiHits
Definition: VrtSecInclusive.h:165
VKalVrtAthena::VrtSecInclusive::JobProperties::FillNtuple
bool FillNtuple
Definition: VrtSecInclusive.h:123
VKalVrtAthena::VrtSecInclusive::fillAANT_SecondaryVertices
StatusCode fillAANT_SecondaryVertices(xAOD::VertexContainer *)
Definition: AANT_Tools.cxx:351
Trk::numberOfDetectorTypes
@ numberOfDetectorTypes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:263
Muon::nsw::STGTPSegments::MergedSegmentProperty::dTheta
@ dTheta
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
VKalVrtAthena::VrtSecInclusive::initEvent
virtual StatusCode initEvent()
Definition: VrtSecInclusive.cxx:276
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
VKalVrtAthena::VrtSecInclusive::m_jp
struct JobProperties m_jp
Definition: VrtSecInclusive.h:242
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
VKalVrtAthena::VrtSecInclusive::JobProperties::doTRTPixCut
bool doTRTPixCut
Definition: VrtSecInclusive.h:162
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
python.changerun.pv
pv
Definition: changerun.py:81
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Trk::MappedVertex::valid
bool valid
Definition: IVertexMapper.h:34
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
VKalVrtAthena::VrtSecInclusive::m_sctId
const SCT_ID * m_sctId
Definition: VrtSecInclusive.h:280
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
VKalVrtAthena::VrtSecInclusive::removeInconsistentTracks
void removeInconsistentTracks(WrkVrt &)
Remove inconsistent tracks from vertices.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:2330
VKalVrtAthena::VrtSecInclusive::JobProperties::TrackLocation
std::string TrackLocation
Definition: VrtSecInclusive.h:108
VKalVrtAthena::VrtSecInclusive::JobProperties::z0TrkPVDstMinCut
double z0TrkPVDstMinCut
Definition: VrtSecInclusive.h:150
VKalVrtAthena::VrtSecInclusive::m_matchMap
std::map< const xAOD::TruthVertex *, bool > m_matchMap
Definition: VrtSecInclusive.h:374
xAOD::EgammaHelpers::getOriginalTrackParticle
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
Definition: ElectronxAODHelpers.cxx:11
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
xAOD::TrackParticle_v1::numberDoF
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
Trk::phi
@ phi
Definition: ParamDefs.h:75
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
VKalVrtAthena::VrtSecInclusive::monitorVertexingAlgorithmStep
StatusCode monitorVertexingAlgorithmStep(std::vector< WrkVrt > *, const std::string &name, bool final=false)
monitor the intermediate status of vertexing
Definition: VertexingAlgs.cxx:1970
VKalVrtAthena::VrtSecInclusive::JobProperties::doTruth
bool doTruth
Definition: VrtSecInclusive.h:121
fillSymmetric
void fillSymmetric(size_t i, size_t j, Scalar value)
method to fill elements for a symmetric matrix
Definition: AmgMatrixBasePlugin.h:124
VKalVrtAthena::VrtSecInclusive::JobProperties::CutTightSCTHits
int CutTightSCTHits
Definition: VrtSecInclusive.h:169
VKalVrtAthena::VrtSecInclusive::m_trkDecors
std::map< unsigned, SG::AuxElement::Decorator< float > > m_trkDecors
Definition: VrtSecInclusive.h:290
VKalVrtAthena::VrtSecInclusive::m_decor_eta_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_eta_wrtSVs
Definition: VrtSecInclusive.h:300
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
Trk::pixelBarrel0
@ pixelBarrel0
there are three or four pixel barrel layers (R1/R2)
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:232
plotIsoValidation.mu_trk
mu_trk
Definition: plotIsoValidation.py:153
Trk::sctBarrel1
@ sctBarrel1
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:242
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
VKalVrtAthena::VrtSecInclusive::m_tree_Vert
TTree * m_tree_Vert
Definition: VrtSecInclusive.h:314
VKalVrtAthena::IntersectionPos::barrel
@ barrel
Definition: IntersectionPos.h:29
VKalVrtAthena::VrtSecInclusive::JobProperties::VertexMergeFinalDistCut
double VertexMergeFinalDistCut
Definition: VrtSecInclusive.h:190
VKalVrtAthena::VrtSecInclusive::JobProperties::TruthTrkLen
double TruthTrkLen
Definition: VrtSecInclusive.h:238
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
VKalVrtAthena::VrtSecInclusive::SHUFFLE1
@ SHUFFLE1
Definition: VrtSecInclusive.h:490
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
VKalVrtAthena::VrtSecInclusive::m_tracingTruthVertices
std::vector< const xAOD::TruthVertex * > m_tracingTruthVertices
Definition: VrtSecInclusive.h:563
VKalVrtAthena::VrtSecInclusive::JobProperties::maxWrkVertices
size_t maxWrkVertices
Definition: VrtSecInclusive.h:204
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
VKalVrtAthena::VrtSecInclusive::selectTrack_z0errCut
bool selectTrack_z0errCut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:31
minValue
#define minValue(current, test)
Definition: CompoundLayerMaterialCreator.h:21
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
VKalVrtAthena::VrtSecInclusive::JobProperties::z0TrkPVDstMaxCut
double z0TrkPVDstMaxCut
Definition: VrtSecInclusive.h:151
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
VKalVrtAthena::VrtSecInclusive::JobProperties::reassembleMaxImpactParameterZ0
double reassembleMaxImpactParameterZ0
Definition: VrtSecInclusive.h:213
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
VKalVrtAthena::VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolation
bool checkTrackHitPatternToVertexByExtrapolation(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
Definition: Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx:1171
VKalVrtAthena::VrtSecInclusive::m_decor_d0err_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_d0err_wrtSVs
Definition: VrtSecInclusive.h:302
VKalVrtAthena::VrtSecInclusive::JobProperties::CutBLayHits
int CutBLayHits
Definition: VrtSecInclusive.h:166
VKalVrtAthena::AlgConsts::invalidUnsigned
constexpr unsigned invalidUnsigned
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:25
VKalVrtAthena::VrtSecInclusive::selectTrack_notPVassociated
bool selectTrack_notPVassociated(const xAOD::TrackParticle *) const
track-by-track selection strategies
Definition: TrackSelectionAlgs.cxx:97
Trk::MappedVertex::localPosition
Amg::Vector3D localPosition
Definition: IVertexMapper.h:25
VKalVrtAthena::VrtSecInclusive::m_decor_phi_wrtSVs
std::unique_ptr< IPDecoratorType > m_decor_phi_wrtSVs
Definition: VrtSecInclusive.h:301
VKalVrtAthena::VrtSecInclusive::RECONSTRUCT_NTRK
@ RECONSTRUCT_NTRK
Definition: VrtSecInclusive.h:490
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
VKalVrtAthena::VrtSecInclusive::selectTrack_chi2Cut
bool selectTrack_chi2Cut(const xAOD::TrackParticle *) const
Definition: TrackSelectionAlgs.cxx:35
VKalVrtAthena::VrtSecInclusive::mergeFinalVertices
StatusCode mergeFinalVertices(std::vector< WrkVrt > *)
attempt to merge vertices by lookng at the distance between two vertices
Definition: VertexingAlgs.cxx:1416
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
VKalVrtAthena::VrtSecInclusive::m_checkPatternStrategy
std::string m_checkPatternStrategy
Definition: VrtSecInclusive.h:282
IDTPM::nSiHits
float nSiHits(const U &p)
Definition: TrackParametersHelper.h:427
VKalVrtAthena::VrtSecInclusive::addEventInfo
StatusCode addEventInfo()
Definition: AANT_Tools.cxx:236
VKalVrtAthena::VrtSecInclusive::k_nTP
@ k_nTP
Definition: VrtSecInclusive.h:433
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
fitman.k
k
Definition: fitman.py:528
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
Trk::sctEndCap6
@ sctEndCap6
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:252
VKalVrtAthena::VrtSecInclusive::JobProperties::ImpactWrtBL
bool ImpactWrtBL
Definition: VrtSecInclusive.h:146
VKalVrtAthena::VrtSecInclusive::findNtrackVertices
StatusCode findNtrackVertices(std::vector< WrkVrt > *)
Definition: VertexingAlgs.cxx:360
Trk::previous
@ previous
Definition: BinningData.h:32
ServiceHandle< ITHistSvc >
VKalVrtAthena::VrtSecInclusive::JobProperties::d0TrkPVDstMaxCut
double d0TrkPVDstMaxCut
Definition: VrtSecInclusive.h:148
VKalVrtAthena::VrtSecInclusive::clearNtupleVariables
StatusCode clearNtupleVariables()
Definition: AANT_Tools.cxx:227
LArGeo::ATan2
GeoGenfun::FunctionNoop ATan2(GeoGenfun::GENFUNCTION y, GeoGenfun::GENFUNCTION x)
Definition: BarrelAuxFunctions.cxx:50
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65