diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/python/SUSY15TriggerList.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/python/SUSY15TriggerList.py index a30f743a0cd54e3a6afd392df6fdc084cf6ffdc4..47b927b28544bb6de01190060e31b1e8d63c7017 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/python/SUSY15TriggerList.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/python/SUSY15TriggerList.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from DerivationFrameworkSUSY.SUSYCommonTriggerList import MET_2018,MET_2017,MET_2016,MET_2015,JetTrigger_2016 @@ -62,12 +62,28 @@ triggers_jet = [ ] triggers_lep = [ + "HLT_mu20_iloose_L1MU15", + "HLT_mu24_iloose", + "HLT_mu24_ivarloose", + "HLT_mu24_imedium", + "HLT_mu24_ivarmedium", + "HLT_mu26_imedium", + "HLT_mu26_ivarmedium", + "HLT_mu40", + "HLT_mu50", "HLT_mu60_0eta105_msonly", "HLT_mu80_msonly_3layersEC", - "HLT_mu26_ivarmedium", + "HLT_e24_lhmedium_L1EM20VH", + "HLT_e24_lhtight_nod0_ivarloose", + "HLT_e26_lhtight_nod0", "HLT_e26_lhtight_nod0_ivarloose", "HLT_e60_lhmedium_nod0", - "HLT_e140_lhloose_nod0" + "HLT_e60_lhmedium", + "HLT_e60_medium", + "HLT_e120_lhloose", + "HLT_e140_lhloose_nod0", + "HLT_e300_etcut" + ] triggers_photon = [ diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/share/SUSY15.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/share/SUSY15.py index 4cc7e8b4658008f385530131ad8c0f8ebed7685a..766e315b11ed65c0a5a9a41c950681e029b1c1a8 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/share/SUSY15.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkSUSY/share/SUSY15.py @@ -61,6 +61,7 @@ RandomizingSigmas = [ 0.5, 1.0, 2.0, 3.0, 4.0 ] doDissolvedVertexing = False rerunVertexing = True newVertexContainerSuffix = "fixedExtrapolator" +LeptonsModSuffix = "LeptonsMod_LRTR3_1p0" keepOriginalVertexContainer = False #------------------------------------------------------------------------------ @@ -76,10 +77,26 @@ if rerunVertexing: SeqSUSY15 += vsi_2 + # setup addtional vertex container for displaced HNL analysis. + vsi_lepMod = setupVSI( LeptonsModSuffix ) # setup default vsi configuration + vsi_lepMod.twoTrkVtxFormingD0Cut = 1.0 # loosen d0 cut to 1 mm + vsi_lepMod.doSelectTracksWithLRTCuts = True # apply addtional track cuts inspired by LRT Run 3 optimizations + vsi_lepMod.doSelectTracksFromMuons = True # do leptons-only vertexing + vsi_lepMod.doRemoveCaloTaggedMuons = True # do remove calo-tagged muons from track selection + vsi_lepMod.doSelectTracksFromElectrons = True # do leptons-only vertexing + + + vsi_lepMod.VertexFitterTool = InclusiveVxFitterTool + vsi_lepMod.Extrapolator = ToolSvc.AtlasExtrapolator + + SeqSUSY15 += vsi_lepMod + MSMgr.GetStream("StreamDAOD_SUSY15").AddItem( [ 'xAOD::TrackParticleContainer#InDetTrackParticles*', 'xAOD::TrackParticleAuxContainer#InDetTrackParticles*', 'xAOD::VertexContainer#VrtSecInclusive*'+newVertexContainerSuffix+'*', - 'xAOD::VertexAuxContainer#VrtSecInclusive*'+newVertexContainerSuffix+'*'] ) + 'xAOD::VertexAuxContainer#VrtSecInclusive*'+newVertexContainerSuffix+'*', + 'xAOD::VertexContainer#VrtSecInclusive*'+LeptonsModSuffix+'*', + 'xAOD::VertexAuxContainer#VrtSecInclusive*'+LeptonsModSuffix+'*'] ) print "List of items for the DAOD_RPVLL output stream:" print MSMgr.GetStream("StreamDAOD_SUSY15").GetItems() @@ -418,28 +435,32 @@ SUSY15SlimmingHelper.AllVariables = [ SUSY15SlimmingHelper.ExtraVariables = [ "BTagging_AntiKt4EMTopo_201810.MV1_discriminant.MV1c_discriminant.BTagTrackToJetAssociator", "Muons.ptcone30.ptcone20.charge.quality.InnerDetectorPt.MuonSpectrometerPt.CaloLRLikelihood.CaloMuonIDTag.msInnerMatchChi2.msInnerMatchDOF.EnergyLossSigma.MeasEnergyLoss.MeasEnergyLossSigma.ParamEnergyLoss.ParamEnergyLossSigma.ParamEnergyLossSigmaMinus.ParamEnergyLossSigmaPlus", "AntiKt4EMTopoJets.NumTrkPt1000.TrackWidthPt1000.NumTrkPt500.Timing.DFCommonJets_jetClean_LooseBadLLP.DFCommonJets_jetClean_VeryLooseBadLLP.DFCommonJets_jetClean_SuperLooseBadLLP", - "GSFTrackParticles.chiSquared.hitPattern.patternRecoInfo.numberDoF.numberOfPixelHoles.numberOfPixelSharedHits.numberOfSCTSharedHits.vx.vy.vz.z0.d0.definingParametersCovMatrix.truthOrigin.truthType.beamlineTiltX.beamlineTiltY.radiusOfFirstHit.is_selected_Leptons.is_associated_Leptons.is_svtrk_final_Leptons.pt_wrtSV_Leptons.eta_wrtSV_Leptons.phi_wrtSV_Leptons.d0_wrtSV_Leptons.z0_wrtSV_Leptons.errP_wrtSV_Leptons.errd0_wrtSV_Leptons.errz0_wrtSV_Leptons.chi2_toSV_Leptons", - "InDetTrackParticles.truthOrigin.truthType.hitPattern.patternRecoInfo.vx.vy.vz.beamlineTiltX.beamlineTiltY.radiusOfFirstHit", - "CombinedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrix.truthOrigin.truthType", - "ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrix.truthOrigin.truthType", + "GSFTrackParticles.chiSquared.hitPattern.patternRecoInfo.numberDoF.numberOfPixelHoles.numberOfPixelSharedHits.numberOfSCTSharedHits.vx.vy.vz.z0.d0.definingParametersCovMatrix.truthOrigin.truthType.beamlineTiltX.beamlineTiltY.radiusOfFirstHit.truthMatchProbability", + "InDetTrackParticles.truthOrigin.truthType.chiSquared.hitPattern.patternRecoInfo.vx.vy.vz.beamlineTiltX.beamlineTiltY.radiusOfFirstHit.truthMatchProbability", + "CombinedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrix.truthOrigin.truthType.patternRecoInfo", + "ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrix.truthOrigin.truthType.patternRecoInfo", "TauJets.IsTruthMatched.truthOrigin.truthType.truthParticleLink.truthJetLink", "MuonTruthParticles.barcode.decayVtxLink.e.m.pdgId.prodVtxLink.decayVtxLink.px.py.pz.recoMuonLink.status.truthOrigin.truthType.charge", "AntiKt4TruthJets.eta.m.phi.pt.TruthLabelDeltaR_B.TruthLabelDeltaR_C.TruthLabelDeltaR_T.TruthLabelID.ConeTruthLabelID.PartonTruthLabelID", "TruthParticles.px.py.pz.m.e.status.pdgId.charge.barcode.prodVtxLink.decayVtxLink.truthOrigin.truthType", "Electrons.bkgMotherPdgId.bkgTruthOrigin", "InDetTrackParticles.is_selected_Leptons.is_associated_Leptons.is_svtrk_final_Leptons.pt_wrtSV_Leptons.eta_wrtSV_Leptons.phi_wrtSV_Leptons.d0_wrtSV_Leptons.z0_wrtSV_Leptons.errP_wrtSV_Leptons.errd0_wrtSV_Leptons.errz0_wrtSV_Leptons.chi2_toSV_Leptons", + "GSFTrackParticles.is_selected_Leptons.is_associated_Leptons.is_svtrk_final_Leptons.pt_wrtSV_Leptons.eta_wrtSV_Leptons.phi_wrtSV_Leptons.d0_wrtSV_Leptons.z0_wrtSV_Leptons.errP_wrtSV_Leptons.errd0_wrtSV_Leptons.errz0_wrtSV_Leptons.chi2_toSV_Leptons", "Electrons.svLinks.d0_wrtSVs.z0_wrtSVs.pt_wrtSVs.eta_wrtSVs.phi_wrtSVs.d0err_wrtSVs.z0err_wrtSVs", "Muons.svLinks.d0_wrtSVs.z0_wrtSVs.pt_wrtSVs.eta_wrtSVs.phi_wrtSVs.d0err_wrtSVs.z0err_wrtSVs", "MET_LocHadTopo.source.name.mpx.mpy.sumet", "MET_Track.source.name.mpx.mpy.sumet", "MuonSegments.x.y.z.chamberIndex.sector.etaIndex.nPhiLayers.nTrigEtaLayers.nPrecisionHits.t0.clusterTime", - "Electrons.Reta.Rphi.Rhad1.Rhad.weta2.Eratio.f3.deltaEta1.deltaPhiRescaled2.wtots1", + "Electrons.Reta.Rphi.Rhad1.Rhad.weta2.Eratio.f3.deltaEta1.deltaPhiRescaled2.wtots1.LHLoose.ptcone30.ptcone20", ] # Include dvtrack variables from re-running of VSI original_dvtrack_vars = "is_selected.is_associated.is_svtrk_final.pt_wrtSV.eta_wrtSV.phi_wrtSV.d0_wrtSV.z0_wrtSV.errP_wrtSV.errd0_wrtSV.errz0_wrtSV.chi2_toSV".split(".") new_dvtrack_vars = [v + "_" + newVertexContainerSuffix for v in original_dvtrack_vars] SUSY15SlimmingHelper.ExtraVariables += [ "InDetTrackParticles." + ".".join(new_dvtrack_vars) ] +LeptonsMod_dvtrack_vars = [v + "_" + LeptonsModSuffix for v in original_dvtrack_vars] +SUSY15SlimmingHelper.ExtraVariables += [ "InDetTrackParticles." + ".".join(LeptonsMod_dvtrack_vars) ] +SUSY15SlimmingHelper.ExtraVariables += [ "GSFTrackParticles." + ".".join(LeptonsMod_dvtrack_vars) ] SUSY15SlimmingHelper.ExtraVariables += GSFTracksCPDetailedContent diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/VrtSecInclusive.h b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/VrtSecInclusive.h index a9c628c54e82c55e25c34476d8f05f609c4a0504..e75befb54a4abcd3dff4f0f0110876b4ae4fdd59 100755 --- a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/VrtSecInclusive.h +++ b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/VrtSecInclusive.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // VKalVrt.h @@ -216,7 +216,14 @@ namespace VKalVrtAthena { // vertexing using muons (test implementation) bool doSelectTracksFromMuons; + bool doRemoveCaloTaggedMuons; bool doSelectTracksFromElectrons; + + // When doSelectTracksWithLRTCuts is set to true, the addtional track cuts + // be applied to the selected tracks to reduce the number of fake tracks in + // the selected track collected. These cuts are inspired by the improvments that + // were implmented for LRT Run 3. + bool doSelectTracksWithLRTCuts ; // Additional dressing option bool doAugmentDVimpactParametersToMuons; // potentially useful for DV + muon search @@ -386,6 +393,7 @@ namespace VKalVrtAthena { bool selectTrack_z0errCut ( const xAOD::TrackParticle* ) const; bool selectTrack_d0signifCut ( const xAOD::TrackParticle* ) const; bool selectTrack_z0signifCut ( const xAOD::TrackParticle* ) const; + bool selectTrack_LRTR3Cut ( const xAOD::TrackParticle* ) const; /** related to the graph method and verte finding */ StatusCode extractIncompatibleTrackPairs( std::vector<WrkVrt>* ); @@ -438,7 +446,7 @@ namespace VKalVrtAthena { void removeTrackFromVertex(std::vector<WrkVrt>*, std::vector< std::deque<long int> > *, - const long int & ,const long int & ); + const long int & ,const long int & ); StatusCode disassembleVertex(std::vector<WrkVrt> *, const unsigned& vertexIndex ); diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/TrackSelectionAlgs.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/TrackSelectionAlgs.cxx index 07c46164ffca9f09f153c2870546cb9e59489f1a..19360edaebc9d05f55e57d2239216bccd6177421 100644 --- a/Reconstruction/VKalVrt/VrtSecInclusive/src/TrackSelectionAlgs.cxx +++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/TrackSelectionAlgs.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Header include @@ -7,6 +7,8 @@ #include "VrtSecInclusive/NtupleVars.h" #include "VrtSecInclusive/Tools.h" +#include "xAODEgamma/ElectronxAODHelpers.h" + #include <iostream> #include "TH1D.h" @@ -52,11 +54,11 @@ namespace VKalVrtAthena { // do Pixel/SCT/SiHits only if we exclude StandAlone TRT hits if( !m_jp.SAloneTRT ) { - if(PixelHits < m_jp.CutPixelHits) return false; + if(PixelHits < m_jp.CutPixelHits) return false; if(SCTHits < m_jp.CutSctHits) return false; if((PixelHits+SCTHits) < m_jp.CutSiHits) return false; - if(BLayHits < m_jp.CutBLayHits) return false; - if(SharedHits > m_jp.CutSharedHits) return false; + if(BLayHits < m_jp.CutBLayHits) return false; + if(SharedHits > m_jp.CutSharedHits) return false; } // The folloing part reproduces the track selection in RPVDixpVrt @@ -94,7 +96,40 @@ namespace VKalVrtAthena { bool VrtSecInclusive::selectTrack_notPVassociated ( const xAOD::TrackParticle* trk ) const { return !( VKalVrtAthena::isAssociatedToVertices( trk, m_primaryVertices ) ); } - + + //____________________________________________________________________________________________________ + bool VrtSecInclusive::selectTrack_LRTR3Cut( const xAOD::TrackParticle* trk ) const { + uint8_t npix = 0; + trk->summaryValue(npix, xAOD::numberOfPixelHits); + uint8_t nsct = 0; + trk->summaryValue(nsct, xAOD::numberOfSCTHits); + uint8_t nSiHits = npix + nsct ; + uint8_t nSCTHoles=0; + trk->summaryValue(nSCTHoles, xAOD::numberOfSCTHoles); + + double dTheta = std::fabs(TMath::ATan2(std::fabs(trk->d0()),trk->z0())-2*std::atan(std::exp(-1*trk->eta()))); + bool geometric_cut = dTheta < 1. || std::fabs(trk->z0()) < 200. ; + + bool z0_cut = trk->z0() <= 500. ; + bool chi2_cut = (trk->chiSquared()/ (trk->numberDoF()+AlgConsts::infinitesimal)) <= 9. ; + bool NSiHits_cut = nSiHits >=8 ; + bool NSCTHits_cut = nsct >= 7 ; + bool NSCTHoles_cut = nSCTHoles <= 1; + + ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": z0_cut, chi2_cut, NSiHits_cut, NSCTHits_cut, NSCTHoles_cut = " <<z0_cut<<", "<<chi2_cut<<", "<<NSiHits_cut<<", "<<NSCTHits_cut<<", "<< NSCTHoles_cut ); + 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() ) ; + + const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco = trk->patternRecoInfo(); + bool isLRT = patternReco.test(49) ; + ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Track is LRT = " << isLRT ) ; + if (isLRT) { // apply all cuts to LRT tracks + return (z0_cut && chi2_cut && NSiHits_cut && NSCTHits_cut && NSCTHoles_cut && geometric_cut); + } + else{ // not LRT track; only apply SiHit cut + return NSiHits_cut ; + } + } + //____________________________________________________________________________________________________ void VrtSecInclusive::selectTrack( const xAOD::TrackParticle* trk ) { @@ -105,11 +140,12 @@ namespace VKalVrtAthena { if( 0 == m_trackSelectionFuncs.size() && !m_jp.passThroughTrackSelection ) { // These cuts are optional. Specified by JobProperty - if( m_jp.do_PVvetoCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_notPVassociated ); - if( m_jp.do_d0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0Cut ); - if( m_jp.do_z0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0Cut ); - if( m_jp.do_d0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0errCut ); - if( m_jp.do_z0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0errCut ); + if( m_jp.do_PVvetoCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_notPVassociated ); + if( m_jp.do_d0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0Cut ); + if( m_jp.do_z0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0Cut ); + if( m_jp.do_d0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0errCut ); + if( m_jp.do_z0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0errCut ); + if (m_jp.doSelectTracksWithLRTCuts) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_LRTR3Cut ); //if( m_jp.do_d0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0signifCut ); // not implemented yet //if( m_jp.do_z0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0signifCut ); // not implemented yet @@ -160,6 +196,12 @@ namespace VKalVrtAthena { } (*m_decor_isSelected)( *trk ) = true; + if (m_jp.doSelectTracksFromElectrons) { + const xAOD::TrackParticle *id_tr; + id_tr = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(trk); + if (id_tr != nullptr){ + (*m_decor_isSelected)( *id_tr ) = true; } + } m_selectedTracks->emplace_back( trk ); @@ -198,7 +240,6 @@ namespace VKalVrtAthena { // Loop over tracks for( auto *trk : *trackParticleContainer ) { selectTrack( trk ); } - ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total ID tracks = " << trackParticleContainer->size() ); ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() ); @@ -217,7 +258,10 @@ namespace VKalVrtAthena { const auto* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle ); if( !trk ) continue; - + // remove calo-tagged muons when selecting muons + if (m_jp.doRemoveCaloTaggedMuons) { + if (muon->muonType() == xAOD::Muon::CaloTagged) continue; + } selectTrack( trk ); } @@ -242,9 +286,7 @@ namespace VKalVrtAthena { const auto* trk = electron->trackParticle(0); if( !trk ) continue; - selectTrack( trk ); - } ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total electrons = " << electrons->size() ); diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx index 415a9a339cc906a374a6bad78f7c523d1fa2ea23..ab11487f2fb44d1213e9049e65532a6e81cfe847 100644 --- a/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx +++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx @@ -133,11 +133,11 @@ namespace VKalVrtAthena { const xAOD::TrackParticle* trk = m_selectedTracks->at( index ); ATH_MSG_VERBOSE(" >> disassembleVertex(): > track at vertex[" << iv << "]: " - << "index = " << trk->index() - << ", pT = " << trk->pt() - << ", phi = " << trk->phi() - << ", d0 = " << trk->d0() - << ", z0 = " << trk->z0()); + << "index = " << trk->index() + << ", pT = " << trk->pt() + << ", phi = " << trk->phi() + << ", d0 = " << trk->d0() + << ", z0 = " << trk->z0()); } // find the track with the maximum chi2 @@ -164,8 +164,8 @@ namespace VKalVrtAthena { // reject the selected track if( itrk == maxChi2TrackIndex ) { - ATH_MSG_VERBOSE(" >> disassembleVertex(): > skipped." ); - continue; + ATH_MSG_VERBOSE(" >> disassembleVertex(): > skipped." ); + continue; } const size_t this_trk_id = wrkvrt.selectedTrackIndices[itrk]; @@ -173,12 +173,12 @@ namespace VKalVrtAthena { ATH_MSG_VERBOSE(" >> disassembleVertex(): > this_trk_id = " << this_trk_id << ", selected_trk_id = " << selected_trk_id << ", alltrks_size = " << m_selectedTracks->size() ); if( this_trk_id >= m_selectedTracks->size() ) { - ATH_MSG_VERBOSE(" >> disassembleVertex(): > this_trk_id is invalid. continue!" ); - continue; + ATH_MSG_VERBOSE(" >> disassembleVertex(): > this_trk_id is invalid. continue!" ); + continue; } if( selected_trk_id >= m_selectedTracks->size() ) { - ATH_MSG_VERBOSE(" >> disassembleVertex(): > selected_trk_id is invalid. continue!" ); - continue; + ATH_MSG_VERBOSE(" >> disassembleVertex(): > selected_trk_id is invalid. continue!" ); + continue; } ATH_MSG_VERBOSE(" >> disassembleVertex(): > Storing tracks to ListBaseTracks" ); @@ -188,7 +188,7 @@ namespace VKalVrtAthena { vector<const xAOD::TrackParticle*> ListBaseTracks; ListBaseTracks.emplace_back( m_selectedTracks->at( this_trk_id ) ); ListBaseTracks.emplace_back( m_selectedTracks->at( selected_trk_id ) ); - + ATH_MSG_VERBOSE(" >> disassembleVertex(): > ListBaseTracks was stored." ); WrkVrt newvrt; @@ -333,9 +333,9 @@ namespace VKalVrtAthena { //____________________________________________________________________________________________________ void VrtSecInclusive::removeTrackFromVertex(std::vector<WrkVrt> *workVerticesContainer, - std::vector< std::deque<long int> > *TrkInVrt, - const long int & trackIndexToRemove, - const long int & SelectedVertex) + std::vector< std::deque<long int> > *TrkInVrt, + const long int & trackIndexToRemove, + const long int & SelectedVertex) { auto& wrkvrt = workVerticesContainer->at(SelectedVertex); @@ -551,13 +551,13 @@ namespace VKalVrtAthena { ATH_MSG_VERBOSE( " >>> refitVertex: approx vertex is set. Now going to perform fitting..." ); StatusCode SC=m_fitSvc->VKalVrtFit(ListBaseTracks,dummyNeutrals, - workVertex.vertex, - workVertex.vertexMom, - workVertex.Charge, - workVertex.vertexCov, - workVertex.Chi2PerTrk, - workVertex.TrkAtVrt, - workVertex.Chi2); + workVertex.vertex, + workVertex.vertexMom, + workVertex.Charge, + workVertex.vertexCov, + workVertex.Chi2PerTrk, + workVertex.TrkAtVrt, + workVertex.Chi2); auto& cov = workVertex.vertexCov; @@ -615,13 +615,13 @@ namespace VKalVrtAthena { ATH_MSG_VERBOSE( " >>> " << __FUNCTION__ << ": approx vertex is set. Now going to perform fitting..." ); StatusCode SC=m_fitSvc->VKalVrtFit(ListBaseTracks,dummyNeutrals, - workVertex.vertex, - workVertex.vertexMom, - workVertex.Charge, - workVertex.vertexCov, - workVertex.Chi2PerTrk, - workVertex.TrkAtVrt, - workVertex.Chi2); + workVertex.vertex, + workVertex.vertexMom, + workVertex.Charge, + workVertex.vertexCov, + workVertex.Chi2PerTrk, + workVertex.TrkAtVrt, + workVertex.Chi2); auto& cov = workVertex.vertexCov; @@ -653,7 +653,7 @@ namespace VKalVrtAthena { size_t nTrkCom = 0; for( auto& index : trackIndices1 ) { - if( std::find(trackIndices2.begin(),trackIndices2.end(), index) != trackIndices2.end()) nTrkCom++; + if( std::find(trackIndices2.begin(),trackIndices2.end(), index) != trackIndices2.end()) nTrkCom++; } return nTrkCom; @@ -764,7 +764,10 @@ namespace VKalVrtAthena { // A test implementation for muon vertices declareProperty("doSelectTracksFromMuons", m_jp.doSelectTracksFromMuons = false ); + declareProperty("doRemoveCaloTaggedMuons", m_jp.doRemoveCaloTaggedMuons = false ); declareProperty("doSelectTracksFromElectrons", m_jp.doSelectTracksFromElectrons = false ); + // Select tracks with additonal LRT Cuts (inspiried by Run 3 LRT optimization studies) + declareProperty("doSelectTracksWithLRTCuts", m_jp.doSelectTracksWithLRTCuts = false ); // Additional dressing option declareProperty("doAugmentDVimpactParametersToMuons", m_jp.doAugmentDVimpactParametersToMuons = false ); @@ -810,12 +813,12 @@ namespace VKalVrtAthena { if( m_jp.FillNtuple ) { if( 0 == m_ntupleVars->get<unsigned int>( "NumPV" ) ) { - + m_ntupleVars->get<double>( "PVX" ) = vertex->x(); m_ntupleVars->get<double>( "PVY" ) = vertex->y(); m_ntupleVars->get<double>( "PVZ" ) = vertex->z(); m_ntupleVars->get<unsigned int>( "PVType" ) = vertex->vertexType(); - + // number of tracks associated to the PV m_ntupleVars->get<unsigned int>( "NTrksPV" ) = vertex->nTrackParticles(); } @@ -827,10 +830,10 @@ namespace VKalVrtAthena { } ATH_MSG_DEBUG("PrimVertex x/y/z/nDOF " - << vertex->x() << "," - << vertex->y() << "," - << vertex->z() << "," - << vertex->numberDoF() ); + << vertex->x() << "," + << vertex->y() << "," + << vertex->z() << "," + << vertex->numberDoF() ); } @@ -838,18 +841,18 @@ namespace VKalVrtAthena { if( !m_thePV ) { ATH_MSG_DEBUG("No Reconstructed PV was found. Using the dummy PV instead."); for( auto *vertex : *m_primaryVertices ) { - if( xAOD::VxType::NoVtx != vertex->vertexType() ) continue; - + if( xAOD::VxType::NoVtx != vertex->vertexType() ) continue; + if( m_jp.FillNtuple ) { // Not considering pile-up; pick-up the first PV if( 0 == m_ntupleVars->get<unsigned int>( "NumPV" ) ) { m_thePV = vertex; - + m_ntupleVars->get<double>( "PVX" ) = vertex->x(); m_ntupleVars->get<double>( "PVY" ) = vertex->y(); m_ntupleVars->get<double>( "PVZ" ) = vertex->z(); m_ntupleVars->get<unsigned int>( "PVType" ) = vertex->vertexType(); - + // number of tracks associated to the PV m_ntupleVars->get<unsigned int>( "NTrksPV" ) = vertex->nTrackParticles(); } @@ -885,7 +888,7 @@ namespace VKalVrtAthena { if( trackIndices.size() < 2 ) continue; for( auto& index : trackIndices ) { - trackToVertexMap[index].emplace_back( iv ); + trackToVertexMap[index].emplace_back( iv ); } } @@ -903,9 +906,9 @@ namespace VKalVrtAthena { //____________________________________________________________________________________________________ double VrtSecInclusive::findWorstChi2ofMaximallySharedTrack(std::vector<WrkVrt> *workVerticesContainer, - std::map<long int, std::vector<long int> >& trackToVertexMap, - long int & maxSharedTrack, - long int & worstMatchingVertex) + std::map<long int, std::vector<long int> >& trackToVertexMap, + long int & maxSharedTrack, + long int & worstMatchingVertex) { double worstChi2 = AlgConsts::invalidFloat; @@ -1096,19 +1099,19 @@ namespace VKalVrtAthena { enum { Pixel = 1, SCT = 2 }; const auto& id = detElement->identify(); - Flag good = false; + Flag good = false; if( m_atlasId->is_pixel(id) ) { auto idHash = m_pixelId->wafer_hash( id ); - good = m_pixelCondSummarySvc->isGood( idHash ); + good = m_pixelCondSummarySvc->isGood( idHash ); pattern->emplace_back( std::make_tuple( position, Pixel, m_pixelId->barrel_ec(id), m_pixelId->layer_disk(id), good ) ); } else if( m_atlasId->is_sct(id) ) { auto idHash = m_sctId->wafer_hash( id ); - good = m_sctCondSummarySvc->isGood( idHash ); + good = m_sctCondSummarySvc->isGood( idHash ); pattern->emplace_back( std::make_tuple( position, SCT, m_sctId->barrel_ec(id), m_sctId->layer_disk(id), good ) ); @@ -1119,7 +1122,7 @@ namespace VKalVrtAthena { ATH_MSG_VERBOSE(" >> " << __FUNCTION__ << ", track " << trk << ": position = (" << position.Perp() << ", " << position.z() << ", " << position.Phi() << "), detElement ID = " << id << ", good = " << good << ": (det, bec, layer) = (" << std::get<1>( pattern->back() ) << ", " << std::get<2>( pattern->back() ) << ", " << std::get<3>( pattern->back() ) << ")" ); - if( !good ) nDisabled++; + if( !good ) nDisabled++; } } @@ -1418,22 +1421,22 @@ namespace VKalVrtAthena { // vertex area classification enum vertexArea { insideBeamPipe, - + insidePixelBarrel0, aroundPixelBarrel0, - + outsidePixelBarrel0_and_insidePixelBarrel1, aroundPixelBarrel1, - + outsidePixelBarrel1_and_insidePixelBarrel2, aroundPixelBarrel2, - + outsidePixelBarrel2_and_insidePixelBarrel3, aroundPixelBarrel3, - + outsidePixelBarrel3_and_insideSctBarrel0, aroundSctBarrel0, - + outsideSctBarrel0_and_insideSctBarrel1, aroundSctBarrel1, }; @@ -1442,43 +1445,43 @@ namespace VKalVrtAthena { int vertex_pattern = 0; if( rad < 23.50 ) { vertex_pattern = insideBeamPipe; - + } else if( rad < 31.0 && absz < 331.5 ) { vertex_pattern = insidePixelBarrel0; - + } else if( rad < 38.4 && absz < 331.5 ) { vertex_pattern = aroundPixelBarrel0; - + } else if( rad < 47.7 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1; - + } else if( rad < 54.4 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel1; - + } else if( rad < 85.5 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2; - + } else if( rad < 92.2 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel2; - + } else if( rad < 119.3 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3; - + } else if( rad < 126.1 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel3; - + } else if( rad < 290 && absz < 749.0 ) { vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0; - + } else if( rad < 315 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel0; - + } else if( rad < 360 && absz < 749.0 ) { vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1; - + } else if( rad < 390 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel1; - + } else { } @@ -1495,20 +1498,20 @@ namespace VKalVrtAthena { ////////////////////////////////////////////////////////////////////////////////// if( vertex_pattern == insideBeamPipe ) { - + if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( nPixelLayers < 3 ) return false; - - + + } else if( vertex_pattern == insidePixelBarrel0 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( nPixelLayers < 3 ) return false; } else if( vertex_pattern == aroundPixelBarrel0 ) { - + // require nothing for PixelBarrel0 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( nPixelLayers < 2 ) return false; @@ -1516,7 +1519,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( nPixelLayers < 2 ) return false; @@ -1524,7 +1527,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundPixelBarrel1 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; // require nothing for PixelBarrel if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1533,7 +1536,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1542,7 +1545,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundPixelBarrel2 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; // require nothing for PixelBarrel2 @@ -1551,15 +1554,15 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; } - + else if( vertex_pattern == aroundPixelBarrel3 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1569,7 +1572,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1579,7 +1582,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundSctBarrel0 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1590,7 +1593,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) { - + if( (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1632,22 +1635,22 @@ namespace VKalVrtAthena { // vertex area classification enum vertexArea { insideBeamPipe, - + insidePixelBarrel0, aroundPixelBarrel0, - + outsidePixelBarrel0_and_insidePixelBarrel1, aroundPixelBarrel1, - + outsidePixelBarrel1_and_insidePixelBarrel2, aroundPixelBarrel2, - + outsidePixelBarrel2_and_insidePixelBarrel3, aroundPixelBarrel3, - + outsidePixelBarrel3_and_insideSctBarrel0, aroundSctBarrel0, - + outsideSctBarrel0_and_insideSctBarrel1, aroundSctBarrel1, }; @@ -1656,43 +1659,43 @@ namespace VKalVrtAthena { int vertex_pattern = 0; if( rad < 23.50 ) { vertex_pattern = insideBeamPipe; - + } else if( rad < 31.0 && absz < 331.5 ) { vertex_pattern = insidePixelBarrel0; - + } else if( rad < 38.4 && absz < 331.5 ) { vertex_pattern = aroundPixelBarrel0; - + } else if( rad < 47.7 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel0_and_insidePixelBarrel1; - + } else if( rad < 54.4 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel1; - + } else if( rad < 85.5 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2; - + } else if( rad < 92.2 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel2; - + } else if( rad < 119.3 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3; - + } else if( rad < 126.1 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel3; - + } else if( rad < 290 && absz < 749.0 ) { vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0; - + } else if( rad < 315 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel0; - + } else if( rad < 360 && absz < 749.0 ) { vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1; - + } else if( rad < 390 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel1; - + } else { } @@ -1710,13 +1713,13 @@ namespace VKalVrtAthena { ////////////////////////////////////////////////////////////////////////////////// if( vertex_pattern == insideBeamPipe ) { - + if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( nPixelLayers < 3 ) return false; } else if( vertex_pattern == insidePixelBarrel0 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel0)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( nPixelLayers < 3 ) return false; @@ -1725,7 +1728,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundPixelBarrel0 ) { - + // require nothing for PixelBarrel0 if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; @@ -1734,7 +1737,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel0_and_insidePixelBarrel1 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( nPixelLayers < 3 ) return false; @@ -1742,7 +1745,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundPixelBarrel1 ) { - + // require nothing for PixelBarrel1 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; @@ -1751,7 +1754,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; if( nPixelLayers < 2 ) return false; @@ -1759,19 +1762,19 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundPixelBarrel2 ) { - + // require nothing for PixelBarrel2 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; } else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; } - + else if( vertex_pattern == aroundPixelBarrel3 ) { - + // require nothing for PixelBarrel3 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false; if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false; @@ -1779,14 +1782,14 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) { - + if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false; if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false; } else if( vertex_pattern == aroundSctBarrel0 ) { - + // require nothing for SctBarrel0 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false; if( ! (pattern & (1<<Trk::sctBarrel2)) ) return false; @@ -1826,19 +1829,19 @@ namespace VKalVrtAthena { // vertex area classification enum vertexArea { insideBeamPipe, - + insidePixelBarrel1, aroundPixelBarrel1, - + outsidePixelBarrel1_and_insidePixelBarrel2, aroundPixelBarrel2, - + outsidePixelBarrel2_and_insidePixelBarrel3, aroundPixelBarrel3, - + outsidePixelBarrel3_and_insideSctBarrel0, aroundSctBarrel0, - + outsideSctBarrel0_and_insideSctBarrel1, aroundSctBarrel1, }; @@ -1847,71 +1850,71 @@ namespace VKalVrtAthena { Int_t vertex_pattern = 0; if( rad < 25.00 ) { vertex_pattern = insideBeamPipe; - + } else if( rad < 47.7 && absz < 400.5 ) { vertex_pattern = insidePixelBarrel1; - + } else if( rad < 54.4 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel1; - + } else if( rad < 85.5 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2; - + } else if( rad < 92.2 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel2; - + } else if( rad < 119.3 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3; - + } else if( rad < 126.1 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel3; - + } else if( rad < 290 && absz < 749.0 ) { vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0; - + } else if( rad < 315 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel0; - + } else if( rad < 360 && absz < 749.0 ) { vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1; - + } else if( rad < 390 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel1; - + } else { } ////////////////////////////////////////////////////////////////////////////////// if( vertex_pattern == insideBeamPipe ) { - + if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; - + } else if( vertex_pattern == insidePixelBarrel1 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; } else if( vertex_pattern == aroundPixelBarrel1 ) { - + // require nothing for PixelBarrel1 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; } else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; } else if( vertex_pattern == aroundPixelBarrel2 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; // require nothing for PixelBarrel2 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; @@ -1919,14 +1922,14 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; } - + else if( vertex_pattern == aroundPixelBarrel3 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; // require nothing for PixelBarrel3 @@ -1935,7 +1938,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( (pattern & (1<<Trk::pixelBarrel3)) ) return false; @@ -1944,7 +1947,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == aroundSctBarrel0 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( (pattern & (1<<Trk::pixelBarrel3)) ) return false; @@ -1954,7 +1957,7 @@ namespace VKalVrtAthena { else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) { - + if( (pattern & (1<<Trk::pixelBarrel1)) ) return false; if( (pattern & (1<<Trk::pixelBarrel2)) ) return false; if( (pattern & (1<<Trk::pixelBarrel3)) ) return false; @@ -1991,19 +1994,19 @@ namespace VKalVrtAthena { // vertex area classification enum vertexArea { insideBeamPipe, - + insidePixelBarrel1, aroundPixelBarrel1, - + outsidePixelBarrel1_and_insidePixelBarrel2, aroundPixelBarrel2, - + outsidePixelBarrel2_and_insidePixelBarrel3, aroundPixelBarrel3, - + outsidePixelBarrel3_and_insideSctBarrel0, aroundSctBarrel0, - + outsideSctBarrel0_and_insideSctBarrel1, aroundSctBarrel1, }; @@ -2012,102 +2015,102 @@ namespace VKalVrtAthena { Int_t vertex_pattern = 0; if( rad < 25.00 ) { vertex_pattern = insideBeamPipe; - + } else if( rad < 47.7 && absz < 400.5 ) { vertex_pattern = insidePixelBarrel1; - + } else if( rad < 54.4 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel1; - + } else if( rad < 85.5 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel1_and_insidePixelBarrel2; - + } else if( rad < 92.2 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel2; - + } else if( rad < 119.3 && absz < 400.5 ) { vertex_pattern = outsidePixelBarrel2_and_insidePixelBarrel3; - + } else if( rad < 126.1 && absz < 400.5 ) { vertex_pattern = aroundPixelBarrel3; - + } else if( rad < 290 && absz < 749.0 ) { vertex_pattern = outsidePixelBarrel3_and_insideSctBarrel0; - + } else if( rad < 315 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel0; - + } else if( rad < 360 && absz < 749.0 ) { vertex_pattern = outsideSctBarrel0_and_insideSctBarrel1; - + } else if( rad < 390 && absz < 749.0 ) { vertex_pattern = aroundSctBarrel1; - + } else { } ////////////////////////////////////////////////////////////////////////////////// if( vertex_pattern == insideBeamPipe ) { - + if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; - + } else if( vertex_pattern == insidePixelBarrel1 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel1)) ) return false; } else if( vertex_pattern == aroundPixelBarrel1 ) { - + // require nothing for PixelBarrel1 if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; } else if( vertex_pattern == outsidePixelBarrel1_and_insidePixelBarrel2 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel2)) ) return false; } else if( vertex_pattern == aroundPixelBarrel2 ) { - + // require nothing for PixelBarrel2 if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; } else if( vertex_pattern == outsidePixelBarrel2_and_insidePixelBarrel3 ) { - + if( ! (pattern & (1<<Trk::pixelBarrel3)) ) return false; } - + else if( vertex_pattern == aroundPixelBarrel3 ) { - + // require nothing for PixelBarrel3 if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false; } else if( vertex_pattern == outsidePixelBarrel3_and_insideSctBarrel0 ) { - + if( ! (pattern & (1<<Trk::sctBarrel0)) ) return false; } else if( vertex_pattern == aroundSctBarrel0 ) { - + // require nothing for SctBarrel0 if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false; } else if( vertex_pattern == outsideSctBarrel0_and_insideSctBarrel1 ) { - + if( ! (pattern & (1<<Trk::sctBarrel1)) ) return false; } @@ -2154,7 +2157,7 @@ namespace VKalVrtAthena { const uint32_t pattern = trk->hitPattern(); return patternCheck( pattern, vertex ); - + } @@ -2165,7 +2168,7 @@ namespace VKalVrtAthena { const uint32_t pattern = trk->hitPattern(); return patternCheckOuterOnly( pattern, vertex ); - + } @@ -2287,8 +2290,8 @@ namespace VKalVrtAthena { //____________________________________________________________________________________________________ bool VrtSecInclusive::passedFakeReject( const Amg::Vector3D& FitVertex, - const xAOD::TrackParticle *itrk, - const xAOD::TrackParticle *jtrk ) + const xAOD::TrackParticle *itrk, + const xAOD::TrackParticle *jtrk ) { const bool& check_itrk = ( this->*m_patternStrategyFuncs[m_checkPatternStrategy] )( itrk, FitVertex ); diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx index 45cfb684f9ede405c84eed1fe1bf9f1d28638e69..0d7eb3a87a13f5d7c259e1ae1226fcfedc8c3922 100644 --- a/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx +++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Header include @@ -11,6 +11,7 @@ #include "EventPrimitives/EventPrimitivesHelpers.h" +#include "xAODEgamma/ElectronxAODHelpers.h" #include "TH1F.h" #include "TH2F.h" @@ -151,7 +152,7 @@ namespace VKalVrtAthena { double dphi1 = vDist.phi() - (*itrk)->phi(); while( dphi1 > TMath::Pi() ) { dphi1 -= TMath::TwoPi(); } while( dphi1 < -TMath::Pi() ) { dphi1 += TMath::TwoPi(); } double dphi2 = vDist.phi() - (*itrk)->phi(); while( dphi2 > TMath::Pi() ) { dphi2 -= TMath::TwoPi(); } while( dphi2 < -TMath::Pi() ) { dphi2 += TMath::TwoPi(); } - const double dist_fromPV = vDist.norm(); + const double dist_fromPV = vDist.norm(); if( m_jp.FillHist ) m_hists["2trkVtxDistFromPV"]->Fill( dist_fromPV ); if( m_jp.FillNtuple ) { @@ -244,26 +245,26 @@ namespace VKalVrtAthena { matchMap.emplace( truthVertex, true ); } } - + if( m_jp.FillHist ) { dynamic_cast<TH2F*>( m_hists["vPosDist"] )->Fill( wrkvrt.vertex.perp(), vPos ); dynamic_cast<TH2F*>( m_hists["vPosMomAngTDist"] )->Fill( wrkvrt.vertex.perp(), vPosMomAngT ); - m_hists["vPosMomAngT"] ->Fill( vPosMomAngT ); - m_hists["vPosMomAng3D"] ->Fill( vPosMomAng3D ); + m_hists["vPosMomAngT"] ->Fill( vPosMomAngT ); + m_hists["vPosMomAng3D"] ->Fill( vPosMomAng3D ); + } + + if( m_jp.doTwoTrSoftBtag ){ + if(dist_fromPV < m_jp.twoTrVrtMinDistFromPV ){ + ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the 2tr vertex min distance from PV cut." ); + continue; + } + + if( vPosMomAng3D < m_jp.twoTrVrtAngleCut ){ + ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vertex angle cut." ); + continue; + } } - if( m_jp.doTwoTrSoftBtag ){ - if(dist_fromPV < m_jp.twoTrVrtMinDistFromPV ){ - ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the 2tr vertex min distance from PV cut." ); - continue; - } - - if( vPosMomAng3D < m_jp.twoTrVrtAngleCut ){ - ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vertex angle cut." ); - continue; - } - } - if( m_jp.doPVcompatibilityCut ) { if( cos( dphi1 ) < -0.8 && cos( dphi2 ) < -0.8 ) { ATH_MSG_DEBUG(" > " << __FUNCTION__ << ": failed to pass the vPos cut. (both tracks are opposite against the vertex pos)" ); @@ -1092,7 +1093,15 @@ namespace VKalVrtAthena { [&] ( WrkVrt& wrkvrt ) { auto found = std::find_if( wrkvrt.selectedTrackIndices.begin(), wrkvrt.selectedTrackIndices.end(), [&]( long int index ) { - return trk == m_selectedTracks->at(index); + // when using selected tracks from electrons, also check the orginal track particle from GSF to see if InDetTrackParticle (trk) is an electron that is already in the vertex + if (m_jp.doSelectTracksFromElectrons) { + const xAOD::TrackParticle *id_tr; + id_tr = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(m_selectedTracks->at(index)); + return trk == m_selectedTracks->at(index) or trk == id_tr; + } + else{ + return trk == m_selectedTracks->at(index); + } } ); return found != wrkvrt.selectedTrackIndices.end(); } );