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 EventContext &ctx, const FittingInput &input, const std::vector< const xAOD::TrackParticle * > &tracks, VtxType vtx) override
virtual std::unique_ptr< xAOD::VertexfitVertexWithSeed (const EventContext &ctx, 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 EventContext &ctx, 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 70 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 228 of file VertexFittingTool.cxx.

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

Implements Prompt::IVertexFittingTool.

Definition at line 69 of file VertexFittingTool.cxx.

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

◆ fitVertexWithSeed()

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

Implements Prompt::IVertexFittingTool.

Definition at line 120 of file VertexFittingTool.cxx.

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

◆ getSecondaryVertexWithSeed()

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

Definition at line 277 of file VertexFittingTool.cxx.

283{
284 //
285 // Fit one vertex with given tracks
286 //
287 std::vector<const xAOD::TrackParticle*> tracksForFit(tracks);
288
289 ATH_MSG_DEBUG("getSecondaryVertexWithSeed -- before remove " << tracksForFit.size());
290
291 removeDoubleEntries(tracksForFit);
292
293 ATH_MSG_DEBUG("getSecondaryVertexWithSeed -- after remove " << tracksForFit.size());
294
295 if(tracksForFit.size() < 2) {
296 ATH_MSG_WARNING("getSecondaryVertexWithSeed -- cannot fit vertex with one or zero input track: ntrack=" << tracksForFit.size());
297 return 0;
298 }
299
300 //
301 // Run fit
302 //
303 ATH_MSG_DEBUG(name() << "::getSecondaryVertexWithSeed -- N tracks = " << tracksForFit.size());
304
305 for(const xAOD::TrackParticle* track: tracksForFit) {
306 ATH_MSG_DEBUG( name() << "::getSecondaryVertexWithSeed -- track pt, eta = " << track->pt() << "," << track->eta());
307 ATH_MSG_DEBUG( name() << "::getSecondaryVertexWithSeed -- track chi2 = " << track->chiSquared());
308 }
309
310 std::unique_ptr<xAOD::Vertex> newVertex;
311 std::unique_ptr<xAOD::Vertex> seedVertex;
312
314 seedVertex = m_seedVertexFitter->fit(ctx, tracksForFit, seed);
315
316 if(seedVertex.get() && !isValidVertex(seedVertex.get())) {
317 ATH_MSG_DEBUG("getSecondaryVertexWithSeed -- failed to fit seed vertex");
318
319 seedVertex.reset();
320 }
321 }
322
323 if(seedVertex.get()) {
324 newVertex = m_vertexFitter->fit(ctx, tracksForFit, seedVertex->position());
325 }
326 else {
327 newVertex = m_vertexFitter->fit(ctx, tracksForFit, seed);
328 }
329
330 if(!newVertex) {
331 ATH_MSG_INFO("getSecondaryVertexWithSeed -- failed to fit vertex and fitter returned null xAOD::Vertex pointer");
332 return 0;
333 }
334
335 //
336 // Save vertex tracks
337 //
338 std::vector<ElementLink< xAOD::TrackParticleContainer> > tpLinks;
339
340 if(inDetTracks) {
341 //
342 // Record links to ID tracks if container pointer is provided
343 //
344 for(const xAOD::TrackParticle *selectedtrack: tracksForFit) {
345 ElementLink<xAOD::TrackParticleContainer> tpLink;
346
347 tpLink.toContainedElement(*inDetTracks, selectedtrack);
348 tpLinks.push_back(tpLink);
349 }
350 }
351
352 newVertex->setTrackParticleLinks(tpLinks);
353
354 TLorentzVector Momentum;
355
356 for(const xAOD::TrackParticle* track: tracksForFit) {
357 Momentum += static_cast<TLorentzVector>(track->p4());
358 }
359
360 xAOD::SecVtxHelper::setVertexMass(newVertex.get(), Momentum.M()); // "mass"
361
362 return newVertex
363;
364}
#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 setVertexMass(xAOD::Vertex *, float value)
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ 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 167 of file VertexFittingTool.cxx.

