ATLAS Offline Software
Loading...
Searching...
No Matches
Prompt::NonPromptLeptonVertexingAlg Class Reference

#include <NonPromptLeptonVertexingAlg.h>

Inheritance diagram for Prompt::NonPromptLeptonVertexingAlg:
Collaboration diagram for Prompt::NonPromptLeptonVertexingAlg:

Public Member Functions

 NonPromptLeptonVertexingAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method with EventContext.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual StatusCode execute ()
 Execute method without EventContext (deprecated).
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
const EventContext & getContext () const
 Deprecated methods (use the ones with EventContext).
bool filterPassed () const
void setFilterPassed (bool state) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef SG::AuxElement::Decorator< std::vector< int > > decoratorVecInt_t
typedef SG::AuxElement::Decorator< std::vector< ElementLink< xAOD::VertexContainer > > > decoratorVecElemVtx_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::vector< const xAOD::TrackParticle * > findNearbyTracks (const xAOD::TrackParticle &tracklep, const xAOD::TrackParticleContainer &inDetTracks, const xAOD::Vertex &priVtx) const
bool passElecCand (const xAOD::Electron &elec) const
bool passMuonCand (const xAOD::Muon &muon) const
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec (const EventContext &ctx, const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
void makeVertexCluster (std::vector< std::unique_ptr< xAOD::Vertex > > &clusterVtxs, std::vector< std::unique_ptr< xAOD::Vertex > > &inputVtxs)
void saveSecondaryVertices (std::vector< std::unique_ptr< xAOD::Vertex > > &vtxs, std::vector< int > &indexVector, std::vector< ElementLink< xAOD::VertexContainer > > &svLinks, xAOD::VertexContainer &SVContainer, std::set< xAOD::Vertex * > &svSet)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Prompt::IVertexMergingToolm_vertexMerger
ToolHandle< Prompt::VertexFittingToolm_vertexFitterTool
Gaudi::Property< bool > m_printTime {this, "PrintTime", false}
Gaudi::Property< bool > m_selectTracks {this, "SelectTracks", true}
Gaudi::Property< double > m_mergeMinVtxDist {this, "MergeMinVtxDist", 1.0}
Gaudi::Property< double > m_mergeChi2OverDoF {this, "MergeChi2OverDoF", 5.0}
Gaudi::Property< std::string > m_linkNameRefittedPriVtxWithoutLepton {this, "NoLeptonPriVtxLinkName"}
Gaudi::Property< std::string > m_refittedVertexTypeName
Gaudi::Property< float > m_minTrackpT {this, "minTrackpT", 500.0}
Gaudi::Property< float > m_maxTrackEta {this, "maxTrackEta", 2.5}
Gaudi::Property< float > m_maxTrackZ0Sin {this, "maxTrackZ0Sin", 1.0}
Gaudi::Property< float > m_minTrackLeptonDR {this, "minTrackLeptonDR", 1.0e-6}
Gaudi::Property< float > m_maxTrackLeptonDR {this, "maxTrackLeptonDR", 0.4}
Gaudi::Property< unsigned > m_minTrackSiHits {this, "minTrackSiHits", 7}
Gaudi::Property< float > m_maxTrackSharedSiHits {this, "maxTrackSharedSiHits", 1.0}
Gaudi::Property< unsigned > m_maxTrackSiHoles {this, "maxTrackSiHoles", 2}
Gaudi::Property< unsigned > m_maxTrackPixHoles {this, "maxTrackPixHoles", 1}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_inDetTracksKey
SG::ReadHandleKey< xAOD::IParticleContainerm_leptonContainerKey
SG::ReadHandleKey< xAOD::VertexContainerm_primaryVertexContainerName
SG::ReadHandleKey< xAOD::VertexContainerm_refittedPriVtxContainerName
SG::WriteHandleKey< xAOD::VertexContainerm_svContainerName
TStopwatch m_timerAll
TStopwatch m_timerExec
unsigned m_countEvents
SG::WriteDecorHandleKey< xAOD::IParticleContainerm_decoratorNameSecVtxLinks { this, "SecVtxLinksName", m_leptonContainerKey, "default", }
SG::WriteDecorHandleKey< xAOD::IParticleContainerm_decoratorNameDeepMergedSecVtxLinks { this, "DeepMergedSecVtxLinksName", m_leptonContainerKey, "default", }
SG::WriteDecorHandleKey< xAOD::IParticleContainerm_decoratorNameIndexVector { this, "IndexVectorName", m_leptonContainerKey, "", }
SG::WriteDecorHandleKey< xAOD::IParticleContainerm_decoratorNameIndexVectorDeepMerge { this, "IndexVectorNameDeepMerge", m_leptonContainerKey, "", }
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 45 of file NonPromptLeptonVertexingAlg.h.

Member Typedef Documentation

◆ decoratorVecElemVtx_t

typedef SG::AuxElement::Decorator<std::vector<ElementLink<xAOD::VertexContainer> > > Prompt::NonPromptLeptonVertexingAlg::decoratorVecElemVtx_t
private

Definition at line 90 of file NonPromptLeptonVertexingAlg.h.

◆ decoratorVecInt_t

typedef SG::AuxElement::Decorator<std::vector<int> > Prompt::NonPromptLeptonVertexingAlg::decoratorVecInt_t
private

Definition at line 89 of file NonPromptLeptonVertexingAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ NonPromptLeptonVertexingAlg()

Prompt::NonPromptLeptonVertexingAlg::NonPromptLeptonVertexingAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 23 of file NonPromptLeptonVertexingAlg.cxx.

23 :
24 AthAlgorithm (name, pSvcLocator),
26{}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute() [1/2]

virtual StatusCode AthAlgorithm::execute ( )
inlinevirtualinherited

Execute method without EventContext (deprecated).

Override this method if the EventContext is not needed.

Reimplemented in AthenaMonManager, AthPrescaler, BuildVertexPointingAlg, CP::AsgClassificationDecorationAlg, CP::AsgEnergyDecoratorAlg, CP::AsgEventScaleFactorAlg, CP::AsgLeptonTrackDecorationAlg, CP::AsgObjectScaleFactorAlg, CP::AsgPriorityDecorationAlg, CP::AsgSelectionAlg, CP::AsgShallowCopyAlg, CP::AsgUnionPreselectionAlg, CP::AsgUnionSelectionAlg, CP::AsgViewFromSelectionAlg, CP::AsgxAODNTupleMakerAlg, CP::BJetCalibrationAlg, CP::BootstrapGeneratorAlg, CP::BTaggingEfficiencyAlg, CP::BTaggingInformationDecoratorAlg, CP::BTaggingTriggerEfficiencyAlg, CP::BTaggingTriggerMatchingAlg, CP::ChargeSelectorAlg, CP::CopyNominalSelectionAlg, CP::DileptonInvariantMassSelectorAlg, CP::DileptonInvariantMassWindowSelectorAlg, CP::DileptonOSSFInvariantMassWindowSelectorAlg, CP::DiTauEfficiencyCorrectionsAlg, CP::DiTauMassCalculatorAlg, CP::DiTauSmearingAlg, CP::DiTauTruthMatchingAlg, CP::EgammaCalibrationAndSmearingAlg, CP::EgammaFSRForMuonsCollectorAlg, CP::EgammaIsolationCorrectionAlg, CP::EgammaIsolationSelectionAlg, CP::ElectronEfficiencyCorrectionAlg, CP::ElectronSiHitDecAlg, CP::EventCutFlowHistAlg, CP::EventFlagSelectionAlg, CP::EventSelectionByObjectFlagAlg, CP::EventStatusSelectionAlg, CP::FakeBkgCalculatorAlg, CP::InDetTrackBiasingAlg, CP::InDetTrackExtraVarDecoratorAlg, CP::InDetTrackSelectionAlg, CP::InDetTrackSmearingAlg, CP::JetCalibAlg, CP::JetCalibrationAlg, CP::JetDecoratorAlg, CP::JetFFSmearingAlg, CP::JetGhostMuonAssociationAlg, CP::JetModifierAlg, CP::JetNGhostSelectorAlg, CP::JetReclusteringAlg, CP::JetSelectionAlg, CP::JetTriggerDecoratorAlg, CP::JetUncertaintiesAlg, CP::JvtEfficiencyAlg, CP::JvtUpdateAlg, CP::KinematicHistAlg, CP::LeptonSFCalculatorAlg, CP::MCTCDecorationAlg, CP::MetadataHistAlg, CP::MetBuilderAlg, CP::MetMakerAlg, CP::MetSignificanceAlg, CP::MissingETPlusTransverseMassSelectorAlg, CP::MissingETSelectorAlg, CP::MuonCalibrationAndSmearingAlg, CP::MuonEfficiencyScaleFactorAlg, CP::MuonIsolationAlg, CP::MuonSelectionAlgV2, CP::MuonTriggerEfficiencyScaleFactorAlg, CP::NJetDecoratorAlg, CP::NLargeRJetMassWindowSelectorAlg, CP::NObjectMassSelectorAlg, CP::NObjectPtSelectorAlg, CP::ObjectCutFlowHistAlg, CP::OverlapRemovalAlg, CP::PhotonEfficiencyCorrectionAlg, CP::PhotonExtraVariablesAlg, CP::PhotonShowerShapeFudgeAlg, CP::PileupReweightingAlg, CP::PileupReweightingProvider, CP::PMGTruthWeightAlg, CP::RNtupleTreeMakerAlg, CP::RunNumberSelectorAlg, CP::RunPartonHistoryAlg, CP::SaveFilterAlg, CP::SecVertexTruthMatchAlg, CP::SSVWeightsAlg, CP::SumNLeptonPtSelectorAlg, CP::SysListDumperAlg, CP::SysTruthWeightAlg, CP::TauCombineMuonRMTausAlg, CP::TauEfficiencyCorrectionsAlg, CP::TauSmearingAlg, CP::TauTruthMatchingAlg, CP::TransverseMassSelectorAlg, CP::TreeFillerAlg, CP::TreeMakerAlg, CP::TrigEventSelectionAlg, CP::TrigGlobalEfficiencyAlg, CP::TrigMatchingAlg, CP::TrigPrescalesAlg, CP::VGammaORAlg, CP::xAODWriterAlg, CP::XbbEfficiencyAlg, CP::XbbInformationDecoratorAlg, DecoratePhotonPointingAlg, DecorateVertexScoreAlg, DumpGeo, EL::AnaAlgorithm, EL::UnitTestAlg2, EL::UnitTestAlg3, EL::UnitTestAlg4, EL::UnitTestAlg5, EL::UnitTestAlg7, EventReco::KLFitterFinalizeOutputAlg, EventReco::RunKLFitterAlg, GRLSelectorAlg, IdDictCnvTest, InDetUpdateCaches, JetGlobalEventSetup, LArAutoCorrAlgToDB, LArAutoCorrFromStdNtuple, LArBadChannelHunter, LArBlockCorrections, LArCalibCopyAlg< CONDITIONSCONTAINER >, LArCalibCopyAlg< LArDAC2uAMC >, LArCalibCopyAlg< LArPhysWaveContainer >, LArCalibCopyAlg< LArTdriftComplete >, LArCalibPatchingAlg< CONDITIONSCONTAINER >, LArCalibPatchingAlg< LArAutoCorrComplete >, LArCalibPatchingAlg< LArCaliWaveContainer >, LArCalibPatchingAlg< LArMphysOverMcalComplete >, LArCalibPatchingAlg< LArRampComplete >, LArCalibValidationAlg< CONDITIONSCONTAINER, REFCONTAINER >, LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >, LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >, LArCalibValidationAlg< LArPedestalComplete, ILArPedestal >, LArCalibValidationAlg< LArRampComplete, ILArRamp >, LArCaliWaveSelector, LArCompleteToFlat, LArDeltaRespPredictor, LArDSPThresholdFillInline, LArDuplicateConstants, LArFillDSPConfig, LArFlatFromFile, LArGeoWeightsFill, LArMasterWaveBuilder, LArMphysOverMcalFromTuple, LArOFCAlg, LArOFCBin_PhysCaliTdiffFromStdNtuple, LArOFCtoOFC, LArOFPhaseFill, LArParamsFromStdNtuple, LArPhysWaveFromAscii, LArPhysWaveFromStdNtuple, LArPhysWaveFromTuple, LArPhysWavePredictor, LArPhysWaveShifter, LArRampAdHocPatchingAlg, LArReadParamsFromFile< DATA >, LArReadParamsFromFile< LArCableAttenuationComplete >, LArReadParamsFromFile< LArCableLengthComplete >, LArReadParamsFromFile< LArCaliPulseParamsComplete >, LArReadParamsFromFile< LArDetCellParamsComplete >, LArReadParamsFromFile< LArEMEC_CphiComplete >, LArReadParamsFromFile< LArEMEC_HValphaComplete >, LArReadParamsFromFile< LArEMEC_HVbetaComplete >, LArReadParamsFromFile< LArMphysOverMcalComplete >, LArReadParamsFromFile< LArPhysCaliTdiffComplete >, LArReadParamsFromFile< LArRinjComplete >, LArReadParamsFromFile< LArTdriftComplete >, LArReadParamsFromFile< LArTshaperComplete >, LArRTMParamExtractor, LArShapeFromStdNtuple, LArTimePhysPrediction, LisNtuple, LVL1::eFEXDriver, LVL1::L1CaloTriggerTowerDecoratorAlg, LVL1::L1TopoSimulation, LVL1::TrigT1MBTS, OverlapRemovalGenUseAlg, PyAthena::Alg, SGInputLoader, SUSYToolsAlg, TBBPCRec, TBMWPCRec, TBScintillatorRec, TBTailCatcherRec, TBTrackInfoFromTag, Trig::TrigMatchTestAlg, TrkEDMTestAlg, ZdcLEDNtuple, and ZdcNtuple.

Definition at line 76 of file AthAlgorithm.h.

76 {
77 throw GaudiException( "execute() or execute(const EventContext&) needs to be implemented", name(),
78 StatusCode::FAILURE );
79 }

◆ execute() [2/2]

StatusCode Prompt::NonPromptLeptonVertexingAlg::execute ( const EventContext & )
overridevirtual

Execute method with EventContext.

Override this method if acccess to the EventContext is needed.

Reimplemented from AthAlgorithm.

Definition at line 106 of file NonPromptLeptonVertexingAlg.cxx.

107{
108 //
109 // Start execute timer for new event
110 //
111 TimerScopeHelper timer(m_timerExec);
112
113
115
116 //
117 // Find Inner Detector tracks save them class member variable for convenience.
118 //
119 SG::ReadHandle<xAOD::TrackParticleContainer> h_inDetTracks(m_inDetTracksKey, ctx);
120 if (!h_inDetTracks.isValid()){
121 ATH_MSG_FATAL("execute - failed to find the InDetTrackParticles");
122 return StatusCode::FAILURE;
123 }
124
125 const xAOD::TrackParticleContainer inDetTracks = *h_inDetTracks;
126
127 //
128 // Create vertex containers and record them in StoreGate
129 //
130 std::set< xAOD::Vertex* > svSet;
131
132 SG::WriteHandle<xAOD::VertexContainer> h_SVContainer (m_svContainerName, ctx);
133 ATH_CHECK(h_SVContainer.record(
134 std::make_unique< xAOD::VertexContainer>(), std::make_unique< xAOD::VertexAuxContainer>()
135 ));
136 xAOD::VertexContainer &SVContainerRef = *(h_SVContainer.ptr());
137
138 //
139 // Retrieve containers from evtStore
140 //
141 SG::ReadHandle<xAOD::IParticleContainer> leptonContainer (m_leptonContainerKey, ctx);
142 SG::ReadHandle<xAOD::VertexContainer> vertices (m_primaryVertexContainerName, ctx);
143 SG::ReadHandle<xAOD::VertexContainer> refittedVertices(m_refittedPriVtxContainerName, ctx);
144
145 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute - Read " << vertices->size() << " primary vertices");
146 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute - Read " << refittedVertices->size() << " refitted primary vertices");
147
148 //
149 // Find default Primary Vertex
150 //
151 Prompt::FittingInput fittingInput(&inDetTracks, 0, 0);
152
153 for(const xAOD::Vertex *vertex: *vertices) {
154 if(vertex->vertexType() == xAOD::VxType::PriVtx) {
155 fittingInput.priVtx = vertex;
156 break;
157 }
158 }
159
160 if(!fittingInput.priVtx) {
161 ATH_MSG_INFO("Failed to find primary vertex - skip this event");
162
163 return StatusCode::SUCCESS;
164 }
165
166 //
167 // Find the refitted Primary Vertex
168 //
169 for(const xAOD::Vertex *vertex: *refittedVertices) {
170 short refittedVertexType = 0;
171
172 if(getVar(vertex, refittedVertexType, m_refittedVertexTypeName) && refittedVertexType == xAOD::VxType::PriVtx) {
173 fittingInput.refittedPriVtx = vertex;
174 }
175
176 if(fittingInput.refittedPriVtx) {
177 break;
178 }
179 }
180
181 //
182 // Dynamic cast IParticle container to electron or muon container
183 //
184 ATH_MSG_DEBUG("\n\t\t\t Size of lepton container: " << leptonContainer ->size());
185
186 SG::AuxElement::ConstAccessor<ElementLink<xAOD::VertexContainer> > priVtxWithoutLepAcc(m_linkNameRefittedPriVtxWithoutLepton);
187
188 using VecElemVtx_t = std::vector<ElementLink<xAOD::VertexContainer> >;
189 SG::WriteDecorHandle<xAOD::IParticleContainer, std::vector<int> >
190 indexVectorDec (m_decoratorNameIndexVector, ctx);
191 SG::WriteDecorHandle<xAOD::IParticleContainer, std::vector<int> >
192 indexVectorDecDeepMerge (m_decoratorNameIndexVectorDeepMerge, ctx);
193 SG::WriteDecorHandle<xAOD::IParticleContainer, VecElemVtx_t>
194 lepSVElementLinksDec (m_decoratorNameSecVtxLinks, ctx);
195 SG::WriteDecorHandle<xAOD::IParticleContainer, VecElemVtx_t>
196 lepDeepMergedSVElementLinksDec (m_decoratorNameDeepMergedSecVtxLinks, ctx);
197
198 for(const xAOD::IParticle *lepton: *leptonContainer) {
199 const xAOD::TrackParticle *tracklep = 0;
200 const xAOD::Electron *elec = dynamic_cast<const xAOD::Electron*>(lepton);
201 const xAOD::Muon *muon = dynamic_cast<const xAOD::Muon *>(lepton);
202
203 if(elec) {
204 //
205 // Get GSF track
206 //
207 const xAOD::TrackParticle *bestmatchedGSFElTrack = elec->trackParticle(0);
208
209 //
210 // Get original ID track for vertex fitting
211 //
212 if(passElecCand(*elec) && bestmatchedGSFElTrack) {
213 tracklep = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(bestmatchedGSFElTrack);
214 }
215 }
216 else if(muon) {
217 if(passMuonCand(*muon)) {
218 tracklep = muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
219 }
220 }
221 else {
222 ATH_MSG_WARNING("NonPromptLeptonVertexingAlg::execute - failed to find electron or muon: should never happen!");
223 }
224
225 if(!tracklep) {
226 lepSVElementLinksDec (*lepton).clear();
227 lepDeepMergedSVElementLinksDec(*lepton).clear();
228 indexVectorDec (*lepton).clear();
229 indexVectorDecDeepMerge (*lepton).clear();
230
231 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute - cannot find muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle) nor electron->trackParticle()");
232 continue;
233 }
234
235 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute - process new lepton track " << tracklep);
236
237 //
238 // Find refitted primary vertex with lepton track excluded
239 //
240 fittingInput.refittedPriVtxWithoutLep = 0;
241
242 if(priVtxWithoutLepAcc.isAvailable(*lepton)) {
243 ElementLink<xAOD::VertexContainer> vtxLink = priVtxWithoutLepAcc(*lepton);
244
245 if(vtxLink.isValid()) {
246 fittingInput.refittedPriVtxWithoutLep = *vtxLink;
247
248 ATH_MSG_DEBUG("DecorateSecondaryVertex - found refitted primary vertex without lepton: "
249 << m_linkNameRefittedPriVtxWithoutLepton << " with Ntrack =" << fittingInput.refittedPriVtxWithoutLep->nTrackParticles());
250 }
251 }
252
253 //
254 // Collect tracks around the lepton track
255 //
256 std::vector<const xAOD::TrackParticle* > ifitTracks = findNearbyTracks(*tracklep, inDetTracks, *fittingInput.priVtx);
257
258 //
259 // Fit 2-track vertices
260 //
261 std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVertices = prepLepWithTwoTrkSVVec(
262 ctx, fittingInput, tracklep, ifitTracks
263 );
264
265 // We make a copy so we can store the list of original
266 // two-track vertices
267 std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVerticesCopy;
268 for (std::unique_ptr<xAOD::Vertex> &vtx : twoTrkVertices) {
269 std::unique_ptr<xAOD::Vertex> newVtx = std::make_unique<xAOD::Vertex>(*vtx);
270 twoTrkVerticesCopy.push_back(std::move(newVtx));
271 }
272
273 // Deep merge 2-track vertices.
274 ATH_MSG_DEBUG("Getting deep merged vertices");
275 ATH_MSG_DEBUG("Starting with " << twoTrkVertices.size() << " 2-track vertices");
276 Prompt::MergeResultNotOwner deep_merged_result = m_vertexMerger->mergeInitVertices(
277 ctx, fittingInput, tracklep, twoTrkVertices, ifitTracks);
278
279 //
280 // Save secondary vertices
281 //
282 std::vector<ElementLink<xAOD::VertexContainer> > svLinks;
283 std::vector<ElementLink<xAOD::VertexContainer> > deepmergeSVLinks;
284
285 std::vector<int> indexVectorTwoTrk;
286 std::vector<int> indexVectorDeepMerged;
287
288 //
289 // Record 2-track vertexes and simple merged vertexes
290 //
291 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute --- recording " << twoTrkVerticesCopy.size() << " 2-track and simple merged vertices");
292 saveSecondaryVertices(twoTrkVerticesCopy, indexVectorTwoTrk, svLinks, SVContainerRef, svSet);
293
294 //
295 // Record both merged multi-track vertices and also unmerged 2-track vertices
296 //
297 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute --- recording " << deep_merged_result.vtxsNewMerged.size() << " merged multi-track vertices");
298 saveSecondaryVertices(deep_merged_result.vtxsNewMerged, indexVectorDeepMerged, deepmergeSVLinks, SVContainerRef, svSet);
299
300 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute --- recording " << deep_merged_result.vtxsInitPassedNotMerged.size() << " unmerged 2-track vertices");
301 saveSecondaryVertices(deep_merged_result.vtxsInitPassedNotMerged, indexVectorDeepMerged, deepmergeSVLinks, SVContainerRef, svSet);
302
303 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute -- number of two-track SV = " << twoTrkVertices.size());
304 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute -- number of deep merged SV = " << deep_merged_result.vtxsNewMerged.size());
305
306 lepSVElementLinksDec (*lepton) = std::move(svLinks);
307 lepDeepMergedSVElementLinksDec(*lepton) = std::move(deepmergeSVLinks);
308 indexVectorDec (*lepton) = std::move(indexVectorTwoTrk);
309 indexVectorDecDeepMerge (*lepton) = std::move(indexVectorDeepMerged);
310
311 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg - done with lepton pT=" << tracklep->pt() << ", " << truthAsStr(*lepton) << endl
312 << "___________________________________________________________________________");
313 }
314
315 ATH_MSG_DEBUG("SV Vertex container " << m_svContainerName << " recorded in store");
316
317 ATH_MSG_DEBUG(" NonPromptLeptonVertexingAlg::execute - done with this event" << endl
318 << "___________________________________________________________________________");
319
320 return StatusCode::SUCCESS;
321}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
size_t size() const
Number of registered mappings.
Gaudi::Property< std::string > m_linkNameRefittedPriVtxWithoutLepton
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameIndexVector
SG::WriteHandleKey< xAOD::VertexContainer > m_svContainerName
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameIndexVectorDeepMerge
void saveSecondaryVertices(std::vector< std::unique_ptr< xAOD::Vertex > > &vtxs, std::vector< int > &indexVector, std::vector< ElementLink< xAOD::VertexContainer > > &svLinks, xAOD::VertexContainer &SVContainer, std::set< xAOD::Vertex * > &svSet)
ToolHandle< Prompt::IVertexMergingTool > m_vertexMerger
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameSecVtxLinks
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainerName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inDetTracksKey
bool passMuonCand(const xAOD::Muon &muon) const
SG::ReadHandleKey< xAOD::IParticleContainer > m_leptonContainerKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameDeepMergedSecVtxLinks
bool passElecCand(const xAOD::Electron &elec) const
std::vector< const xAOD::TrackParticle * > findNearbyTracks(const xAOD::TrackParticle &tracklep, const xAOD::TrackParticleContainer &inDetTracks, const xAOD::Vertex &priVtx) const
Gaudi::Property< std::string > m_refittedVertexTypeName
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec(const EventContext &ctx, const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
SG::ReadHandleKey< xAOD::VertexContainer > m_refittedPriVtxContainerName
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
std::string truthAsStr(const xAOD::IParticle &particle)
bool getVar(T1 &obj, T2 &value, const std::string &var_name)
Definition PromptUtils.h:62
timer(name, disabled=False)
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...
@ PriVtx
Primary vertex.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version:
Electron_v1 Electron
Definition of the current "egamma version".

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

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

◆ filterPassed()

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return execState( Gaudi::Hive::currentContext() ).filterPassed();
96}

