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

#include <VertexFittingTool.h>

Inheritance diagram for Prompt::VertexFittingTool:
Collaboration diagram for Prompt::VertexFittingTool:

Public Member Functions

 VertexFittingTool (const std::string &t, const std::string &name, const IInterface *p)
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual std::unique_ptr< xAOD::VertexfitVertexWithPrimarySeed (const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, VtxType vtx) override
virtual std::unique_ptr< xAOD::VertexfitVertexWithSeed (const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, const Amg::Vector3D &seed, VtxType vtxType) override
virtual bool isValidVertex (const xAOD::Vertex *vtx) const override
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 sysInitialize () override
 Perform system initialization for an algorithm.
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
 DeclareInterfaceID (Prompt::IVertexFittingTool, 1, 0)

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

typedef std::unique_ptr< xAOD::VertexvtxPtr_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void removeDoubleEntries (std::vector< const xAOD::TrackParticle * > &tracks)
bool decorateNewSecondaryVertex (const FittingInput &input, xAOD::Vertex *secVtx)
std::unique_ptr< xAOD::VertexgetSecondaryVertexWithSeed (const std::vector< const xAOD::TrackParticle * > &tracks, const xAOD::TrackParticleContainer *inDetTracks, const Amg::Vector3D &seed)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Trk::IVertexFitterm_vertexFitter
ToolHandle< Trk::IVertexFitterm_seedVertexFitter
Gaudi::Property< bool > m_doSeedVertexFit
Gaudi::Property< std::string > m_distToPriVtxName
Gaudi::Property< std::string > m_normDistToPriVtxName
Gaudi::Property< std::string > m_distToRefittedPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName
Gaudi::Property< std::string > m_distToRefittedRmLepPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedRmLepPriVtxName
TStopwatch m_timer
int m_countNumberOfFits {0}
int m_countNumberOfFitsFailed {0}
int m_countNumberOfFitsInvalid {0}
int m_secondaryVertexIndex {0}
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedRmLepPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedRmLepPriVtx
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 29 of file VertexFittingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ vtxPtr_t

typedef std::unique_ptr<xAOD::Vertex> Prompt::VertexFittingTool::vtxPtr_t
private

Definition at line 67 of file VertexFittingTool.h.

Constructor & Destructor Documentation

◆ VertexFittingTool()

Prompt::VertexFittingTool::VertexFittingTool ( const std::string & t,
const std::string & name,
const IInterface * p )

Definition at line 21 of file VertexFittingTool.cxx.

23 : AthAlgTool(t, name, p)
24{
25 declareInterface<Prompt::IVertexFittingTool>(this);
26}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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)

◆ DeclareInterfaceID()

Prompt::IVertexFittingTool::DeclareInterfaceID ( Prompt::IVertexFittingTool ,
1 ,
0  )
inherited

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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>

◆ decorateNewSecondaryVertex()

bool Prompt::VertexFittingTool::decorateNewSecondaryVertex ( const FittingInput & input,
xAOD::Vertex * secVtx )
private

Definition at line 226 of file VertexFittingTool.cxx.

