 |
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, V, H > &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, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &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 491 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 1101 of file VertexingAlgs.cxx.
1114 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": #verticess = " << workVerticesContainer->size() );
1116 unsigned associateCounter { 0 };
1119 for(
auto& wrkvrt : *workVerticesContainer ) {
1121 if( !wrkvrt.isGood )
continue;
1122 if( wrkvrt.selectedTrackIndices.size() <= 1 )
continue;
1126 wrkvrt.Chi2_core = wrkvrt.Chi2;
1128 auto& vertexPos = wrkvrt.vertex;
1130 std::vector<double> distanceToPVs;
1132 for(
const auto*
pv : *pvs ) {
1135 const auto& minDistance = *( std::min_element( distanceToPVs.begin(), distanceToPVs.end() ) );
1140 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex pos = (" << vertexPos.x() <<
", " << vertexPos.y() <<
", " << vertexPos.z() <<
"), "
1141 "#selected = " << wrkvrt.selectedTrackIndices.size() <<
", #assoc = " << wrkvrt.associatedTrackIndices.size() );
1143 std::vector<const xAOD::TrackParticle*>
candidates;
1146 for(
auto itr = allTracks->begin(); itr != allTracks->end(); ++itr ) {
1147 const auto* trk = *itr;
1151 auto result = std::find_if( workVerticesContainer->begin(), workVerticesContainer->end(),
1152 [&] ( WrkVrt& wrkvrt ) {
1153 auto found = std::find_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1154 [&]( long int index ) {
1156 if (m_jp.doSelectTracksFromElectrons || m_jp.doSelectIDAndGSFTracks) {
1157 const xAOD::TrackParticle *id_tr;
1158 id_tr = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(m_selectedTracks.at(index));
1159 return trk == m_selectedTracks.at(index) or trk == id_tr;
1162 return trk == m_selectedTracks.at(index);
1165 return found != wrkvrt.selectedTrackIndices.end();
1167 if(
result != workVerticesContainer->end() )
continue;
1173 [&] (
const auto* atrk) { return trk == atrk; } );
1190 std::vector<double> impactParameters;
1191 std::vector<double> impactParErrors;
1199 <<
": d0 to vtx = " << impactParameters.at(
k_d0)
1200 <<
", z0 to vtx = " << impactParameters.at(
k_z0)
1201 <<
", distance to vtx = " << hypot( impactParameters.at(
k_d0), impactParameters.at(
k_z0) ) );
1209 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
1213 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": attempting to associate track = " << trk );
1216 WrkVrt wrkvrt_backup = wrkvrt;
1218 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1220 std::vector<const xAOD::TrackParticle*> baseTracks;
1221 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
1223 wrkvrt.Chi2PerTrk.clear();
1225 for(
const auto&
index : wrkvrt.selectedTrackIndices ) {
1229 for(
const auto&
index : wrkvrt.associatedTrackIndices ) {
1234 baseTracks.emplace_back( trk );
1242 if(
sc.isFailure() )
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation failed.");
1244 const auto& diffPos = initPos - vertexPos;
1246 if( diffPos.norm() > 10. ) {
1248 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": approx vertex as original" );
1249 m_fitSvc->setApproximateVertex( vertexPos.x(), vertexPos.y(), vertexPos.z(), *state );
1253 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": approx vertex set to (" << initPos.x() <<
", " << initPos.y() <<
", " << initPos.z() <<
")" );
1254 m_fitSvc->setApproximateVertex( initPos.x(), initPos.y(), initPos.z(), *state );
1260 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": now vertex fitting..." );
1272 if(
sc.isFailure() ) {
1273 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit failure. Revert to backup");
1274 wrkvrt = wrkvrt_backup;
1284 auto&
cov = wrkvrt.vertexCov;
1286 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": succeeded in associating. New vertex pos = (" << vertexPos.perp() <<
", " << vertexPos.z() <<
", " << vertexPos.perp()*vertexPos.phi() <<
")" );
1287 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) <<
")" );
1294 (*m_decor_isAssociated)( *trk ) =
true;
1300 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1301 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": total associated number of tracks = " << associateCounter );
1302 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1304 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 1178 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1192 using LayerCombination = std::vector<int>;
1194 std::map<LayerCombination, unsigned> layerMap;
1195 if( layerMap.empty() ) {
1238 const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
1240 for(
auto& pair : layerMap ) {
1241 if( pair.first == comb ) {
1249 enum { kShouldNotHaveHit, kShouldHaveHit, kMayHaveHit };
1255 auto& exPattern_along = *( exPattern.first );
1257 for(
auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
1258 if(
std::next( itr ) == exPattern_along.end() )
continue;
1260 const auto& point = *itr;
1261 const auto& nextPoint = *(
std::next( itr ) );
1263 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": isGood = " << std::get<isGood>( point ) );
1265 const auto& thisPos = std::get<position>( point );
1266 const auto& nextPos = std::get<position>( nextPoint );
1268 auto sectionVector = nextPos - thisPos;
1272 const auto& detectorType = getDetectorType( point );
1274 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": detType = " << detectorType );
1280 if( vertexVector.Mag() < 10. ) {
1281 expectedHitPattern.at( detectorType ) = kMayHaveHit;
1287 if( !
static_cast<bool>(std::get<isGood>( point )) ) {
1288 expectedHitPattern.at( detectorType ) = kMayHaveHit;
1297 if( sectionVector.Mag() == 0. )
continue;
1300 <<
": hitPos = (" << thisPos.Perp() <<
", " << thisPos.z() <<
", " << thisPos.Phi() <<
")"
1301 <<
", sectionVec = (" << sectionVector.Perp() <<
", " << sectionVector.z() <<
", " << sectionVector.Phi() <<
")"
1302 <<
", vertexVec = (" << vertexVector.Perp() <<
", " << vertexVector.z() <<
", " << vertexVector.Phi() <<
")"
1303 <<
", cos(s,v) = " << sectionVector * vertexVector / ( sectionVector.Mag() * vertexVector.Mag() +
AlgConsts::infinitesimal ) );
1305 if( sectionVector * vertexVector > 0. )
continue;
1307 if( minExpectedRadius > thisPos.Perp() ) minExpectedRadius = thisPos.Perp();
1311 expectedHitPattern.at( detectorType ) = kShouldHaveHit;
1315 auto& exPattern_oppos = *( exPattern.second );
1316 bool oppositeFlag =
false;
1318 for(
auto itr = exPattern_oppos.begin(); itr != exPattern_oppos.end(); ++itr ) {
1319 if(
std::next( itr ) == exPattern_oppos.end() )
continue;
1321 const auto& point = *itr;
1322 const auto& nextPoint = *(
std::next( itr ) );
1324 const auto& thisPos = std::get<position>( point );
1325 const auto& nextPos = std::get<position>( nextPoint );
1327 auto sectionVector = nextPos - thisPos;
1330 const auto& detectorType = getDetectorType( point );
1332 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": detType = " << detectorType );
1335 <<
": hitPos = (" << thisPos.Perp() <<
", " << thisPos.z() <<
", " << thisPos.Phi() <<
")"
1336 <<
", vertex = (" <<
vertex.perp() <<
", " <<
vertex.z() <<
", " <<
vertex.phi() <<
")"
1337 <<
", cos(s,v) = " << sectionVector * vertexVector / ( sectionVector.Mag() * vertexVector.Mag() +
AlgConsts::infinitesimal ) );
1342 if( sectionVector * vertexVector < 0. ) {
1343 oppositeFlag =
true;
1352 std::string
msg =
"Expected hit pattern: ";
1354 msg += Form(
"%s", expectedHitPattern.at(
i) < kMayHaveHit? Form(
"%u", expectedHitPattern.at(
i)) :
"X" );
1358 msg =
"Recorded hit pattern: ";
1364 std::vector<unsigned> matchedLayers;
1367 const unsigned recordedPattern = ( (trk->
hitPattern()>>
i) & 1 );
1369 if( expectedHitPattern.at(
i) == kMayHaveHit ) {
1370 matchedLayers.emplace_back(
i );
1371 }
else if( expectedHitPattern.at(
i) == kShouldHaveHit ) {
1372 if( expectedHitPattern.at(
i) != recordedPattern ) {
1375 matchedLayers.emplace_back(
i );
1378 if( expectedHitPattern.at(
i) != recordedPattern ) {
1393 while( dphi > TMath::Pi() ) dphi -= TMath::TwoPi();
1394 while( dphi < -TMath::Pi() ) dphi += TMath::TwoPi();
1396 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vtx phi = " <<
vertex.phi() <<
", track phi = " << trk->
phi() <<
", dphi = " << dphi
1397 <<
", oppositeFlag = " << oppositeFlag
1398 <<
", nPixelHits = " <<
static_cast<int>(PixelHits)
1399 <<
", nSCTHits = " <<
static_cast<int>(SctHits)
1400 <<
", nTRTHits = " <<
static_cast<int>(TRTHits)
1401 <<
", nMatchedLayers = " << matchedLayers.size() );
1403 if( PixelHits == 0 &&
vertex.perp() > 300. ) {
1404 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex r > 300 mm, w/o no pixel hits" );
1409 if( matchedLayers.size() < 2 )
return false;
1413 if( matchedLayers.size() < 4 )
return false;
1419 if( oppositeFlag )
return false;
1425 if( fabs( dphi ) > TMath::Pi()/2.0 )
return false;
1428 TVector3 trkP; trkP.SetPtEtaPhi( trk->
pt(), trk->
eta(), trk->
phi() );
1430 if( trkP.Dot( vtx ) < 0. )
return false;
◆ checkTrackHitPatternToVertexByExtrapolationAssist()
New method with track extrapolation.
Definition at line 2207 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
2218 if(
vertex.perp() < 31.0 ) {
2219 double dphi = trk->
phi() -
vertex.phi();
2220 while( dphi > TMath::Pi() ) { dphi -= TMath::TwoPi(); }
2221 while( dphi < -TMath::Pi() ) { dphi += TMath::TwoPi(); }
2222 if(
cos(dphi) < -0.8 )
return false;
2227 using LayerCombination = std::vector<int>;
2229 std::map<LayerCombination, unsigned> layerMap;
2230 if( layerMap.empty() ) {
2273 const LayerCombination comb { std::get<detector>( point ), std::get<bec>( point ), std::get<layer>( point ) };
2275 for(
auto& pair : layerMap ) {
2276 if( pair.first == comb ) {
2287 auto& exPattern_along = *( exPattern.first );
2289 for(
auto itr = exPattern_along.begin(); itr != exPattern_along.end(); ++itr ) {
2290 if(
std::next( itr ) == exPattern_along.end() )
continue;
2292 const auto& point = *itr;
2294 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": isGood = " << std::get<isGood>( point ) );
2296 if( !std::get<isGood>( point ) ) {
2297 const auto& detectorType = getDetectorType( point );
2298 disabledPattern += (1 << detectorType);
2303 uint32_t modifiedPattern = disabledPattern | hitPattern;
2305 std::string
msg =
"Disabled hit pattern: ";
2307 msg += Form(
"%u", ( disabledPattern >>
i ) & 1 );
2311 msg =
"Recorded hit pattern: ";
2313 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 2366 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
2372 auto sc0 =
evtStore()->retrieve( eventInfo,
"EventInfo" );
2373 if( sc0.isFailure() ) {
return; }
2379 auto sc1 =
evtStore()->retrieve( truthParticles,
"TruthParticles" );
2380 if( sc1.isFailure() ) {
return; }
2382 auto sc2 =
evtStore()->retrieve( truthVertices,
"TruthVertices" );
2383 if( sc2.isFailure() ) {
return; }
2385 if( !truthParticles ) {
return; }
2386 if( !truthVertices ) {
return; }
2390 std::vector<const xAOD::TruthParticle*> truthSvTracks;
2397 if( truthVertex->nIncomingParticles() != 1 )
return false;
2398 if( !truthVertex->incomingParticle(0) )
return false;
2399 if( abs(truthVertex->incomingParticle(0)->pdgId()) < 1000000 )
return false;
2400 if( abs(truthVertex->incomingParticle(0)->pdgId()) > 1000000000 )
return false;
2402 bool hasNeutralino =
false;
2403 for(
unsigned ip = 0;
ip < truthVertex->nOutgoingParticles();
ip++ ) {
2404 const auto*
p = truthVertex->outgoingParticle(
ip);
2405 if( abs(
p->pdgId() ) == 1000022 ) {
2406 hasNeutralino =
true;
2410 return hasNeutralino;
2414 if( truthVertex->nIncomingParticles() != 1 )
return false;
2415 if( !truthVertex->incomingParticle(0) )
return false;
2416 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 50 )
return false;
2421 if( truthVertex->nIncomingParticles() != 1 )
return false;
2422 if( !truthVertex->incomingParticle(0) )
return false;
2423 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 36 )
return false;
2428 if( truthVertex->nIncomingParticles() != 1 )
return false;
2429 if( !truthVertex->incomingParticle(0) )
return false;
2430 if( abs(truthVertex->incomingParticle(0)->pdgId()) != 310 )
return false;
2435 if( truthVertex->nIncomingParticles() != 1 )
return false;
2436 if( !truthVertex->incomingParticle(0) )
return false;
2437 if( abs(truthVertex->incomingParticle(0)->pdgId()) <= 500 || abs(truthVertex->incomingParticle(0)->pdgId()) >= 600 )
return false;
2442 if( truthVertex->nIncomingParticles() != 1 )
return false;
2443 if( !truthVertex->incomingParticle(0) )
return false;
2445 const auto*
parent = truthVertex->incomingParticle(0);
2446 if(
parent->isLepton() )
return false;
2448 TLorentzVector p4sum_in;
2449 TLorentzVector p4sum_out;
2450 for(
unsigned ip = 0;
ip < truthVertex->nIncomingParticles();
ip++ ) {
2451 const auto*
particle = truthVertex->incomingParticle(
ip);
2455 for(
unsigned ip = 0;
ip < truthVertex->nOutgoingParticles();
ip++ ) {
2456 const auto*
particle = truthVertex->outgoingParticle(
ip);
2460 return p4sum_out.E() - p4sum_in.E() >= 100.;
2466 std::map<std::string, ParticleSelectFunc> selectFuncs { {
"", selectNone },
2467 {
"Kshort", selectKshort },
2468 {
"Bhadron", selectBhadron },
2469 {
"Rhadron", selectRhadron },
2470 {
"HNL", selectHNL },
2471 {
"Higgs", selectHiggs },
2472 {
"HadInt", selectHadInt } };
2483 for(
const auto *truthVertex : *truthVertices ) {
2484 if( selectFunc( truthVertex ) ) {
2487 msg += Form(
"pdgId = %d, (r, z) = (%.2f, %.2f), ", truthVertex->incomingParticle(0)->pdgId(), truthVertex->perp(), truthVertex->z());
2488 msg += Form(
"nOutgoing = %lu, ", truthVertex->nOutgoingParticles() );
2489 msg += Form(
"mass = %.3f GeV, pt = %.3f GeV", truthVertex->incomingParticle(0)->m()/1.e3, truthVertex->incomingParticle(0)->pt()/1.e3 );
2496 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.
302 if (!eventInfo.isValid()) {
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 double roughD0Cut = 100.;
68 double roughZ0Cut = 50.;
75 std::map<const xAOD::TruthVertex*, bool> matchMap;
87 wrkvrt.selectedTrackIndices.emplace_back( itrk_id );
88 wrkvrt.selectedTrackIndices.emplace_back( jtrk_id );
91 m_incomp.emplace_back( itrk_id, jtrk_id );
98 if ( !cont_i || !cont_j ) {
108 ATH_MSG_DEBUG(
" link itrk (" << (*itrk)->index() <<
") or jtrk (" << (*jtrk)->index() <<
") is not valid");
121 baseTracks.emplace_back( *itrk );
122 baseTracks.emplace_back( *jtrk );
129 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
131 if(
sc.isFailure() ) {
132 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
136 if( initVertex.perp() > maxR ) {
144 std::vector<double> impactParameters;
145 std::vector<double> impactParErrors;
148 const auto roughD0_itrk = impactParameters.at(TrkParameter::k_d0);
149 const auto roughZ0_itrk = impactParameters.at(TrkParameter::k_z0);
150 if( fabs( impactParameters.at(0)) > roughD0Cut || fabs( impactParameters.at(1) ) > roughZ0Cut ) {
155 const auto roughD0_jtrk = impactParameters.at(TrkParameter::k_d0);
156 const auto roughZ0_jtrk = impactParameters.at(TrkParameter::k_z0);
157 if( fabs( impactParameters.at(0) ) > roughD0Cut || fabs( impactParameters.at(1) ) > roughZ0Cut ) {
162 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
169 wrkvrt.vertex, wrkvrt.vertexMom, wrkvrt.Charge,
170 wrkvrt.vertexCov, wrkvrt.Chi2PerTrk,
171 wrkvrt.TrkAtVrt, wrkvrt.Chi2, *state );
173 if(
sc.isFailure() ) {
180 const double vPos = ( vDist.x()*wrkvrt.vertexMom.Px()+vDist.y()*wrkvrt.vertexMom.Py()+vDist.z()*wrkvrt.vertexMom.Pz() )/wrkvrt.vertexMom.Rho();
181 const double vPosMomAngT = ( vDist.x()*wrkvrt.vertexMom.Px()+vDist.y()*wrkvrt.vertexMom.Py() ) / vDist.perp() / wrkvrt.vertexMom.Pt();
182 const double vPosMomAng3D = ( vDist.x()*wrkvrt.vertexMom.Px()+vDist.y()*wrkvrt.vertexMom.Py()+vDist.z()*wrkvrt.vertexMom.Pz() ) / (vDist.norm() * wrkvrt.vertexMom.Rho());
187 const double dist_fromPV = vDist.norm();
193 m_ntupleVars->get< std::vector<double> >(
"All2TrkVrtMass" ) .emplace_back(wrkvrt.vertexMom.M());
194 m_ntupleVars->get< std::vector<double> >(
"All2TrkVrtPt" ) .emplace_back(wrkvrt.vertexMom.Perp());
195 m_ntupleVars->get< std::vector<int> > (
"All2TrkVrtCharge" ) .emplace_back(wrkvrt.Charge);
196 m_ntupleVars->get< std::vector<double> >(
"All2TrkVrtX" ) .emplace_back(wrkvrt.vertex.x());
197 m_ntupleVars->get< std::vector<double> >(
"All2TrkVrtY" ) .emplace_back(wrkvrt.vertex.y());
198 m_ntupleVars->get< std::vector<double> >(
"All2TrkVrtZ" ) .emplace_back(wrkvrt.vertex.z());
199 m_ntupleVars->get< std::vector<double> >(
"All2TrkVrtChiSq" ) .emplace_back(wrkvrt.Chi2);
208 twoTrksVertexContainer->emplace_back(
vertex );
210 for(
const auto *trk: baseTracks ) {
216 vertex->addTrackAtVertex( trackElementLink, 1. );
220 vertex->setPosition( wrkvrt.vertex );
221 vertex->setFitQuality( wrkvrt.Chi2, 1 );
228 massAcc(*
vertex) = wrkvrt.vertexMom.M();
229 pTAcc(*
vertex) = wrkvrt.vertexMom.Perp();
230 chargeAcc(*
vertex) = wrkvrt.Charge;
232 isFakeAcc(*
vertex) =
true;
248 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": failed to pass chi2 threshold." );
254 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": attempting form vertex from ( " << itrk_id <<
", " << jtrk_id <<
" )." );
255 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": candidate vertex: "
256 <<
" isGood = " << (wrkvrt.isGood?
"true" :
"false")
257 <<
", #ntrks = " << wrkvrt.nTracksTotal()
258 <<
", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
259 <<
", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
260 <<
", chi2/ndof = " << wrkvrt.fitQuality()
261 <<
", (r, z) = (" << wrkvrt.vertex.perp()
262 <<
", " << wrkvrt.vertex.z() <<
")" );
265 Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
266 Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
268 const auto distance = vReco - vTruth;
281 ATH_MSG_DEBUG (
" > " << __FUNCTION__ <<
": truth-matched candidate! : signif^2 = " <<
s2 );
282 matchMap.emplace( truthVertex,
true );
287 dynamic_cast<TH2F*
>(
m_hists[
"vPosDist"] )->Fill( wrkvrt.vertex.perp(), vPos );
288 dynamic_cast<TH2F*
>(
m_hists[
"vPosMomAngTDist"] )->Fill( wrkvrt.vertex.perp(), vPosMomAngT );
289 m_hists[
"vPosMomAngT"] ->Fill( vPosMomAngT );
290 m_hists[
"vPosMomAng3D"] ->Fill( vPosMomAng3D );
295 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the 2tr vertex min distance from PV cut." );
300 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vertex angle cut." );
306 if(
cos( dphi1 ) < -0.8 &&
cos( dphi2 ) < -0.8 ) {
307 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vPos cut. (both tracks are opposite against the vertex pos)" );
311 ATH_MSG_DEBUG(
" > "<< __FUNCTION__ <<
": failed to pass the tightened vPos cut. (at least one track is opposite against the vertex pos)" );
314 if( vPosMomAngT < -0.8 ) {
315 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vPos cut. (pos-mom directions are opposite)" );
319 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass the vPos cut." );
329 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failed to pass fake rejection algorithm." );
335 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": passed fake rejection." );
340 m_ntupleVars->get< std::vector<double> >(
"AfFakVrtMass" ) .emplace_back(wrkvrt.vertexMom.M());
341 m_ntupleVars->get< std::vector<double> >(
"AfFakVrtPt" ) .emplace_back(wrkvrt.vertexMom.Perp());
342 m_ntupleVars->get< std::vector<int> > (
"AfFakVrtCharge" ) .emplace_back(wrkvrt.Charge);
343 m_ntupleVars->get< std::vector<double> >(
"AfFakVrtX" ) .emplace_back(wrkvrt.vertex.x());
344 m_ntupleVars->get< std::vector<double> >(
"AfFakVrtY" ) .emplace_back(wrkvrt.vertex.y());
345 m_ntupleVars->get< std::vector<double> >(
"AfFakVrtZ" ) .emplace_back(wrkvrt.vertex.z());
346 m_ntupleVars->get< std::vector<double> >(
"AfFakVrtChiSq" ) .emplace_back(wrkvrt.Chi2);
352 isFakeAcc(*
vertex) =
false;
360 wrkvrt.isGood =
true;
362 workVerticesContainer->emplace_back( wrkvrt );
364 msg += Form(
" (%d, %d), ", itrk_id, jtrk_id );
367 m_hists[
"initVertexDispD0"]->Fill( roughD0_itrk, initVertex.perp() );
368 m_hists[
"initVertexDispD0"]->Fill( roughD0_jtrk, initVertex.perp() );
369 m_hists[
"initVertexDispZ0"]->Fill( roughZ0_itrk, initVertex.z() );
370 m_hists[
"initVertexDispZ0"]->Fill( roughZ0_jtrk, initVertex.z() );
377 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": compatible track pairs = " <<
msg );
382 for(
auto& pair: matchMap ) {
383 if( pair.second )
m_hists[
"nMatchedTruths"]->Fill( 1, pair.first->perp() );
387 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 1110 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1113 const EventContext& ctx = Gaudi::Hive::currentContext();
1114 std::vector<std::unique_ptr<Trk::TrackParameters>> paramsVector =
1121 for(
auto&
params : paramsVector ) {
1123 const TVector3 position(
params->position().x(),
params->position().y(),
params->position().z() );
1125 if( prevPos == position ) {
1131 const auto* detElement =
params->associatedSurface().associatedDetectorElement();
1137 const auto&
id = detElement->identify();
1158 ATH_MSG_VERBOSE(
" >> " << __FUNCTION__ <<
", track " << trk <<
": position = (" << position.Perp() <<
", " << position.z() <<
", " << position.Phi() <<
"), detElement ID = " <<
id <<
", good = " <<
good
1159 <<
": (det, bec, layer) = (" << std::get<1>(
pattern->back() ) <<
", " << std::get<2>(
pattern->back() ) <<
", " << std::get<3>(
pattern->back() ) <<
")" );
1161 if( !
good ) nDisabled++;
1169 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 392 of file VertexingAlgs.cxx.
397 return StatusCode::SUCCESS;
404 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": compatible track pair size = " << compSize );
410 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": incompatibility graph finder mode" );
413 workVerticesContainer->clear();
420 std::vector<long int> weit;
423 weit.emplace_back( pair.first + 1 );
424 weit.emplace_back( pair.second + 1 );
443 long int solutionSize { 0 };
446 std::vector<const xAOD::TrackParticle*> baseTracks;
447 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
449 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
450 auto pgraph = std::make_unique<Trk::PGraph>();
451 int iterationLimit(2000);
456 pgraph->pgraphm_( weit.data(), nEdges, nTracks, solution.data(), &solutionSize, nth);
458 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Trk::pgraphm_() output: solutionSize = " << solutionSize );
459 if (0 == iterationLimit--){
460 ATH_MSG_WARNING(
"Iteration limit (2000) reached in VrtSecInclusive::findNtrackVertices, solution size = "<<solutionSize);
463 if(solutionSize <= 0)
break;
464 if(solutionSize == 1)
continue;
468 std::string
msg =
"solution = [ ";
469 for(
int i=0;
i< solutionSize;
i++) {
470 msg += Form(
"%ld, ", solution[
i]-1 );
480 wrkvrt.isGood =
true;
481 wrkvrt.selectedTrackIndices.clear();
483 for(
long int i = 0;
i<solutionSize;
i++) {
484 wrkvrt.selectedTrackIndices.emplace_back(solution[
i]-1);
492 if(
sc.isFailure())
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
494 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
496 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
506 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": FoundAppVrt=" << solutionSize <<
", (r, z) = " << wrkvrt.vertex.perp() <<
", " << wrkvrt.vertex.z() <<
", chi2/ndof = " << wrkvrt.fitQuality() );
508 if(
sc.isFailure() ) {
510 if( wrkvrt.selectedTrackIndices.size() <= 2 ) {
511 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit failed in 2-trk solution ==> give up.");
515 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit failed ==> retry...");
521 for(
auto& itrk: wrkvrt.selectedTrackIndices ) {
522 for(
auto& jtrk: wrkvrt.selectedTrackIndices ) {
523 if( itrk == jtrk )
continue;
524 if(
tmp.isGood )
continue;
526 tmp.selectedTrackIndices.clear();
527 tmp.selectedTrackIndices.emplace_back( itrk );
528 tmp.selectedTrackIndices.emplace_back( jtrk );
537 sc =
m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );
538 if(
sc.isFailure() )
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
540 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
542 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
552 if(
sc.isFailure() )
continue;
560 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Did not find any viable vertex in all 2-trk combinations. Give up.");
565 for(
auto& itrk: wrkvrt.selectedTrackIndices ) {
567 if(
std::find(
tmp.selectedTrackIndices.begin(),
tmp.selectedTrackIndices.end(), itrk ) !=
tmp.selectedTrackIndices.end() )
continue;
571 tmp.selectedTrackIndices.emplace_back( itrk );
573 for(
auto& jtrk :
tmp.selectedTrackIndices ) { baseTracks.emplace_back(
m_selectedTracks.at(jtrk) ); }
578 sc =
m_fitSvc->VKalVrtFitFast( baseTracks, initVertex, *state );
579 if(
sc.isFailure())
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
581 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
583 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
593 if(
sc.isFailure() ) {
601 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit succeeded; register the vertex to the list.");
602 wrkvrt.isGood =
true;
605 workVerticesContainer->emplace_back( wrkvrt );
609 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": VKalVrtFit succeeded; register the vertex to the list.");
610 wrkvrt.isGood =
true;
613 workVerticesContainer->emplace_back( wrkvrt );
622 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": rapid finder mode" );
626 std::set<long int> tracks;
629 std::vector<struct Cluster>
clusters;
631 for(
auto& wrkvrt : *workVerticesContainer ) {
633 bool foundCluster =
false;
636 if( (wrkvrt.vertex - cluster.position).norm() < 1.0 ) {
637 for(
auto& itrk : wrkvrt.selectedTrackIndices ) {
638 cluster.tracks.insert( itrk );
645 if( !foundCluster ) {
647 c.position = wrkvrt.vertex;
648 for(
auto& itrk : wrkvrt.selectedTrackIndices ) {
649 c.tracks.insert( itrk );
652 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": added a new cluster" );
658 std::vector<const xAOD::TrackParticle*> baseTracks;
659 std::vector<const xAOD::NeutralParticle*> dummyNeutrals;
661 workVerticesContainer->clear();
665 std::unique_ptr<Trk::IVKalState> state =
m_fitSvc->makeState();
673 wrkvrt.isGood =
true;
674 wrkvrt.selectedTrackIndices.clear();
676 for(
const auto&
index: cluster.tracks) {
677 wrkvrt.selectedTrackIndices.emplace_back(
index );
685 if(
sc.isFailure())
ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": fast crude estimation fails ");
687 m_fitSvc->setApproximateVertex( initVertex.x(), initVertex.y(), initVertex.z(), *state );
689 sc =
m_fitSvc->VKalVrtFit(baseTracks, dummyNeutrals,
699 if(
sc.isFailure() ) {
703 workVerticesContainer->emplace_back( wrkvrt );
719 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Remove vertices fully contained in other vertices .");
720 while( workVerticesContainer->size() > 1 ) {
721 size_t tmpN = workVerticesContainer->size();
724 for(; iv<tmpN-1; iv++) {
726 for(; jv<tmpN; jv++) {
727 const auto nTCom =
nTrkCommon( workVerticesContainer, {iv, jv} );
729 if( nTCom == workVerticesContainer->at(iv).selectedTrackIndices.size() ) { workVerticesContainer->erase(workVerticesContainer->begin()+iv);
break; }
730 else if( nTCom == workVerticesContainer->at(jv).selectedTrackIndices.size() ) { workVerticesContainer->erase(workVerticesContainer->begin()+jv);
break; }
735 if(iv==tmpN-1)
break;
739 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Identify remaining 2-track vertices with very bad Chi2 and mass (b-tagging).");
740 for(
auto& wrkvrt : *workVerticesContainer ) {
743 if( wrkvrt.selectedTrackIndices.size() != 2 )
continue;
749 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 946 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
955 auto maxSharedTrackToVertices = std::max_element( trackToVertexMap.begin(), trackToVertexMap.end(), [](
auto&
p1,
auto&
p2 ) { return p1.second.size() < p2.second.size(); } );
957 if( maxSharedTrackToVertices == trackToVertexMap.end() )
return worstChi2;
959 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": max-shared track index = " << maxSharedTrackToVertices->first <<
", number of shared vertices = " << maxSharedTrackToVertices->second.size() );
961 if( maxSharedTrackToVertices->second.size() < 2 )
return worstChi2;
964 std::map<long int, double> vrtChi2Map;
967 for(
auto& iv : maxSharedTrackToVertices->second ) {
968 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": loop over vertices: vertex index " << iv );
970 auto& wrkvrt = workVerticesContainer->at( iv );
971 auto& trackIndices = wrkvrt.selectedTrackIndices;
974 auto index = std::find_if( trackIndices.begin(), trackIndices.end(), [&](
auto&
index ) { return index == maxSharedTrackToVertices->first; } );
975 if(
index == trackIndices.end() ) {
976 ATH_MSG_WARNING(
" >> " << __FUNCTION__ <<
": index not found (algorithm inconsistent)" );
980 auto&
chi2 = wrkvrt.Chi2PerTrk.at(
index - trackIndices.begin() );
982 vrtChi2Map.emplace( std::pair<long int, double>(iv,
chi2) );
985 auto worstVrtChi2Pair = std::max_element( vrtChi2Map.begin(), vrtChi2Map.end(), [](
auto&
p1,
auto&
p2 ) { return p1.second < p2.second; } );
987 if( worstVrtChi2Pair == vrtChi2Map.end() ) {
988 ATH_MSG_WARNING(
" >> " << __FUNCTION__ <<
": max_element of vrtChi2Map not found" );
992 maxSharedTrack = maxSharedTrackToVertices->first;
993 worstMatchingVertex = worstVrtChi2Pair->first;
994 worstChi2 = worstVrtChi2Pair->second;
◆ getIntersection() [1/2]
◆ getIntersection() [2/2]
◆ getSVImpactParameters()
get secondary vertex impact parameters
Definition at line 2317 of file VertexingAlgs.cxx.
2321 impactParameters.clear();
2322 impactParErrors.clear();
2325 m_fitSvc->VKalGetImpact(trk,
vertex,
static_cast<int>( trk->
charge() ), impactParameters, impactParErrors);
2329 if( !sv_perigee )
return false;
2330 impactParameters.push_back(sv_perigee->parameters() [
Trk::d0]);
2331 impactParameters.push_back(sv_perigee->parameters() [
Trk::z0]);
2332 impactParErrors.push_back((*sv_perigee->covariance())(
Trk::d0,
Trk::d0 ));
2333 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 1309 of file VertexingAlgs.cxx.
1312 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": #verticess = " << workVerticesContainer->size() );
1314 unsigned mergeCounter { 0 };
1317 std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt&
v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
1320 for(
auto& wrkvrt : *workVerticesContainer ) {
1321 if( !wrkvrt.isGood )
continue;
1322 if( wrkvrt.selectedTrackIndices.size() <= 1 )
continue;
1325 for(
auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
1326 auto& vertexToMerge = *ritr;
1328 if( !vertexToMerge.isGood )
continue;
1329 if( vertexToMerge.selectedTrackIndices.size() <= 1 )
continue;
1330 if( &wrkvrt == &vertexToMerge )
continue;
1331 if( vertexToMerge.selectedTrackIndices.size() < wrkvrt.selectedTrackIndices.size() )
continue;
1337 bool mergeFlag {
false };
1340 <<
": vertex " << &wrkvrt <<
" #tracks = " << wrkvrt.selectedTrackIndices.size()
1341 <<
" --> to Merge : " << &vertexToMerge <<
", #tracks = " << vertexToMerge.selectedTrackIndices.size()
1342 <<
" significance = " << significance );
1348 WrkVrt testVertex = wrkvrt;
1350 if(
sc.isFailure() ) {
1355 if( signif < min_signif ) min_signif = signif;
1358 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": method1: vertexToMerge " << &vertexToMerge <<
": test signif = " << signif );
1363 if(
m_jp.
FillHist && min_signif > 0. )
m_hists[
"shuffleMinSignif1"]->Fill( log10( min_signif ) );
1372 for(
auto&
index : vertexToMerge.selectedTrackIndices ) {
1374 WrkVrt testVertex = wrkvrt;
1375 testVertex.selectedTrackIndices.emplace_back(
index );
1378 if(
sc.isFailure() ) {
1383 if( signif < min_signif ) min_signif = signif;
1386 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": method2: vertexToMerge " << &vertexToMerge <<
" track index " <<
index <<
": test signif = " << signif );
1393 if(
m_jp.
FillHist && min_signif > 0. )
m_hists[
"shuffleMinSignif2"]->Fill( log10( min_signif ) );
1401 WrkVrt testVertex = wrkvrt;
1403 for(
auto&
index : vertexToMerge.selectedTrackIndices ) {
1404 testVertex.selectedTrackIndices.emplace_back(
index );
1408 if(
sc.isFailure() ) {
1413 if( signif < min_signif ) min_signif = signif;
1416 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": method3: vertexToMerge " << &vertexToMerge <<
": test signif = " << signif );
1420 if(
m_jp.
FillHist && min_signif > 0. )
m_hists[
"shuffleMinSignif3"]->Fill( log10( min_signif ) );
1428 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertexToMerge " << &vertexToMerge <<
" ==> min signif = " << min_signif <<
" judged to merge" );
1430 auto vertexToMerge_backup = vertexToMerge;
1431 auto wrkvrt_backup = wrkvrt;
1434 if(
sc.isFailure() ) {
1435 vertexToMerge = vertexToMerge_backup;
1436 wrkvrt = wrkvrt_backup;
1449 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1450 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of merges = " << mergeCounter );
1451 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1453 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 1458 of file VertexingAlgs.cxx.
1461 unsigned mergeCounter { 0 };
1467 for(
auto& wrkvrt : *workVerticesContainer) {
1479 auto& v1 = workVerticesContainer->at(indexPair.first);
1480 auto&
v2 = workVerticesContainer->at(indexPair.second);
1482 const double averageRadius = ( v1.vertex.perp() +
v2.vertex.perp() ) / 2.0;
1485 ATH_MSG_DEBUG(
"Vertices " << indexPair.first <<
" and " << indexPair.second
1486 <<
" are separated by distance " << minDistance );
1490 ATH_MSG_DEBUG(
"Merging FINAL vertices " << indexPair.first <<
" and " << indexPair.second
1491 <<
" which are separated by distance "<< minDistance );
1494 if(
sc.isFailure() ) {}
1503 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1504 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of merges = " << mergeCounter );
1505 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1507 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 2210 of file VertexingAlgs.cxx.
2221 for(
auto& wrkvrt : *workVerticesContainer ) {
2224 intermediateVertexContainer->emplace_back(
vertex );
2227 vertex->setPosition( wrkvrt.vertex );
2233 int ndof = wrkvrt.ndof();
2237 std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
2238 vertex->setCovariance(fCov);
2242 for(
auto trk_id : wrkvrt.selectedTrackIndices ) {
2250 vertex->addTrackAtVertex( link_trk, 1. );
2254 for(
auto trk_id : wrkvrt.associatedTrackIndices ) {
2262 vertex->addTrackAtVertex( link_trk, 1. );
2275 unsigned count = std::count_if( workVerticesContainer->begin(), workVerticesContainer->end(),
2276 []( WrkVrt&
v ) { return ( v.selectedTrackIndices.size() + v.associatedTrackIndices.size() ) >= 2; } );
2291 for(
auto&
vertex : *workVerticesContainer ) {
2292 auto ntrk =
vertex.selectedTrackIndices.size() +
vertex.associatedTrackIndices.size();
2293 if(
vertex.isGood && ntrk >= 2 ) {
2302 if( !
final )
return StatusCode::SUCCESS;
2304 for(
auto&
vertex : *workVerticesContainer ) {
2305 auto ntrk =
vertex.selectedTrackIndices.size() +
vertex.associatedTrackIndices.size();
2306 if(
vertex.isGood && ntrk >= 2 ) {
2307 m_hists[
"finalVtxNtrk"] ->Fill( ntrk );
2309 dynamic_cast<TH2F*
>(
m_hists[
"finalVtxNtrkR"] )->Fill( ntrk,
vertex.vertex.perp() );
2313 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 1849 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1858 const double absz = fabs(
vertex.z() );
1867 outsidePixelBarrel1_and_insidePixelBarrel2,
1870 outsidePixelBarrel2_and_insidePixelBarrel3,
1873 outsidePixelBarrel3_and_insideSctBarrel0,
1876 outsideSctBarrel0_and_insideSctBarrel1,
1881 Int_t vertex_pattern = 0;
1883 vertex_pattern = insideBeamPipe;
1885 }
else if(
rad < 47.7 && absz < 400.5 ) {
1886 vertex_pattern = insidePixelBarrel1;
1888 }
else if(
rad < 54.4 && absz < 400.5 ) {
1889 vertex_pattern = aroundPixelBarrel1;
1891 }
else if(
rad < 85.5 && absz < 400.5 ) {
1892 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1894 }
else if(
rad < 92.2 && absz < 400.5 ) {
1895 vertex_pattern = aroundPixelBarrel2;
1897 }
else if(
rad < 119.3 && absz < 400.5 ) {
1898 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1900 }
else if(
rad < 126.1 && absz < 400.5 ) {
1901 vertex_pattern = aroundPixelBarrel3;
1903 }
else if(
rad < 290 && absz < 749.0 ) {
1904 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1906 }
else if(
rad < 315 && absz < 749.0 ) {
1907 vertex_pattern = aroundSctBarrel0;
1909 }
else if(
rad < 360 && absz < 749.0 ) {
1910 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1912 }
else if(
rad < 390 && absz < 749.0 ) {
1913 vertex_pattern = aroundSctBarrel1;
1920 if( vertex_pattern == insideBeamPipe ) {
1927 else if( vertex_pattern == insidePixelBarrel1 ) {
1933 else if( vertex_pattern == aroundPixelBarrel1 ) {
1940 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1947 else if( vertex_pattern == aroundPixelBarrel2 ) {
1955 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1962 else if( vertex_pattern == aroundPixelBarrel3 ) {
1971 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1980 else if( vertex_pattern == aroundSctBarrel0 ) {
1990 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
2000 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ patternCheckRun1OuterOnly()
bool VKalVrtAthena::VrtSecInclusive::patternCheckRun1OuterOnly |
( |
const uint32_t & |
pattern, |
|
|
const Amg::Vector3D & |
vertex |
|
) |
| |
|
staticprivate |
Definition at line 2014 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
2023 const double absz = fabs(
vertex.z() );
2032 outsidePixelBarrel1_and_insidePixelBarrel2,
2035 outsidePixelBarrel2_and_insidePixelBarrel3,
2038 outsidePixelBarrel3_and_insideSctBarrel0,
2041 outsideSctBarrel0_and_insideSctBarrel1,
2046 Int_t vertex_pattern = 0;
2048 vertex_pattern = insideBeamPipe;
2050 }
else if(
rad < 47.7 && absz < 400.5 ) {
2051 vertex_pattern = insidePixelBarrel1;
2053 }
else if(
rad < 54.4 && absz < 400.5 ) {
2054 vertex_pattern = aroundPixelBarrel1;
2056 }
else if(
rad < 85.5 && absz < 400.5 ) {
2057 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
2059 }
else if(
rad < 92.2 && absz < 400.5 ) {
2060 vertex_pattern = aroundPixelBarrel2;
2062 }
else if(
rad < 119.3 && absz < 400.5 ) {
2063 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
2065 }
else if(
rad < 126.1 && absz < 400.5 ) {
2066 vertex_pattern = aroundPixelBarrel3;
2068 }
else if(
rad < 290 && absz < 749.0 ) {
2069 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
2071 }
else if(
rad < 315 && absz < 749.0 ) {
2072 vertex_pattern = aroundSctBarrel0;
2074 }
else if(
rad < 360 && absz < 749.0 ) {
2075 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
2077 }
else if(
rad < 390 && absz < 749.0 ) {
2078 vertex_pattern = aroundSctBarrel1;
2085 if( vertex_pattern == insideBeamPipe ) {
2092 else if( vertex_pattern == insidePixelBarrel1 ) {
2098 else if( vertex_pattern == aroundPixelBarrel1 ) {
2105 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
2111 else if( vertex_pattern == aroundPixelBarrel2 ) {
2118 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
2123 else if( vertex_pattern == aroundPixelBarrel3 ) {
2130 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
2136 else if( vertex_pattern == aroundSctBarrel0 ) {
2143 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
2149 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ patternCheckRun2()
Definition at line 1439 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1450 const double absz = fabs(
vertex.z() );
1459 outsidePixelBarrel0_and_insidePixelBarrel1,
1462 outsidePixelBarrel1_and_insidePixelBarrel2,
1465 outsidePixelBarrel2_and_insidePixelBarrel3,
1468 outsidePixelBarrel3_and_insideSctBarrel0,
1471 outsideSctBarrel0_and_insideSctBarrel1,
1476 int vertex_pattern = 0;
1478 vertex_pattern = insideBeamPipe;
1480 }
else if(
rad < 31.0 && absz < 331.5 ) {
1481 vertex_pattern = insidePixelBarrel0;
1483 }
else if(
rad < 38.4 && absz < 331.5 ) {
1484 vertex_pattern = aroundPixelBarrel0;
1486 }
else if(
rad < 47.7 && absz < 400.5 ) {
1487 vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1489 }
else if(
rad < 54.4 && absz < 400.5 ) {
1490 vertex_pattern = aroundPixelBarrel1;
1492 }
else if(
rad < 85.5 && absz < 400.5 ) {
1493 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1495 }
else if(
rad < 92.2 && absz < 400.5 ) {
1496 vertex_pattern = aroundPixelBarrel2;
1498 }
else if(
rad < 119.3 && absz < 400.5 ) {
1499 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1501 }
else if(
rad < 126.1 && absz < 400.5 ) {
1502 vertex_pattern = aroundPixelBarrel3;
1504 }
else if(
rad < 290 && absz < 749.0 ) {
1505 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1507 }
else if(
rad < 315 && absz < 749.0 ) {
1508 vertex_pattern = aroundSctBarrel0;
1510 }
else if(
rad < 360 && absz < 749.0 ) {
1511 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1513 }
else if(
rad < 390 && absz < 749.0 ) {
1514 vertex_pattern = aroundSctBarrel1;
1519 unsigned nPixelLayers { 0 };
1531 if( vertex_pattern == insideBeamPipe ) {
1534 if( nPixelLayers < 3 )
return false;
1537 }
else if( vertex_pattern == insidePixelBarrel0 ) {
1540 if( nPixelLayers < 3 )
return false;
1544 else if( vertex_pattern == aroundPixelBarrel0 ) {
1548 if( nPixelLayers < 2 )
return false;
1552 else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1556 if( nPixelLayers < 2 )
return false;
1560 else if( vertex_pattern == aroundPixelBarrel1 ) {
1565 if( nPixelLayers < 2 )
return false;
1569 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1574 if( nPixelLayers < 2 )
return false;
1578 else if( vertex_pattern == aroundPixelBarrel2 ) {
1587 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1595 else if( vertex_pattern == aroundPixelBarrel3 ) {
1605 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1615 else if( vertex_pattern == aroundSctBarrel0 ) {
1626 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1637 else if( vertex_pattern == aroundSctBarrel1 ) {
◆ patternCheckRun2OuterOnly()
bool VKalVrtAthena::VrtSecInclusive::patternCheckRun2OuterOnly |
( |
const uint32_t & |
pattern, |
|
|
const Amg::Vector3D & |
vertex |
|
) |
| |
|
staticprivate |
Definition at line 1653 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1664 const double absz = fabs(
vertex.z() );
1673 outsidePixelBarrel0_and_insidePixelBarrel1,
1676 outsidePixelBarrel1_and_insidePixelBarrel2,
1679 outsidePixelBarrel2_and_insidePixelBarrel3,
1682 outsidePixelBarrel3_and_insideSctBarrel0,
1685 outsideSctBarrel0_and_insideSctBarrel1,
1690 int vertex_pattern = 0;
1692 vertex_pattern = insideBeamPipe;
1694 }
else if(
rad < 31.0 && absz < 331.5 ) {
1695 vertex_pattern = insidePixelBarrel0;
1697 }
else if(
rad < 38.4 && absz < 331.5 ) {
1698 vertex_pattern = aroundPixelBarrel0;
1700 }
else if(
rad < 47.7 && absz < 400.5 ) {
1701 vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1;
1703 }
else if(
rad < 54.4 && absz < 400.5 ) {
1704 vertex_pattern = aroundPixelBarrel1;
1706 }
else if(
rad < 85.5 && absz < 400.5 ) {
1707 vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2;
1709 }
else if(
rad < 92.2 && absz < 400.5 ) {
1710 vertex_pattern = aroundPixelBarrel2;
1712 }
else if(
rad < 119.3 && absz < 400.5 ) {
1713 vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3;
1715 }
else if(
rad < 126.1 && absz < 400.5 ) {
1716 vertex_pattern = aroundPixelBarrel3;
1718 }
else if(
rad < 290 && absz < 749.0 ) {
1719 vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0;
1721 }
else if(
rad < 315 && absz < 749.0 ) {
1722 vertex_pattern = aroundSctBarrel0;
1724 }
else if(
rad < 360 && absz < 749.0 ) {
1725 vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1;
1727 }
else if(
rad < 390 && absz < 749.0 ) {
1728 vertex_pattern = aroundSctBarrel1;
1734 unsigned nPixelLayers { 0 };
1746 if( vertex_pattern == insideBeamPipe ) {
1750 if( nPixelLayers < 3 )
return false;
1752 }
else if( vertex_pattern == insidePixelBarrel0 ) {
1756 if( nPixelLayers < 3 )
return false;
1761 else if( vertex_pattern == aroundPixelBarrel0 ) {
1766 if( nPixelLayers < 3 )
return false;
1770 else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) {
1774 if( nPixelLayers < 3 )
return false;
1778 else if( vertex_pattern == aroundPixelBarrel1 ) {
1783 if( nPixelLayers < 2 )
return false;
1787 else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) {
1791 if( nPixelLayers < 2 )
return false;
1795 else if( vertex_pattern == aroundPixelBarrel2 ) {
1802 else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) {
1807 else if( vertex_pattern == aroundPixelBarrel3 ) {
1815 else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) {
1822 else if( vertex_pattern == aroundSctBarrel0 ) {
1830 else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) {
1837 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 1001 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
1003 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": ===============================================================" );
1004 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": " <<
name <<
": #vertices = " << workVerticesContainer->size() );
1006 std::set<const xAOD::TrackParticle*> usedTracks;
1008 auto concatenateIndicesToString = [](
auto indices,
auto& collection ) -> std::string {
1009 if( 0 ==
indices.size() )
return "";
1011 [&collection](
const std::string&
str,
auto&
index ) { return str +
", " + std::to_string( collection.at(index)->index() ); } );
1014 std::map<const xAOD::TruthVertex*, bool>
previous;
1021 for(
size_t iv=0; iv<workVerticesContainer->size(); iv++) {
1022 const auto& wrkvrt = workVerticesContainer->at(iv);
1024 if( wrkvrt.nTracksTotal() < 2 )
continue;
1026 std::string sels = concatenateIndicesToString( wrkvrt.selectedTrackIndices,
m_selectedTracks );
1027 std::string assocs = concatenateIndicesToString( wrkvrt.associatedTrackIndices,
m_associatedTracks );
1032 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": " <<
name <<
" vertex [" << iv <<
"]: " << &wrkvrt
1033 <<
", isGood = " << (wrkvrt.isGood?
"true" :
"false")
1034 <<
", #ntrks(tot, sel, assoc) = (" << wrkvrt.nTracksTotal() <<
", " << wrkvrt.selectedTrackIndices.size() <<
", " << wrkvrt.associatedTrackIndices.size() <<
"), "
1035 <<
", chi2/ndof = " << wrkvrt.fitQuality()
1036 <<
", (r, z) = (" << wrkvrt.vertex.perp()
1037 <<
", " << wrkvrt.vertex.z() <<
")"
1038 <<
", sels = { " << sels <<
" }"
1039 <<
", assocs = { " << assocs <<
" }" );
1045 Amg::Vector3D vTruth( truthVertex->x(), truthVertex->y(), truthVertex->z() );
1046 Amg::Vector3D vReco ( wrkvrt.vertex.x(), wrkvrt.vertex.y(), wrkvrt.vertex.z() );
1048 const auto distance = vReco - vTruth;
1071 if( pair.second !=
previous.at( pair.first ) ) {
1072 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": Match flag has changed: (r, z) = (" << pair.first->perp() <<
", " << pair.first->z() <<
")" );
1084 for(
const auto* trk : usedTracks ) {
msg += Form(
"%ld, ", trk->index() ); }
1087 ATH_MSG_DEBUG(
" >> " << __FUNCTION__ <<
": ===============================================================" );
◆ processPrimaryVertices()
StatusCode VKalVrtAthena::VrtSecInclusive::processPrimaryVertices |
( |
| ) |
|
|
private |
◆ rearrangeTracks()
StatusCode VKalVrtAthena::VrtSecInclusive::rearrangeTracks |
( |
std::vector< WrkVrt > * |
workVerticesContainer | ) |
|
|
private |
Definition at line 754 of file VertexingAlgs.cxx.
758 return StatusCode::SUCCESS;
764 std::vector<long int> processedTracks;
766 unsigned mergeCounter { 0 };
767 unsigned brokenCounter { 0 };
768 unsigned removeTrackCounter { 0 };
773 long int maxSharedTrack;
774 long int worstMatchingVertex;
781 std::map<long int, std::vector<long int> > trackToVertexMap;
790 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": no shared tracks are found --> exit the while loop." );
794 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex [" << worstMatchingVertex <<
"]: maximally shared track index = " << maxSharedTrack
795 <<
", multiplicity = " << trackToVertexMap.at( maxSharedTrack ).size()
796 <<
", worst chi2_trk = " << worstChi2 );
804 std::vector< std::pair<unsigned, unsigned> > badPairs;
810 unsigned nShared { 0 };
813 auto& vrtList = trackToVertexMap.at( maxSharedTrack );
815 auto nGood = std::count_if( vrtList.begin(), vrtList.end(), [&](
auto&
v ) { return workVerticesContainer->at(v).isGood; } );
818 std::vector< std::tuple< std::pair<unsigned, unsigned>,
double,
unsigned> > significanceTuple;
819 enum { kIndexPair, kSignificance, kNshared };
821 for(
auto ivrt = vrtList.begin(); ivrt != vrtList.end(); ++ivrt ) {
822 for(
auto jvrt =
std::next( ivrt ); jvrt != vrtList.end(); ++jvrt ) {
823 auto pair = std::pair<unsigned, unsigned>( *ivrt, *jvrt );
825 if( !( workVerticesContainer->at(*ivrt).isGood ) )
continue;
826 if( !( workVerticesContainer->at(*jvrt).isGood ) )
continue;
829 if(
std::find( badPairs.begin(), badPairs.end(), pair ) != badPairs.end() )
continue;
833 auto& ivrtTrks = workVerticesContainer->at(*ivrt).selectedTrackIndices;
834 auto& jvrtTrks = workVerticesContainer->at(*jvrt).selectedTrackIndices;
836 auto nSharedTracks = std::count_if( ivrtTrks.begin(), ivrtTrks.end(),
838 return std::find( jvrtTrks.begin(), jvrtTrks.end(), index ) != jvrtTrks.end();
841 significanceTuple.emplace_back( pair, signif, nSharedTracks );
845 if( significanceTuple.empty() ) {
846 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": no vertex pairs are found --> exit the while loop." );
850 auto minSignificanceTuple = std::min_element( significanceTuple.begin(), significanceTuple.end(), [&](
auto&
t1,
auto&
t2 ) { return std::get<kSignificance>(t1) < std::get<kSignificance>(t2); } );
852 indexPair = std::get<kIndexPair> ( *minSignificanceTuple );
853 minSignificance = std::get<kSignificance> ( *minSignificanceTuple );
854 nShared = std::get<kNshared> ( *minSignificanceTuple );
857 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": minSignificance = " << minSignificance );
859 if( minSignificance < m_jp.VertexMergeCut || nShared >= 2 ) {
861 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": attempt to merge vertices " << indexPair.first <<
" and " << indexPair.second );
863 WrkVrt vertex_backup1 = workVerticesContainer->at( indexPair.first );
864 WrkVrt vertex_backup2 = workVerticesContainer->at( indexPair.second );
866 StatusCode sc =
mergeVertices( workVerticesContainer->at( indexPair.first ), workVerticesContainer->at( indexPair.second ) );
870 if(
sc.isFailure() ) {
872 workVerticesContainer->at( indexPair.first ) = vertex_backup1;
873 workVerticesContainer->at( indexPair.second ) = vertex_backup2;
874 badPairs.emplace_back( indexPair );
879 workVerticesContainer->at( indexPair.second ).isGood =
false;
886 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Merged vertices " << indexPair.first <<
" and " << indexPair.second <<
". merged vertex multiplicity = " << workVerticesContainer->at( indexPair.first ).selectedTrackIndices.size() );
894 auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
896 auto end =
std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&](
auto&
index ) { return index == maxSharedTrack; } );
897 wrkvrt.selectedTrackIndices.erase(
end, wrkvrt.selectedTrackIndices.end() );
899 removeTrackCounter++;
901 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": removed track " << maxSharedTrack <<
" from vertex " << worstMatchingVertex );
903 if( wrkvrt.selectedTrackIndices.size() < 2 ) {
904 wrkvrt.isGood =
false;
910 if(
sc.isFailure() ) {
911 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
924 auto& wrkvrt = workVerticesContainer->at( worstMatchingVertex );
926 auto end =
std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&](
auto&
index ) { return index == maxSharedTrack; } );
927 wrkvrt.selectedTrackIndices.erase(
end, wrkvrt.selectedTrackIndices.end() );
929 if( wrkvrt.nTracksTotal() >=2 ) {
931 auto wrkvrt_backup = wrkvrt;
933 if(
sc.isFailure() ) {
934 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
935 wrkvrt = wrkvrt_backup;
939 wrkvrt.isGood =
false;
943 removeTrackCounter++;
945 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": removed track " << maxSharedTrack <<
" from vertex " << worstMatchingVertex );
953 for(
auto& wrkvrt : *workVerticesContainer ) {
955 if(!wrkvrt.isGood )
continue;
956 if( wrkvrt.selectedTrackIndices.size() < 3 )
continue;
958 WrkVrt backup = wrkvrt;
960 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
962 if( wrkvrt.nTracksTotal() < 2 ) wrkvrt.isGood =
false;
967 m_ntupleVars->get<
unsigned int>(
"NumRearrSecVrt" )=workVerticesContainer->size();
968 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Size of Solution Set: "<<
m_ntupleVars->get<
unsigned int>(
"NumRearrSecVrt" ));
971 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
972 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of merges = " << mergeCounter <<
", Number of track removal = " << removeTrackCounter <<
", broken vertices = " << brokenCounter );
973 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
975 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 980 of file VertexingAlgs.cxx.
989 unsigned reassembleCounter { 0 };
992 std::sort( workVerticesContainer->begin(), workVerticesContainer->end(), [](WrkVrt& v1, WrkVrt&
v2) { return v1.selectedTrackIndices.size() < v2.selectedTrackIndices.size(); } );
994 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": #vertices = " << workVerticesContainer->size() );
996 for(
auto& wrkvrt : *workVerticesContainer ) {
997 if( !wrkvrt.isGood )
continue;
998 if( wrkvrt.selectedTrackIndices.size() <= 1 )
continue;
1000 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": vertex " << &wrkvrt <<
" #tracks = " << wrkvrt.selectedTrackIndices.size() );
1001 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": candidate vertex: "
1002 <<
" isGood = " << (wrkvrt.isGood?
"true" :
"false")
1003 <<
", #ntrks = " << wrkvrt.nTracksTotal()
1004 <<
", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
1005 <<
", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
1006 <<
", chi2/ndof = " << wrkvrt.fitQuality()
1007 <<
", (r, z) = (" << wrkvrt.vertex.perp()
1008 <<
", " << wrkvrt.vertex.z() <<
")" );
1010 std::map<unsigned, std::vector<WrkVrt>::reverse_iterator> mergiableVertex;
1011 std::set<std::vector<WrkVrt>::reverse_iterator> mergiableVerticesSet;
1013 for(
auto&
index : wrkvrt.selectedTrackIndices ) {
1017 mergiableVertex[
index] = workVerticesContainer->rend();
1019 std::vector<double> distances;
1022 for(
auto ritr = workVerticesContainer->rbegin(); ritr != workVerticesContainer->rend(); ++ritr ) {
1023 auto& targetVertex = *ritr;
1025 if( &wrkvrt == &targetVertex )
continue;
1026 if( wrkvrt.selectedTrackIndices.size() >= targetVertex.selectedTrackIndices.size() )
continue;
1029 std::vector<double> impactParameters;
1030 std::vector<double> impactParErrors;
1034 const auto&
distance = hypot( impactParameters.at(0), impactParameters.at(1) );
1035 distances.emplace_back(
distance );
1040 mergiableVertex[
index] = ritr;
1041 mergiableVerticesSet.emplace( ritr );
1045 auto min_distance = !distances.empty() ? *(std::min_element( distances.begin(), distances.end() )) :
AlgConsts::invalidFloat;
1047 if( mergiableVertex[
index] == workVerticesContainer->rend() ) {
1048 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": track " << trk <<
" --> none : min distance = " << min_distance );
1050 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": track " << trk <<
" --> " << &( *(mergiableVertex[
index]) ) <<
" --> size = " << mergiableVertex[
index]->selectedTrackIndices.size() <<
": min distance = " << min_distance );
1055 size_t count_mergiable = std::count_if( mergiableVertex.begin(), mergiableVertex.end(),
1056 [&](
const std::pair<
unsigned, std::vector<WrkVrt>::reverse_iterator>&
p ) {
1057 return p.second != workVerticesContainer->rend(); } );
1059 if( mergiableVerticesSet.size() == 1 && count_mergiable == wrkvrt.selectedTrackIndices.size() ) {
1061 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": identified a unique association destination vertex" );
1063 WrkVrt& destination = *( mergiableVertex.begin()->second );
1064 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": destination #tracks before merging = " << destination.selectedTrackIndices.size() );
1067 if(
sc.isFailure() ) {
1068 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": failure in vertex merging" );
1073 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": merged destination vertex: "
1074 <<
" isGood = " << (destination.isGood?
"true" :
"false")
1075 <<
", #ntrks = " << destination.nTracksTotal()
1076 <<
", #selectedTracks = " << destination.selectedTrackIndices.size()
1077 <<
", #associatedTracks = " << destination.associatedTrackIndices.size()
1078 <<
", chi2/ndof = " << destination.fitQuality()
1079 <<
", (r, z) = (" << destination.vertex.perp()
1080 <<
", " << destination.vertex.z() <<
")" );
1084 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": destination #tracks after merging = " << destination.selectedTrackIndices.size() );
1086 reassembleCounter++;
1092 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1093 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": reassembled vertices = " << reassembleCounter );
1094 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
"----------------------------------------------" );
1096 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 1514 of file VertexingAlgs.cxx.
1529 enum { kPt,
kEta,
kPhi, kD0, kZ0, kErrP, kErrD0, kErrZ0, kChi2SV };
1545 std::map<const WrkVrt*, const xAOD::Vertex*> wrkvrtLinkMap;
1548 const auto& ctx = Gaudi::Hive::currentContext();
1550 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": input #vertices = " << workVerticesContainer->size() );
1553 for(
auto& wrkvrt : *workVerticesContainer ) {
1555 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": candidate vertex: "
1556 <<
" isGood = " << (wrkvrt.isGood?
"true" :
"false")
1557 <<
", #ntrks = " << wrkvrt.nTracksTotal()
1558 <<
", #selectedTracks = " << wrkvrt.selectedTrackIndices.size()
1559 <<
", #associatedTracks = " << wrkvrt.associatedTrackIndices.size()
1561 <<
", (r, z) = (" << wrkvrt.vertex.perp()
1562 <<
", " << wrkvrt.vertex.z() <<
")" );
1570 if( wrkvrt.nTracksTotal() < 2 ) {
1571 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": ntrk < 2 --> rejected." );
1579 if( wrkvrt.vertex.perp() < 31.0 ) {
1582 wrkvrt.selectedTrackIndices.erase( std::remove_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(),
1583 [&](
auto&
index ) {
1584 auto* trk = m_selectedTracks.at( index );
1588 wrkvrt.selectedTrackIndices.end() );
1591 wrkvrt.associatedTrackIndices.erase( std::remove_if( wrkvrt.associatedTrackIndices.begin(), wrkvrt.associatedTrackIndices.end(),
1592 [&](
auto&
index ) {
1593 auto* trk = m_associatedTracks.at( index );
1597 wrkvrt.associatedTrackIndices.end() );
1607 WrkVrt backup = wrkvrt;
1611 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1616 if( wrkvrt.nTracksTotal() < 2 )
continue;
1619 if( wrkvrt.selectedTrackIndices.size() < 2 )
continue;
1626 WrkVrt backup = wrkvrt;
1629 if(
sc.isFailure() ) {
1631 auto indices = wrkvrt.associatedTrackIndices;
1633 wrkvrt.associatedTrackIndices.clear();
1635 if(
sc.isFailure() ) {
1636 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
1639 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1643 wrkvrt.associatedTrackIndices.emplace_back(
index );
1646 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": detected vertex fitting failure!" );
1653 if( wrkvrt.fitQuality() > backup.fitQuality() ) wrkvrt = backup;
1664 TLorentzVector sumP4_pion;
1665 TLorentzVector sumP4_electron;
1666 TLorentzVector sumP4_proton;
1669 bool good_flag =
true;
1671 std::map<const std::deque<long int>*,
const std::vector<const xAOD::TrackParticle*>&> indicesSet
1677 for(
auto& pair : indicesSet ) {
1679 const auto*
indices = pair.first;
1680 const auto& tracks = pair.second;
1682 for(
const auto& itrk : *
indices ) {
1683 const auto* trk = tracks.at( itrk );
1686 ATH_MSG_INFO(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": Failed in obtaining the SV perigee!" );
1694 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": sv perigee could not be obtained --> rejected" );
1701 std::vector<const xAOD::TrackParticle*> tracks;
1702 std::vector< std::pair<const xAOD::TrackParticle*, double> > trackChi2Pairs;
1706 for(
auto& pair : indicesSet ) {
1707 for(
const auto&
index : *pair.first ) tracks.emplace_back( pair.second.at(
index ) );
1710 auto trkitr = tracks.begin();
1711 auto chi2itr = wrkvrt.Chi2PerTrk.begin();
1713 for( ; ( trkitr!=tracks.end() && chi2itr!=wrkvrt.Chi2PerTrk.end() ); ++trkitr, ++chi2itr ) {
1714 trackChi2Pairs.emplace_back( *trkitr, *chi2itr );
1720 TLorentzVector sumP4_selected;
1722 bool badIPflag {
false };
1725 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Track loop: size = " << tracks.size() );
1726 for(
auto& pair : trackChi2Pairs ) {
1728 const auto* trk = pair.first;
1729 const auto& chi2AtSV = pair.second;
1731 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": start." );
1740 double trk_pt = trk->pt();
1741 double trk_eta = trk->eta();
1742 double trk_phi = trk->phi();
1744 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": in vrt chg/pt/phi/eta = "
1745 << trk->charge() <<
","
1752 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": Get the prigee of the track at the vertex." );
1756 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": Failed in obtaining the SV perigee!" );
1761 (*m_decor_is_svtrk_final)( *trk ) =
true;
1765 double qOverP_wrtSV = sv_perigee->parameters() [
Trk::qOverP];
1766 double theta_wrtSV = sv_perigee->parameters() [
Trk::theta];
1767 double p_wrtSV = 1.0 / std::abs( qOverP_wrtSV );
1768 double pt_wrtSV = p_wrtSV *
sin( theta_wrtSV );
1769 double eta_wrtSV = -
log(
tan( theta_wrtSV/2. ) );
1770 double phi_wrtSV = sv_perigee->parameters() [
Trk::phi];
1771 double d0_wrtSV = sv_perigee->parameters() [
Trk::d0];
1772 double z0_wrtSV = sv_perigee->parameters() [
Trk::z0];
1773 double errd0_wrtSV = (*sv_perigee->covariance())(
Trk::d0,
Trk::d0 );
1774 double errz0_wrtSV = (*sv_perigee->covariance())(
Trk::z0,
Trk::z0 );
1788 (*m_decor_is_svtrk_final)( *trk ) =
true;
1790 TLorentzVector p4wrtSV_pion;
1791 TLorentzVector p4wrtSV_electron;
1792 TLorentzVector p4wrtSV_proton;
1799 if( is_associatedAcc.isAvailable(*trk) ) {
1800 if( !is_associatedAcc(*trk) ) {
1801 sumP4_selected += p4wrtSV_pion;
1804 sumP4_selected += p4wrtSV_pion;
1807 sumP4_pion += p4wrtSV_pion;
1808 sumP4_electron += p4wrtSV_electron;
1809 sumP4_proton += p4wrtSV_proton;
1811 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": > Track index " << trk->index() <<
": end." );
1816 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Final Sec.Vertex=" << wrkvrt.nTracksTotal() <<
", "
1817 <<wrkvrt.vertex.perp() <<
", "<<wrkvrt.vertex.z() <<
", "
1818 <<wrkvrt.vertex.phi() <<
", mass = "<< sumP4_pion.M() <<
"," << sumP4_electron.M() );
1821 float perigee_x_trk1 = 0.0;
1822 float perigee_y_trk1 = 0.0;
1823 float perigee_z_trk1 = 0.0;
1824 float perigee_x_trk2 = 0.0;
1825 float perigee_y_trk2 = 0.0;
1826 float perigee_z_trk2 = 0.0;
1827 float perigee_px_trk1 = 0.0;
1828 float perigee_py_trk1 = 0.0;
1829 float perigee_pz_trk1 = 0.0;
1830 float perigee_px_trk2 = 0.0;
1831 float perigee_py_trk2 = 0.0;
1832 float perigee_pz_trk2 = 0.0;
1833 float perigee_cov_xx_trk1 = 0.0;
1834 float perigee_cov_xy_trk1 = 0.0;
1835 float perigee_cov_xz_trk1 = 0.0;
1836 float perigee_cov_yy_trk1 = 0.0;
1837 float perigee_cov_yz_trk1 = 0.0;
1838 float perigee_cov_zz_trk1 = 0.0;
1839 float perigee_cov_xx_trk2 = 0.0;
1840 float perigee_cov_xy_trk2 = 0.0;
1841 float perigee_cov_xz_trk2 = 0.0;
1842 float perigee_cov_yy_trk2 = 0.0;
1843 float perigee_cov_yz_trk2 = 0.0;
1844 float perigee_cov_zz_trk2 = 0.0;
1845 float perigee_d0_trk1 = 0.0;
1846 float perigee_d0_trk2 = 0.0;
1847 float perigee_z0_trk1 = 0.0;
1848 float perigee_z0_trk2 = 0.0;
1849 float perigee_qOverP_trk1 = 0.0;
1850 float perigee_qOverP_trk2 = 0.0;
1851 float perigee_theta_trk1 = 0.0;
1852 float perigee_theta_trk2 = 0.0;
1853 float perigee_phi_trk1 = 0.0;
1854 float perigee_phi_trk2 = 0.0;
1855 int perigee_charge_trk1 = 0;
1856 int perigee_charge_trk2 = 0;
1857 float perigee_distance = 9999.0;
1860 float vPos = (vDist.x() * wrkvrt.vertexMom.Px() + vDist.y() * wrkvrt.vertexMom.Py() + vDist.z() * wrkvrt.vertexMom.Pz()) / wrkvrt.vertexMom.Rho();
1861 float vPosMomAngT = (vDist.x() * wrkvrt.vertexMom.Px() + vDist.y() * wrkvrt.vertexMom.Py()) / vDist.perp() / wrkvrt.vertexMom.Pt();
1862 float vPosMomAng3D = (vDist.x() * wrkvrt.vertexMom.Px() + vDist.y() * wrkvrt.vertexMom.Py() + vDist.z() * wrkvrt.vertexMom.Pz()) / (vDist.norm() * wrkvrt.vertexMom.Rho());
1863 float dphi_trk1 = 0.0;
1864 float dphi_trk2 = 0.0;
1868 const auto* track1 = trackChi2Pairs[0].first;
1872 perigee_x_trk1 = sv_perigee1->position().x();
1873 perigee_y_trk1 = sv_perigee1->position().y();
1874 perigee_z_trk1 = sv_perigee1->position().z();
1875 perigee_px_trk1 = sv_perigee1->momentum().x();
1876 perigee_py_trk1 = sv_perigee1->momentum().y();
1877 perigee_pz_trk1 = sv_perigee1->momentum().z();
1878 perigee_cov_xx_trk1 = (*sv_perigee1->covariance())(0, 0);
1879 perigee_cov_xy_trk1 = (*sv_perigee1->covariance())(0, 1);
1880 perigee_cov_xz_trk1 = (*sv_perigee1->covariance())(0, 2);
1881 perigee_cov_yy_trk1 = (*sv_perigee1->covariance())(1, 1);
1882 perigee_cov_yz_trk1 = (*sv_perigee1->covariance())(1, 2);
1883 perigee_cov_zz_trk1 = (*sv_perigee1->covariance())(2, 2);
1884 perigee_d0_trk1 = sv_perigee1->parameters()[
Trk::d0];
1885 perigee_z0_trk1 = sv_perigee1->parameters()[
Trk::z0];
1886 perigee_qOverP_trk1 = sv_perigee1->parameters()[
Trk::qOverP];
1887 perigee_theta_trk1 = sv_perigee1->parameters()[
Trk::theta];
1888 perigee_phi_trk1 = sv_perigee1->parameters()[
Trk::phi];
1889 perigee_charge_trk1 = sv_perigee1->parameters()[
Trk::qOverP] > 0 ? 1 : -1;
1891 ATH_MSG_DEBUG(
"Failed to obtain perigee for track1 at vertex.");
1895 const auto* track2 = trackChi2Pairs[1].first;
1899 perigee_x_trk2 = sv_perigee2->position().x();
1900 perigee_y_trk2 = sv_perigee2->position().y();
1901 perigee_z_trk2 = sv_perigee2->position().z();
1902 perigee_px_trk2 = sv_perigee2->momentum().x();
1903 perigee_py_trk2 = sv_perigee2->momentum().y();
1904 perigee_pz_trk2 = sv_perigee2->momentum().z();
1905 perigee_cov_xx_trk2 = (*sv_perigee2->covariance())(0, 0);
1906 perigee_cov_xy_trk2 = (*sv_perigee2->covariance())(0, 1);
1907 perigee_cov_xz_trk2 = (*sv_perigee2->covariance())(0, 2);
1908 perigee_cov_yy_trk2 = (*sv_perigee2->covariance())(1, 1);
1909 perigee_cov_yz_trk2 = (*sv_perigee2->covariance())(1, 2);
1910 perigee_cov_zz_trk2 = (*sv_perigee2->covariance())(2, 2);
1911 perigee_d0_trk2 = sv_perigee2->parameters()[
Trk::d0];
1912 perigee_z0_trk2 = sv_perigee2->parameters()[
Trk::z0];
1913 perigee_qOverP_trk2 = sv_perigee2->parameters()[
Trk::qOverP];
1914 perigee_theta_trk2 = sv_perigee2->parameters()[
Trk::theta];
1915 perigee_phi_trk2 = sv_perigee2->parameters()[
Trk::phi];
1916 perigee_charge_trk2 = sv_perigee2->parameters()[
Trk::qOverP] > 0 ? 1 : -1;
1918 ATH_MSG_DEBUG(
"Failed to obtain perigee for track2 at vertex.");
1921 if(sv_perigee1 && sv_perigee2){
1922 perigee_distance = sqrt(
1923 (perigee_x_trk1 - perigee_x_trk2) * (perigee_x_trk1 - perigee_x_trk2) +
1924 (perigee_y_trk1 - perigee_y_trk2) * (perigee_y_trk1 - perigee_y_trk2) +
1925 (perigee_z_trk1 - perigee_z_trk2) * (perigee_z_trk1 - perigee_z_trk2)
1935 std::vector<double> opAngles;
1937 for(
auto itr1 = tracks.begin(); itr1 != tracks.end(); ++itr1 ) {
1938 for(
auto itr2 =
std::next( itr1 ); itr2 != tracks.end(); ++itr2 ) {
1939 const auto&
p1 = (*itr1)->p4().Vect();
1940 const auto&
p2 = (*itr2)->p4().Vect();
1942 opAngles.emplace_back(
cos );
1945 minOpAng = *( std::max_element( opAngles.begin(), opAngles.end() ) );
1952 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Bad impact parameter signif wrt SV was flagged." );
1957 bool oneLepMatchTrack =
false;
1958 for (
const auto *trk: tracks) {
1960 oneLepMatchTrack =
true;
1966 if (!oneLepMatchTrack)
continue;
1972 wrkvrt.isGood =
true;
1977 secondaryVertexContainer->emplace_back(
vertex );
1980 vertex->setPosition( wrkvrt.vertex );
1987 vertex->setFitQuality( wrkvrt.Chi2_core, wrkvrt.ndof_core() );
1990 std::vector<float> fCov(wrkvrt.vertexCov.cbegin(), wrkvrt.vertexCov.cend());
1991 vertex->setCovariance(fCov);
2012 vtx_pxAcc(*
vertex) = wrkvrt.vertexMom.Px();
2013 vtx_pyAcc(*
vertex) = wrkvrt.vertexMom.Py();
2014 vtx_pzAcc(*
vertex) = wrkvrt.vertexMom.Pz();
2016 vtx_massAcc(*
vertex) = wrkvrt.vertexMom.M();
2017 vtx_chargeAcc(*
vertex) = wrkvrt.Charge;
2019 chi2_coreAcc(*
vertex) = wrkvrt.Chi2_core;
2020 ndof_coreAcc(*
vertex) = wrkvrt.ndof_core();
2021 chi2_assocAcc(*
vertex) = wrkvrt.Chi2;
2022 ndof_assocAcc(*
vertex) = wrkvrt.ndof();
2024 massAcc(*
vertex) = sumP4_pion.M();
2025 mass_eAcc(*
vertex) = sumP4_electron.M();
2026 mass_selectedTracksAcc(*
vertex) = sumP4_selected.M();
2027 minOpAngAcc(*
vertex) = minOpAng;
2028 num_trksAcc(*
vertex) = wrkvrt.nTracksTotal();
2029 num_selectedTracksAcc(*
vertex) = wrkvrt.selectedTrackIndices.size();
2030 num_associatedTracksAcc(*
vertex) = wrkvrt.associatedTrackIndices.size();
2031 dCloseVrtAcc(*
vertex) = wrkvrt.closestWrkVrtValue;
2076 perigee_x_trk1Acc(*
vertex) = perigee_x_trk1;
2077 perigee_y_trk1Acc(*
vertex) = perigee_y_trk1;
2078 perigee_z_trk1Acc(*
vertex) = perigee_z_trk1;
2079 perigee_x_trk2Acc(*
vertex) = perigee_x_trk2;
2080 perigee_y_trk2Acc(*
vertex) = perigee_y_trk2;
2081 perigee_z_trk2Acc(*
vertex) = perigee_z_trk2;
2082 perigee_px_trk1Acc(*
vertex) = perigee_px_trk1;
2083 perigee_py_trk1Acc(*
vertex) = perigee_py_trk1;
2084 perigee_pz_trk1Acc(*
vertex) = perigee_pz_trk1;
2085 perigee_px_trk2Acc(*
vertex) = perigee_px_trk2;
2086 perigee_py_trk2Acc(*
vertex) = perigee_py_trk2;
2087 perigee_pz_trk2Acc(*
vertex) = perigee_pz_trk2;
2088 perigee_cov_xx_trk1Acc(*
vertex) = perigee_cov_xx_trk1;
2089 perigee_cov_xy_trk1Acc(*
vertex) = perigee_cov_xy_trk1;
2090 perigee_cov_xz_trk1Acc(*
vertex) = perigee_cov_xz_trk1;
2091 perigee_cov_yy_trk1Acc(*
vertex) = perigee_cov_yy_trk1;
2092 perigee_cov_yz_trk1Acc(*
vertex) = perigee_cov_yz_trk1;
2093 perigee_cov_zz_trk1Acc(*
vertex) = perigee_cov_zz_trk1;
2094 perigee_cov_xx_trk2Acc(*
vertex) = perigee_cov_xx_trk2;
2095 perigee_cov_xy_trk2Acc(*
vertex) = perigee_cov_xy_trk2;
2096 perigee_cov_xz_trk2Acc(*
vertex) = perigee_cov_xz_trk2;
2097 perigee_cov_yy_trk2Acc(*
vertex) = perigee_cov_yy_trk2;
2098 perigee_cov_yz_trk2Acc(*
vertex) = perigee_cov_yz_trk2;
2099 perigee_cov_zz_trk2Acc(*
vertex) = perigee_cov_zz_trk2;
2100 perigee_d0_trk1Acc(*
vertex) = perigee_d0_trk1;
2101 perigee_d0_trk2Acc(*
vertex) = perigee_d0_trk2;
2102 perigee_z0_trk1Acc(*
vertex) = perigee_z0_trk1;
2103 perigee_z0_trk2Acc(*
vertex) = perigee_z0_trk2;
2104 perigee_qOverP_trk1Acc(*
vertex) = perigee_qOverP_trk1;
2105 perigee_qOverP_trk2Acc(*
vertex) = perigee_qOverP_trk2;
2106 perigee_theta_trk1Acc(*
vertex) = perigee_theta_trk1;
2107 perigee_theta_trk2Acc(*
vertex) = perigee_theta_trk2;
2108 perigee_phi_trk1Acc(*
vertex) = perigee_phi_trk1;
2109 perigee_phi_trk2Acc(*
vertex) = perigee_phi_trk2;
2110 perigee_charge_trk1Acc(*
vertex) = perigee_charge_trk1;
2111 perigee_charge_trk2Acc(*
vertex) = perigee_charge_trk2;
2113 vPosMomAngTAcc(*
vertex) = vPosMomAngT;
2114 vPosMomAng3DAcc(*
vertex) = vPosMomAng3D;
2115 dphi_trk1Acc(*
vertex) = dphi_trk1;
2116 dphi_trk2Acc(*
vertex) = dphi_trk2;
2121 for(
auto trk_id : wrkvrt.selectedTrackIndices ) {
2129 vertex->addTrackAtVertex( link_trk, 1. );
2133 for(
auto trk_id : wrkvrt.associatedTrackIndices ) {
2141 vertex->addTrackAtVertex( link_trk, 1. );
2154 if( mappedVtx.
valid ) {
2177 wrkvrtLinkMap[&wrkvrt] =
vertex;
2191 }
catch (
const std::out_of_range&
e) {
2193 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": out of range error is detected: " <<
e.what() );
2195 return StatusCode::SUCCESS;
2199 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": some other error is detected." );
2201 return StatusCode::SUCCESS;
2205 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 2337 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
2340 const auto&
vertex = wrkvrt.vertex;
2342 std::map< std::deque<long int>*, std::vector<const xAOD::TrackParticle*>& > indexMap
2347 for(
auto& pair : indexMap ) {
2350 auto& tracks = pair.second;
2353 [&](
auto&
index ) {
2354 bool isConsistent = (this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( tracks.at(index), vertex );
2355 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;
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 914 of file Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx.
918 trackToVertexMap.clear();
920 for(
size_t iv = 0; iv<workVerticesContainer->size(); iv++ ) {
922 WrkVrt&
vertex = workVerticesContainer->at(iv);
924 auto& trackIndices =
vertex.selectedTrackIndices;
925 if( !
vertex.isGood )
continue;
926 if( trackIndices.size() < 2 )
continue;
928 for(
auto&
index : trackIndices ) {
929 trackToVertexMap[
index].emplace_back( iv );
933 for(
auto& pair: trackToVertexMap ) {
934 std::string
msg = Form(
"track index [%ld]: vertices = (", pair.first);
935 for(
auto&
v : pair.second ) {
936 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
uint64_t eventNumber() const
The current event's event number.
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
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 > *)
bool isValid() const
Test to see if the link can be dereferenced.
#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
const ID_type & dataID() const
Get the key that we reference, as a string.
float d0() const
Returns the parameter.
uint32_t runNumber() const
The current event's run number.
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
bool doDisappearingTrackVertexing
std::string ElectronLocation
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
@ pixelEndCap0
three pixel discs (on each side)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
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()
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.
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
uint32_t lumiBlock() const
The current event's luminosity block number.
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)
double twoTrVrtMaxPerigeeDist
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.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
@ 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
uint32_t bcid() const
The bunch crossing ID of the event.
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
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