◆ finalize()

StatusCode Prompt::NonPromptLeptonVertexingAlg::finalize ( )
overridevirtual

Definition at line 90 of file NonPromptLeptonVertexingAlg.cxx.

91{
92 if(m_printTime) {
93 //
94 // Print full time stopwatch
95 //
96 m_timerAll.Stop();
97
98 ATH_MSG_INFO("NonPromptLeptonVertexingAlg - total time: " << PrintResetStopWatch(m_timerAll));
99 ATH_MSG_INFO("NonPromptLeptonVertexingAlg - execute time: " << PrintResetStopWatch(m_timerExec));
100 }
101
102 return StatusCode::SUCCESS;
103}
std::string PrintResetStopWatch(TStopwatch &watch)

◆ findNearbyTracks()

std::vector< const xAOD::TrackParticle * > Prompt::NonPromptLeptonVertexingAlg::findNearbyTracks ( const xAOD::TrackParticle & tracklep,
const xAOD::TrackParticleContainer & inDetTracks,
const xAOD::Vertex & priVtx ) const
private

Definition at line 360 of file NonPromptLeptonVertexingAlg.cxx.

364 {
365 //
366 // Select tracks -- avoid using track selection tool since z0 definition is different
367 //
368 std::vector<const xAOD::TrackParticle *> mytracks;
369
370 for(const xAOD::TrackParticle *track: inDetTracks) {
371 if(!track) {
372 ATH_MSG_WARNING("skip null track pointer - should never happen");
373 continue;
374 }
375
376 //
377 // Check minimum track and lepton DR: skip the track that is probably the lepton track
378 //
379 if(tracklep.p4().DeltaR(track->p4()) < m_minTrackLeptonDR) {
380 ATH_MSG_DEBUG("skip the track very close to the lepton ");
381 continue;
382 }
383
384 //
385 // Check track and lepton maximum DR
386 //
387 if(tracklep.p4().DeltaR(track->p4()) > m_maxTrackLeptonDR) {
388 continue;
389 }
390
391 const double delta_z0 = track->z0() + track->vz() - priVtx.z();
392 const double Z0Sin = std::abs(delta_z0*std::sin(track->theta()));
393 const double abs_eta = std::abs(track->eta());
394
401
402 if(!(track->summaryValue(numberOfPixelHits, xAOD::numberOfPixelHits))) continue;
403 if(!(track->summaryValue(numberOfSCTHits, xAOD::numberOfSCTHits))) continue;
404 if(!(track->summaryValue(numberOfPixelHoles, xAOD::numberOfPixelHoles))) continue;
405 if(!(track->summaryValue(numberOfSCTHoles, xAOD::numberOfSCTHoles))) continue;
406 if(!(track->summaryValue(numberOfPixelSharedHits, xAOD::numberOfPixelSharedHits))) continue;
407 if(!(track->summaryValue(numberOfSCTSharedHits, xAOD::numberOfSCTSharedHits))) continue;
408
409 const uint8_t NSiHits = numberOfPixelHits + numberOfSCTHits;
411 const float NSiShHits = float(numberOfPixelSharedHits) + float(numberOfSCTSharedHits)/2.0;
412
413 if(m_selectTracks) {
414 //
415 // Kinematic track selection
416 //
417 if(track->pt() < m_minTrackpT) continue;
418 if(abs_eta > m_maxTrackEta) continue;
419 if(Z0Sin > m_maxTrackZ0Sin) continue;
420
421 //
422 // Hit quality track selection
423 //
424 if(NSiHits < m_minTrackSiHits) continue;
425 if(NSiShHits > m_maxTrackSharedSiHits) continue;
426 if(NSiHoles > m_maxTrackSiHoles ) continue;
427 if(numberOfPixelHoles > m_maxTrackPixHoles ) continue;
428 }
429
430 mytracks.push_back(track);
431 }
432
433 return mytracks;
434}
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
float z() const
Returns the z position.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