230{
231 //
232 // Decorate secondary vertex with all useful information
233 //
234 if(!secVtx) {
235 ATH_MSG_WARNING("decorateNewSecondaryVertex - invalid pointer");
236 return false;
237 }
238
239 //
240 // Decorate secondary vertex with the distance/norm_distance it from Prmary Vertex, Refitted Primary vertex and Refitted Primary Vertex that removed lepton itself.
241 //
242 float distToPriVtx = -1;
243 float normDistToPriVtx = -1;
244 float distToRefittedPriVtx = -1;
245 float normDistToRefittedPriVtx = -1;
246 float distToRefittedRmLepPriVtx = -1;
247 float normDistToRefittedRmLepPriVtx = -1;
248
249 if(input.priVtx) {
250 distToPriVtx = Prompt::getDistance(input.priVtx->position(), secVtx->position());
251 normDistToPriVtx = Prompt::getNormDist(input.priVtx->position(), secVtx->position(), secVtx->covariance(), msg(MSG::WARNING));
252 }
253
254 if(input.refittedPriVtx) {
255 distToRefittedPriVtx = Prompt::getDistance(input.refittedPriVtx->position(), secVtx->position());
256 normDistToRefittedPriVtx = Prompt::getNormDist(input.refittedPriVtx->position(), secVtx->position(), secVtx->covariance(), msg(MSG::WARNING));
257 }
258
259 if(input.refittedPriVtxWithoutLep) {
260 distToRefittedRmLepPriVtx = Prompt::getDistance(input.refittedPriVtxWithoutLep->position(), secVtx->position());
261 normDistToRefittedRmLepPriVtx = Prompt::getNormDist(input.refittedPriVtxWithoutLep->position(), secVtx->position(), secVtx->covariance(), msg(MSG::WARNING));
262 }
263
264 (*m_distToPriVtx) (*secVtx) = distToPriVtx;
265 (*m_normDistToPriVtx) (*secVtx) = normDistToPriVtx;
266 (*m_distToRefittedPriVtx) (*secVtx) = distToRefittedPriVtx;
267 (*m_normDistToRefittedPriVtx) (*secVtx) = normDistToRefittedPriVtx;
268 (*m_distToRefittedRmLepPriVtx) (*secVtx) = distToRefittedRmLepPriVtx;
269 (*m_normDistToRefittedRmLepPriVtx)(*secVtx) = normDistToRefittedRmLepPriVtx;
270
271 return true;
272}
#define ATH_MSG_WARNING(x)
MsgStream & msg() const
const Amg::Vector3D & position() const
Returns the 3-pos.
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
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)

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ finalize()

StatusCode Prompt::VertexFittingTool::finalize ( )
overridevirtual

Definition at line 53 of file VertexFittingTool.cxx.

54{
55 //
56 // Delete pointers
57 //
58 m_timer.Stop();
59
60 ATH_MSG_INFO("VertexFittingSvc::finalize - number of total fits: " << m_countNumberOfFits);
61 ATH_MSG_INFO("VertexFittingSvc::finalize - number of failed fits: " << m_countNumberOfFitsFailed);
62 ATH_MSG_INFO("VertexFittingSvc::finalize - number of invalid vtxs: " << m_countNumberOfFitsInvalid);
63 ATH_MSG_INFO("VertexFittingSvc::finalize - fitting timer: " << PrintResetStopWatch(m_timer));
64
65 return StatusCode::SUCCESS;
66}
#define ATH_MSG_INFO(x)
std::string PrintResetStopWatch(TStopwatch &watch)

◆ fitVertexWithPrimarySeed()

std::unique_ptr< xAOD::Vertex > Prompt::VertexFittingTool::fitVertexWithPrimarySeed ( const FittingInput & input,
const std::vector< const xAOD::TrackParticle * > & tracks,
VtxType vtx )
overridevirtual

Implements Prompt::IVertexFittingTool.

Definition at line 69 of file VertexFittingTool.cxx.

74{
75 //
76 // Make new secondary vertex
77 //
78 TimerScopeHelper timer(m_timer);
80
81 if(!input.priVtx) {
82 ATH_MSG_WARNING("fitVertexWithPrimarySeed -- missing primary vertex");
83 return nullptr;
84 }
85
86 // Fit a new secondary vertex
87 std::unique_ptr<xAOD::Vertex> secondaryVtx = getSecondaryVertexWithSeed(
88 tracks, input.inDetTracks, input.priVtx->position()
89 );
90
91 if(!secondaryVtx) {
93 ATH_MSG_WARNING("fitVertexWithPrimarySeed -- failed to fit vertex");
94 return nullptr;
95 }
96
97 if(!isValidVertex(secondaryVtx.get())) {
99
100 ATH_MSG_WARNING("fitVertexWithPrimarySeed -- failed to get valid vertex");
101 return nullptr;
102 }
103
105
106 // Decorate the newly created vertex
107 static const SG::AuxElement::Accessor<int> indexAcc("SecondaryVertexIndex");
108 static const SG::AuxElement::Accessor<int> typeAcc("SVType");
109
110 indexAcc(*secondaryVtx) = m_secondaryVertexIndex;
111 typeAcc(*secondaryVtx) = static_cast<int>(vtxType);
112
113 decorateNewSecondaryVertex(input, secondaryVtx.get());
114
115 return secondaryVtx;
116}
std::unique_ptr< xAOD::Vertex > getSecondaryVertexWithSeed(const std::vector< const xAOD::TrackParticle * > &tracks, const xAOD::TrackParticleContainer *inDetTracks, const Amg::Vector3D &seed)
bool decorateNewSecondaryVertex(const FittingInput &input, xAOD::Vertex *secVtx)
virtual bool isValidVertex(const xAOD::Vertex *vtx) const override
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
timer(name, disabled=False)

