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

#include <PrimaryVertexReFitter.h>

Inheritance diagram for Prompt::PrimaryVertexReFitter:
Collaboration diagram for Prompt::PrimaryVertexReFitter:

Public Member Functions

 PrimaryVertexReFitter (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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

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

using accessorFloat_t = SG::Accessor<float>
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

bool decorateLepWithReFitPrimaryVertex (const EventContext &ctx, const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks, xAOD::VertexContainer &refitVtxContainer)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Prompt::VertexFittingToolm_vertexFitterTool
Gaudi::Property< bool > m_printTime {this, "PrintTime", false}
Gaudi::Property< std::string > m_distToRefittedPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName
TStopwatch m_timerAll
TStopwatch m_timerExec
SG::ReadHandleKey< xAOD::TrackParticleContainerm_inDetTracksKey
SG::ReadHandleKey< xAOD::IParticleContainerm_leptonContainerKey
SG::ReadHandleKey< xAOD::VertexContainerm_primaryVertexContainerKey
SG::WriteHandleKey< xAOD::VertexContainerm_reFitPrimaryVertexKey
std::optional< accessorFloat_tm_distToRefittedPriVtx
std::optional< accessorFloat_tm_normdistToRefittedPriVtx
SG::WriteDecorHandleKey< xAOD::IParticleContainerm_lepRefittedVtxWithoutLeptonLinkName { this, "RefittedVtxWithoutLeptonLinkName", m_leptonContainerKey, "default", "" }
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 44 of file PrimaryVertexReFitter.h.

Member Typedef Documentation

◆ accessorFloat_t

Definition at line 56 of file PrimaryVertexReFitter.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PrimaryVertexReFitter()

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

Definition at line 19 of file PrimaryVertexReFitter.cxx.

19 :
20 AthAlgorithm (name, pSvcLocator)
21{}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

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>

◆ decorateLepWithReFitPrimaryVertex()

bool Prompt::PrimaryVertexReFitter::decorateLepWithReFitPrimaryVertex ( const EventContext & ctx,
const FittingInput & input,
const xAOD::TrackParticle * tracklep,
const std::vector< const xAOD::TrackParticle * > & tracks,
xAOD::VertexContainer & refitVtxContainer )
private

Definition at line 243 of file PrimaryVertexReFitter.cxx.

249{
250 //
251 // Check if the lepton track has been used for primary vertex reconstruction.
252 // if true, then remove the lepton track from the input track list, re-fit primary vertex again.
253 // Save the ElementLink of the re-fit primary vertex to the lepton
254 //
255 if(!input.priVtx) {
256 ATH_MSG_WARNING("decorateLepWithReFitPrimaryVertex - invalid input primary vertex pointer");
257 return false;
258 }
259
260 //--------------------------------------------------------
261 // Remove the lepton track from the track list
262 // get re-fitted non-prompt primary vertex
263 //
264 std::vector<const xAOD::TrackParticle*> priVtx_tracks_pass;
265 bool isRefit = false;
266
267 for(const xAOD::TrackParticle *track: tracks) {
268 if(track == tracklep) {
269 isRefit = true;
270 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- lepton has been used, lepton pT =" << tracklep->pt() << ", track pT =" << track->pt());
271 continue;
272 }
273
274 priVtx_tracks_pass.push_back(track);
275 }
276
277 if(!isRefit) {
278 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- Skip the primary vertex without lepton track");
279
280 return false;
281 }
282
283 if(priVtx_tracks_pass.size() < 2) {
284 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- Skip the primary vertex refitting: N tracks =" << priVtx_tracks_pass.size());
285
286 return false;
287 }
288
289 std::unique_ptr<xAOD::Vertex> refittedVtxRMLep = m_vertexFitterTool->fitVertexWithSeed(
290 ctx, input, priVtx_tracks_pass, input.priVtx->position(),
292
293 if(refittedVtxRMLep) {
294 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- save refitted non-prompt primary vertex with NTrack = " << refittedVtxRMLep->nTrackParticles());
295
296 if(input.refittedPriVtx) {
297 (*m_distToRefittedPriVtx) (*refittedVtxRMLep) = Prompt::getDistance(input.refittedPriVtx->position(), refittedVtxRMLep->position());
298 (*m_normdistToRefittedPriVtx)(*refittedVtxRMLep) = Prompt::getNormDist(
299 input.refittedPriVtx->position(),
300 refittedVtxRMLep->position(),
301 refittedVtxRMLep->covariance(),
302 msg(MSG::WARNING)
303 );
304 }
305 //
306 // Record vertex with output container
307 //
308 refitVtxContainer.push_back(std::move(refittedVtxRMLep));
309
310 return true;
311 }
312 return false;
313}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ToolHandle< Prompt::VertexFittingTool > m_vertexFitterTool
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ kRefittedPriVtxWithoutLep
double getNormDist(const Amg::Vector3D &PrimVtx, const Amg::Vector3D &SecVtx, const std::vector< float > &ErrorMatrix, MsgStream &msg)
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ 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()

StatusCode Prompt::PrimaryVertexReFitter::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 90 of file PrimaryVertexReFitter.cxx.

91{
92
93 //
94 // Start execute timer
95 //
96 TimerScopeHelper timer(m_timerExec);
97
98 //
99 // Find Inner Detector tracks
100 //
101 SG::ReadHandle<xAOD::TrackParticleContainer> h_inDetTracks(m_inDetTracksKey, ctx);
102 if (!h_inDetTracks.isValid()){
103 ATH_MSG_FATAL("execute - failed to find the InDetTrackParticles");
104 return StatusCode::FAILURE;
105 }
106
107 const xAOD::TrackParticleContainer inDetTracks = *h_inDetTracks;
108
109 //
110 // Create output vertex collections and record them immediately
111 // in StoreGate for memory management
112 //
113 std::unique_ptr<xAOD::VertexContainer> refitVtxContainer = std::make_unique< xAOD::VertexContainer>();
114 std::unique_ptr<xAOD::VertexAuxContainer> refitVtxContainerAux = std::make_unique< xAOD::VertexAuxContainer>();
115
116 refitVtxContainer->setStore(refitVtxContainerAux.get());
117
118 SG::WriteHandle<xAOD::VertexContainer> h_refitVtxContainer (m_reFitPrimaryVertexKey, ctx);
119 ATH_CHECK(h_refitVtxContainer.record(
120 std::move(refitVtxContainer), std::move(refitVtxContainerAux)
121 ));
122 xAOD::VertexContainer &refitVtxContainerRef = *h_refitVtxContainer;
123
124 //
125 // Retrieve containers from evtStore
126 //
127 SG::ReadHandle<xAOD::IParticleContainer> h_leptonContainer(m_leptonContainerKey, ctx);
128 if (!h_leptonContainer.isValid()){
129 ATH_MSG_FATAL("execute - failed to find the lepton container");
130 return StatusCode::FAILURE;
131 }
132
133 SG::ReadHandle<xAOD::VertexContainer> h_vertices(m_primaryVertexContainerKey, ctx);
134 if (!h_vertices.isValid()){
135 ATH_MSG_FATAL("execute - failed to find the vertices");
136 return StatusCode::FAILURE;
137 }
138
139 const xAOD::IParticleContainer leptonContainer = *h_leptonContainer;
140 const xAOD::VertexContainer vertices = *h_vertices;
141
142 Prompt::FittingInput fittingInput(&inDetTracks, 0, 0);
143
144 for(const xAOD::Vertex *vertex: vertices) {
145 if(vertex->vertexType() == 1) {
146 fittingInput.priVtx = dynamic_cast<const xAOD::Vertex*>(vertex);
147 break;
148 }
149 }
150
151 if(!fittingInput.priVtx) {
152 ATH_MSG_INFO("Failed to find primary vertices - save empty containers");
153 return StatusCode::SUCCESS;
154 }
155
156 //
157 // Collect tracks used for primary vertex fit
158 //
159 std::vector<const xAOD::TrackParticle *> priVtx_tracks;
160 priVtx_tracks.reserve(fittingInput.priVtx->nTrackParticles());
161
162 for(unsigned k = 0; k < fittingInput.priVtx->nTrackParticles(); ++k) {
163 const xAOD::TrackParticle *track = fittingInput.priVtx->trackParticle(k);
164
165 if(track) {
166 priVtx_tracks.push_back(track);
167 }
168 }
169
170 // Refit primary vertex
171 std::unique_ptr<xAOD::Vertex> refittedPriVtx = m_vertexFitterTool->fitVertexWithSeed(
172 ctx, fittingInput, priVtx_tracks,
173 fittingInput.priVtx->position(),
175 );
176
177 if(!refittedPriVtx) {
178 ATH_MSG_WARNING("Failed to refit primary vertex - save empty containers");
179 return StatusCode::SUCCESS;
180 }
181
182 //
183 // Save refitted primary vertex for fitting service
184 //
185 fittingInput.refittedPriVtx = refittedPriVtx.get();
186
187 ATH_MSG_DEBUG("execute -- primary vertex NTrack = " << fittingInput.priVtx ->nTrackParticles());
188 ATH_MSG_DEBUG("execute -- refitted primary vertex NTrack = " << fittingInput.refittedPriVtx->nTrackParticles());
189
190 //
191 // Dynamic cast IParticle container to electron or muon container
192 //
193 ATH_MSG_DEBUG("======================================="
194 << "\n\t\t\t Size of lepton container: " << leptonContainer.size()
195 << "\n-----------------------------------------------------------------");
196
197 SG::WriteDecorHandle<xAOD::IParticleContainer, ElementLink<xAOD::VertexContainer> >
198 lepRefittedRMVtxLinkDec (m_lepRefittedVtxWithoutLeptonLinkName, ctx);
199
200 DataLink<xAOD::VertexContainer> refitVtxContainerLink (refitVtxContainerRef, ctx);
201 for(const xAOD::IParticle *lepton: leptonContainer) {
202 const xAOD::TrackParticle *tracklep = 0;
203 const xAOD::Electron *elec = dynamic_cast<const xAOD::Electron*>(lepton);
204 const xAOD::Muon *muon = dynamic_cast<const xAOD::Muon*>(lepton);
205
206 if(elec) {
207 //
208 // get GSF track
209 //
210 const xAOD::TrackParticle *bestmatchedGSFElTrack=elec->trackParticle(0);
211
212 //
213 // get origin ID track for later study
214 //
215 tracklep = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(bestmatchedGSFElTrack);
216 }
217 else if(muon) {
218 tracklep = muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
219 }
220
221 if(!tracklep) {
222 ATH_MSG_WARNING("PrimaryVertexReFitter::execute - cannot find muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle) nor electron->trackParticle()");
223 continue;
224 }
225
226 if (decorateLepWithReFitPrimaryVertex(ctx, fittingInput, tracklep, priVtx_tracks, refitVtxContainerRef))
227 {
228 lepRefittedRMVtxLinkDec(*lepton) = ElementLink<xAOD::VertexContainer>(refitVtxContainerLink, refitVtxContainerRef.size()-1);
229 }
230 }
231
232 h_refitVtxContainer->push_back(std::move(refittedPriVtx));
233
234 ATH_MSG_DEBUG("SV Vertex container " << m_reFitPrimaryVertexKey << " recorded in store");
235
236 ATH_MSG_DEBUG("execute - all done");
237 ATH_MSG_DEBUG("=======================================");
238
239 return StatusCode::SUCCESS;
240}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
size_type size() const noexcept
Returns the number of elements in the collection.
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_lepRefittedVtxWithoutLeptonLinkName
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainerKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_leptonContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_reFitPrimaryVertexKey
bool decorateLepWithReFitPrimaryVertex(const EventContext &ctx, const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks, xAOD::VertexContainer &refitVtxContainer)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inDetTracksKey
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
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...
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".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.

◆ 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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode Prompt::PrimaryVertexReFitter::finalize ( )
overridevirtual

Definition at line 74 of file PrimaryVertexReFitter.cxx.

75{
76 if(m_printTime) {
77 //
78 // Print full time stopwatch
79 //
80 m_timerAll.Stop();
81
82 ATH_MSG_INFO("Real time: " << m_timerAll.RealTime() << "\t CPU time: " << m_timerAll.CpuTime());
83 ATH_MSG_INFO("Execute time: " << PrintResetStopWatch(m_timerExec));
84 }
85
86 return StatusCode::SUCCESS;
87}
Gaudi::Property< bool > m_printTime
std::string PrintResetStopWatch(TStopwatch &watch)

◆ initialize()

StatusCode Prompt::PrimaryVertexReFitter::initialize ( )
overridevirtual

Definition at line 24 of file PrimaryVertexReFitter.cxx.

25{
26 ANA_MSG_DEBUG("ReFitPriVtxName = " << m_reFitPrimaryVertexKey);
27 ANA_MSG_DEBUG("LeptonContainerName = " << m_leptonContainerKey);
28 ANA_MSG_DEBUG("PriVertexContainerName = " << m_primaryVertexContainerKey);
29
30 ANA_MSG_DEBUG("PrintTime = " << m_printTime);
31
32 ANA_MSG_DEBUG("DistToRefittedPriVtxName = " << m_distToRefittedPriVtxName);
33 ANA_MSG_DEBUG("NormDistToRefittedPriVtxName = " << m_normDistToRefittedPriVtxName);
34 ANA_MSG_DEBUG("RefittedVtxWithoutLeptonLinkName = " << m_lepRefittedVtxWithoutLeptonLinkName.key());
35
36 ATH_CHECK(m_inDetTracksKey.initialize());
37
38 ATH_CHECK(m_leptonContainerKey.initialize());
40
42
43 //
44 // Must have non-empty container name for refitted primary vertex with/without lepton
45 //
46 if(m_reFitPrimaryVertexKey.empty()) {
47 ATH_MSG_FATAL("initialize - SecVtx container invalid name: \"" << m_reFitPrimaryVertexKey << "\"");
48 return StatusCode::FAILURE;
49 }
50
54
55 ATH_CHECK(m_vertexFitterTool.retrieve());
56
57 if(m_printTime) {
58 //
59 // Reset timers
60 //
61 m_timerAll .Reset();
62 m_timerExec.Reset();
63
64 //
65 // Start full timer
66 //
67 m_timerAll.Start();
68 }
69
70 return StatusCode::SUCCESS;
71}
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
std::optional< accessorFloat_t > m_normdistToRefittedPriVtx
std::optional< accessorFloat_t > m_distToRefittedPriVtx
Gaudi::Property< std::string > m_distToRefittedPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName

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

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

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

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

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ 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_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_distToRefittedPriVtx

std::optional<accessorFloat_t> Prompt::PrimaryVertexReFitter::m_distToRefittedPriVtx
private

Definition at line 111 of file PrimaryVertexReFitter.h.

◆ m_distToRefittedPriVtxName

Gaudi::Property<std::string> Prompt::PrimaryVertexReFitter::m_distToRefittedPriVtxName
private
Initial value:
{
this, "DistToRefittedPriVtxName", "default"
}

Definition at line 80 of file PrimaryVertexReFitter.h.

80 {
81 this, "DistToRefittedPriVtxName", "default"
82 };

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_inDetTracksKey

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

Definition at line 91 of file PrimaryVertexReFitter.h.

91 {
92 this, "InDetTrackParticlesKey", "InDetTrackParticles"
93 };

◆ m_lepRefittedVtxWithoutLeptonLinkName

SG::WriteDecorHandleKey<xAOD::IParticleContainer> Prompt::PrimaryVertexReFitter::m_lepRefittedVtxWithoutLeptonLinkName { this, "RefittedVtxWithoutLeptonLinkName", m_leptonContainerKey, "default", "" }
private

Definition at line 114 of file PrimaryVertexReFitter.h.

115{ this, "RefittedVtxWithoutLeptonLinkName", m_leptonContainerKey, "default", "" };

◆ m_leptonContainerKey

SG::ReadHandleKey<xAOD::IParticleContainer> Prompt::PrimaryVertexReFitter::m_leptonContainerKey
private
Initial value:
{
this,
"LeptonContainerName",
"lepContainerNameDefault", "Name of lepton container"
}

Definition at line 95 of file PrimaryVertexReFitter.h.

95 {
96 this,
97 "LeptonContainerName",
98 "lepContainerNameDefault", "Name of lepton container"
99 };

◆ m_normdistToRefittedPriVtx

std::optional<accessorFloat_t> Prompt::PrimaryVertexReFitter::m_normdistToRefittedPriVtx
private

Definition at line 112 of file PrimaryVertexReFitter.h.

◆ m_normDistToRefittedPriVtxName

Gaudi::Property<std::string> Prompt::PrimaryVertexReFitter::m_normDistToRefittedPriVtxName
private
Initial value:
{
this, "NormDistToRefittedPriVtxName", "default"
}

Definition at line 83 of file PrimaryVertexReFitter.h.

83 {
84 this, "NormDistToRefittedPriVtxName", "default"
85 };

◆ m_primaryVertexContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> Prompt::PrimaryVertexReFitter::m_primaryVertexContainerKey
private
Initial value:
{
this, "PriVertexContainerName", "PrimaryVertices",
"Name of primary vertex container"
}

Definition at line 100 of file PrimaryVertexReFitter.h.

100 {
101 this, "PriVertexContainerName", "PrimaryVertices",
102 "Name of primary vertex container"
103 };

◆ m_printTime

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

Definition at line 78 of file PrimaryVertexReFitter.h.

78{this, "PrintTime", false};

◆ m_reFitPrimaryVertexKey

SG::WriteHandleKey<xAOD::VertexContainer> Prompt::PrimaryVertexReFitter::m_reFitPrimaryVertexKey
private
Initial value:
{
this, "ReFitPriVtxName", "default"
}

Definition at line 104 of file PrimaryVertexReFitter.h.

104 {
105 this, "ReFitPriVtxName", "default"
106 };

◆ m_timerAll

TStopwatch Prompt::PrimaryVertexReFitter::m_timerAll
private

Definition at line 87 of file PrimaryVertexReFitter.h.

◆ m_timerExec

TStopwatch Prompt::PrimaryVertexReFitter::m_timerExec
private

Definition at line 88 of file PrimaryVertexReFitter.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::PrimaryVertexReFitter::m_vertexFitterTool
private
Initial value:
{
this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
}

Definition at line 71 of file PrimaryVertexReFitter.h.

71 {
72 this, "VertexFittingTool", "Prompt::VertexFittingTool/VertexFittingTool"
73 };

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