◆ initialize()

StatusCode Prompt::NonPromptLeptonVertexingAlg::initialize ( )
overridevirtual

Definition at line 29 of file NonPromptLeptonVertexingAlg.cxx.

30{
31 if(m_printTime) {
32 //
33 // Reset timers
34 //
35 m_timerAll .Reset();
36 m_timerExec.Reset();
37
38 //
39 // Start full timer
40 //
41 m_timerAll.Start();
42 }
43
44 if(m_svContainerName.empty()) {
45 ATH_MSG_ERROR("NonPromptLeptonVertexingAlg::initialize - empty SV container name: \"" << m_svContainerName << "\"");
46 return StatusCode::FAILURE;
47 }
48
49 ATH_CHECK(m_vertexMerger.retrieve());
50 ATH_CHECK(m_vertexFitterTool.retrieve());
51
52 ATH_CHECK(m_inDetTracksKey.initialize());
53 ATH_CHECK(m_leptonContainerKey.initialize());
56
57 ATH_CHECK(m_svContainerName.initialize());
58
64
65 ATH_MSG_DEBUG("LeptonContainerName = " << m_leptonContainerKey);
66 ATH_MSG_DEBUG("ReFitPriVtxContainerName = " << m_refittedPriVtxContainerName);
67 ATH_MSG_DEBUG("SVContainerName = " << m_svContainerName);
68 ATH_MSG_DEBUG("IndexVectorName = " << m_decoratorNameIndexVector.key());
69
70 ATH_MSG_DEBUG("mergeMinVtxDist = " << m_mergeMinVtxDist);
71 ATH_MSG_DEBUG("mergeChi2OverDoF = " << m_mergeChi2OverDoF);
72
73 ATH_MSG_DEBUG("minTrackLeptonDR = " << m_minTrackLeptonDR);
74 ATH_MSG_DEBUG("maxTrackLeptonDR = " << m_maxTrackLeptonDR);
75
76 ATH_MSG_DEBUG("selectTracks = " << m_selectTracks);
77 ATH_MSG_DEBUG("minTrackpT = " << m_minTrackpT);
78 ATH_MSG_DEBUG("maxTrackEta = " << m_maxTrackEta);
79 ATH_MSG_DEBUG("maxTrackZ0Sin = " << m_maxTrackZ0Sin);
80
81 ATH_MSG_DEBUG("minTrackSiHits = " << m_minTrackSiHits);
82 ATH_MSG_DEBUG("maxTrackSharedSiHits = " << m_maxTrackSharedSiHits);
83 ATH_MSG_DEBUG("maxTrackSiHoles = " << m_maxTrackSiHoles);
84 ATH_MSG_DEBUG("maxTrackPixHoles = " << m_maxTrackPixHoles);
85
86 return StatusCode::SUCCESS;
87}
#define ATH_MSG_ERROR(x)
ToolHandle< Prompt::VertexFittingTool > m_vertexFitterTool
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 118 of file AthAlgorithm.h.