168{
169 //
170 // Check if vertex is valid
171 //
172 bool bad_vtx = false;
173
174 if(!vtx){
175 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- invalid vtx pointer!!!");
176 return false;
177 }
178
179 if(vtx->covariance().empty()) {
180 bad_vtx = true;
181 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- empty vtx covariance!!!");
182 }
183
184 float chisquared = -9999;
185
186 if(!getVar(vtx, chisquared, "chiSquared")) {
187 bad_vtx = true;
188 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- not valid vtx chiSquared!!!");
189 }
190
191 float numberdof = -9999;
192
193 if(!getVar(vtx, numberdof, "numberDoF")) {
194 bad_vtx = true;
195 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- not valid vtx numberDoF!!!");
196 }
197
198 if(std::isnan(vtx->x()) || std::isnan(vtx->y()) || std::isnan(vtx->z())) {
199 bad_vtx = true;
200 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- vertex coordinate is nan");
201 }
202
203 if(bad_vtx) {
204 ATH_MSG_WARNING("VertexFittingSvc::Validate_Vertex -- bad vertex!!!");
205 ATH_MSG_INFO(printPromptVertexAsStr(vtx, msg(MSG::WARNING)));
206 }
207
208 return !bad_vtx;
209}
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 212 of file VertexFittingTool.cxx.

213{
214 const unsigned nbefore = tracks.size();
215
216 sort(tracks.begin(), tracks.end());
217
218 typename std::vector<const xAOD::TrackParticle*>::iterator TransfEnd = std::unique(tracks.begin(), tracks.end());
219
220 tracks.erase(TransfEnd, tracks.end());
221
222 if(nbefore != tracks.size()) {
223 ATH_MSG_DEBUG("removeDoubleEntries nbefore != tracks.size()): " << nbefore << " != " << tracks.size());
224 }
225}
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 112 of file VertexFittingTool.h.

112{0};

◆ m_countNumberOfFitsFailed

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

Definition at line 113 of file VertexFittingTool.h.

113{0};

◆ m_countNumberOfFitsInvalid

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

Definition at line 114 of file VertexFittingTool.h.

114{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 118 of file VertexFittingTool.h.

◆ m_distToPriVtxName

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

Definition at line 89 of file VertexFittingTool.h.

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

◆ m_distToRefittedPriVtx

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

Definition at line 120 of file VertexFittingTool.h.

◆ m_distToRefittedPriVtxName

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

Definition at line 95 of file VertexFittingTool.h.

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

◆ m_distToRefittedRmLepPriVtx

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

Definition at line 122 of file VertexFittingTool.h.

◆ m_distToRefittedRmLepPriVtxName

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

Definition at line 101 of file VertexFittingTool.h.

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

◆ m_doSeedVertexFit

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

Definition at line 85 of file VertexFittingTool.h.

85 {
86 this, "doSeedVertexFit", false
87 };

◆ 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 119 of file VertexFittingTool.h.

◆ m_normDistToPriVtxName

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

Definition at line 92 of file VertexFittingTool.h.

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

◆ m_normDistToRefittedPriVtx

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

Definition at line 121 of file VertexFittingTool.h.

◆ m_normDistToRefittedPriVtxName

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

Definition at line 98 of file VertexFittingTool.h.

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

◆ m_normDistToRefittedRmLepPriVtx

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

Definition at line 123 of file VertexFittingTool.h.

◆ m_normDistToRefittedRmLepPriVtxName

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

Definition at line 104 of file VertexFittingTool.h.

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

◆ m_secondaryVertexIndex

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

Definition at line 116 of file VertexFittingTool.h.

116{0};

◆ m_seedVertexFitter

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

Definition at line 80 of file VertexFittingTool.h.

80 {
81 this, "seedVertexFitterTool",
82 "Trk::FastVertexFitter/FastVertexFitterTool"
83 };

◆ m_timer

TStopwatch Prompt::VertexFittingTool::m_timer
private

Definition at line 111 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 77 of file VertexFittingTool.h.

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

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