◆ fitVertexWithSeed()

std::unique_ptr< xAOD::Vertex > Prompt::VertexFittingTool::fitVertexWithSeed ( const FittingInput & input,
const std::vector< const xAOD::TrackParticle * > & tracks,
const Amg::Vector3D & seed,
VtxType vtxType )
overridevirtual

Implements Prompt::IVertexFittingTool.

Definition at line 119 of file VertexFittingTool.cxx.

125{
126 //
127 // Make new secondary vertex
128 //
129 TimerScopeHelper timer(m_timer);
131
132 std::unique_ptr<xAOD::Vertex> secondaryVtx = getSecondaryVertexWithSeed(
133 tracks, input.inDetTracks, seed
134 );
135
136 if(!secondaryVtx) {
138
139 ATH_MSG_WARNING("fitVertexWithSeed -- failed to fit vertex");
140 return nullptr;
141 }
142
143 if(!isValidVertex(secondaryVtx.get())) {
145
146 ATH_MSG_WARNING("fitVertexWithSeed -- failed to get valid vertex");
147 return nullptr;
148 }
149
151
152 // Decorate the newly created vertex
153 static const SG::AuxElement::Accessor<int> indexAcc("SecondaryVertexIndex");
154 static const SG::AuxElement::Accessor<int> typeAcc("SVType");
155
156 indexAcc(*secondaryVtx) = m_secondaryVertexIndex;
157 typeAcc(*secondaryVtx) = static_cast<int>(vtxType);
158
159 decorateNewSecondaryVertex(input, secondaryVtx.get());
160
161 return secondaryVtx;
162}

◆ getSecondaryVertexWithSeed()

std::unique_ptr< xAOD::Vertex > Prompt::VertexFittingTool::getSecondaryVertexWithSeed ( const std::vector< const xAOD::TrackParticle * > & tracks,
const xAOD::TrackParticleContainer * inDetTracks,
const Amg::Vector3D & seed )
private

Definition at line 275 of file VertexFittingTool.cxx.