118{ return false; }

◆ makeVertexCluster()

void Prompt::NonPromptLeptonVertexingAlg::makeVertexCluster ( std::vector< std::unique_ptr< xAOD::Vertex > > & clusterVtxs,
std::vector< std::unique_ptr< xAOD::Vertex > > & inputVtxs )
private

Definition at line 477 of file NonPromptLeptonVertexingAlg.cxx.

481{
482 ATH_MSG_DEBUG("makeVertexCluster - before: clusterVtxs.size()=" << clusterVtxs.size() << ", inputVtxs.size()=" << inputVtxs.size());
483
484 std::vector<std::unique_ptr<xAOD::Vertex>>::iterator vit = inputVtxs.begin();
485
486 while(vit != inputVtxs.end()) {
487 bool pass = false;
488
489 for(std::vector<std::unique_ptr<xAOD::Vertex>>::const_iterator cit = clusterVtxs.begin(); cit != clusterVtxs.end(); ++cit) {
490 if(vit->get() == cit->get()) {
491 ATH_MSG_DEBUG("makeVertexCluster - logic error - found the same vertex twice: " << ((*vit).get()));
492 continue;
493 }
494
495 const double vdist = getDistance((*vit)->position(), (*cit)->position());
496
497 ATH_MSG_DEBUG("makeVertexCluster - vdist=" << vdist );
498
499 if(vdist < m_mergeMinVtxDist) {
500 pass = true;
501 break;
502 }
503 }
504
505 if(pass) {
506 clusterVtxs.push_back(std::move(*vit));
507 inputVtxs.erase(vit);
508
509 vit = inputVtxs.begin();
510 }
511 else {
512 ++vit;
513 }
514 }
515
516 ATH_MSG_DEBUG("makeVertexCluster - after: clusterVtxs.size()=" << clusterVtxs.size() << ", inputVtxs.size()=" << inputVtxs.size());
517}
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ passElecCand()

