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 () override
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
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

Protected Member Functions

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 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
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< 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 20 of file PrimaryVertexReFitter.cxx.

20 :
21 AthAlgorithm (name, pSvcLocator)
22{}
AthAlgorithm()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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 FittingInput & input,
const xAOD::TrackParticle * tracklep,
const std::vector< const xAOD::TrackParticle * > & tracks,
xAOD::VertexContainer & refitVtxContainer )
private

Definition at line 251 of file PrimaryVertexReFitter.cxx.

256{
257 //
258 // Check if the lepton track has been used for primary vertex reconstruction.
259 // if true, then remove the lepton track from the input track list, re-fit primary vertex again.
260 // Save the ElementLink of the re-fit primary vertex to the lepton
261 //
262 if(!input.priVtx) {
263 ATH_MSG_WARNING("decorateLepWithReFitPrimaryVertex - invalid input primary vertex pointer");
264 return false;
265 }
266
267 //--------------------------------------------------------
268 // Remove the lepton track from the track list
269 // get re-fitted non-prompt primary vertex
270 //
271 std::vector<const xAOD::TrackParticle*> priVtx_tracks_pass;
272 bool isRefit = false;
273
274 for(const xAOD::TrackParticle *track: tracks) {
275 if(track == tracklep) {
276 isRefit = true;
277 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- lepton has been used, lepton pT =" << tracklep->pt() << ", track pT =" << track->pt());
278 continue;
279 }
280
281 priVtx_tracks_pass.push_back(track);
282 }
283
284 if(!isRefit) {
285 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- Skip the primary vertex without lepton track");
286
287 return false;
288 }
289
290 if(priVtx_tracks_pass.size() < 2) {
291 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- Skip the primary vertex refitting: N tracks =" << priVtx_tracks_pass.size());
292
293 return false;
294 }
295
296 std::unique_ptr<xAOD::Vertex> refittedVtxRMLep = m_vertexFitterTool->fitVertexWithSeed(
297 input, priVtx_tracks_pass, input.priVtx->position(),
299
300 if(refittedVtxRMLep) {
301 ATH_MSG_DEBUG("decorateLepWithReFitPrimaryVertex -- save refitted non-prompt primary vertex with NTrack = " << refittedVtxRMLep->nTrackParticles());
302
303 if(input.refittedPriVtx) {
304 (*m_distToRefittedPriVtx) (*refittedVtxRMLep) = Prompt::getDistance(input.refittedPriVtx->position(), refittedVtxRMLep->position());
305 (*m_normdistToRefittedPriVtx)(*refittedVtxRMLep) = Prompt::getNormDist(
306 input.refittedPriVtx->position(),
307 refittedVtxRMLep->position(),
308 refittedVtxRMLep->covariance(),
309 msg(MSG::WARNING)
310 );
311 }
312 //
313 // Record vertex with output container
314 //
315 refitVtxContainer.push_back(std::move(refittedVtxRMLep));
316
317 return true;
318 }
319 return false;
320}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
MsgStream & msg() const
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< 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< 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 ( )
overridevirtual

Definition at line 91 of file PrimaryVertexReFitter.cxx.

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

◆ finalize()

StatusCode Prompt::PrimaryVertexReFitter::finalize ( )
overridevirtual

Definition at line 75 of file PrimaryVertexReFitter.cxx.

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

◆ initialize()

StatusCode Prompt::PrimaryVertexReFitter::initialize ( )
overridevirtual

Definition at line 25 of file PrimaryVertexReFitter.cxx.

26{
27 ANA_MSG_DEBUG("ReFitPriVtxName = " << m_reFitPrimaryVertexKey);
28 ANA_MSG_DEBUG("LeptonContainerName = " << m_leptonContainerKey);
29 ANA_MSG_DEBUG("PriVertexContainerName = " << m_primaryVertexContainerKey);
30
31 ANA_MSG_DEBUG("PrintTime = " << m_printTime);
32
33 ANA_MSG_DEBUG("DistToRefittedPriVtxName = " << m_distToRefittedPriVtxName);
34 ANA_MSG_DEBUG("NormDistToRefittedPriVtxName = " << m_normDistToRefittedPriVtxName);
35 ANA_MSG_DEBUG("RefittedVtxWithoutLeptonLinkName = " << m_lepRefittedVtxWithoutLeptonLinkName.key());
36
37 ATH_CHECK(m_inDetTracksKey.initialize());
38
39 ATH_CHECK(m_leptonContainerKey.initialize());
41
43
44 //
45 // Must have non-empty container name for refitted primary vertex with/without lepton
46 //
47 if(m_reFitPrimaryVertexKey.empty()) {
48 ATH_MSG_FATAL("initialize - SecVtx container invalid name: \"" << m_reFitPrimaryVertexKey << "\"");
49 return StatusCode::FAILURE;
50 }
51
55
56 ATH_CHECK(m_vertexFitterTool.retrieve());
57
58 if(m_printTime) {
59 //
60 // Reset timers
61 //
62 m_timerAll .Reset();
63 m_timerExec.Reset();
64
65 //
66 // Start full timer
67 //
68 m_timerAll.Start();
69 }
70
71 return StatusCode::SUCCESS;
72}
#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< 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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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< 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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ 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< 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}
#define ATH_MSG_ERROR(x)
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< 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< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< 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 110 of file PrimaryVertexReFitter.h.

◆ m_distToRefittedPriVtxName

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

Definition at line 79 of file PrimaryVertexReFitter.h.

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

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< 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 79 of file AthAlgorithm.h.

◆ m_inDetTracksKey

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

Definition at line 90 of file PrimaryVertexReFitter.h.

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

◆ m_lepRefittedVtxWithoutLeptonLinkName

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

Definition at line 113 of file PrimaryVertexReFitter.h.

114{ 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 94 of file PrimaryVertexReFitter.h.

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

◆ m_normdistToRefittedPriVtx

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

Definition at line 111 of file PrimaryVertexReFitter.h.

◆ m_normDistToRefittedPriVtxName

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

Definition at line 82 of file PrimaryVertexReFitter.h.

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

◆ m_primaryVertexContainerKey

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

Definition at line 99 of file PrimaryVertexReFitter.h.

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

◆ m_printTime

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

Definition at line 77 of file PrimaryVertexReFitter.h.

77{this, "PrintTime", false};

◆ m_reFitPrimaryVertexKey

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

Definition at line 103 of file PrimaryVertexReFitter.h.

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

◆ m_timerAll

TStopwatch Prompt::PrimaryVertexReFitter::m_timerAll
private

Definition at line 86 of file PrimaryVertexReFitter.h.

◆ m_timerExec

TStopwatch Prompt::PrimaryVertexReFitter::m_timerExec
private

Definition at line 87 of file PrimaryVertexReFitter.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< 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 70 of file PrimaryVertexReFitter.h.

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

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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