280{
281 //
282 // Fit one vertex with given tracks
283 //
284 std::vector<const xAOD::TrackParticle*> tracksForFit(tracks);
285
286 ATH_MSG_DEBUG("getSecondaryVertexWithSeed -- before remove " << tracksForFit.size());
287
288 removeDoubleEntries(tracksForFit);
289
290 ATH_MSG_DEBUG("getSecondaryVertexWithSeed -- after remove " << tracksForFit.size());
291
292 if(tracksForFit.size() < 2) {
293 ATH_MSG_WARNING("getSecondaryVertexWithSeed -- cannot fit vertex with one or zero input track: ntrack=" << tracksForFit.size());
294 return 0;
295 }
296
297 //
298 // Run fit
299 //
300 ATH_MSG_DEBUG(name() << "::getSecondaryVertexWithSeed -- N tracks = " << tracksForFit.size());
301
302 for(const xAOD::TrackParticle* track: tracksForFit) {
303 ATH_MSG_DEBUG( name() << "::getSecondaryVertexWithSeed -- track pt, eta = " << track->pt() << "," << track->eta());
304 ATH_MSG_DEBUG( name() << "::getSecondaryVertexWithSeed -- track chi2 = " << track->chiSquared());
305 }
306
307 xAOD::Vertex *newVertex = 0;
308 std::unique_ptr<xAOD::Vertex> seedVertex;
309
311 seedVertex = std::unique_ptr<xAOD::Vertex>(m_seedVertexFitter->fit(tracksForFit, seed));
312
313 if(seedVertex.get() && !isValidVertex(seedVertex.get())) {
314 ATH_MSG_DEBUG("getSecondaryVertexWithSeed -- failed to fit seed vertex");
315
316 seedVertex.reset();
317 }
318 }
319
320 if(seedVertex.get()) {
321 newVertex = m_vertexFitter->fit(tracksForFit, seedVertex->position());
322 }
323 else {
324 newVertex = m_vertexFitter->fit(tracksForFit, seed);
325 }
326
327 if(!newVertex) {
328 ATH_MSG_INFO("getSecondaryVertexWithSeed -- failed to fit vertex and fitter returned null xAOD::Vertex pointer");
329 return 0;
330 }
331
332 //
333 // Save vertex tracks
334 //
335 std::vector<ElementLink< xAOD::TrackParticleContainer> > tpLinks;
336
337 if(inDetTracks) {
338 //
339 // Record links to ID tracks if container pointer is provided
340 //
341 for(const xAOD::TrackParticle *selectedtrack: tracksForFit) {
342 ElementLink<xAOD::TrackParticleContainer> tpLink;
343
344 tpLink.toContainedElement(*inDetTracks, selectedtrack);
345 tpLinks.push_back(tpLink);
346 }
347 }
348
349 newVertex->setTrackParticleLinks(tpLinks);
350
351 TLorentzVector Momentum;
352
353 for(const xAOD::TrackParticle* track: tracksForFit) {
354 Momentum += static_cast<TLorentzVector>(track->p4());
355 }
356
357 xAOD::SecVtxHelper::setVertexMass(newVertex, Momentum.M()); // "mass"
358
359 // newVertex was returned from the vertex fitter as a raw pointer
360 // It looks like Trk::IVertexFitter::fit function expects
361 // memory management to be done by the caller.
362 // Therefore, we take ownership by casting to a unique_ptr
363
364 std::unique_ptr<xAOD::Vertex> returnPtr(newVertex);
365
366 return returnPtr;
367}
#define ATH_MSG_DEBUG(x)
ToolHandle< Trk::IVertexFitter > m_seedVertexFitter
Gaudi::Property< bool > m_doSeedVertexFit
ToolHandle< Trk::IVertexFitter > m_vertexFitter
void removeDoubleEntries(std::vector< const xAOD::TrackParticle * > &tracks)
void setTrackParticleLinks(const TrackParticleLinks_t &trackParticles)
Set all track particle links at once.
void setVertexMass(xAOD::Vertex *, float value)
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ initialize()

StatusCode Prompt::VertexFittingTool::initialize ( )
overridevirtual

Definition at line 29 of file VertexFittingTool.cxx.

30{
31 ATH_CHECK(m_vertexFitter.retrieve());
32
34 ATH_CHECK(m_seedVertexFitter.retrieve());
35 }
36
37 m_distToPriVtx = std::make_unique<SG::AuxElement::Decorator<float> > (m_distToPriVtxName);
38 m_normDistToPriVtx = std::make_unique<SG::AuxElement::Decorator<float> > (m_normDistToPriVtxName);
39 m_distToRefittedPriVtx = std::make_unique<SG::AuxElement::Decorator<float> > (m_distToRefittedPriVtxName);
40 m_normDistToRefittedPriVtx = std::make_unique<SG::AuxElement::Decorator<float> > (m_normDistToRefittedPriVtxName);
41 m_distToRefittedRmLepPriVtx = std::make_unique<SG::AuxElement::Decorator<float> > (m_distToRefittedRmLepPriVtxName);
42 m_normDistToRefittedRmLepPriVtx = std::make_unique<SG::AuxElement::Decorator<float> > (m_normDistToRefittedRmLepPriVtxName);
43
44 m_timer.Reset();
45
46 ATH_MSG_DEBUG("VertexFittingSvc::initialize - doSeedVertexFit = " << m_doSeedVertexFit);
47 ATH_MSG_DEBUG("VertexFittingSvc::initialize - vertexFitter = " << m_vertexFitter.name());
48
49 return StatusCode::SUCCESS;
50}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedRmLepPriVtx
Gaudi::Property< std::string > m_normDistToRefittedPriVtxName
Gaudi::Property< std::string > m_distToPriVtxName
Gaudi::Property< std::string > m_distToRefittedRmLepPriVtxName
Gaudi::Property< std::string > m_normDistToRefittedRmLepPriVtxName
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToPriVtx
std::unique_ptr< SG::AuxElement::Decorator< float > > m_normDistToRefittedPriVtx
Gaudi::Property< std::string > m_distToRefittedPriVtxName
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedRmLepPriVtx
Gaudi::Property< std::string > m_normDistToPriVtxName
std::unique_ptr< SG::AuxElement::Decorator< float > > m_distToRefittedPriVtx

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ isValidVertex()