bool Prompt::NonPromptLeptonVertexingAlg::passElecCand ( const xAOD::Electron & elec) const
private

Definition at line 324 of file NonPromptLeptonVertexingAlg.cxx.

325{
326 //
327 // Check whether electron candidate passes loose selection
328 //
329 char lh_loose = -1;
330
331 Prompt::GetAuxVar(elec, lh_loose, "DFCommonElectronsLHLoose");
332
333 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::passElecCand - "
334 << "pT=" << elec.pt() << ", eta=" << elec.eta() << ", phi=" << elec.phi() << std::endl
335 << " DFCommonElectronsLHLoose = " << int(lh_loose) << std::endl
336 << " " << truthAsStr(elec));
337
338 if(!lh_loose) {
339 return false;
340 }
341
342 return true;
343}
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition Egamma_v1.cxx:66
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition Egamma_v1.cxx:71
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition Egamma_v1.cxx:76
bool GetAuxVar(const T1 &obj, T2 &value, const std::string &var_name)
Definition PromptUtils.h:83

◆ passMuonCand()

bool Prompt::NonPromptLeptonVertexingAlg::passMuonCand ( const xAOD::Muon & muon) const
private

Definition at line 346 of file NonPromptLeptonVertexingAlg.cxx.

347{
348 //
349 // Check whether muon candidate is a combined muon
350 //
351 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::passMuonCand - "
352 << "pT=" << muon.pt() << ", eta=" << muon.eta() << ", phi=" << muon.phi() << std::endl
353 << " Type = " << muon.muonType() << std::endl
354 << " " << truthAsStr(muon));
355
356 return muon.muonType() == xAOD::Muon::MuonType::Combined;
357}

