 |
ATLAS Offline Software
|
#include <VrtSecInclusive.h>
|
| 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 |
|
|
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< StoreGateSvc > | StoreGateSvc_t |
|
|
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...
|
|
ExtrapolatedPattern * | extrapolatedPattern (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) |
|
void | lockTrackDecorations (const xAOD::TrackParticle *trk, bool onlySelection) const |
| lock decorations at the end of the algorithm More...
|
|
void | lockLeptonDecorations (const SG::AuxVectorData *cont) const |
|
StatusCode | lockTrackDecorations (bool onlySelection) const |
|
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 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) |
| retrieve 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::TruthParticle * | getTrkGenParticle (const xAOD::TrackParticle *) |
|
|
struct JobProperties | m_jp |
|
int | m_vertexingStatus = 0 |
|
const xAOD::VertexContainer * | m_primaryVertices |
|
const xAOD::Vertex * | m_thePV |
|
std::vector< const xAOD::TrackParticle * > | m_selectedTracks |
|
std::vector< const xAOD::TrackParticle * > | m_associatedTracks |
|
std::vector< const xAOD::TrackParticle * > | m_leptonicTracks |
|
std::vector< double > | m_BeamPosition |
|
ToolHandle< Trk::ITrkVKalVrtFitter > | m_fitSvc |
|
ToolHandle< Trk::ITruthToTrack > | m_truthToTrack |
|
ToolHandle< Reco::ITrackToVertex > | m_trackToVertexTool |
| get a handle on the Track to Vertex tool More...
|
|
ToolHandle< Trk::ITrackToVertexIPEstimator > | m_trackToVertexIPEstimatorTool |
|
ToolHandle< Trk::IExtrapolator > | m_extrapolator |
|
ToolHandle< Trk::IVertexMapper > | m_vertexMapper |
|
ToolHandle< IInDetConditionsTool > | m_pixelCondSummaryTool {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"} |
| Condition service. More...
|
|
ToolHandle< IInDetConditionsTool > | m_sctCondSummaryTool {this, "InDetSCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT conditions summary"} |
|
const AtlasDetectorID * | m_atlasId = nullptr |
|
const PixelID * | m_pixelId = nullptr |
|
const SCT_ID * | m_sctId = nullptr |
|
std::string | m_checkPatternStrategy |
|
std::map< std::string, PatternStrategyFunc > | m_patternStrategyFuncs |
|
std::optional< SG::Decorator< char > > | m_decor_isSelected |
|
std::optional< SG::Decorator< char > > | m_decor_isAssociated |
|
std::optional< SG::Decorator< char > > | m_decor_is_svtrk_final |
|
std::map< unsigned, SG::Decorator< float > > | m_trkDecors |
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey {this,"EventInfoKey", "EventInfo", "EventInfo name"} |
| Read/Write Handle Keys. More...
|
|
SG::WriteDecorHandleKey< xAOD::EventInfo > | m_vertexingStatusKey |
|
std::vector< IPDecoratorType > | m_ipDecors |
|
std::optional< VertexELType > | m_decor_svLink |
|
TTree * | m_tree_Vert |
|
std::unique_ptr< NtupleVars > | m_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< TrackSelectionAlg > | m_trackSelectionAlgs |
|
std::vector< CutFunc > | m_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 |
|
Definition at line 86 of file VrtSecInclusive.h.
◆ AlgForVerticesPair
◆ Bec
◆ CutFunc
◆ Detector
◆ ExtrapolatedPattern
◆ ExtrapolatedPoint
◆ Flag
◆ IPDecoratorType
◆ Layer
◆ PatternBank
◆ PatternStrategyFunc
◆ StoreGateSvc_t
◆ track_summary
◆ TrackSelectionAlg
◆ VertexELType
◆ vertexingAlg
◆ mergeStep
Enumerator |
---|
RECONSTRUCT_NTRK | |
REASSEMBLE | |
SHUFFLE1 | |
SHUFFLE2 | |
SHUFFLE3 | |
FINAL | |
Definition at line 486 of file VrtSecInclusive.h.
◆ TrkParameter
◆ TrkParameterUnc
◆ VrtSecInclusive()
VKalVrtAthena::VrtSecInclusive::VrtSecInclusive |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~VrtSecInclusive()
VKalVrtAthena::VrtSecInclusive::~VrtSecInclusive |
( |
| ) |
|
◆ addEventInfo()
StatusCode VKalVrtAthena::VrtSecInclusive::addEventInfo |
( |
| ) |
|
|
private |
◆ 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.
1074 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": #verticess = " << workVerticesContainer->size() );
1076 unsigned associateCounter { 0 };
1079 for(
auto& wrkvrt : *workVerticesContainer ) {
1081 if( !wrkvrt.isGood )
continue;
1082 if( wrkvrt.selectedTrackIndices.size() <= 1 )
continue;
1086 wrkvrt.Chi2_core = wrkvrt.Chi2;
1088 auto& vertexPos = wrkvrt.vertex;
1090 std::vector<double> distanceToPVs;
1092 for(
const auto*
pv : *pvs ) {
1095 const auto& minDistance = *( std::min_element( distanceToPVs.begin(), distanceToPVs.end() ) );
1100 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex pos = (" << vertexPos.x() <<
", " << vertexPos.y() <<
", " << vertexPos.z() <<
"), "
1101 "#selected = " << wrkvrt.selectedTrackIndices.size() <<
", #assoc = " << wrkvrt.associatedTrackIndices.size() );
1103 std::vector<const xAOD::TrackParticle*>
candidates;
1106 for(
auto itr = allTracks->begin(); itr != allTracks->end(); ++itr ) {
1107 const auto* trk = *itr;
1111 auto result = std::find_if( workVerticesContainer->begin(), workVerticesContainer->end(),
1112 [&] ( WrkVrt& wrkvrt ) {
1113 auto found = std::find_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1114 [&]( long int index ) {
1116 if (m_jp.doSelectTracksFromElectrons || m_jp.doSelectIDAndGSFTracks) {
1117 const xAOD::TrackParticle *id_tr;
1118 id_tr = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(m_selectedTracks.at(index));
1119 return trk == m_selectedTracks.at(index) or trk == id_tr;
1122 return trk == m_selectedTracks.at(index);
1125 return found != wrkvrt.selectedTrackIndices.end();
1127 if(
result != workVerticesContainer->end() )
continue;
1133 [&] (
const auto* atrk) { return trk == atrk; } );
1150 std::vector<double> impactParameters;
1151 std::vector<double> impactParErrors;
1159 <<
": d0 to vtx = " << impactParameters.at(
k_d0)
1160 <<
", z0 to vtx = " << impactParameters.at(
k_z0)
1161 <<
", distance to vtx = " << hypot( impactParameters.at(
k_d0), impactParameters.at(
k_z0) ) );
1169 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
1173 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": attempting to associate track = " << trk );
1176 WrkVrt wrkvrt_backup = wrkvrt;
1178 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1180 std::vector<const xAOD::TrackParticle*> baseTracks;
1181 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
1183 wrkvrt.Chi2PerTrk.clear();
1185 for(
const auto&
index : wrkvrt.selectedTrackIndices ) {
1189 for(
const auto&
index : wrkvrt.associatedTrackIndices ) {
1194 baseTracks.emplace_back( trk );
1202 if(
sc.isFailure() )
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation failed.");
1204 const auto& diffPos = initPos - vertexPos;
1206 if( diffPos.norm() > 10. ) {
1208 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": approx vertex as original" );
1209 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1213 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": approx vertex set to (" << initPos.x() <<
", " << initPos.y() <<
", " << initPos.z() <<
")" );
1214 m_fitSvc->setApproximateVertex( initPos.x(), initPos.y(), initPos.z(), *state );
1220 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": now vertex fitting..." );
1232 if(
sc.isFailure() ) {
1233 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit failure. Revert to backup");
1234 wrkvrt = wrkvrt_backup;
1244 auto&
cov = wrkvrt.vertexCov;
1246 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": succeeded in associating. New vertex pos = (" << vertexPos.perp() <<
", " << vertexPos.z() <<
", " << vertexPos.perp()*vertexPos.phi() <<
")" );
1247 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) <<
")" );
1254 (*m_decor_isAssociated)( *trk ) =
true;
1260 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1261 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": total associated number of tracks = " << associateCounter );
1262 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1264 return StatusCode::SUCCESS;
◆ 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.
116 const LeptonContainer *leptonContainer(
nullptr );
130 enum { k_ip_d0, k_ip_z0, k_ip_pt, k_ip_eta, k_ip_phi, k_ip_d0err, k_ip_z0err };
137 for(
const auto& lepton : *leptonContainer ) {
139 std::vector< std::vector< std::vector<float> > > ip_wrtSVs(
m_ipDecors.size() );
141 bool linkFlag {
false };
143 std::vector<unsigned> trackTypes;
144 genSequence<LeptonFlavor>( lepton, trackTypes );
147 for(
auto& trackType : trackTypes ) {
149 std::vector< std::vector<float> > ip_wrtSV(
m_ipDecors.size() );
151 const auto* trk = getLeptonTrackParticle<LeptonFlavor>( lepton, trackType );
155 std::map< const xAOD::Vertex*, std::vector<double> > distanceMap;
157 std::vector<ElementLink< xAOD::VertexContainer > >
links;
160 for(
const auto vtx : *secondaryVertexContainer ) {
162 std::vector<double> impactParameters;
163 std::vector<double> impactParErrors;
165 m_fitSvc->VKalGetImpact( trk, vtx->position(),
static_cast<int>( lepton->charge() ), impactParameters, impactParErrors );
171 const auto&
phi = impactParameters.at(
k_phi );
172 const auto p = fabs( 1.0 / impactParameters.at(
k_qOverP) );
173 const auto pt = fabs(
p *
sin( theta ) );
177 ip_wrtSV.at( k_ip_d0 ) .emplace_back( impactParameters.at(
k_d0) );
178 ip_wrtSV.at( k_ip_z0 ) .emplace_back( impactParameters.at(
k_z0) );
179 ip_wrtSV.at( k_ip_pt ) .emplace_back(
pt );
180 ip_wrtSV.at( k_ip_eta ) .emplace_back( eta );
181 ip_wrtSV.at( k_ip_phi ) .emplace_back( phi );
182 ip_wrtSV.at( k_ip_d0err ) .emplace_back( impactParErrors.at(
k_d0d0) );
183 ip_wrtSV.at( k_ip_z0err ) .emplace_back( impactParErrors.at(
k_z0z0) );
188 links.emplace_back( link_SV );
196 ( *m_decor_svLink )( *lepton ) =
links;
200 for(
size_t ipar = 0; ipar < ip_wrtSVs.size(); ipar++ ) ip_wrtSVs.at( ipar ).emplace_back( ip_wrtSV.at( ipar ) );
205 for(
size_t ipar = 0; ipar <
m_ipDecors.size(); ipar++ ) {
206 m_ipDecors.at( ipar )( *lepton ) = ip_wrtSVs.at( ipar );
211 return StatusCode::SUCCESS;
◆ categorizeVertexTruthTopology()
StatusCode VKalVrtAthena::VrtSecInclusive::categorizeVertexTruthTopology |
( |
xAOD::Vertex * |
vertex | ) |
|
|
private |
Definition at line 44 of file TruthAlgs.cxx.
47 enum vertexCatogory_tracks {
53 enum vertexCategory_vertex {
55 multipleTruthVertices,
61 multiset<const xAOD::TruthVertex*> truth_vertices;
64 set<const xAOD::TruthVertex*> truth_vertices_types;
66 vector<const xAOD::TrackParticle*> reco_tracks;
67 vector<const xAOD::TrackParticle*> orphan_tracks;
68 vector<const xAOD::TrackParticle*> fake_tracks;
72 for(
size_t itrk=0; itrk<
vertex->nTrackParticles(); itrk++ ) {
73 const auto *trk =
vertex->trackParticle( itrk );
75 ATH_MSG_VERBOSE(
"categorizeVertexTruthTopology(): track loop itrk = " << itrk );
78 const truthLink& link = truthParticleLinkAcc(*trk);
81 fake_tracks.emplace_back( trk );
87 orphan_tracks.emplace_back( trk );
91 reco_tracks.emplace_back( trk );
93 truth_vertices_types .insert( truth->
prodVtx() );
94 truth_vertices .insert( truth->
prodVtx() );
100 ATH_MSG_VERBOSE(
"categorizeVertexTruthTopology(): Add truth track pattern to the reco vertex" );
102 if( reco_tracks.size() ==
vertex->nTrackParticles() ) {
103 trkpatAcc( *vertex ) = allTruthAssociated;
104 }
else if( fake_tracks.size() ==
vertex->nTrackParticles() ) {
105 trkpatAcc( *vertex ) = allFakeTracks;
107 trkpatAcc( *vertex ) = hasFakeTracks;
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 );
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;
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;
136 truth_vtx_pattern = multipleTruthVertices;
139 vtxpatAcc(*vertex) = truth_vtx_pattern;
143 if( noTruthVertex != truth_vtx_pattern ) {
146 ATH_MSG_VERBOSE(
"categorizeVertexTruthTopology(): Retrieve the truth vertex container for element link" );
151 ATH_MSG_VERBOSE(
"categorizeVertexTruthTopology(): create the element link" );
152 const auto *theVertex = get<0>( tmp_tuple );
156 ATH_MSG_VERBOSE(
"categorizeVertexTruthTopology(): Add the truth vertex element link to the reco vertex" );
162 linkAcc(
"truth_vtx_link" );
163 linkAcc(*vertex) = vtx_link;
165 return StatusCode::SUCCESS;
◆ checkTrackHitPatternToVertex()
◆ checkTrackHitPatternToVertexByExtrapolation()
New method with track extrapolation.
Definition at line 1171 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1185 using LayerCombination = std::vector<int>;
1187 std::map<LayerCombination, unsigned> layerMap;
1188 if( layerMap.empty() ) {
1231 const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
1233 for(
auto& pair : layerMap ) {
1234 if( pair.first == comb ) {
1242 enum { kShouldNotHaveHit, kShouldHaveHit, kMayHaveHit };
1248 auto& exPattern_along = *( exPattern.first );
1250 for(
auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
1251 if(
std::next( itr ) == exPattern_along.end() )
continue;
1253 const auto& point = *itr;
1254 const auto& nextPoint = *(
std::next( itr ) );
1256 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": isGood = " << std::get<isGood>( point ) );
1258 const auto& thisPos = std::get<position>( point );
1259 const auto& nextPos = std::get<position>( nextPoint );
1261 auto sectionVector = nextPos - thisPos;
1265 const auto& detectorType = getDetectorType( point );
1267 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": detType = " << detectorType );
1273 if( vertexVector.Mag() < 10. ) {
1274 expectedHitPattern.at( detectorType ) = kMayHaveHit;
1280 if( !
static_cast<bool>(std::get<isGood>( point )) ) {
1281 expectedHitPattern.at( detectorType ) = kMayHaveHit;
1290 if( sectionVector.Mag() == 0. )
continue;
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 ) );
1298 if( sectionVector * vertexVector > 0. )
continue;
1300 if( minExpectedRadius > thisPos.Perp() ) minExpectedRadius = thisPos.Perp();
1304 expectedHitPattern.at( detectorType ) = kShouldHaveHit;
1308 auto& exPattern_oppos = *( exPattern.second );
1309 bool oppositeFlag =
false;
1311 for(
auto itr = exPattern_oppos.begin(); itr != exPattern_oppos.end(); ++itr ) {
1312 if(
std::next( itr ) == exPattern_oppos.end() )
continue;
1314 const auto& point = *itr;
1315 const auto& nextPoint = *(
std::next( itr ) );
1317 const auto& thisPos = std::get<position>( point );
1318 const auto& nextPos = std::get<position>( nextPoint );
1320 auto sectionVector = nextPos - thisPos;
1323 const auto& detectorType = getDetectorType( point );
1325 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": detType = " << detectorType );
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 ) );
1335 if( sectionVector * vertexVector < 0. ) {
1336 oppositeFlag =
true;
1345 std::string
msg =
"Expected hit pattern: ";
1347 msg += Form(
"%s", expectedHitPattern.at(
i) < kMayHaveHit? Form(
"%u", expectedHitPattern.at(
i)) :
"X" );
1351 msg =
"Recorded hit pattern: ";
1357 std::vector<unsigned> matchedLayers;
1360 const unsigned recordedPattern = ( (trk->
hitPattern()>>
i) & 1 );
1362 if( expectedHitPattern.at(
i) == kMayHaveHit ) {
1363 matchedLayers.emplace_back(
i );
1364 }
else if( expectedHitPattern.at(
i) == kShouldHaveHit ) {
1365 if( expectedHitPattern.at(
i) != recordedPattern ) {
1368 matchedLayers.emplace_back(
i );
1371 if( expectedHitPattern.at(
i) != recordedPattern ) {
1386 while( dphi > TMath::Pi() ) dphi -= TMath::TwoPi();
1387 while( dphi < -TMath::Pi() ) dphi += TMath::TwoPi();
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() );
1396 if( PixelHits == 0 &&
vertex.perp() > 300. ) {
1397 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex r > 300 mm, w/o no pixel hits" );
1402 if( matchedLayers.size() < 2 )
return false;
1406 if( matchedLayers.size() < 4 )
return false;
1412 if( oppositeFlag )
return false;
1418 if( fabs( dphi ) > TMath::Pi()/2.0 )
return false;
1421 TVector3 trkP; trkP.SetPtEtaPhi( trk->
pt(), trk->
eta(), trk->
phi() );
1423 if( trkP.Dot( vtx ) < 0. )
return false;
◆ checkTrackHitPatternToVertexByExtrapolationAssist()
New method with track extrapolation.
Definition at line 2200 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
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;
2220 using LayerCombination = std::vector<int>;
2222 std::map<LayerCombination, unsigned> layerMap;
2223 if( layerMap.empty() ) {
2266 const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
2268 for(
auto& pair : layerMap ) {
2269 if( pair.first == comb ) {
2280 auto& exPattern_along = *( exPattern.first );
2282 for(
auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
2283 if(
std::next( itr ) == exPattern_along.end() )
continue;
2285 const auto& point = *itr;
2287 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": isGood = " << std::get<isGood>( point ) );
2289 if( !std::get<isGood>( point ) ) {
2290 const auto& detectorType = getDetectorType( point );
2291 disabledPattern += (1 << detectorType);
2296 uint32_t modifiedPattern = disabledPattern | hitPattern;
2298 std::string
msg =
"Disabled hit pattern: ";
2300 msg += Form(
"%u", ( disabledPattern >>
i ) & 1 );
2304 msg =
"Recorded hit pattern: ";
2306 msg += Form(
"%u", ( hitPattern >>
i ) & 1 );
◆ checkTrackHitPatternToVertexOuterOnly()
◆ clearNtupleVariables()
StatusCode VKalVrtAthena::VrtSecInclusive::clearNtupleVariables |
( |
| ) |
|
|
private |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperties()
void VKalVrtAthena::VrtSecInclusive::declareProperties |
( |
| ) |
|
|
private |
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ deleteNtupleVariables()
StatusCode VKalVrtAthena::VrtSecInclusive::deleteNtupleVariables |
( |
| ) |
|
|
private |
◆ 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.
121 auto& wrkvrt = workVerticesContainer->at(iv);
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() );
127 const auto& ntrk = wrkvrt.selectedTrackIndices.size();
131 if( wrkvrt.selectedTrackIndices.size() <= 2 )
return StatusCode::SUCCESS;
133 for(
auto&
index : wrkvrt.selectedTrackIndices ) {
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());
145 const auto&
max = std::max_element( wrkvrt.Chi2PerTrk.begin(), wrkvrt.Chi2PerTrk.end() );
147 if(
max == wrkvrt.Chi2PerTrk.end() )
return StatusCode::SUCCESS;
149 maxChi2TrackIndex =
max - wrkvrt.Chi2PerTrk.begin();
156 vector<const xAOD::NeutralParticle*> dummyNeutrals;
158 vector<WrkVrt> new_vertices;
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++) {
164 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > Loop itrk = " << itrk <<
" / " << ntrk );
167 if( itrk == maxChi2TrackIndex ) {
172 const size_t this_trk_id = wrkvrt.selectedTrackIndices[itrk];
173 const size_t selected_trk_id = wrkvrt.selectedTrackIndices[maxChi2TrackIndex];
175 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > this_trk_id = " << this_trk_id <<
", selected_trk_id = " << selected_trk_id <<
", alltrks_size = " <<
m_selectedTracks.size() );
177 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > this_trk_id is invalid. continue!" );
181 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > selected_trk_id is invalid. continue!" );
185 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > Storing tracks to ListBaseTracks" );
189 vector<const xAOD::TrackParticle*> ListBaseTracks;
193 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > ListBaseTracks was stored." );
196 newvrt.selectedTrackIndices.emplace_back( this_trk_id );
197 newvrt.selectedTrackIndices.emplace_back( selected_trk_id );
202 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
205 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > ApproxVertex: r = " << newvrt.vertex.perp() <<
", z = " << newvrt.vertex.z() );
209 m_fitSvc->setApproximateVertex( wrkvrt.vertex[0], wrkvrt.vertex[1], wrkvrt.vertex[2], *state );
213 m_fitSvc->setApproximateVertex( newvrt.vertex[0], newvrt.vertex[1], newvrt.vertex[2], *state );
228 if(
sc.isFailure() )
continue;
230 newvrt.closestWrkVrtIndex = 0;
234 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > register the new vertex to the vertex list" );
235 new_vertices.emplace_back( newvrt );
239 wrkvrt.selectedTrackIndices.erase( wrkvrt.selectedTrackIndices.begin() + maxChi2TrackIndex );
240 ATH_MSG_VERBOSE(
" >> disassembleVertex(): removed the selected track from the original vertex. wrkvrt.selectedTrackIndices.size = " << wrkvrt.selectedTrackIndices.size() );
243 ATH_MSG_VERBOSE(
" >> disassembleVertex(): refit the original vertex" );
246 if(
sc.isFailure() ) {
249 return StatusCode::SUCCESS;
253 for(
const auto& vertex : new_vertices ) {
254 ATH_MSG_VERBOSE(
" >> disassembleVertex(): > emplace_back new vertex" );
255 workVerticesContainer->emplace_back( vertex );
258 ATH_MSG_VERBOSE(
" >> disassembleVertex(): end. workVerticesContainer.size() = " << workVerticesContainer->size() );
259 return StatusCode::SUCCESS;
◆ distanceBetweenVertices()
◆ dumpTruthInformation()
void VKalVrtAthena::VrtSecInclusive::dumpTruthInformation |
( |
| ) |
|
|
private |
Definition at line 2359 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
2365 auto sc0 =
evtStore()->retrieve( eventInfo,
"EventInfo" );
2366 if( sc0.isFailure() ) {
return; }
2372 auto sc1 =
evtStore()->retrieve( truthParticles,
"TruthParticles" );
2373 if( sc1.isFailure() ) {
return; }
2375 auto sc2 =
evtStore()->retrieve( truthVertices,
"TruthVertices" );
2376 if( sc2.isFailure() ) {
return; }
2378 if( !truthParticles ) {
return; }
2379 if( !truthVertices ) {
return; }
2383 std::vector<const xAOD::TruthParticle*> truthSvTracks;
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;
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;
2403 return hasNeutralino;
2407 if( truthVertex->nIncomingParticles() != 1 )
return false;
2408 if( !truthVertex->incomingParticle(0) )
return false;
2409 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 50 )
return false;
2414 if( truthVertex->nIncomingParticles() != 1 )
return false;
2415 if( !truthVertex->incomingParticle(0) )
return false;
2416 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 36 )
return false;
2421 if( truthVertex->nIncomingParticles() != 1 )
return false;
2422 if( !truthVertex->incomingParticle(0) )
return false;
2423 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 310 )
return false;
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;
2435 if( truthVertex->nIncomingParticles() != 1 )
return false;
2436 if( !truthVertex->incomingParticle(0) )
return false;
2438 const auto*
parent = truthVertex->incomingParticle(0);
2439 if(
parent->isLepton() )
return false;
2441 TLorentzVector p4sum_in;
2442 TLorentzVector p4sum_out;
2443 for(
unsigned ip = 0;
ip < truthVertex->nIncomingParticles();
ip++ ) {
2444 const auto*
particle = truthVertex->incomingParticle(
ip);
2448 for(
unsigned ip = 0;
ip < truthVertex->nOutgoingParticles();
ip++ ) {
2449 const auto*
particle = truthVertex->outgoingParticle(
ip);
2453 return p4sum_out.E() - p4sum_in.E() >= 100.;
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 } };
2476 for(
const auto *truthVertex : *truthVertices ) {
2477 if( selectFunc( truthVertex ) ) {
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 );
2489 m_hists[
"nMatchedTruths"]->Fill( 0., truthVertex->perp() );
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode VKalVrtAthena::VrtSecInclusive::execute |
( |
| ) |
|
|
virtual |
Definition at line 294 of file VrtSecInclusive.cxx.
304 return StatusCode::FAILURE;
314 return StatusCode::SUCCESS;
320 if (
sc.isFailure() ) {
323 return StatusCode::SUCCESS;
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;
346 secondaryVertexContainer ->
setStore( secondaryVertexAuxContainer );
355 twoTrksVertexContainer ->
setStore( twoTrksVertexAuxContainer );
362 auto&
name = itr->first;
367 intermediateVertexContainer ->
setStore( intermediateVertexAuxContainer );
395 if( sc.isFailure() or !
m_thePV ) {
399 return StatusCode::SUCCESS;
416 ATH_MSG_DEBUG(
"execute: Too few (<2) selected reco tracks. Terminated reconstruction." );
420 return StatusCode::SUCCESS;
424 ATH_MSG_INFO(
"execute: Too many selected reco tracks. Terminated reconstruction." );
428 return StatusCode::SUCCESS;
440 std::vector<WrkVrt> workVerticesContainer;
446 auto&
name = itr->first;
447 auto alg = itr->second;
456 auto sec = std::chrono::duration_cast<std::chrono::microseconds>( t_end - t_start ).count();
461 []( WrkVrt& wrkvrt ) {
462 return ( !wrkvrt.isGood || wrkvrt.nTracksTotal() < 2 ); }
485 return StatusCode::SUCCESS;
◆ 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.
56 std::vector<const xAOD::TrackParticle*> baseTracks;
57 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
64 enum recoStep { kStart, kInitVtxPosition, kImpactParamCheck, kVKalVrtFit, kChi2, kVposCut, kPatternMatch };
66 const double maxR { 563. };
67 const double roughD0Cut { 100. };
68 const double roughZ0Cut { 50. };
71 std::map<const xAOD::TruthVertex*, bool> matchMap;
83 wrkvrt.selectedTrackIndices.emplace_back( itrk_id );
84 wrkvrt.selectedTrackIndices.emplace_back( jtrk_id );
87 m_incomp.emplace_back( itrk_id, jtrk_id );
92 baseTracks.emplace_back( *itrk );
93 baseTracks.emplace_back( *jtrk );
100 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
102 if(
sc.isFailure() ) {
103 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
107 if( initVertex.perp() > maxR ) {
112 std::vector<double> impactParameters;
113 std::vector<double> impactParErrors;
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 ) {
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 ) {
130 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
137 wrkvrt.vertex, wrkvrt.vertexMom, wrkvrt.Charge,
138 wrkvrt.vertexCov, wrkvrt.Chi2PerTrk,
139 wrkvrt.TrkAtVrt, wrkvrt.Chi2, *state );
141 if(
sc.isFailure() ) {
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());
155 const double dist_fromPV = vDist.norm();
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);
176 twoTrksVertexContainer->emplace_back( vertex );
178 for(
const auto *trk: baseTracks ) {
184 vertex->addTrackAtVertex( trackElementLink, 1. );
188 vertex->setPosition( wrkvrt.vertex );
189 vertex->setFitQuality( wrkvrt.Chi2, 1 );
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;
216 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": failed to pass chi2 threshold." );
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() <<
")" );
233 Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
234 Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
236 const auto distance = vReco - vTruth;
249 ATH_MSG_DEBUG (
" > " << __FUNCTION__ <<
": truth-matched candidate! : signif^2 = " <<
s2 );
250 matchMap.emplace( truthVertex,
true );
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 );
263 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the 2tr vertex min distance from PV cut." );
268 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vertex angle cut." );
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)" );
279 ATH_MSG_DEBUG(
" > "<< __FUNCTION__ <<
": failed to pass the tightened vPos cut. (at least one track is opposite against the vertex pos)" );
282 if( vPosMomAngT < -0.8 ) {
283 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vPos cut. (pos-mom directions are opposite)" );
287 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vPos cut." );
297 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass fake rejection algorithm." );
303 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": passed fake rejection." );
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);
320 isFakeAcc(*vertex) =
false;
328 wrkvrt.isGood =
true;
330 workVerticesContainer->emplace_back( wrkvrt );
332 msg += Form(
" (%d, %d), ", itrk_id, jtrk_id );
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() );
345 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": compatible track pairs = " <<
msg );
350 for(
auto& pair: matchMap ) {
351 if( pair.second )
m_hists[
"nMatchedTruths"]->Fill( 1, pair.first->perp() );
355 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ extrapolatedPattern()
Definition at line 1103 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1106 const EventContext& ctx = Gaudi::Hive::currentContext();
1107 std::vector<std::unique_ptr<Trk::TrackParameters>> paramsVector =
1114 for(
auto&
params : paramsVector ) {
1116 const TVector3 position(
params->position().x(),
params->position().y(),
params->position().z() );
1118 if( prevPos == position ) {
1124 const auto* detElement =
params->associatedSurface().associatedDetectorElement();
1130 const auto&
id = detElement->identify();
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() ) <<
")" );
1154 if( !
good ) nDisabled++;
1162 m_hists[
"disabledCount"]->Fill( nDisabled );
◆ fillAANT_SecondaryVertices()
StatusCode VKalVrtAthena::VrtSecInclusive::fillAANT_SecondaryVertices |
( |
xAOD::VertexContainer * |
vertices | ) |
|
|
private |
Definition at line 351 of file AANT_Tools.cxx.
357 for(
size_t itrk=0; itrk<
vertex->nTrackParticles(); itrk++) {
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() );
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 );
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) ) {
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) );
410 ATH_MSG_VERBOSE(
" >> fillAANT_SecondaryVertices : filling track vars wrt. SV (invalid values)");
425 ATH_MSG_DEBUG(
" >> fillAANT_SecondaryVertices : Track loop end. ");
427 ATH_MSG_VERBOSE(
" >> fillAANT_SecondaryVertices : filling vertex vars");
438 m_ntupleVars->get< vector<int> >(
"SecVtx_NumTrks" ) .emplace_back(
vertex->nTrackParticles() );
439 m_ntupleVars->get< vector<double> >(
"SecVtx_Chi2" ) .emplace_back(
vertex->chiSquared() );
455 return StatusCode::SUCCESS;
◆ fillAANT_SelectedBaseTracks()
StatusCode VKalVrtAthena::VrtSecInclusive::fillAANT_SelectedBaseTracks |
( |
| ) |
|
|
private |
Definition at line 263 of file AANT_Tools.cxx.
270 m_ntupleVars->get< vector<int> >(
"SVTrk_PixHits" ).emplace_back( (
int) tmpT);
273 m_ntupleVars->get< vector<int> >(
"SVTrk_SCTHits" ).emplace_back( (
int) tmpT);
276 m_ntupleVars->get< vector<int> >(
"SVTrk_TRTHits" ).emplace_back( (
int) tmpT);
279 m_ntupleVars->get< vector<int> >(
"SVTrk_BLayHits" ).emplace_back( (
int) tmpT);
286 const auto& perigee = trk->perigeeParameters();
292 double d0 = perigee.parameters()[
Trk::d0];
296 double ptrk = (1./
qOverP);
297 double pT = ptrk*
sin(theta);
298 double trketa = -1.*
log(
tan(theta/2) );
303 m_ntupleVars->get< vector<int> >(
"SVTrk_id" ) .emplace_back( trk_idAcc(*trk) );
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]);
312 double matchProb = -1;
321 matchProb= truthMatchProbabilityAcc( *trk );
326 m_ntupleVars->get< vector<double> >(
"SVTrk_matchPr" ) .emplace_back( matchProb );
328 ATH_MSG_DEBUG(
" > fillAANT_SelectedBaseTracks: Sel Trk d0/pT/eta/match bc/pr "
335 double errp = ptrk*ptrk*errqOverP;
337 m_ntupleVars->get< vector<double> >(
"SVTrk_delp" ) .emplace_back( errp );
338 m_ntupleVars->get< vector<double> >(
"SVTrk_del2dIP" ) .emplace_back( errd0 );
346 return StatusCode::SUCCESS;
◆ fillTrackSummary()
◆ finalize()
StatusCode VKalVrtAthena::VrtSecInclusive::finalize |
( |
| ) |
|
|
virtual |
◆ 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.
421 indexPair.second = 0;
425 for(
unsigned iv=0; iv<workVerticesContainer->size()-1; iv++) {
426 auto&
vertex = workVerticesContainer->at(iv);
428 if(
vertex.selectedTrackIndices.size() < 2)
continue;
429 if(
vertex.closestWrkVrtIndex == 0 )
continue;
433 unsigned jv =
vertex.closestWrkVrtIndex;
436 if( workVerticesContainer->at(jv).closestWrkVrtIndex == 0 )
continue;
440 indexPair.first = iv;
441 indexPair.second = jv;
◆ 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.
380 for(
auto& workVertex : *workVerticesContainer ) {
382 workVertex.closestWrkVrtIndex = 0;
387 for(
auto iv = workVerticesContainer->begin(); iv != workVerticesContainer->end(); ++iv ) {
388 if( (*iv).selectedTrackIndices.size()< 2)
continue;
390 auto i_index = iv - workVerticesContainer->begin();
392 for(
auto jv =
std::next(iv); jv != workVerticesContainer->end(); ++jv ) {
393 if( (*jv).selectedTrackIndices.size()< 2)
continue;
395 auto j_index = iv - workVerticesContainer->begin();
401 indexPair.first = i_index;
402 indexPair.second = j_index;
404 if(
value < (*iv).closestWrkVrtValue ) {(*iv).closestWrkVrtValue =
value; (*iv).closestWrkVrtIndex = j_index; }
405 if(
value < (*jv).closestWrkVrtValue ) {(*jv).closestWrkVrtValue =
value; (*jv).closestWrkVrtIndex = i_index; }
◆ findNtrackVertices()
StatusCode VKalVrtAthena::VrtSecInclusive::findNtrackVertices |
( |
std::vector< WrkVrt > * |
workVerticesContainer | ) |
|
|
private |
Definition at line 360 of file VertexingAlgs.cxx.
367 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": compatible track pair size = " << compSize );
373 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": incompatibility graph finder mode" );
376 workVerticesContainer->clear();
383 std::vector<long int> weit;
386 weit.emplace_back( pair.first + 1 );
387 weit.emplace_back( pair.second + 1 );
406 long int solutionSize { 0 };
409 std::vector<const xAOD::TrackParticle*> baseTracks;
410 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
412 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
413 auto pgraph = std::make_unique<Trk::PGraph>();
414 int iterationLimit(2000);
419 pgraph->pgraphm_( weit.data(), nEdges, nTracks, solution.data(), &solutionSize, nth);
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);
426 if(solutionSize <= 0)
break;
427 if(solutionSize == 1)
continue;
431 std::string
msg =
"solution = [ ";
432 for(
int i=0;
i< solutionSize;
i++) {
433 msg += Form(
"%ld, ", solution[
i]-1 );
443 wrkvrt.isGood =
true;
444 wrkvrt.selectedTrackIndices.clear();
446 for(
long int i = 0;
i<solutionSize;
i++) {
447 wrkvrt.selectedTrackIndices.emplace_back(solution[
i]-1);
455 if(
sc.isFailure())
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
457 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
459 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
469 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": FoundAppVrt=" << solutionSize <<
", (r, z) = " << wrkvrt.vertex.perp() <<
", " << wrkvrt.vertex.z() <<
", chi2/ndof = " << wrkvrt.fitQuality() );
471 if(
sc.isFailure() ) {
473 if( wrkvrt.selectedTrackIndices.size() <= 2 ) {
474 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit failed in 2-trk solution ==> give up.");
478 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit failed ==> retry...");
484 for(
auto& itrk: wrkvrt.selectedTrackIndices ) {
485 for(
auto& jtrk: wrkvrt.selectedTrackIndices ) {
486 if( itrk == jtrk )
continue;
487 if(
tmp.isGood )
continue;
489 tmp.selectedTrackIndices.clear();
490 tmp.selectedTrackIndices.emplace_back( itrk );
491 tmp.selectedTrackIndices.emplace_back( jtrk );
500 sc =
m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );
501 if(
sc.isFailure() )
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
503 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
505 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
515 if(
sc.isFailure() )
continue;
523 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Did not find any viable vertex in all 2-trk combinations. Give up.");
528 for(
auto& itrk: wrkvrt.selectedTrackIndices ) {
530 if(
std::find(
tmp.selectedTrackIndices.begin(),
tmp.selectedTrackIndices.end(), itrk ) !=
tmp.selectedTrackIndices.end() )
continue;
534 tmp.selectedTrackIndices.emplace_back( itrk );
536 for(
auto& jtrk :
tmp.selectedTrackIndices ) { baseTracks.emplace_back(
m_selectedTracks.at(jtrk) ); }
541 sc =
m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );
542 if(
sc.isFailure())
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
544 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
546 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
556 if(
sc.isFailure() ) {
564 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit succeeded; register the vertex to the list.");
565 wrkvrt.isGood =
true;
568 workVerticesContainer->emplace_back( wrkvrt );
572 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit succeeded; register the vertex to the list.");
573 wrkvrt.isGood =
true;
576 workVerticesContainer->emplace_back( wrkvrt );
585 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": rapid finder mode" );
589 std::set<long int> tracks;
592 std::vector<struct Cluster>
clusters;
594 for(
auto& wrkvrt : *workVerticesContainer ) {
596 bool foundCluster =
false;
599 if( (wrkvrt.vertex -
cluster.position).norm() < 1.0 ) {
600 for(
auto& itrk : wrkvrt.selectedTrackIndices ) {
608 if( !foundCluster ) {
610 c.position = wrkvrt.vertex;
611 for(
auto& itrk : wrkvrt.selectedTrackIndices ) {
612 c.tracks.insert( itrk );
615 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": added a new cluster" );
621 std::vector<const xAOD::TrackParticle*> baseTracks;
622 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
624 workVerticesContainer->clear();
628 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
636 wrkvrt.isGood =
true;
637 wrkvrt.selectedTrackIndices.clear();
640 wrkvrt.selectedTrackIndices.emplace_back(
index );
648 if(
sc.isFailure())
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
650 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
652 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
662 if(
sc.isFailure() ) {
666 workVerticesContainer->emplace_back( wrkvrt );
682 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Remove vertices fully contained in other vertices .");
683 while( workVerticesContainer->size() > 1 ) {
684 size_t tmpN = workVerticesContainer->size();
687 for(; iv<tmpN-1; iv++) {
689 for(; jv<tmpN; jv++) {
690 const auto nTCom =
nTrkCommon( workVerticesContainer, {iv, jv} );
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; }
698 if(iv==tmpN-1)
break;
702 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Identify remaining 2-track vertices with very bad Chi2 and mass (b-tagging).");
703 for(
auto& wrkvrt : *workVerticesContainer ) {
706 if( wrkvrt.selectedTrackIndices.size() != 2 )
continue;
712 return StatusCode::SUCCESS;
◆ 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.
948 auto maxSharedTrackToVertices = std::max_element( trackToVertexMap.begin(), trackToVertexMap.end(), [](
auto&
p1,
auto&
p2 ) { return p1.second.size() < p2.second.size(); } );
950 if( maxSharedTrackToVertices == trackToVertexMap.end() )
return worstChi2;
952 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": max-shared track index = " << maxSharedTrackToVertices->first <<
", number of shared vertices = " << maxSharedTrackToVertices->second.size() );
954 if( maxSharedTrackToVertices->second.size() < 2 )
return worstChi2;
957 std::map<long int, double> vrtChi2Map;
960 for(
auto& iv : maxSharedTrackToVertices->second ) {
961 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": loop over vertices: vertex index " << iv );
963 auto& wrkvrt = workVerticesContainer->at( iv );
964 auto& trackIndices = wrkvrt.selectedTrackIndices;
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)" );
973 auto&
chi2 = wrkvrt.Chi2PerTrk.at(
index - trackIndices.begin() );
975 vrtChi2Map.emplace( std::pair<long int, double>(iv,
chi2) );
978 auto worstVrtChi2Pair = std::max_element( vrtChi2Map.begin(), vrtChi2Map.end(), [](
auto&
p1,
auto&
p2 ) { return p1.second < p2.second; } );
980 if( worstVrtChi2Pair == vrtChi2Map.end() ) {
981 ATH_MSG_WARNING(
" >> " << __FUNCTION__ <<
": max_element of vrtChi2Map not found" );
985 maxSharedTrack = maxSharedTrackToVertices->first;
986 worstMatchingVertex = worstVrtChi2Pair->first;
987 worstChi2 = worstVrtChi2Pair->second;
◆ getIntersection() [1/2]
◆ getIntersection() [2/2]
◆ getSVImpactParameters()
get secondary vertex impact parameters
Definition at line 2081 of file VertexingAlgs.cxx.
2085 impactParameters.clear();
2086 impactParErrors.clear();
2089 m_fitSvc->VKalGetImpact(trk, vertex,
static_cast<int>( trk->
charge() ), impactParameters, impactParErrors);
2092 auto sv_perigee =
m_trackToVertexTool->perigeeAtVertex(Gaudi::Hive::currentContext(), *trk, vertex );
2093 if( !sv_perigee )
return false;
2094 impactParameters.push_back(sv_perigee->parameters() [
Trk::d0]);
2095 impactParameters.push_back(sv_perigee->parameters() [
Trk::z0]);
2096 impactParErrors.push_back((*sv_perigee->covariance())(
Trk::d0,
Trk::d0 ));
2097 impactParErrors.push_back((*sv_perigee->covariance())(
Trk::z0,
Trk::z0 ));
◆ getTrkGenParticle()
Definition at line 26 of file TruthAlgs.cxx.
29 constexpr
const char* NAME =
"truthParticleLink";
31 if( !
acc.isAvailable( *trkPart ) ) {
34 const Link_t& link =
acc( *trkPart );
35 if( ! link.isValid() ) {
◆ 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.
271 auto fitQuality_begin =
vertex.fitQuality();
273 auto removeCounter = 0;
275 if(
vertex.nTracksTotal() <= 2 )
return 0.;
280 if(
sc.isFailure() ) {
286 double chi2Probability = TMath::Prob(
vertex.Chi2,
vertex.ndof() );
289 if(
vertex.nTracksTotal() == 2 )
return chi2Probability;
291 WrkVrt vertex_backup =
vertex;
293 auto maxChi2 = std::max_element(
vertex.Chi2PerTrk.begin(),
vertex.Chi2PerTrk.end() );
294 size_t index = maxChi2 -
vertex.Chi2PerTrk.begin();
297 ATH_MSG_DEBUG(
" >>> " << __FUNCTION__ <<
": worst chi2 trk index = " <<
index <<
", #trks = " <<
vertex.Chi2PerTrk.size() );
300 vertex.selectedTrackIndices.erase(
vertex.selectedTrackIndices.begin() +
index );
304 if(
index >=
vertex.associatedTrackIndices.size() ) {
308 vertex.associatedTrackIndices.erase(
vertex.associatedTrackIndices.begin() +
index );
314 if(
sc.isFailure() || vertex_backup.fitQuality() <
vertex.fitQuality() ) {
320 chi2Probability = TMath::Prob(
vertex.Chi2,
vertex.ndof() );
323 auto fitQuality_end =
vertex.fitQuality();
325 if( 0 == removeCounter ) {
326 ATH_MSG_DEBUG(
" >>> " << __FUNCTION__ <<
": no improvement was found." );
328 ATH_MSG_DEBUG(
" >>> " << __FUNCTION__ <<
": Removed " << removeCounter <<
" tracks; Fit quality improvement: " << fitQuality_begin <<
" ==> " << fitQuality_end );
331 return chi2Probability;
◆ initEvent()
StatusCode VKalVrtAthena::VrtSecInclusive::initEvent |
( |
| ) |
|
|
virtual |
◆ initialize()
StatusCode VKalVrtAthena::VrtSecInclusive::initialize |
( |
| ) |
|
|
virtual |
Definition at line 84 of file VrtSecInclusive.cxx.
91 if (
m_fitSvc.retrieve().isFailure()) {
92 ATH_MSG_ERROR(
"initialize: Can't find Trk::TrkVKalVrtFitter");
93 return StatusCode::SUCCESS;
101 ATH_MSG_INFO(
"initialize: Cannot retrieve Trk::TruthToTrack Tool!");
102 return StatusCode::FAILURE;
110 ATH_MSG_ERROR(
"initialize: failed to retrieve trackToVertex tool ");
111 return StatusCode::SUCCESS;
118 ATH_MSG_ERROR(
"initialize: failed to retrieve trackToVertexIPEstimator tool ");
119 return StatusCode::SUCCESS;
130 ATH_MSG_ERROR(
"initialize: failed to retrieve PixelConditionsSummaryTool");
131 return StatusCode::SUCCESS;
137 ATH_MSG_ERROR(
"initialize: failed to retrieve SCTConditionsSummaryTool");
138 return StatusCode::SUCCESS;
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 };
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 );
235 ATH_CHECK( hist_root->regHist( histDir + pair.first, pair.second ) );
244 m_tree_Vert =
new TTree(
"tree_VrtSecInclusive",
"TTree of VrtSecInclusive");
261 ATH_MSG_INFO(
"initialize: Exit VrtSecInclusive::initialize()");
262 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ lockLeptonDecorations()
◆ lockTrackDecorations() [1/2]
StatusCode VKalVrtAthena::VrtSecInclusive::lockTrackDecorations |
( |
bool |
onlySelection | ) |
const |
|
private |
Definition at line 524 of file VrtSecInclusive.cxx.
555 if(
electron->nTrackParticles() > 0 ) {
564 for(
const auto *trk : *IDtracks ) {
568 return StatusCode::SUCCESS;
◆ lockTrackDecorations() [2/2]
lock decorations at the end of the algorithm
Definition at line 489 of file VrtSecInclusive.cxx.
494 if (onlySelection)
return;
504 cont_nc->lockDecoration (
p.second.auxid());
◆ 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 1269 of file VertexingAlgs.cxx.
1272 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": #verticess = " << workVerticesContainer->size() );
1274 unsigned mergeCounter { 0 };
1277 std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt&
v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
1280 for(
auto& wrkvrt : *workVerticesContainer ) {
1281 if( !wrkvrt.isGood )
continue;
1282 if( wrkvrt.selectedTrackIndices.size() <= 1 )
continue;
1285 for(
auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
1286 auto& vertexToMerge = *ritr;
1288 if( !vertexToMerge.isGood )
continue;
1289 if( vertexToMerge.selectedTrackIndices.size() <= 1 )
continue;
1290 if( &wrkvrt == &vertexToMerge )
continue;
1291 if( vertexToMerge.selectedTrackIndices.size() < wrkvrt.selectedTrackIndices.size() )
continue;
1297 bool mergeFlag {
false };
1300 <<
": vertex " << &wrkvrt <<
" #tracks = " << wrkvrt.selectedTrackIndices.size()
1301 <<
" --> to Merge : " << &vertexToMerge <<
", #tracks = " << vertexToMerge.selectedTrackIndices.size()
1302 <<
" significance = " << significance );
1308 WrkVrt testVertex = wrkvrt;
1310 if(
sc.isFailure() ) {
1315 if( signif < min_signif ) min_signif = signif;
1318 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": method1: vertexToMerge " << &vertexToMerge <<
": test signif = " << signif );
1323 if(
m_jp.
FillHist && min_signif > 0. )
m_hists[
"shuffleMinSignif1"]->Fill( log10( min_signif ) );
1332 for(
auto&
index : vertexToMerge.selectedTrackIndices ) {
1334 WrkVrt testVertex = wrkvrt;
1335 testVertex.selectedTrackIndices.emplace_back(
index );
1338 if(
sc.isFailure() ) {
1343 if( signif < min_signif ) min_signif = signif;
1346 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": method2: vertexToMerge " << &vertexToMerge <<
" track index " <<
index <<
": test signif = " << signif );
1353 if(
m_jp.
FillHist && min_signif > 0. )
m_hists[
"shuffleMinSignif2"]->Fill( log10( min_signif ) );
1361 WrkVrt testVertex = wrkvrt;
1363 for(
auto&
index : vertexToMerge.selectedTrackIndices ) {
1364 testVertex.selectedTrackIndices.emplace_back(
index );
1368 if(
sc.isFailure() ) {
1373 if( signif < min_signif ) min_signif = signif;
1376 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": method3: vertexToMerge " << &vertexToMerge <<
": test signif = " << signif );
1380 if(
m_jp.
FillHist && min_signif > 0. )
m_hists[
"shuffleMinSignif3"]->Fill( log10( min_signif ) );
1388 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertexToMerge " << &vertexToMerge <<
" ==> min signif = " << min_signif <<
" judged to merge" );
1390 auto vertexToMerge_backup = vertexToMerge;
1391 auto wrkvrt_backup = wrkvrt;
1394 if(
sc.isFailure() ) {
1395 vertexToMerge = vertexToMerge_backup;
1396 wrkvrt = wrkvrt_backup;
1409 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1410 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of merges = " << mergeCounter );
1411 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1413 return StatusCode::SUCCESS;
◆ 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 1418 of file VertexingAlgs.cxx.
1421 unsigned mergeCounter { 0 };
1427 for(
auto& wrkvrt : *workVerticesContainer) {
1439 auto& v1 = workVerticesContainer->at(indexPair.first);
1440 auto&
v2 = workVerticesContainer->at(indexPair.second);
1442 const double averageRadius = ( v1.vertex.perp() +
v2.vertex.perp() ) / 2.0;
1445 ATH_MSG_DEBUG(
"Vertices " << indexPair.first <<
" and " << indexPair.second
1446 <<
" are separated by distance " << minDistance );
1450 ATH_MSG_DEBUG(
"Merging FINAL vertices " << indexPair.first <<
" and " << indexPair.second
1451 <<
" which are separated by distance "<< minDistance );
1454 if(
sc.isFailure() ) {}
1463 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1464 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of merges = " << mergeCounter );
1465 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1467 return StatusCode::SUCCESS;
◆ 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.
462 for(
auto&
index :
v2.selectedTrackIndices ) { v1.selectedTrackIndices.emplace_back(
index ); }
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());
471 v2.selectedTrackIndices.clear();
473 v2.closestWrkVrtIndex = 0;
477 v1.closestWrkVrtIndex = 0;
481 if(
sc.isFailure() ) {
485 ATH_MSG_DEBUG(
" >>> " << __FUNCTION__ <<
": failure in merging" );
487 return StatusCode::FAILURE;
490 return StatusCode::SUCCESS;
◆ 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 1974 of file VertexingAlgs.cxx.
1985 for(
auto& wrkvrt : *workVerticesContainer ) {
1988 intermediateVertexContainer->emplace_back( vertex );
1991 vertex->setPosition( wrkvrt.vertex );
1997 int ndof = wrkvrt.ndof();
2001 std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
2002 vertex->setCovariance(fCov);
2006 for(
auto trk_id : wrkvrt.selectedTrackIndices ) {
2014 vertex->addTrackAtVertex( link_trk, 1. );
2018 for(
auto trk_id : wrkvrt.associatedTrackIndices ) {
2026 vertex->addTrackAtVertex( link_trk, 1. );
2039 unsigned count = std::count_if( workVerticesContainer->begin(), workVerticesContainer->end(),
2040 []( WrkVrt&
v ) { return ( v.selectedTrackIndices.size() + v.associatedTrackIndices.size() ) >= 2; } );
2055 for(
auto& vertex : *workVerticesContainer ) {
2056 auto ntrk =
vertex.selectedTrackIndices.size() +
vertex.associatedTrackIndices.size();
2057 if(
vertex.isGood && ntrk >= 2 ) {
2066 if( !
final )
return StatusCode::SUCCESS;
2068 for(
auto& vertex : *workVerticesContainer ) {
2069 auto ntrk =
vertex.selectedTrackIndices.size() +
vertex.associatedTrackIndices.size();
2070 if(
vertex.isGood && ntrk >= 2 ) {
2071 m_hists[
"finalVtxNtrk"] ->Fill( ntrk );
2073 dynamic_cast<TH2F*
>(
m_hists[
"finalVtxNtrkR"] )->Fill( ntrk,
vertex.vertex.perp() );
2077 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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.
668 auto& trackIndices1 = workVerticesContainer->at( pairIndex.first ).selectedTrackIndices;
669 auto& trackIndices2 = workVerticesContainer->at( pairIndex.second ).selectedTrackIndices;
671 if( trackIndices1.size() < 2 )
return 0;
672 if( trackIndices2.size() < 2 )
return 0;
676 for(
auto&
index : trackIndices1 ) {
677 if(
std::find(trackIndices2.begin(),trackIndices2.end(),
index) != trackIndices2.end()) nTrkCom++;
◆ outputHandles()
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()
◆ patternCheck()
◆ patternCheckOuterOnly()
bool VKalVrtAthena::VrtSecInclusive::patternCheckOuterOnly |
( |
const uint32_t & |
pattern, |
|
|
const Amg::Vector3D & |
vertex |
|
) |
| |
|
private |
◆ patternCheckRun1()
Definition at line 1842 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1851 const double absz = fabs(
vertex.z() );
1860 outsidePixelBarrel1_and_insidePixelBarrel2,
1863 outsidePixelBarrel2_and_insidePixelBarrel3,
1866 outsidePixelBarrel3_and_insideSctBarrel0,
1869 outsideSctBarrel0_and_insideSctBarrel1,
1874 Int_t vertex_pattern = 0;
1876 vertex_pattern = insideBeamPipe;
1878 }
else if(
rad < 47.7 && absz < 400.5 ) {
1879 vertex_pattern = insidePixelBarrel1;
1881 }
else if(
rad < 54.4 && absz < 400.5 ) {
1882 vertex_pattern = aroundPixelBarrel1;
1884 }
else if(
rad < 85.5 && absz < 400.5 ) {
1885 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1887 }
else if(
rad < 92.2 && absz < 400.5 ) {
1888 vertex_pattern = aroundPixelBarrel2;
1890 }
else if(
rad < 119.3 && absz < 400.5 ) {
1891 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1893 }
else if(
rad < 126.1 && absz < 400.5 ) {
1894 vertex_pattern = aroundPixelBarrel3;
1896 }
else if(
rad < 290 && absz < 749.0 ) {
1897 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1899 }
else if(
rad < 315 && absz < 749.0 ) {
1900 vertex_pattern = aroundSctBarrel0;
1902 }
else if(
rad < 360 && absz < 749.0 ) {
1903 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1905 }
else if(
rad < 390 && absz < 749.0 ) {
1906 vertex_pattern = aroundSctBarrel1;
1913 if( vertex_pattern == insideBeamPipe ) {
1920 else if( vertex_pattern == insidePixelBarrel1 ) {
1926 else if( vertex_pattern == aroundPixelBarrel1 ) {
1933 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1940 else if( vertex_pattern == aroundPixelBarrel2 ) {
1948 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1955 else if( vertex_pattern == aroundPixelBarrel3 ) {
1964 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1973 else if( vertex_pattern == aroundSctBarrel0 ) {
1983 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1993 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ 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.
2016 const double absz = fabs(
vertex.z() );
2025 outsidePixelBarrel1_and_insidePixelBarrel2,
2028 outsidePixelBarrel2_and_insidePixelBarrel3,
2031 outsidePixelBarrel3_and_insideSctBarrel0,
2034 outsideSctBarrel0_and_insideSctBarrel1,
2039 Int_t vertex_pattern = 0;
2041 vertex_pattern = insideBeamPipe;
2043 }
else if(
rad < 47.7 && absz < 400.5 ) {
2044 vertex_pattern = insidePixelBarrel1;
2046 }
else if(
rad < 54.4 && absz < 400.5 ) {
2047 vertex_pattern = aroundPixelBarrel1;
2049 }
else if(
rad < 85.5 && absz < 400.5 ) {
2050 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
2052 }
else if(
rad < 92.2 && absz < 400.5 ) {
2053 vertex_pattern = aroundPixelBarrel2;
2055 }
else if(
rad < 119.3 && absz < 400.5 ) {
2056 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
2058 }
else if(
rad < 126.1 && absz < 400.5 ) {
2059 vertex_pattern = aroundPixelBarrel3;
2061 }
else if(
rad < 290 && absz < 749.0 ) {
2062 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
2064 }
else if(
rad < 315 && absz < 749.0 ) {
2065 vertex_pattern = aroundSctBarrel0;
2067 }
else if(
rad < 360 && absz < 749.0 ) {
2068 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
2070 }
else if(
rad < 390 && absz < 749.0 ) {
2071 vertex_pattern = aroundSctBarrel1;
2078 if( vertex_pattern == insideBeamPipe ) {
2085 else if( vertex_pattern == insidePixelBarrel1 ) {
2091 else if( vertex_pattern == aroundPixelBarrel1 ) {
2098 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
2104 else if( vertex_pattern == aroundPixelBarrel2 ) {
2111 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
2116 else if( vertex_pattern == aroundPixelBarrel3 ) {
2123 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
2129 else if( vertex_pattern == aroundSctBarrel0 ) {
2136 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
2142 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ patternCheckRun2()
Definition at line 1432 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1443 const double absz = fabs(
vertex.z() );
1452 outsidePixelBarrel0_and_insidePixelBarrel1,
1455 outsidePixelBarrel1_and_insidePixelBarrel2,
1458 outsidePixelBarrel2_and_insidePixelBarrel3,
1461 outsidePixelBarrel3_and_insideSctBarrel0,
1464 outsideSctBarrel0_and_insideSctBarrel1,
1469 int vertex_pattern = 0;
1471 vertex_pattern = insideBeamPipe;
1473 }
else if(
rad < 31.0 && absz < 331.5 ) {
1474 vertex_pattern = insidePixelBarrel0;
1476 }
else if(
rad < 38.4 && absz < 331.5 ) {
1477 vertex_pattern = aroundPixelBarrel0;
1479 }
else if(
rad < 47.7 && absz < 400.5 ) {
1480 vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1482 }
else if(
rad < 54.4 && absz < 400.5 ) {
1483 vertex_pattern = aroundPixelBarrel1;
1485 }
else if(
rad < 85.5 && absz < 400.5 ) {
1486 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1488 }
else if(
rad < 92.2 && absz < 400.5 ) {
1489 vertex_pattern = aroundPixelBarrel2;
1491 }
else if(
rad < 119.3 && absz < 400.5 ) {
1492 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1494 }
else if(
rad < 126.1 && absz < 400.5 ) {
1495 vertex_pattern = aroundPixelBarrel3;
1497 }
else if(
rad < 290 && absz < 749.0 ) {
1498 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1500 }
else if(
rad < 315 && absz < 749.0 ) {
1501 vertex_pattern = aroundSctBarrel0;
1503 }
else if(
rad < 360 && absz < 749.0 ) {
1504 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1506 }
else if(
rad < 390 && absz < 749.0 ) {
1507 vertex_pattern = aroundSctBarrel1;
1512 unsigned nPixelLayers { 0 };
1524 if( vertex_pattern == insideBeamPipe ) {
1527 if( nPixelLayers < 3 )
return false;
1530 }
else if( vertex_pattern == insidePixelBarrel0 ) {
1533 if( nPixelLayers < 3 )
return false;
1537 else if( vertex_pattern == aroundPixelBarrel0 ) {
1541 if( nPixelLayers < 2 )
return false;
1545 else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1549 if( nPixelLayers < 2 )
return false;
1553 else if( vertex_pattern == aroundPixelBarrel1 ) {
1558 if( nPixelLayers < 2 )
return false;
1562 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1567 if( nPixelLayers < 2 )
return false;
1571 else if( vertex_pattern == aroundPixelBarrel2 ) {
1580 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1588 else if( vertex_pattern == aroundPixelBarrel3 ) {
1598 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1608 else if( vertex_pattern == aroundSctBarrel0 ) {
1619 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1630 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ 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.
1657 const double absz = fabs(
vertex.z() );
1666 outsidePixelBarrel0_and_insidePixelBarrel1,
1669 outsidePixelBarrel1_and_insidePixelBarrel2,
1672 outsidePixelBarrel2_and_insidePixelBarrel3,
1675 outsidePixelBarrel3_and_insideSctBarrel0,
1678 outsideSctBarrel0_and_insideSctBarrel1,
1683 int vertex_pattern = 0;
1685 vertex_pattern = insideBeamPipe;
1687 }
else if(
rad < 31.0 && absz < 331.5 ) {
1688 vertex_pattern = insidePixelBarrel0;
1690 }
else if(
rad < 38.4 && absz < 331.5 ) {
1691 vertex_pattern = aroundPixelBarrel0;
1693 }
else if(
rad < 47.7 && absz < 400.5 ) {
1694 vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1696 }
else if(
rad < 54.4 && absz < 400.5 ) {
1697 vertex_pattern = aroundPixelBarrel1;
1699 }
else if(
rad < 85.5 && absz < 400.5 ) {
1700 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1702 }
else if(
rad < 92.2 && absz < 400.5 ) {
1703 vertex_pattern = aroundPixelBarrel2;
1705 }
else if(
rad < 119.3 && absz < 400.5 ) {
1706 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1708 }
else if(
rad < 126.1 && absz < 400.5 ) {
1709 vertex_pattern = aroundPixelBarrel3;
1711 }
else if(
rad < 290 && absz < 749.0 ) {
1712 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1714 }
else if(
rad < 315 && absz < 749.0 ) {
1715 vertex_pattern = aroundSctBarrel0;
1717 }
else if(
rad < 360 && absz < 749.0 ) {
1718 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1720 }
else if(
rad < 390 && absz < 749.0 ) {
1721 vertex_pattern = aroundSctBarrel1;
1727 unsigned nPixelLayers { 0 };
1739 if( vertex_pattern == insideBeamPipe ) {
1743 if( nPixelLayers < 3 )
return false;
1745 }
else if( vertex_pattern == insidePixelBarrel0 ) {
1749 if( nPixelLayers < 3 )
return false;
1754 else if( vertex_pattern == aroundPixelBarrel0 ) {
1759 if( nPixelLayers < 3 )
return false;
1763 else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1767 if( nPixelLayers < 3 )
return false;
1771 else if( vertex_pattern == aroundPixelBarrel1 ) {
1776 if( nPixelLayers < 2 )
return false;
1780 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1784 if( nPixelLayers < 2 )
return false;
1788 else if( vertex_pattern == aroundPixelBarrel2 ) {
1795 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1800 else if( vertex_pattern == aroundPixelBarrel3 ) {
1808 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1815 else if( vertex_pattern == aroundSctBarrel0 ) {
1823 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1830 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ 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.
996 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": ===============================================================" );
997 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": " <<
name <<
": #vertices = " << workVerticesContainer->size() );
999 std::set<const xAOD::TrackParticle*> usedTracks;
1001 auto concatenateIndicesToString = [](
auto indices,
auto& collection ) -> std::string {
1002 if( 0 ==
indices.size() )
return "";
1004 [&collection](
const std::string&
str,
auto&
index ) { return str +
", " + std::to_string( collection.at(index)->index() ); } );
1007 std::map<const xAOD::TruthVertex*, bool>
previous;
1014 for(
size_t iv=0; iv<workVerticesContainer->size(); iv++) {
1015 const auto& wrkvrt = workVerticesContainer->at(iv);
1017 if( wrkvrt.nTracksTotal() < 2 )
continue;
1019 std::string sels = concatenateIndicesToString( wrkvrt.selectedTrackIndices,
m_selectedTracks );
1020 std::string assocs = concatenateIndicesToString( wrkvrt.associatedTrackIndices,
m_associatedTracks );
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 <<
" }" );
1038 Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
1039 Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
1041 const auto distance = vReco - vTruth;
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() <<
")" );
1077 for(
const auto* trk : usedTracks ) {
msg += Form(
"%ld, ", trk->index() ); }
1080 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": ===============================================================" );
◆ processPrimaryVertices()
StatusCode VKalVrtAthena::VrtSecInclusive::processPrimaryVertices |
( |
| ) |
|
|
private |
◆ rearrangeTracks()
StatusCode VKalVrtAthena::VrtSecInclusive::rearrangeTracks |
( |
std::vector< WrkVrt > * |
workVerticesContainer | ) |
|
|
private |
Definition at line 717 of file VertexingAlgs.cxx.
724 std::vector<long int> processedTracks;
726 unsigned mergeCounter { 0 };
727 unsigned brokenCounter { 0 };
728 unsigned removeTrackCounter { 0 };
733 long int maxSharedTrack;
734 long int worstMatchingVertex;
741 std::map<long int, std::vector<long int> > trackToVertexMap;
750 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": no shared tracks are found --> exit the while loop." );
754 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex [" << worstMatchingVertex <<
"]: maximally shared track index = " << maxSharedTrack
755 <<
", multiplicity = " << trackToVertexMap.at( maxSharedTrack ).size()
756 <<
", worst chi2_trk = " << worstChi2 );
764 std::vector< std::pair<unsigned, unsigned> > badPairs;
770 unsigned nShared { 0 };
773 auto& vrtList = trackToVertexMap.at( maxSharedTrack );
775 auto nGood = std::count_if( vrtList.begin(), vrtList.end(), [&](
auto&
v ) { return workVerticesContainer->at(v).isGood; } );
778 std::vector< std::tuple< std::pair<unsigned, unsigned>,
double,
unsigned> > significanceTuple;
779 enum { kIndexPair, kSignificance, kNshared };
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 );
785 if( !( workVerticesContainer->at(*ivrt).isGood ) )
continue;
786 if( !( workVerticesContainer->at(*jvrt).isGood ) )
continue;
789 if(
std::find( badPairs.begin(), badPairs.end(), pair ) != badPairs.end() )
continue;
793 auto& ivrtTrks = workVerticesContainer->at(*ivrt).selectedTrackIndices;
794 auto& jvrtTrks = workVerticesContainer->at(*jvrt).selectedTrackIndices;
796 auto nSharedTracks = std::count_if( ivrtTrks.begin(), ivrtTrks.end(),
798 return std::find( jvrtTrks.begin(), jvrtTrks.end(), index ) != jvrtTrks.end();
801 significanceTuple.emplace_back( pair, signif, nSharedTracks );
805 if( significanceTuple.empty() ) {
806 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": no vertex pairs are found --> exit the while loop." );
810 auto minSignificanceTuple = std::min_element( significanceTuple.begin(), significanceTuple.end(), [&](
auto&
t1,
auto&
t2 ) { return std::get<kSignificance>(t1) < std::get<kSignificance>(t2); } );
812 indexPair = std::get<kIndexPair> ( *minSignificanceTuple );
813 minSignificance = std::get<kSignificance> ( *minSignificanceTuple );
814 nShared = std::get<kNshared> ( *minSignificanceTuple );
817 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": minSignificance = " << minSignificance );
819 if( minSignificance < m_jp.VertexMergeCut || nShared >= 2 ) {
821 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": attempt to merge vertices " << indexPair.first <<
" and " << indexPair.second );
823 WrkVrt vertex_backup1 = workVerticesContainer->at( indexPair.first );
824 WrkVrt vertex_backup2 = workVerticesContainer->at( indexPair.second );
826 StatusCode sc =
mergeVertices( workVerticesContainer->at( indexPair.first ), workVerticesContainer->at( indexPair.second ) );
830 if(
sc.isFailure() ) {
832 workVerticesContainer->at( indexPair.first ) = vertex_backup1;
833 workVerticesContainer->at( indexPair.second ) = vertex_backup2;
834 badPairs.emplace_back( indexPair );
839 workVerticesContainer->at( indexPair.second ).isGood =
false;
846 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Merged vertices " << indexPair.first <<
" and " << indexPair.second <<
". merged vertex multiplicity = " << workVerticesContainer->at( indexPair.first ).selectedTrackIndices.size() );
854 auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
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() );
859 removeTrackCounter++;
861 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": removed track " << maxSharedTrack <<
" from vertex " << worstMatchingVertex );
863 if( wrkvrt.selectedTrackIndices.size() < 2 ) {
864 wrkvrt.isGood =
false;
870 if(
sc.isFailure() ) {
871 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
884 auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
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() );
889 if( wrkvrt.nTracksTotal() >=2 ) {
891 auto wrkvrt_backup = wrkvrt;
893 if(
sc.isFailure() ) {
894 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
895 wrkvrt = wrkvrt_backup;
899 wrkvrt.isGood =
false;
903 removeTrackCounter++;
905 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": removed track " << maxSharedTrack <<
" from vertex " << worstMatchingVertex );
913 for(
auto& wrkvrt : *workVerticesContainer ) {
915 if(!wrkvrt.isGood )
continue;
916 if( wrkvrt.selectedTrackIndices.size() < 3 )
continue;
918 WrkVrt backup = wrkvrt;
920 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
922 if( wrkvrt.nTracksTotal() < 2 ) wrkvrt.isGood =
false;
927 m_ntupleVars->get<
unsigned int>(
"NumRearrSecVrt" )=workVerticesContainer->size();
928 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Size of Solution Set: "<<
m_ntupleVars->get<
unsigned int>(
"NumRearrSecVrt" ));
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__ <<
"----------------------------------------------" );
935 return StatusCode::SUCCESS;
◆ 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.
949 unsigned reassembleCounter { 0 };
952 std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt&
v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
954 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": #vertices = " << workVerticesContainer->size() );
956 for(
auto& wrkvrt : *workVerticesContainer ) {
957 if( !wrkvrt.isGood )
continue;
958 if( wrkvrt.selectedTrackIndices.size() <= 1 )
continue;
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() <<
")" );
970 std::map<unsigned, std::vector<WrkVrt>::reverse_iterator> mergiableVertex;
971 std::set<std::vector<WrkVrt>::reverse_iterator> mergiableVerticesSet;
973 for(
auto&
index : wrkvrt.selectedTrackIndices ) {
977 mergiableVertex[
index] = workVerticesContainer->rend();
979 std::vector<double> distances;
982 for(
auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
983 auto& targetVertex = *ritr;
985 if( &wrkvrt == &targetVertex )
continue;
986 if( wrkvrt.selectedTrackIndices.size() >= targetVertex.selectedTrackIndices.size() )
continue;
989 std::vector<double> impactParameters;
990 std::vector<double> impactParErrors;
994 const auto&
distance = hypot( impactParameters.at(0), impactParameters.at(1) );
1000 mergiableVertex[
index] = ritr;
1001 mergiableVerticesSet.emplace( ritr );
1005 auto min_distance = !distances.empty() ? *(std::min_element( distances.begin(), distances.end() )) :
AlgConsts::invalidFloat;
1007 if( mergiableVertex[
index] == workVerticesContainer->rend() ) {
1008 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": track " << trk <<
" --> none : min distance = " << min_distance );
1010 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": track " << trk <<
" --> " << &( *(mergiableVertex[
index]) ) <<
" --> size = " << mergiableVertex[
index]->selectedTrackIndices.size() <<
": min distance = " << min_distance );
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(); } );
1019 if( mergiableVerticesSet.size() == 1 && count_mergiable == wrkvrt.selectedTrackIndices.size() ) {
1021 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": identified a unique association destination vertex" );
1023 WrkVrt& destination = *( mergiableVertex.begin()->second );
1024 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": destination #tracks before merging = " << destination.selectedTrackIndices.size() );
1027 if(
sc.isFailure() ) {
1028 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failure in vertex merging" );
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() <<
")" );
1044 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": destination #tracks after merging = " << destination.selectedTrackIndices.size() );
1046 reassembleCounter++;
1052 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1053 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": reassembled vertices = " << reassembleCounter );
1054 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1056 return StatusCode::SUCCESS;
◆ refitAndSelectGoodQualityVertices()
StatusCode VKalVrtAthena::VrtSecInclusive::refitAndSelectGoodQualityVertices |
( |
std::vector< WrkVrt > * |
workVerticesContainer | ) |
|
|
private |
finalization of the vertex and store to xAOD::VertexContainer
Definition at line 1474 of file VertexingAlgs.cxx.
1489 enum { kPt, kEta, kPhi, kD0, kZ0, kErrP, kErrD0, kErrZ0, kChi2SV };
1505 std::map<const WrkVrt*, const xAOD::Vertex*> wrkvrtLinkMap;
1508 const auto& ctx = Gaudi::Hive::currentContext();
1510 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": input #vertices = " << workVerticesContainer->size() );
1513 for(
auto& wrkvrt : *workVerticesContainer ) {
1515 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": candidate vertex: "
1516 <<
" isGood = " << (wrkvrt.isGood?
"true" :
"false")
1517 <<
", #ntrks = " << wrkvrt.nTracksTotal()
1518 <<
", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
1519 <<
", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
1521 <<
", (r, z) = (" << wrkvrt.vertex.perp()
1522 <<
", " << wrkvrt.vertex.z() <<
")" );
1530 if( wrkvrt.nTracksTotal() < 2 ) {
1531 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": ntrk < 2 --> rejected." );
1539 if( wrkvrt.vertex.perp() < 31.0 ) {
1542 wrkvrt.selectedTrackIndices.erase( std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1543 [&](
auto&
index ) {
1544 auto* trk = m_selectedTracks.at( index );
1548 wrkvrt.selectedTrackIndices.end() );
1551 wrkvrt.associatedTrackIndices.erase( std::remove_if( wrkvrt.associatedTrackIndices.begin(), wrkvrt.associatedTrackIndices.end(),
1552 [&](
auto&
index ) {
1553 auto* trk = m_associatedTracks.at( index );
1557 wrkvrt.associatedTrackIndices.end() );
1567 WrkVrt backup = wrkvrt;
1571 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1576 if( wrkvrt.nTracksTotal() < 2 )
continue;
1579 if( wrkvrt.selectedTrackIndices.size() < 2 )
continue;
1586 WrkVrt backup = wrkvrt;
1589 if(
sc.isFailure() ) {
1591 auto indices = wrkvrt.associatedTrackIndices;
1593 wrkvrt.associatedTrackIndices.clear();
1595 if(
sc.isFailure() ) {
1596 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
1599 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1603 wrkvrt.associatedTrackIndices.emplace_back(
index );
1606 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
1613 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1624 TLorentzVector sumP4_pion;
1625 TLorentzVector sumP4_electron;
1626 TLorentzVector sumP4_proton;
1629 bool good_flag =
true;
1631 std::map<const std::deque<long int>*,
const std::vector<const xAOD::TrackParticle*>&> indicesSet
1637 for(
auto& pair : indicesSet ) {
1639 const auto*
indices = pair.first;
1640 const auto& tracks = pair.second;
1642 for(
const auto& itrk : *
indices ) {
1643 const auto* trk = tracks.at( itrk );
1646 ATH_MSG_INFO(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": Failed in obtaining the SV perigee!" );
1654 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": sv perigee could not be obtained --> rejected" );
1661 std::vector<const xAOD::TrackParticle*> tracks;
1662 std::vector< std::pair<const xAOD::TrackParticle*, double> > trackChi2Pairs;
1666 for(
auto& pair : indicesSet ) {
1667 for(
const auto&
index : *pair.first ) tracks.emplace_back( pair.second.at(
index ) );
1670 auto trkitr = tracks.begin();
1671 auto chi2itr = wrkvrt.Chi2PerTrk.begin();
1673 for( ; ( trkitr!=tracks.end() && chi2itr!=wrkvrt.Chi2PerTrk.end() ); ++trkitr, ++chi2itr ) {
1674 trackChi2Pairs.emplace_back( *trkitr, *chi2itr );
1680 TLorentzVector sumP4_selected;
1682 bool badIPflag {
false };
1685 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Track loop: size = " << tracks.size() );
1686 for(
auto& pair : trackChi2Pairs ) {
1688 const auto* trk = pair.first;
1689 const auto& chi2AtSV = pair.second;
1691 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": start." );
1700 double trk_pt = trk->pt();
1701 double trk_eta = trk->eta();
1702 double trk_phi = trk->phi();
1704 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": in vrt chg/pt/phi/eta = "
1705 << trk->charge() <<
","
1712 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": Get the prigee of the track at the vertex." );
1716 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": Failed in obtaining the SV perigee!" );
1721 (*m_decor_is_svtrk_final)( *trk ) =
true;
1725 double qOverP_wrtSV = sv_perigee->parameters() [
Trk::qOverP];
1726 double theta_wrtSV = sv_perigee->parameters() [
Trk::theta];
1727 double p_wrtSV = 1.0 / std::abs( qOverP_wrtSV );
1728 double pt_wrtSV = p_wrtSV *
sin( theta_wrtSV );
1729 double eta_wrtSV = -
log(
tan( theta_wrtSV/2. ) );
1730 double phi_wrtSV = sv_perigee->parameters() [
Trk::phi];
1731 double d0_wrtSV = sv_perigee->parameters() [
Trk::d0];
1732 double z0_wrtSV = sv_perigee->parameters() [
Trk::z0];
1733 double errd0_wrtSV = (*sv_perigee->covariance())(
Trk::d0,
Trk::d0 );
1734 double errz0_wrtSV = (*sv_perigee->covariance())(
Trk::z0,
Trk::z0 );
1748 (*m_decor_is_svtrk_final)( *trk ) =
true;
1750 TLorentzVector p4wrtSV_pion;
1751 TLorentzVector p4wrtSV_electron;
1752 TLorentzVector p4wrtSV_proton;
1759 if( is_associatedAcc.isAvailable(*trk) ) {
1760 if( !is_associatedAcc(*trk) ) {
1761 sumP4_selected += p4wrtSV_pion;
1764 sumP4_selected += p4wrtSV_pion;
1767 sumP4_pion += p4wrtSV_pion;
1768 sumP4_electron += p4wrtSV_electron;
1769 sumP4_proton += p4wrtSV_proton;
1771 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": end." );
1776 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Final Sec.Vertex=" << wrkvrt.nTracksTotal() <<
", "
1777 <<wrkvrt.vertex.perp() <<
", "<<wrkvrt.vertex.z() <<
", "
1778 <<wrkvrt.vertex.phi() <<
", mass = "<< sumP4_pion.M() <<
"," << sumP4_electron.M() );
1785 std::vector<double> opAngles;
1787 for(
auto itr1 = tracks.begin(); itr1 != tracks.end(); ++itr1 ) {
1788 for(
auto itr2 =
std::next( itr1 ); itr2 != tracks.end(); ++itr2 ) {
1789 const auto&
p1 = (*itr1)->p4().Vect();
1790 const auto&
p2 = (*itr2)->p4().Vect();
1792 opAngles.emplace_back(
cos );
1795 minOpAng = *( std::max_element( opAngles.begin(), opAngles.end() ) );
1802 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Bad impact parameter signif wrt SV was flagged." );
1807 bool oneLepMatchTrack =
false;
1808 for (
const auto *trk: tracks) {
1810 oneLepMatchTrack =
true;
1816 if (!oneLepMatchTrack)
continue;
1822 wrkvrt.isGood =
true;
1827 secondaryVertexContainer->emplace_back( vertex );
1830 vertex->setPosition( wrkvrt.vertex );
1837 vertex->setFitQuality( wrkvrt.Chi2_core, wrkvrt.ndof_core() );
1840 std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
1841 vertex->setCovariance(fCov);
1862 vtx_pxAcc(*vertex) = wrkvrt.vertexMom.Px();
1863 vtx_pyAcc(*vertex) = wrkvrt.vertexMom.Py();
1864 vtx_pzAcc(*vertex) = wrkvrt.vertexMom.Pz();
1866 vtx_massAcc(*vertex) = wrkvrt.vertexMom.M();
1867 vtx_chargeAcc(*vertex) = wrkvrt.Charge;
1869 chi2_coreAcc(*vertex) = wrkvrt.Chi2_core;
1870 ndof_coreAcc(*vertex) = wrkvrt.ndof_core();
1871 chi2_assocAcc(*vertex) = wrkvrt.Chi2;
1872 ndof_assocAcc(*vertex) = wrkvrt.ndof();
1874 massAcc(*vertex) = sumP4_pion.M();
1875 mass_eAcc(*vertex) = sumP4_electron.M();
1876 mass_selectedTracksAcc(*vertex) = sumP4_selected.M();
1877 minOpAngAcc(*vertex) = minOpAng;
1878 num_trksAcc(*vertex) = wrkvrt.nTracksTotal();
1879 num_selectedTracksAcc(*vertex) = wrkvrt.selectedTrackIndices.size();
1880 num_associatedTracksAcc(*vertex) = wrkvrt.associatedTrackIndices.size();
1881 dCloseVrtAcc(*vertex) = wrkvrt.closestWrkVrtValue;
1885 for(
auto trk_id : wrkvrt.selectedTrackIndices ) {
1893 vertex->addTrackAtVertex( link_trk, 1. );
1897 for(
auto trk_id : wrkvrt.associatedTrackIndices ) {
1905 vertex->addTrackAtVertex( link_trk, 1. );
1918 if( mappedVtx.
valid ) {
1920 local_layerIndexAcc(*vertex) = mappedVtx.
layerIndex;
1941 wrkvrtLinkMap[&wrkvrt] =
vertex;
1955 }
catch (
const std::out_of_range&
e) {
1957 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": out of range error is detected: " <<
e.what() );
1959 return StatusCode::SUCCESS;
1963 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": some other error is detected." );
1965 return StatusCode::SUCCESS;
1969 return StatusCode::SUCCESS;
◆ refitVertex() [1/2]
StatusCode VKalVrtAthena::VrtSecInclusive::refitVertex |
( |
WrkVrt & |
workVertex | ) |
|
|
private |
◆ refitVertex() [2/2]
Definition at line 505 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
510 vector<const xAOD::NeutralParticle*> dummyNeutrals;
512 int nth = workVertex.selectedTrackIndices.size();
515 workVertex.isGood =
false;
516 return StatusCode::SUCCESS;
519 vector<const xAOD::TrackParticle*> ListBaseTracks;
521 workVertex.Chi2PerTrk.clear();
523 for(
const auto&
index : workVertex.selectedTrackIndices ) {
528 for(
const auto&
index : workVertex.associatedTrackIndices ) {
533 auto& vertexPos = workVertex.vertex;
535 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), istate );
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 ) {
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() <<
", " <<
")" );
554 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), istate );
558 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), istate );
562 ATH_MSG_VERBOSE(
" >>> refitVertex: approx vertex is set. Now going to perform fitting..." );
566 workVertex.vertexMom,
568 workVertex.vertexCov,
569 workVertex.Chi2PerTrk,
574 auto&
cov = workVertex.vertexCov;
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) <<
")" );
◆ refitVertexWithSuggestion() [1/2]
StatusCode VKalVrtAthena::VrtSecInclusive::refitVertexWithSuggestion |
( |
WrkVrt & |
workVertex, |
|
|
const Amg::Vector3D & |
suggestedPosition |
|
) |
| |
|
private |
◆ refitVertexWithSuggestion() [2/2]
Definition at line 593 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
599 vector<const xAOD::NeutralParticle*> dummyNeutrals;
601 int nth = workVertex.selectedTrackIndices.size();
604 workVertex.isGood =
false;
605 return StatusCode::SUCCESS;
608 vector<const xAOD::TrackParticle*> ListBaseTracks;
610 workVertex.Chi2PerTrk.clear();
612 for(
const auto&
index : workVertex.selectedTrackIndices ) {
617 for(
const auto&
index : workVertex.associatedTrackIndices ) {
622 auto& vertexPos = workVertex.vertex;
624 m_fitSvc->setApproximateVertex( suggestedPosition.x(), suggestedPosition.y(), suggestedPosition.z(), istate );
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() );
635 ATH_MSG_VERBOSE(
" >>> " << __FUNCTION__ <<
": approx vertex is set. Now going to perform fitting..." );
639 workVertex.vertexMom,
641 workVertex.vertexCov,
642 workVertex.Chi2PerTrk,
647 auto&
cov = workVertex.vertexCov;
649 if(
SC.isFailure() )
ATH_MSG_VERBOSE(
" >>> " << __FUNCTION__ <<
": SC in refitVertex returned failure ");
650 ATH_MSG_VERBOSE(
" >>> " << __FUNCTION__ <<
": "<<
SC<<
", "<<ListBaseTracks.size()<<
","<<workVertex.Chi2PerTrk.size());
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) <<
")" );
◆ 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.
2333 const auto&
vertex = wrkvrt.vertex;
2335 std::map< std::deque<long int>*, std::vector<const xAOD::TrackParticle*>& > indexMap
2340 for(
auto& pair : indexMap ) {
2343 auto& tracks = pair.second;
2346 [&](
auto&
index ) {
2347 bool isConsistent = (this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( tracks.at(index), vertex );
2348 return !isConsistent;
◆ 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.
343 auto& wrkvrt = workVerticesContainer->at(SelectedVertex);
344 auto& tracks = wrkvrt.selectedTrackIndices;
347 auto end =
std::remove_if( tracks.begin(), tracks.end(), [&](
long int index) { return index == trackIndexToRemove; } );
348 tracks.erase(
end, tracks.end() );
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() );
360 if( wrkvrt.selectedTrackIndices.size() == 1 ) {
362 const auto& leftTrackIndex = *( tracks.begin() );
363 auto&
list = TrkInVrt->at(leftTrackIndex);
◆ renounce()
◆ renounceArray()
◆ selectInDetAndGSFTracks()
StatusCode VKalVrtAthena::VrtSecInclusive::selectInDetAndGSFTracks |
( |
| ) |
|
|
private |
Definition at line 304 of file TrackSelectionAlgs.cxx.
321 std::vector<const xAOD::TrackParticle*> IDTrksFromEls;
324 for(
const auto *electron : *
electrons ) {
325 if( 0 ==
electron->nTrackParticles() ) {
continue; }
334 for(
const auto *trk : *IDtracks ) {
336 if (
std::find(IDTrksFromEls.begin(), IDTrksFromEls.end(), trk) != IDTrksFromEls.end() ) {
continue; }
341 for (
const auto *muon : *muons) {
343 const auto*
mu_trk =
muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
348 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total ID tracks = " << IDtracks->size() );
352 return StatusCode::SUCCESS;
◆ selectTrack()
Vertexing Algorithm Member Functions.
select tracks which become seeds for vertex finding
Definition at line 136 of file TrackSelectionAlgs.cxx.
165 std::vector<bool> cutBits;
171 m_hists[
"trkSelCuts"]->Fill( 0 );
172 for(
size_t ibit = 0; ibit < cutBits.size(); ibit++) {
173 if( cutBits.at(ibit) ) {
174 m_hists[
"trkSelCuts"]->Fill( ibit+1 );
182 bool isGood_standard = (
std::find( cutBits.begin(), cutBits.end(),
false ) == cutBits.end() );
184 if( isGood_standard ) {
202 (*m_decor_isSelected)( *trk ) =
true;
206 if (id_tr !=
nullptr){
207 (*m_decor_isSelected)( *id_tr ) =
true; }
214 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Track index " << trk->index() <<
" has been selected." );
215 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Track index " << trk->index()
217 <<
" pt = " << trk->pt()
218 <<
" eta = " << trk->eta()
219 <<
" d0 = " << trk->d0()
220 <<
" z0 = " << trk->z0() <<
"." );
◆ selectTrack_chi2Cut()
◆ selectTrack_d0Cut()
◆ selectTrack_d0errCut()
◆ selectTrack_d0signifCut()
◆ selectTrack_hitPattern()
Definition at line 38 of file TrackSelectionAlgs.cxx.
54 uint8_t SharedHits = PixShare + SCTShare;
67 if(TRTHits == 0 && PixelHits < 2)
return false;
70 if( PixelHits == 0 && SCTHits < 6 )
return false;
◆ selectTrack_hitPatternTight()
◆ selectTrack_LRTR3Cut()
Definition at line 102 of file TrackSelectionAlgs.cxx.
112 bool geometric_cut =
dTheta < 1. || std::fabs(trk->
z0()) < 200. ;
114 bool z0_cut = trk->
z0() <= 500. ;
116 bool NSiHits_cut =
nSiHits >=8 ;
117 bool NSCTHits_cut = nsct >= 7 ;
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() ) ;
123 const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco = trk->
patternRecoInfo();
124 bool isLRT = patternReco.test(49) ;
127 return (z0_cut && chi2_cut && NSiHits_cut && NSCTHits_cut && NSCTHoles_cut && geometric_cut);
◆ selectTrack_notPVassociated()
◆ selectTrack_pTCut()
◆ selectTrack_z0Cut()
◆ selectTrack_z0errCut()
◆ selectTrack_z0signifCut()
◆ selectTracksFromElectrons()
StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksFromElectrons |
( |
| ) |
|
|
private |
◆ selectTracksFromMuons()
StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksFromMuons |
( |
| ) |
|
|
private |
Definition at line 255 of file TrackSelectionAlgs.cxx.
261 for(
const auto *
const muon : *muons ) {
262 const auto* trk =
muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
267 if (
muon->muonType() == xAOD::Muon::CaloTagged)
continue;
273 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total muons = " << muons->size() );
276 return StatusCode::SUCCESS;
◆ selectTracksInDet()
StatusCode VKalVrtAthena::VrtSecInclusive::selectTracksInDet |
( |
| ) |
|
|
private |
Definition at line 227 of file TrackSelectionAlgs.cxx.
238 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Extracted xAOD::TrackParticle number=" << trackParticleContainer->size() );
241 m_ntupleVars->get<
unsigned int>(
"NumAllTrks" ) =
static_cast<int>( trackParticleContainer->size() );
245 for(
const auto *trk : *trackParticleContainer ) {
selectTrack( trk ); }
247 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total ID tracks = " << trackParticleContainer->size() );
250 return StatusCode::SUCCESS;
◆ setIntersection() [1/2]
◆ setIntersection() [2/2]
Definition at line 40 of file Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h.
44 const EventContext& ctx = Gaudi::Hive::currentContext();
45 std::unique_ptr<Trk::TrackParameters>
Output;
49 IntersectionPos_barrel *
barrel =
dynamic_cast<IntersectionPos_barrel*
>(
layer );
65 IntersectionPos_endcap *endcap =
dynamic_cast<IntersectionPos_endcap*
>(
layer );
68 ", zpos = " << endcap->zpos() <<
69 ", Rmin = " << endcap->rmin() <<
70 ", Rmax = " << endcap->rmax() );
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 );
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();
◆ setupNtuple()
StatusCode VKalVrtAthena::VrtSecInclusive::setupNtuple |
( |
| ) |
|
|
private |
◆ setupNtupleVariables()
StatusCode VKalVrtAthena::VrtSecInclusive::setupNtupleVariables |
( |
| ) |
|
|
private |
Definition at line 28 of file AANT_Tools.cxx.
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" );
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" );
76 m_ntupleVars->addNewVar< vector<int> > (
"SelTrk_barcode" );
79 m_ntupleVars->addNewVar< vector<double> > (
"SVTrk_pT" );
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" );
94 m_ntupleVars->addNewVar< vector<double> > (
"SVTrk_matchPr" );
95 m_ntupleVars->addNewVar< vector<int> > (
"SVTrk_TrkAuth" );
96 m_ntupleVars->addNewVar< vector<int> > (
"SVTrk_TrkLowPt" );
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" );
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" );
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" );
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" );
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" );
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" );
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" );
204 return StatusCode::SUCCESS;
◆ significanceBetweenVertices()
double VKalVrtAthena::VrtSecInclusive::significanceBetweenVertices |
( |
const WrkVrt & |
v1, |
|
|
const WrkVrt & |
v2 |
|
) |
| const |
|
private |
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
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.
911 trackToVertexMap.clear();
913 for(
size_t iv = 0; iv<workVerticesContainer->size(); iv++ ) {
915 WrkVrt&
vertex = workVerticesContainer->at(iv);
917 auto& trackIndices =
vertex.selectedTrackIndices;
918 if( !
vertex.isGood )
continue;
919 if( trackIndices.size() < 2 )
continue;
921 for(
auto&
index : trackIndices ) {
922 trackToVertexMap[
index].emplace_back( iv );
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);
◆ updateVHKA()
◆ m_associatedTracks
◆ m_atlasId
◆ m_BeamPosition
std::vector<double> VKalVrtAthena::VrtSecInclusive::m_BeamPosition |
|
private |
◆ m_checkPatternStrategy
std::string VKalVrtAthena::VrtSecInclusive::m_checkPatternStrategy |
|
private |
◆ m_decor_is_svtrk_final
std::optional< SG::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_is_svtrk_final |
|
private |
◆ m_decor_isAssociated
std::optional< SG::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_isAssociated |
|
private |
◆ m_decor_isSelected
std::optional< SG::Decorator< char > > VKalVrtAthena::VrtSecInclusive::m_decor_isSelected |
|
private |
◆ m_decor_svLink
std::optional< VertexELType > VKalVrtAthena::VrtSecInclusive::m_decor_svLink |
|
private |
◆ m_detStore
◆ m_eventInfoKey
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_extrapolatedPatternBank
PatternBank VKalVrtAthena::VrtSecInclusive::m_extrapolatedPatternBank |
|
private |
◆ m_extrapolator
◆ m_fitSvc
◆ m_hists
std::map<std::string, TH1*> VKalVrtAthena::VrtSecInclusive::m_hists |
|
private |
◆ m_incomp
std::vector< std::pair<int, int> > VKalVrtAthena::VrtSecInclusive::m_incomp |
|
private |
◆ m_ipDecors
◆ m_jp
◆ m_leptonicTracks
◆ m_matchMap
◆ m_ntupleVars
std::unique_ptr<NtupleVars> VKalVrtAthena::VrtSecInclusive::m_ntupleVars |
|
private |
◆ m_patternStrategyFuncs
std::map<std::string, PatternStrategyFunc> VKalVrtAthena::VrtSecInclusive::m_patternStrategyFuncs |
|
private |
◆ m_pixelCondSummaryTool
◆ m_pixelId
const PixelID* VKalVrtAthena::VrtSecInclusive::m_pixelId = nullptr |
|
private |
◆ m_primaryVertices
◆ m_sctCondSummaryTool
◆ m_sctId
const SCT_ID* VKalVrtAthena::VrtSecInclusive::m_sctId = nullptr |
|
private |
◆ m_selectedTracks
◆ m_thePV
◆ m_tracingTruthVertices
◆ m_trackSelectionAlgs
◆ m_trackSelectionFuncs
std::vector<CutFunc> VKalVrtAthena::VrtSecInclusive::m_trackSelectionFuncs |
|
private |
◆ m_trackToVertexIPEstimatorTool
◆ m_trackToVertexTool
◆ m_tree_Vert
TTree* VKalVrtAthena::VrtSecInclusive::m_tree_Vert |
|
private |
◆ m_trkDecors
std::map< unsigned, SG::Decorator<float> > VKalVrtAthena::VrtSecInclusive::m_trkDecors |
|
private |
◆ m_truthToTrack
◆ m_varHandleArraysDeclared
◆ m_vertexingAlgorithms
std::vector< std::pair<std::string, vertexingAlg> > VKalVrtAthena::VrtSecInclusive::m_vertexingAlgorithms |
|
private |
◆ m_vertexingAlgorithmStep
unsigned VKalVrtAthena::VrtSecInclusive::m_vertexingAlgorithmStep = 0U |
|
private |
◆ m_vertexingStatus
int VKalVrtAthena::VrtSecInclusive::m_vertexingStatus = 0 |
|
private |
◆ m_vertexingStatusKey
◆ m_vertexMapper
◆ m_vhka
The documentation for this class was generated from the following files:
bool doSelectTracksFromMuons
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
bool is_pixel(Identifier id) const
void setIntersection(Track *trk, IntersectionPos *bec, const Trk::Perigee *per)
SG::AuxElement::Decorator< std::vector< std::vector< float > > > IPDecoratorType
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
bool selectTrack_LRTR3Cut(const xAOD::TrackParticle *) const
std::map< std::string, TH1 * > m_hists
constexpr double infinitesimal
double distanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the physical distance
bool doPVcompatibilityCut
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Condition service.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
bool checkTrackHitPatternToVertexOuterOnly(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
bool patternCheck(const uint32_t &pattern, const Amg::Vector3D &vertex)
#define maxValue(current, test)
ToolHandle< Trk::IVertexMapper > m_vertexMapper
unsigned m_vertexingAlgorithmStep
void dumpTruthInformation()
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Vertex_v1 Vertex
Define the latest version of the vertex class.
bool passThroughTrackSelection
std::string find(const std::string &s)
return a remapped string
bool selectTrack_pTCut(const xAOD::TrackParticle *) const
bool doSelectIDAndGSFTracks
StatusCode setupNtupleVariables()
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
double associateMaxD0Signif
bool doSuggestedRefitOnMerging
float charge() const
Returns the charge.
bool is_sct(Identifier id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
const xAOD::Vertex * m_thePV
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
double improveVertexChi2(WrkVrt &)
attempt to improve the vertex chi2 by removing the most-outlier track one by one until the vertex chi...
std::string secondaryVerticesContainerName
@ sctEndCap0
and 9 sct discs (on each side)
std::vector< std::pair< std::string, vertexingAlg > > m_vertexingAlgorithms
double findWorstChi2ofMaximallySharedTrack(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &, long int &, long int &)
bool checkTrackHitPatternToVertexByExtrapolationAssist(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
std::pair< long int, long int > indices
struct VKalVrtAthena::VrtSecInclusive::track_summary_properties track_summary
constexpr double chi2PerTrackInitValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
std::vector< const xAOD::TrackParticle * > m_leptonicTracks
PatternBank m_extrapolatedPatternBank
std::unique_ptr< NtupleVars > m_ntupleVars
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
std::vector< ALFA_RawDataCollection_p1 > t1
ToolHandle< Trk::IExtrapolator > m_extrapolator
StatusCode mergeVertices(WrkVrt &destination, WrkVrt &source)
the 2nd vertex is merged into the 1st vertex.
std::string truthParticleContainerName
static bool patternCheckRun1(const uint32_t &pattern, const Amg::Vector3D &vertex)
StatusCode associateNonSelectedTracks(std::vector< WrkVrt > *)
in addition to selected tracks, associate as much tracks as possible
float z0() const
Returns the parameter.
const PixelID * m_pixelId
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
@ sctBarrel0
four sct barrel layers
float chiSquared() const
Returns the of the overall track fit.
std::vector< SG::VarHandleKeyArray * > m_vhka
static const xAOD::TruthParticle * getTrkGenParticle(const xAOD::TrackParticle *)
double twoTrVrtMinDistFromPV
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
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...
@ numberOfTRTHits
number of TRT hits [unit8_t].
const Amg::Vector3D & position() const
Returns the 3-pos.
bool doRemoveCaloTaggedMuons
void lockDecoration(SG::auxid_t auxid)
Explicitly lock a decoration.
static bool patternCheckRun2(const uint32_t &pattern, const Amg::Vector3D &vertex)
Helper class to provide constant type-safe access to aux data.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
void trackClassification(std::vector< WrkVrt > *, std::map< long int, std::vector< long int > > &)
double associateMinDistanceToPV
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool const RAWDATA *ch2 const
double pvCompatibilityCut
__HOSTDEV__ double Phi_mpi_pi(double)
@ IS_SIMULATION
true: simulation, false: data
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
bool selectTrack_hitPatternTight(const xAOD::TrackParticle *) const
std::string mcEventContainerName
float nPixelHits(const U &p)
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
StatusCode rearrangeTracks(std::vector< WrkVrt > *)
#define AmgSymMatrix(dim)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
bool selectTrack_hitPattern(const xAOD::TrackParticle *) const
float d0() const
Returns the parameter.
double twoTrkVtxFormingD0Cut
bool doAugmentDVimpactParametersToMuons
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Read/Write Handle Keys.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
bool FillIntermediateVertices
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
const xAOD::VertexContainer * m_primaryVertices
uint32_t hitPattern() const
std::tuple< const TVector3, Detector, Bec, Layer, Flag > ExtrapolatedPoint
StatusCode selectInDetAndGSFTracks()
ToolHandle< IInDetConditionsTool > m_sctCondSummaryTool
std::string ElectronLocation
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
@ pixelEndCap0
three pixel discs (on each side)
bool isAssociatedToVertices(const xAOD::TrackParticle *trk, const xAOD::VertexContainer *vertices)
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
ToolHandle< Trk::ITrkVKalVrtFitter > m_fitSvc
double mergeByShufflingMaxSignificance
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
virtual StatusCode sysInitialize() override
Override sysInitialize.
Helper class to provide type-safe access to aux data.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
StatusCode extractIncompatibleTrackPairs(std::vector< WrkVrt > *)
related to the graph method and verte finding
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.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
bool doAugmentDVimpactParametersToElectrons
StatusCode mergeByShuffling(std::vector< WrkVrt > *)
attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior ...
ExtrapolatedPattern * extrapolatedPattern(const xAOD::TrackParticle *, enum Trk::PropDirection)
double reassembleMaxImpactParameterD0
std::string all2trksVerticesContainerName
unsigned int SelTrkMaxCutoff
double VertexMergeFinalDistScaling
::StatusCode StatusCode
StatusCode definition for legacy code.
@ SecVtx
Secondary vertex.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
StatusCode processPrimaryVertices()
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
std::vector< CutFunc > m_trackSelectionFuncs
Eigen::Affine3d Transform3D
bool doAssociateNonSelectedTracks
StatusCode refitVertexWithSuggestion(WrkVrt &, const Amg::Vector3D &)
refit the vertex with suggestion
bool hasProdVtx() const
Check for a production vertex on this particle.
double chi2(TH1 *h0, TH1 *h1)
bool doRemoveNonLeptonVertices
void lockLeptonDecorations(const SG::AuxVectorData *cont) const
const float SC[NC]
Cross sections for Carbon.
static void fillTrackSummary(track_summary &summary, const xAOD::TrackParticle *trk)
retrieve the track hit information
bool selectTrack_d0Cut(const xAOD::TrackParticle *) const
std::vector< TrackSelectionAlg > m_trackSelectionAlgs
constexpr double maxValue
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.
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
double vtxVtxDistance(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
double significanceBetweenVertices(const WrkVrt &, const WrkVrt &) const
calculate the significance (Mahalanobis distance) between two reconstructed vertices
StatusCode selectTracksInDet()
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
double mergeByShufflingAllowance
@ numberOfSCTHoles
number of SCT holes [unit8_t].
size_t index() const
Return the index of this element within its container.
int barcode() const
Barcode.
float nSCTHoles(const U &p)
bool patternCheckOuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
StatusCode refitAndSelectGoodQualityVertices(std::vector< WrkVrt > *)
finalization of the vertex and store to xAOD::VertexContainer
const AtlasDetectorID * m_atlasId
std::map< std::string, PatternStrategyFunc > m_patternStrategyFuncs
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
get a handle on the Track to Vertex tool
std::optional< SG::Decorator< char > > m_decor_isAssociated
std::size_t erase_if(T_container &container, T_Func pred)
bool doSelectTracksFromElectrons
bool selectTrack_z0Cut(const xAOD::TrackParticle *) const
virtual void renounce()=0
constexpr int UNDEFINED_ID
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
bool selectTrack_d0errCut(const xAOD::TrackParticle *) const
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
SG::WriteDecorHandleKey< xAOD::EventInfo > m_vertexingStatusKey
std::optional< SG::Decorator< char > > m_decor_isSelected
int layer_disk(const Identifier &id) const
StatusCode categorizeVertexTruthTopology(xAOD::Vertex *vertex)
bool getSVImpactParameters(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex, std::vector< double > &impactParameters, std::vector< double > &impactParErrors)
get secondary vertex impact parameters
Class describing a truth vertex in the MC record.
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
std::bitset< NumberOfTrackRecoInfo > patternRecoInfo() const
Access method for pattern recognition algorithm.
constexpr double mass_electron
StatusCode refitVertex(WrkVrt &)
refit the vertex.
std::string to_string(const DetectorType &type)
double improveChi2ProbThreshold
constexpr double mass_chargedPion
std::vector< ExtrapolatedPoint > ExtrapolatedPattern
std::string PrimVrtLocation
StatusCode fillAANT_SelectedBaseTracks()
int layer_disk(const Identifier &id) const
void selectTrack(const xAOD::TrackParticle *)
Vertexing Algorithm Member Functions.
std::optional< SG::Decorator< char > > m_decor_is_svtrk_final
bool doMergeFinalVerticesDistance
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...
static size_t nTrkCommon(std::vector< WrkVrt > *WrkVrtSet, const std::pair< unsigned, unsigned > &pairIndex)
returns the number of tracks commonly present in both vertices
bool doReassembleVertices
Eigen::Matrix< double, 3, 1 > Vector3D
double associateMaxZ0Signif
StatusCode selectTracksFromMuons()
bool doTightPVcompatibilityCut
Class describing the basic event information.
StatusCode selectTracksFromElectrons()
std::vector< std::pair< int, int > > m_incomp
void lockTrackDecorations(const xAOD::TrackParticle *trk, bool onlySelection) const
lock decorations at the end of the algorithm
std::vector< const xAOD::TrackParticle * > m_associatedTracks
std::vector< ALFA_RawDataContainer_p1 > t2
bool checkTrackHitPatternToVertex(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
DataObjIDColl m_extendedExtraObjects
static bool patternCheckRun1OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
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.
accumulate
Update flags based on parser line args.
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
constexpr double invalidFloat
void printWrkSet(const std::vector< WrkVrt > *WrkVrtSet, const std::string &name)
print the contents of reconstructed vertices
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class describing a Vertex.
static bool patternCheckRun2OuterOnly(const uint32_t &pattern, const Amg::Vector3D &vertex)
std::string truthParticleFilter
bool doSelectTracksWithLRTCuts
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.
#define ATH_MSG_WARNING(x)
StatusCode fillAANT_SecondaryVertices(xAOD::VertexContainer *)
virtual StatusCode initEvent()
struct JobProperties m_jp
std::optional< VertexELType > m_decor_svLink
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
void removeInconsistentTracks(WrkVrt &)
Remove inconsistent tracks from vertices.
std::string TrackLocation
std::map< const xAOD::TruthVertex *, bool > m_matchMap
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
AthAlgorithm()
Default constructor:
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
StatusCode monitorVertexingAlgorithmStep(std::vector< WrkVrt > *, const std::string &name, bool final=false)
monitor the intermediate status of vertexing
void fillSymmetric(size_t i, size_t j, Scalar value)
method to fill elements for a symmetric matrix
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::vector< const xAOD::TrackParticle * > m_selectedTracks
@ pixelBarrel0
there are three or four pixel barrel layers (R1/R2)
Manage lookup of vectors of auxiliary data.
#define ATLAS_THREAD_SAFE
Class describing a TrackParticle.
double VertexMergeFinalDistCut
const SG::AuxVectorData * container() const
Return the container holding this element.
std::vector< const xAOD::TruthVertex * > m_tracingTruthVertices
setBGCode setTAP setLVL2ErrorBits bool
bool selectTrack_z0errCut(const xAOD::TrackParticle *) const
#define minValue(current, test)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
size_type size() const noexcept
Returns the number of elements in the collection.
double reassembleMaxImpactParameterZ0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
bool checkTrackHitPatternToVertexByExtrapolation(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
constexpr unsigned invalidUnsigned
bool selectTrack_notPVassociated(const xAOD::TrackParticle *) const
track-by-track selection strategies
Amg::Vector3D localPosition
bool selectTrack_chi2Cut(const xAOD::TrackParticle *) const
StatusCode mergeFinalVertices(std::vector< WrkVrt > *)
attempt to merge vertices by lookng at the distance between two vertices
std::string m_checkPatternStrategy
float nSiHits(const U &p)
StatusCode addEventInfo()
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
StatusCode findNtrackVertices(std::vector< WrkVrt > *)
std::map< unsigned, SG::Decorator< float > > m_trkDecors
StatusCode clearNtupleVariables()
GeoGenfun::FunctionNoop ATan2(GeoGenfun::GENFUNCTION y, GeoGenfun::GENFUNCTION x)
std::vector< IPDecoratorType > m_ipDecors