bool Prompt::VertexFittingTool::isValidVertex ( const xAOD::Vertex * vtx) const
overridevirtual

Implements Prompt::IVertexFittingTool.

Definition at line 165 of file VertexFittingTool.cxx.

166{
167 //
168 // Check if vertex is valid
169 //
170 bool bad_vtx = false;
171
172 if(!vtx){
173 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- invalid vtx pointer!!!");
174 return false;
175 }
176
177 if(vtx->covariance().empty()) {
178 bad_vtx = true;
179 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- empty vtx covariance!!!");
180 }
181
182 float chisquared = -9999;
183
184 if(!getVar(vtx, chisquared, "chiSquared")) {
185 bad_vtx = true;
186 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- not valid vtx chiSquared!!!");
187 }
188
189 float numberdof = -9999;
190
191 if(!getVar(vtx, numberdof, "numberDoF")) {
192 bad_vtx = true;
193 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- not valid vtx numberDoF!!!");
194 }
195
196 if(std::isnan(vtx->x()) || std::isnan(vtx->y()) || std::isnan(vtx->z())) {
197 bad_vtx = true;
198 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- vertex coordinate is nan");
199 }
200
201 if(bad_vtx) {
202 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- bad vertex!!!");
203 ATH_MSG_INFO(printPromptVertexAsStr(vtx, msg(MSG::WARNING)));
204 }
205
206 return !bad_vtx;
207}
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.
std::string printPromptVertexAsStr(const xAOD::Vertex *vtx, MsgStream &msg)
bool getVar(T1 &obj, T2 &value, const std::string &var_name)
Definition PromptUtils.h:62

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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.

◆ removeDoubleEntries()

void Prompt::VertexFittingTool::removeDoubleEntries ( std::vector< const xAOD::TrackParticle * > & tracks)
private

Definition at line 210 of file VertexFittingTool.cxx.

211{
212 const unsigned nbefore = tracks.size();
213
214 sort(tracks.begin(), tracks.end());
215
216 typename std::vector<const xAOD::TrackParticle*>::iterator TransfEnd = std::unique(tracks.begin(), tracks.end());
217
218 tracks.erase(TransfEnd, tracks.end());
219
220 if(nbefore != tracks.size()) {
221 ATH_MSG_DEBUG("removeDoubleEntries nbefore != tracks.size()): " << nbefore << " != " << tracks.size());
222 }
223}
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ 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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_countNumberOfFits

int Prompt::VertexFittingTool::m_countNumberOfFits {0}
private

Definition at line 109 of file VertexFittingTool.h.

109{0};

◆ m_countNumberOfFitsFailed

int Prompt::VertexFittingTool::m_countNumberOfFitsFailed {0}
private

Definition at line 110 of file VertexFittingTool.h.

110{0};

◆ m_countNumberOfFitsInvalid

int Prompt::VertexFittingTool::m_countNumberOfFitsInvalid {0}
private

Definition at line 111 of file VertexFittingTool.h.

111{0};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_distToPriVtx

std::unique_ptr<SG::AuxElement::Decorator<float> > Prompt::VertexFittingTool::m_distToPriVtx
private

Definition at line 115 of file VertexFittingTool.h.

◆ m_distToPriVtxName

Gaudi::Property<std::string> Prompt::VertexFittingTool::m_distToPriVtxName
private
Initial value:
{
this, "DistToPriVtxName", "default"
}

Definition at line 86 of file VertexFittingTool.h.

86 {
87 this, "DistToPriVtxName", "default"
88 };

◆ m_distToRefittedPriVtx

std::unique_ptr<SG::AuxElement::Decorator<float> > Prompt::VertexFittingTool::m_distToRefittedPriVtx
private