◆ prepLepWithTwoTrkSVVec()

std::vector< std::unique_ptr< xAOD::Vertex > > Prompt::NonPromptLeptonVertexingAlg::prepLepWithTwoTrkSVVec ( const EventContext & ctx,
const FittingInput & input,
const xAOD::TrackParticle * tracklep,
const std::vector< const xAOD::TrackParticle * > & tracks )
private

Definition at line 437 of file NonPromptLeptonVertexingAlg.cxx.

443{
444 //
445 // Decorate lepton with vector of two-track vertices.
446 // Return vector of finding vertices
447 //
448 std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVertices;
449 std::vector<const xAOD::TrackParticle*> tracksForFit;
450
451 if(!input.priVtx) {
452 ATH_MSG_WARNING("prepLepWithTwoTrkSVVec -- invalid primary vertex: nothing to do");
453 return twoTrkVertices;
454 }
455
456 for(const xAOD::TrackParticle *selectedtrack: tracks) {
457 tracksForFit.clear();
458 tracksForFit.push_back(tracklep);
459 tracksForFit.push_back(selectedtrack);
460
461 std::unique_ptr<xAOD::Vertex> newSecondaryVertex = m_vertexFitterTool->fitVertexWithPrimarySeed(
462 ctx, input, tracksForFit, kTwoTrackVtx
463 );
464
465 if(!newSecondaryVertex) {
466 ATH_MSG_DEBUG("prepLepWithTwoTrkSVVec -- failed to fit 2-track vertex");
467 continue;
468 }
469
470 twoTrkVertices.push_back(std::move(newSecondaryVertex));
471 }
472
473 return twoTrkVertices;
474}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ saveSecondaryVertices()

void Prompt::NonPromptLeptonVertexingAlg::saveSecondaryVertices ( std::vector< std::unique_ptr< xAOD::Vertex > > & vtxs,
std::vector< int > & indexVector,
std::vector< ElementLink< xAOD::VertexContainer > > & svLinks,
xAOD::VertexContainer & SVContainer,
std::set< xAOD::Vertex * > & svSet )
private

Definition at line 520 of file NonPromptLeptonVertexingAlg.cxx.

527{
528 //
529 // Record created xAOD::Vertex in output vertex container
530 //
531 ATH_MSG_DEBUG("saveSecondaryVertices - will save " << vtxs.size() << " vertexes");
532
533 for(std::unique_ptr<xAOD::Vertex> &vtx: vtxs) {
534 int index = -99;
535 if(getVar(vtx, index, "SecondaryVertexIndex")) {
536 indexVector.push_back(index);
537 }
538 else {
539 ATH_MSG_WARNING("saveSecondaryVertices - missing \"SecondaryVertexIndex\" variable");
540 }
541
542 if(svSet.insert(vtx.get()).second) {
543 //
544 // First time seeing this this vertex - record it in output container
545 //
546 SVContainer.push_back(std::move(vtx));
547 ElementLink<xAOD::VertexContainer> svLink(SVContainer,SVContainer.size()-1);
548 svLinks.push_back(svLink);
549 } else {
550 ATH_MSG_ERROR("saveSecondaryVertices --- the same vertex has been encountered more than once! Is this a logic error?");
551 }
552 }
553
554 ATH_MSG_DEBUG("saveSecondaryVertices - all done");
555}
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
str index
Definition DeMoScan.py:362

◆ setFilterPassed()

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 execState( Gaudi::Hive::currentContext() ).setFilterPassed(state);
100}

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc.

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

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

Definition at line 66 of file AthAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_countEvents

unsigned Prompt::NonPromptLeptonVertexingAlg::m_countEvents
private

Definition at line 156 of file NonPromptLeptonVertexingAlg.h.

◆ m_decoratorNameDeepMergedSecVtxLinks

SG::WriteDecorHandleKey<xAOD::IParticleContainer> Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameDeepMergedSecVtxLinks { this, "DeepMergedSecVtxLinksName", m_leptonContainerKey, "default", }
private

Definition at line 164 of file NonPromptLeptonVertexingAlg.h.

165{ this, "DeepMergedSecVtxLinksName", m_leptonContainerKey, "default", };

◆ m_decoratorNameIndexVector

SG::WriteDecorHandleKey<xAOD::IParticleContainer> Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameIndexVector { this, "IndexVectorName", m_leptonContainerKey, "", }
private

Definition at line 166 of file NonPromptLeptonVertexingAlg.h.

167{ this, "IndexVectorName", m_leptonContainerKey, "", };

◆ m_decoratorNameIndexVectorDeepMerge

SG::WriteDecorHandleKey<xAOD::IParticleContainer> Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameIndexVectorDeepMerge { this, "IndexVectorNameDeepMerge", m_leptonContainerKey, "", }
private

Definition at line 168 of file NonPromptLeptonVertexingAlg.h.

169{ this, "IndexVectorNameDeepMerge", m_leptonContainerKey, "", };

◆ m_decoratorNameSecVtxLinks

SG::WriteDecorHandleKey<xAOD::IParticleContainer> Prompt::NonPromptLeptonVertexingAlg::m_decoratorNameSecVtxLinks { this, "SecVtxLinksName", m_leptonContainerKey, "default", }
private

Definition at line 162 of file NonPromptLeptonVertexingAlg.h.

163{ this, "SecVtxLinksName", m_leptonContainerKey, "default", };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 121 of file AthAlgorithm.h.

◆ m_inDetTracksKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> Prompt::NonPromptLeptonVertexingAlg::m_inDetTracksKey
private
Initial value:
{
this, "InDetTrackParticlesKey", "InDetTrackParticles"
}

Definition at line 133 of file NonPromptLeptonVertexingAlg.h.

133 {
134 this, "InDetTrackParticlesKey", "InDetTrackParticles"
135 };

◆ m_leptonContainerKey

SG::ReadHandleKey<xAOD::IParticleContainer> Prompt::NonPromptLeptonVertexingAlg::m_leptonContainerKey
private
Initial value:
{
this, "LeptonContainerName", "default"
}

Definition at line 136 of file NonPromptLeptonVertexingAlg.h.

136 {
137 this, "LeptonContainerName", "default"
138 };

◆ m_linkNameRefittedPriVtxWithoutLepton

Gaudi::Property<std::string> Prompt::NonPromptLeptonVertexingAlg::m_linkNameRefittedPriVtxWithoutLepton {this, "NoLeptonPriVtxLinkName"}
private

Definition at line 114 of file NonPromptLeptonVertexingAlg.h.

114{this, "NoLeptonPriVtxLinkName"};

◆ m_maxTrackEta

Gaudi::Property<float> Prompt::NonPromptLeptonVertexingAlg::m_maxTrackEta {this, "maxTrackEta", 2.5}
private

Definition at line 121 of file NonPromptLeptonVertexingAlg.h.

121{this, "maxTrackEta", 2.5};

◆ m_maxTrackLeptonDR

Gaudi::Property<float> Prompt::NonPromptLeptonVertexingAlg::m_maxTrackLeptonDR {this, "maxTrackLeptonDR", 0.4}
private

Definition at line 125 of file NonPromptLeptonVertexingAlg.h.

125{this, "maxTrackLeptonDR", 0.4};

◆ m_maxTrackPixHoles

Gaudi::Property<unsigned> Prompt::NonPromptLeptonVertexingAlg::m_maxTrackPixHoles {this, "maxTrackPixHoles", 1}
private