Definition at line 117 of file VertexFittingTool.h.

◆ m_distToRefittedPriVtxName

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

Definition at line 92 of file VertexFittingTool.h.

92 {
93 this, "DistToRefittedPriVtxName", "default"
94 };

◆ m_distToRefittedRmLepPriVtx

std::unique_ptr<SG::AuxElement::Decorator<float> > Prompt::VertexFittingTool::m_distToRefittedRmLepPriVtx
private

Definition at line 119 of file VertexFittingTool.h.

◆ m_distToRefittedRmLepPriVtxName

Gaudi::Property<std::string> Prompt::VertexFittingTool::m_distToRefittedRmLepPriVtxName
private
Initial value:
{
this, "DistToRefittedRmLepPriVtxName", "default"
}

Definition at line 98 of file VertexFittingTool.h.

98 {
99 this, "DistToRefittedRmLepPriVtxName", "default"
100 };

◆ m_doSeedVertexFit

Gaudi::Property<bool> Prompt::VertexFittingTool::m_doSeedVertexFit
private
Initial value:
{
this, "doSeedVertexFit", false
}

Definition at line 82 of file VertexFittingTool.h.

82 {
83 this, "doSeedVertexFit", false
84 };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_normDistToPriVtx

std::unique_ptr<SG::AuxElement::Decorator<float> > Prompt::VertexFittingTool::m_normDistToPriVtx
private

Definition at line 116 of file VertexFittingTool.h.

◆ m_normDistToPriVtxName

Gaudi::Property<std::string> Prompt::VertexFittingTool::m_normDistToPriVtxName
private
Initial value:
{
this, "NormDistToPriVtxName", "default"
}

Definition at line 89 of file VertexFittingTool.h.

89 {
90 this, "NormDistToPriVtxName", "default"
91 };

◆ m_normDistToRefittedPriVtx

std::unique_ptr<SG::AuxElement::Decorator<float> > Prompt::VertexFittingTool::m_normDistToRefittedPriVtx
private

Definition at line 118 of file VertexFittingTool.h.

◆ m_normDistToRefittedPriVtxName

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

Definition at line 95 of file VertexFittingTool.h.

95 {
96 this, "NormDistToRefittedPriVtxName", "default"
97 };

◆ m_normDistToRefittedRmLepPriVtx

std::unique_ptr<SG::AuxElement::Decorator<float> > Prompt::VertexFittingTool::m_normDistToRefittedRmLepPriVtx
private

Definition at line 120 of file VertexFittingTool.h.

◆ m_normDistToRefittedRmLepPriVtxName

Gaudi::Property<std::string> Prompt::VertexFittingTool::m_normDistToRefittedRmLepPriVtxName
private
Initial value:
{
this, "NormDistToRefittedRmLepPriVtxName", "default"
}

Definition at line 101 of file VertexFittingTool.h.

101 {
102 this, "NormDistToRefittedRmLepPriVtxName", "default"
103 };

◆ m_secondaryVertexIndex

int Prompt::VertexFittingTool::m_secondaryVertexIndex {0}
private

Definition at line 113 of file VertexFittingTool.h.

113{0};

◆ m_seedVertexFitter

ToolHandle<Trk::IVertexFitter> Prompt::VertexFittingTool::m_seedVertexFitter
private
Initial value:
{
this, "seedVertexFitterTool",
"Trk::FastVertexFitter/FastVertexFitterTool"
}

Definition at line 77 of file VertexFittingTool.h.

77 {
78 this, "seedVertexFitterTool",
79 "Trk::FastVertexFitter/FastVertexFitterTool"
80 };

◆ m_timer

TStopwatch Prompt::VertexFittingTool::m_timer
private

Definition at line 108 of file VertexFittingTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexFitter

ToolHandle<Trk::IVertexFitter> Prompt::VertexFittingTool::m_vertexFitter
private
Initial value:
{
this, "vertexFitterTool", "Trk::FastVertexFitter/FastVertexFitterTool"
}

Definition at line 74 of file VertexFittingTool.h.

74 {
75 this, "vertexFitterTool", "Trk::FastVertexFitter/FastVertexFitterTool"
76 };

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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