Definition at line 130 of file NonPromptLeptonVertexingAlg.h.

130{this, "maxTrackPixHoles", 1};

◆ m_maxTrackSharedSiHits

Gaudi::Property<float> Prompt::NonPromptLeptonVertexingAlg::m_maxTrackSharedSiHits {this, "maxTrackSharedSiHits", 1.0}
private

Definition at line 128 of file NonPromptLeptonVertexingAlg.h.

128{this, "maxTrackSharedSiHits", 1.0};

◆ m_maxTrackSiHoles

Gaudi::Property<unsigned> Prompt::NonPromptLeptonVertexingAlg::m_maxTrackSiHoles {this, "maxTrackSiHoles", 2}
private

Definition at line 129 of file NonPromptLeptonVertexingAlg.h.

129{this, "maxTrackSiHoles", 2};

◆ m_maxTrackZ0Sin

Gaudi::Property<float> Prompt::NonPromptLeptonVertexingAlg::m_maxTrackZ0Sin {this, "maxTrackZ0Sin", 1.0}
private

Definition at line 122 of file NonPromptLeptonVertexingAlg.h.

122{this, "maxTrackZ0Sin", 1.0};

◆ m_mergeChi2OverDoF

Gaudi::Property<double> Prompt::NonPromptLeptonVertexingAlg::m_mergeChi2OverDoF {this, "MergeChi2OverDoF", 5.0}
private

Definition at line 112 of file NonPromptLeptonVertexingAlg.h.

112{this, "MergeChi2OverDoF", 5.0};

◆ m_mergeMinVtxDist

Gaudi::Property<double> Prompt::NonPromptLeptonVertexingAlg::m_mergeMinVtxDist {this, "MergeMinVtxDist", 1.0}
private

Definition at line 111 of file NonPromptLeptonVertexingAlg.h.

111{this, "MergeMinVtxDist", 1.0};

◆ m_minTrackLeptonDR

Gaudi::Property<float> Prompt::NonPromptLeptonVertexingAlg::m_minTrackLeptonDR {this, "minTrackLeptonDR", 1.0e-6}
private

Definition at line 124 of file NonPromptLeptonVertexingAlg.h.

124{this, "minTrackLeptonDR", 1.0e-6};

◆ m_minTrackpT

Gaudi::Property<float> Prompt::NonPromptLeptonVertexingAlg::m_minTrackpT {this, "minTrackpT", 500.0}
private

Definition at line 120 of file NonPromptLeptonVertexingAlg.h.

120{this, "minTrackpT", 500.0};

◆ m_minTrackSiHits

Gaudi::Property<unsigned> Prompt::NonPromptLeptonVertexingAlg::m_minTrackSiHits {this, "minTrackSiHits", 7}
private

Definition at line 127 of file NonPromptLeptonVertexingAlg.h.

127{this, "minTrackSiHits", 7};

◆ m_primaryVertexContainerName

SG::ReadHandleKey<xAOD::VertexContainer> Prompt::NonPromptLeptonVertexingAlg::m_primaryVertexContainerName
private
Initial value:
{
this, "PriVertexContainerName", "PrimaryVertices"
}

Definition at line 139 of file NonPromptLeptonVertexingAlg.h.

139 {
140 this, "PriVertexContainerName", "PrimaryVertices"
141 };

◆ m_printTime

Gaudi::Property<bool> Prompt::NonPromptLeptonVertexingAlg::m_printTime {this, "PrintTime", false}
private

Definition at line 108 of file NonPromptLeptonVertexingAlg.h.

108{this, "PrintTime", false};

◆ m_refittedPriVtxContainerName

SG::ReadHandleKey<xAOD::VertexContainer> Prompt::NonPromptLeptonVertexingAlg::m_refittedPriVtxContainerName
private
Initial value:
{
this, "ReFitPriVtxContainerName", "default"
}

Definition at line 142 of file NonPromptLeptonVertexingAlg.h.

142 {
143 this, "ReFitPriVtxContainerName", "default"
144 };

◆ m_refittedVertexTypeName

Gaudi::Property<std::string> Prompt::NonPromptLeptonVertexingAlg::m_refittedVertexTypeName
private
Initial value:
{
this, "ReFitPriVtxTypeName", "refittedVertexType"
}

Definition at line 116 of file NonPromptLeptonVertexingAlg.h.

116 {
117 this, "ReFitPriVtxTypeName", "refittedVertexType"
118 };

◆ m_selectTracks

Gaudi::Property<bool> Prompt::NonPromptLeptonVertexingAlg::m_selectTracks {this, "SelectTracks", true}
private

Definition at line 109 of file NonPromptLeptonVertexingAlg.h.

109{this, "SelectTracks", true};

◆ m_svContainerName

SG::WriteHandleKey<xAOD::VertexContainer> Prompt::NonPromptLeptonVertexingAlg::m_svContainerName
private
Initial value:
{
this, "SVContainerName", "default"
}

Definition at line 145 of file NonPromptLeptonVertexingAlg.h.

145 {
146 this, "SVContainerName", "default"
147 };

◆ m_timerAll

TStopwatch Prompt::NonPromptLeptonVertexingAlg::m_timerAll
private

Definition at line 153 of file NonPromptLeptonVertexingAlg.h.

◆ m_timerExec

TStopwatch Prompt::NonPromptLeptonVertexingAlg::m_timerExec
private

Definition at line 154 of file NonPromptLeptonVertexingAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexFitterTool

ToolHandle<Prompt::VertexFittingTool> Prompt::NonPromptLeptonVertexingAlg::m_vertexFitterTool
private
Initial value:
{
this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
}

Definition at line 101 of file NonPromptLeptonVertexingAlg.h.

101 {
102 this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
103 };

◆ m_vertexMerger

ToolHandle<Prompt::IVertexMergingTool> Prompt::NonPromptLeptonVertexingAlg::m_vertexMerger
private
Initial value:
{
this, "VertexMergingTool",
"Prompt::VertexMergingTool/PromptVertexMergingTool"
}

Definition at line 97 of file NonPromptLeptonVertexingAlg.h.

97 {
98 this, "VertexMergingTool",
99 "Prompt::VertexMergingTool/PromptVertexMergingTool"
100 };

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: