ATLAS Offline Software
Loading...
Searching...
No Matches
NonPromptLeptonVertexingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Local
8
9// Athena
14#include "GaudiKernel/ThreadLocalContext.h"
15
16// C/C++
17#include <cmath>
18#include <iostream>
19#include <sstream>
20
21using namespace std;
22
23//======================================================================================================
24Prompt::NonPromptLeptonVertexingAlg::NonPromptLeptonVertexingAlg(const std::string& name, ISvcLocator *pSvcLocator):
25 AthAlgorithm (name, pSvcLocator),
27{}
28
29//=============================================================================
31{
32 if(m_printTime) {
33 //
34 // Reset timers
35 //
36 m_timerAll .Reset();
37 m_timerExec.Reset();
38
39 //
40 // Start full timer
41 //
42 m_timerAll.Start();
43 }
44
45 if(m_svContainerName.empty()) {
46 ATH_MSG_ERROR("NonPromptLeptonVertexingAlg::initialize - empty SV container name: \"" << m_svContainerName << "\"");
47 return StatusCode::FAILURE;
48 }
49
50 ATH_CHECK(m_vertexMerger.retrieve());
51 ATH_CHECK(m_vertexFitterTool.retrieve());
52
53 ATH_CHECK(m_inDetTracksKey.initialize());
54 ATH_CHECK(m_leptonContainerKey.initialize());
57
58 ATH_CHECK(m_svContainerName.initialize());
59
65
66 ATH_MSG_DEBUG("LeptonContainerName = " << m_leptonContainerKey);
67 ATH_MSG_DEBUG("ReFitPriVtxContainerName = " << m_refittedPriVtxContainerName);
68 ATH_MSG_DEBUG("SVContainerName = " << m_svContainerName);
69 ATH_MSG_DEBUG("IndexVectorName = " << m_decoratorNameIndexVector.key());
70
71 ATH_MSG_DEBUG("mergeMinVtxDist = " << m_mergeMinVtxDist);
72 ATH_MSG_DEBUG("mergeChi2OverDoF = " << m_mergeChi2OverDoF);
73
74 ATH_MSG_DEBUG("minTrackLeptonDR = " << m_minTrackLeptonDR);
75 ATH_MSG_DEBUG("maxTrackLeptonDR = " << m_maxTrackLeptonDR);
76
77 ATH_MSG_DEBUG("selectTracks = " << m_selectTracks);
78 ATH_MSG_DEBUG("minTrackpT = " << m_minTrackpT);
79 ATH_MSG_DEBUG("maxTrackEta = " << m_maxTrackEta);
80 ATH_MSG_DEBUG("maxTrackZ0Sin = " << m_maxTrackZ0Sin);
81
82 ATH_MSG_DEBUG("minTrackSiHits = " << m_minTrackSiHits);
83 ATH_MSG_DEBUG("maxTrackSharedSiHits = " << m_maxTrackSharedSiHits);
84 ATH_MSG_DEBUG("maxTrackSiHoles = " << m_maxTrackSiHoles);
85 ATH_MSG_DEBUG("maxTrackPixHoles = " << m_maxTrackPixHoles);
86
87 return StatusCode::SUCCESS;
88}
89
90//=============================================================================
92{
93 if(m_printTime) {
94 //
95 // Print full time stopwatch
96 //
97 m_timerAll.Stop();
98
99 ATH_MSG_INFO("NonPromptLeptonVertexingAlg - total time: " << PrintResetStopWatch(m_timerAll));
100 ATH_MSG_INFO("NonPromptLeptonVertexingAlg - execute time: " << PrintResetStopWatch(m_timerExec));
101 }
102
103 return StatusCode::SUCCESS;
104}
105
106//=============================================================================
108{
109 //
110 // Start execute timer for new event
111 //
113
114 const EventContext& ctx = Gaudi::Hive::currentContext();
115
117
118 //
119 // Find Inner Detector tracks save them class member variable for convenience.
120 //
122 if (!h_inDetTracks.isValid()){
123 ATH_MSG_FATAL("execute - failed to find the InDetTrackParticles");
124 return StatusCode::FAILURE;
125 }
126
127 const xAOD::TrackParticleContainer inDetTracks = *h_inDetTracks;
128
129 //
130 // Create vertex containers and record them in StoreGate
131 //
132 std::set< xAOD::Vertex* > svSet;
133
135 ATH_CHECK(h_SVContainer.record(
136 std::make_unique< xAOD::VertexContainer>(), std::make_unique< xAOD::VertexAuxContainer>()
137 ));
138 xAOD::VertexContainer &SVContainerRef = *(h_SVContainer.ptr());
139
140 //
141 // Retrieve containers from evtStore
142 //
146
147 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute - Read " << vertices->size() << " primary vertices");
148 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute - Read " << refittedVertices->size() << " refitted primary vertices");
149
150 //
151 // Find default Primary Vertex
152 //
153 Prompt::FittingInput fittingInput(&inDetTracks, 0, 0);
154
155 for(const xAOD::Vertex *vertex: *vertices) {
156 if(vertex->vertexType() == xAOD::VxType::PriVtx) {
157 fittingInput.priVtx = vertex;
158 break;
159 }
160 }
161
162 if(!fittingInput.priVtx) {
163 ATH_MSG_INFO("Failed to find primary vertex - skip this event");
164
165 return StatusCode::SUCCESS;
166 }
167
168 //
169 // Find the refitted Primary Vertex
170 //
171 for(const xAOD::Vertex *vertex: *refittedVertices) {
172 short refittedVertexType = 0;
173
174 if(getVar(vertex, refittedVertexType, m_refittedVertexTypeName) && refittedVertexType == xAOD::VxType::PriVtx) {
175 fittingInput.refittedPriVtx = vertex;
176 }
177
178 if(fittingInput.refittedPriVtx) {
179 break;
180 }
181 }
182
183 //
184 // Dynamic cast IParticle container to electron or muon container
185 //
186 ATH_MSG_DEBUG("\n\t\t\t Size of lepton container: " << leptonContainer ->size());
187
188 SG::AuxElement::ConstAccessor<ElementLink<xAOD::VertexContainer> > priVtxWithoutLepAcc(m_linkNameRefittedPriVtxWithoutLepton);
189
190 using VecElemVtx_t = std::vector<ElementLink<xAOD::VertexContainer> >;
192 indexVectorDec (m_decoratorNameIndexVector, ctx);
194 indexVectorDecDeepMerge (m_decoratorNameIndexVectorDeepMerge, ctx);
196 lepSVElementLinksDec (m_decoratorNameSecVtxLinks, ctx);
198 lepDeepMergedSVElementLinksDec (m_decoratorNameDeepMergedSecVtxLinks, ctx);
199
200 for(const xAOD::IParticle *lepton: *leptonContainer) {
201 const xAOD::TrackParticle *tracklep = 0;
202 const xAOD::Electron *elec = dynamic_cast<const xAOD::Electron*>(lepton);
203 const xAOD::Muon *muon = dynamic_cast<const xAOD::Muon *>(lepton);
204
205 if(elec) {
206 //
207 // Get GSF track
208 //
209 const xAOD::TrackParticle *bestmatchedGSFElTrack = elec->trackParticle(0);
210
211 //
212 // Get original ID track for vertex fitting
213 //
214 if(passElecCand(*elec) && bestmatchedGSFElTrack) {
215 tracklep = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(bestmatchedGSFElTrack);
216 }
217 }
218 else if(muon) {
219 if(passMuonCand(*muon)) {
220 tracklep = muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
221 }
222 }
223 else {
224 ATH_MSG_WARNING("NonPromptLeptonVertexingAlg::execute - failed to find electron or muon: should never happen!");
225 }
226
227 if(!tracklep) {
228 lepSVElementLinksDec (*lepton).clear();
229 lepDeepMergedSVElementLinksDec(*lepton).clear();
230 indexVectorDec (*lepton).clear();
231 indexVectorDecDeepMerge (*lepton).clear();
232
233 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute - cannot find muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle) nor electron->trackParticle()");
234 continue;
235 }
236
237 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute - process new lepton track " << tracklep);
238
239 //
240 // Find refitted primary vertex with lepton track excluded
241 //
242 fittingInput.refittedPriVtxWithoutLep = 0;
243
244 if(priVtxWithoutLepAcc.isAvailable(*lepton)) {
245 ElementLink<xAOD::VertexContainer> vtxLink = priVtxWithoutLepAcc(*lepton);
246
247 if(vtxLink.isValid()) {
248 fittingInput.refittedPriVtxWithoutLep = *vtxLink;
249
250 ATH_MSG_DEBUG("DecorateSecondaryVertex - found refitted primary vertex without lepton: "
251 << m_linkNameRefittedPriVtxWithoutLepton << " with Ntrack =" << fittingInput.refittedPriVtxWithoutLep->nTrackParticles());
252 }
253 }
254
255 //
256 // Collect tracks around the lepton track
257 //
258 std::vector<const xAOD::TrackParticle* > ifitTracks = findNearbyTracks(*tracklep, inDetTracks, *fittingInput.priVtx);
259
260 //
261 // Fit 2-track vertices
262 //
263 std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVertices = prepLepWithTwoTrkSVVec(
264 ctx, fittingInput, tracklep, ifitTracks
265 );
266
267 // We make a copy so we can store the list of original
268 // two-track vertices
269 std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVerticesCopy;
270 for (std::unique_ptr<xAOD::Vertex> &vtx : twoTrkVertices) {
271 std::unique_ptr<xAOD::Vertex> newVtx = std::make_unique<xAOD::Vertex>(*vtx);
272 twoTrkVerticesCopy.push_back(std::move(newVtx));
273 }
274
275 // Deep merge 2-track vertices.
276 ATH_MSG_DEBUG("Getting deep merged vertices");
277 ATH_MSG_DEBUG("Starting with " << twoTrkVertices.size() << " 2-track vertices");
278 Prompt::MergeResultNotOwner deep_merged_result = m_vertexMerger->mergeInitVertices(
279 ctx, fittingInput, tracklep, twoTrkVertices, ifitTracks);
280
281 //
282 // Save secondary vertices
283 //
284 std::vector<ElementLink<xAOD::VertexContainer> > svLinks;
285 std::vector<ElementLink<xAOD::VertexContainer> > deepmergeSVLinks;
286
287 std::vector<int> indexVectorTwoTrk;
288 std::vector<int> indexVectorDeepMerged;
289
290 //
291 // Record 2-track vertexes and simple merged vertexes
292 //
293 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute --- recording " << twoTrkVerticesCopy.size() << " 2-track and simple merged vertices");
294 saveSecondaryVertices(twoTrkVerticesCopy, indexVectorTwoTrk, svLinks, SVContainerRef, svSet);
295
296 //
297 // Record both merged multi-track vertices and also unmerged 2-track vertices
298 //
299 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute --- recording " << deep_merged_result.vtxsNewMerged.size() << " merged multi-track vertices");
300 saveSecondaryVertices(deep_merged_result.vtxsNewMerged, indexVectorDeepMerged, deepmergeSVLinks, SVContainerRef, svSet);
301
302 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::execute --- recording " << deep_merged_result.vtxsInitPassedNotMerged.size() << " unmerged 2-track vertices");
303 saveSecondaryVertices(deep_merged_result.vtxsInitPassedNotMerged, indexVectorDeepMerged, deepmergeSVLinks, SVContainerRef, svSet);
304
305 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute -- number of two-track SV = " << twoTrkVertices.size());
306 ATH_MSG_DEBUG ("NonPromptLeptonVertexingAlg::execute -- number of deep merged SV = " << deep_merged_result.vtxsNewMerged.size());
307
308 lepSVElementLinksDec (*lepton) = std::move(svLinks);
309 lepDeepMergedSVElementLinksDec(*lepton) = std::move(deepmergeSVLinks);
310 indexVectorDec (*lepton) = std::move(indexVectorTwoTrk);
311 indexVectorDecDeepMerge (*lepton) = std::move(indexVectorDeepMerged);
312
313 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg - done with lepton pT=" << tracklep->pt() << ", " << truthAsStr(*lepton) << endl
314 << "___________________________________________________________________________");
315 }
316
317 ATH_MSG_DEBUG("SV Vertex container " << m_svContainerName << " recorded in store");
318
319 ATH_MSG_DEBUG(" NonPromptLeptonVertexingAlg::execute - done with this event" << endl
320 << "___________________________________________________________________________");
321
322 return StatusCode::SUCCESS;
323}
324
325//=============================================================================
327{
328 //
329 // Check whether electron candidate passes loose selection
330 //
331 char lh_loose = -1;
332
333 Prompt::GetAuxVar(elec, lh_loose, "DFCommonElectronsLHLoose");
334
335 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::passElecCand - "
336 << "pT=" << elec.pt() << ", eta=" << elec.eta() << ", phi=" << elec.phi() << std::endl
337 << " DFCommonElectronsLHLoose = " << int(lh_loose) << std::endl
338 << " " << truthAsStr(elec));
339
340 if(!lh_loose) {
341 return false;
342 }
343
344 return true;
345}
346
347//=============================================================================
349{
350 //
351 // Check whether muon candidate is a combined muon
352 //
353 ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::passMuonCand - "
354 << "pT=" << muon.pt() << ", eta=" << muon.eta() << ", phi=" << muon.phi() << std::endl
355 << " Type = " << muon.muonType() << std::endl
356 << " " << truthAsStr(muon));
357
358 return muon.muonType() == xAOD::Muon::MuonType::Combined;
359}
360
361//=============================================================================
362std::vector<const xAOD::TrackParticle*> Prompt::NonPromptLeptonVertexingAlg::findNearbyTracks(
363 const xAOD::TrackParticle &tracklep,
364 const xAOD::TrackParticleContainer &inDetTracks,
365 const xAOD::Vertex &priVtx
366) const {
367 //
368 // Select tracks -- avoid using track selection tool since z0 definition is different
369 //
370 std::vector<const xAOD::TrackParticle *> mytracks;
371
372 for(const xAOD::TrackParticle *track: inDetTracks) {
373 if(!track) {
374 ATH_MSG_WARNING("skip null track pointer - should never happen");
375 continue;
376 }
377
378 //
379 // Check minimum track and lepton DR: skip the track that is probably the lepton track
380 //
381 if(tracklep.p4().DeltaR(track->p4()) < m_minTrackLeptonDR) {
382 ATH_MSG_DEBUG("skip the track very close to the lepton ");
383 continue;
384 }
385
386 //
387 // Check track and lepton maximum DR
388 //
389 if(tracklep.p4().DeltaR(track->p4()) > m_maxTrackLeptonDR) {
390 continue;
391 }
392
393 const double delta_z0 = track->z0() + track->vz() - priVtx.z();
394 const double Z0Sin = std::abs(delta_z0*std::sin(track->theta()));
395 const double abs_eta = std::abs(track->eta());
396
397 uint8_t numberOfPixelHits = 0;
398 uint8_t numberOfSCTHits = 0;
399 uint8_t numberOfPixelHoles = 0;
400 uint8_t numberOfSCTHoles = 0;
401 uint8_t numberOfPixelSharedHits = 0;
402 uint8_t numberOfSCTSharedHits = 0;
403
404 if(!(track->summaryValue(numberOfPixelHits, xAOD::numberOfPixelHits))) continue;
405 if(!(track->summaryValue(numberOfSCTHits, xAOD::numberOfSCTHits))) continue;
406 if(!(track->summaryValue(numberOfPixelHoles, xAOD::numberOfPixelHoles))) continue;
407 if(!(track->summaryValue(numberOfSCTHoles, xAOD::numberOfSCTHoles))) continue;
408 if(!(track->summaryValue(numberOfPixelSharedHits, xAOD::numberOfPixelSharedHits))) continue;
409 if(!(track->summaryValue(numberOfSCTSharedHits, xAOD::numberOfSCTSharedHits))) continue;
410
411 const uint8_t NSiHits = numberOfPixelHits + numberOfSCTHits;
412 const uint8_t NSiHoles = numberOfPixelHoles + numberOfSCTHoles;
413 const float NSiShHits = float(numberOfPixelSharedHits) + float(numberOfSCTSharedHits)/2.0;
414
415 if(m_selectTracks) {
416 //
417 // Kinematic track selection
418 //
419 if(track->pt() < m_minTrackpT) continue;
420 if(abs_eta > m_maxTrackEta) continue;
421 if(Z0Sin > m_maxTrackZ0Sin) continue;
422
423 //
424 // Hit quality track selection
425 //
426 if(NSiHits < m_minTrackSiHits) continue;
427 if(NSiShHits > m_maxTrackSharedSiHits) continue;
428 if(NSiHoles > m_maxTrackSiHoles ) continue;
429 if(numberOfPixelHoles > m_maxTrackPixHoles ) continue;
430 }
431
432 mytracks.push_back(track);
433 }
434
435 return mytracks;
436}
437
438//=============================================================================
439std::vector<std::unique_ptr<xAOD::Vertex>> Prompt::NonPromptLeptonVertexingAlg::prepLepWithTwoTrkSVVec(
440 const EventContext& ctx,
441 const FittingInput &input,
442 const xAOD::TrackParticle* tracklep,
443 const std::vector<const xAOD::TrackParticle*> &tracks
444)
445{
446 //
447 // Decorate lepton with vector of two-track vertices.
448 // Return vector of finding vertices
449 //
450 std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVertices;
451 std::vector<const xAOD::TrackParticle*> tracksForFit;
452
453 if(!input.priVtx) {
454 ATH_MSG_WARNING("prepLepWithTwoTrkSVVec -- invalid primary vertex: nothing to do");
455 return twoTrkVertices;
456 }
457
458 for(const xAOD::TrackParticle *selectedtrack: tracks) {
459 tracksForFit.clear();
460 tracksForFit.push_back(tracklep);
461 tracksForFit.push_back(selectedtrack);
462
463 std::unique_ptr<xAOD::Vertex> newSecondaryVertex = m_vertexFitterTool->fitVertexWithPrimarySeed(
464 ctx, input, tracksForFit, kTwoTrackVtx
465 );
466
467 if(!newSecondaryVertex) {
468 ATH_MSG_DEBUG("prepLepWithTwoTrkSVVec -- failed to fit 2-track vertex");
469 continue;
470 }
471
472 twoTrkVertices.push_back(std::move(newSecondaryVertex));
473 }
474
475 return twoTrkVertices;
476}
477
478//=============================================================================
480 std::vector<std::unique_ptr<xAOD::Vertex>> &clusterVtxs,
481 std::vector<std::unique_ptr<xAOD::Vertex>> &inputVtxs
482)
483{
484 ATH_MSG_DEBUG("makeVertexCluster - before: clusterVtxs.size()=" << clusterVtxs.size() << ", inputVtxs.size()=" << inputVtxs.size());
485
486 std::vector<std::unique_ptr<xAOD::Vertex>>::iterator vit = inputVtxs.begin();
487
488 while(vit != inputVtxs.end()) {
489 bool pass = false;
490
491 for(std::vector<std::unique_ptr<xAOD::Vertex>>::const_iterator cit = clusterVtxs.begin(); cit != clusterVtxs.end(); ++cit) {
492 if(vit->get() == cit->get()) {
493 ATH_MSG_DEBUG("makeVertexCluster - logic error - found the same vertex twice: " << ((*vit).get()));
494 continue;
495 }
496
497 const double vdist = getDistance((*vit)->position(), (*cit)->position());
498
499 ATH_MSG_DEBUG("makeVertexCluster - vdist=" << vdist );
500
501 if(vdist < m_mergeMinVtxDist) {
502 pass = true;
503 break;
504 }
505 }
506
507 if(pass) {
508 clusterVtxs.push_back(std::move(*vit));
509 inputVtxs.erase(vit);
510
511 vit = inputVtxs.begin();
512 }
513 else {
514 ++vit;
515 }
516 }
517
518 ATH_MSG_DEBUG("makeVertexCluster - after: clusterVtxs.size()=" << clusterVtxs.size() << ", inputVtxs.size()=" << inputVtxs.size());
519}
520
521//=============================================================================
523 std::vector<std::unique_ptr<xAOD::Vertex>> &vtxs,
524 std::vector<int> &indexVector,
525 std::vector<ElementLink<xAOD::VertexContainer> > &svLinks,
526 xAOD::VertexContainer &SVContainer,
527 std::set< xAOD::Vertex* >& svSet
528)
529{
530 //
531 // Record created xAOD::Vertex in output vertex container
532 //
533 ATH_MSG_DEBUG("saveSecondaryVertices - will save " << vtxs.size() << " vertexes");
534
535 for(std::unique_ptr<xAOD::Vertex> &vtx: vtxs) {
536 int index = -99;
537 if(getVar(vtx, index, "SecondaryVertexIndex")) {
538 indexVector.push_back(index);
539 }
540 else {
541 ATH_MSG_WARNING("saveSecondaryVertices - missing \"SecondaryVertexIndex\" variable");
542 }
543
544 if(svSet.insert(vtx.get()).second) {
545 //
546 // First time seeing this this vertex - record it in output container
547 //
548 SVContainer.push_back(std::move(vtx));
549 ElementLink<xAOD::VertexContainer> svLink(SVContainer,SVContainer.size()-1);
550 svLinks.push_back(svLink);
551 } else {
552 ATH_MSG_ERROR("saveSecondaryVertices --- the same vertex has been encountered more than once! Is this a logic error?");
553 }
554 }
555
556 ATH_MSG_DEBUG("saveSecondaryVertices - all done");
557}
558
559
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Some common helper functions used by decoration handles.
Handle class for adding a decoration to an object.
size_t size() const
Number of registered mappings.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< std::string > m_linkNameRefittedPriVtxWithoutLepton
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameIndexVector
SG::WriteHandleKey< xAOD::VertexContainer > m_svContainerName
virtual StatusCode execute() override
Execute method without EventContext (deprecated).
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameIndexVectorDeepMerge
void saveSecondaryVertices(std::vector< std::unique_ptr< xAOD::Vertex > > &vtxs, std::vector< int > &indexVector, std::vector< ElementLink< xAOD::VertexContainer > > &svLinks, xAOD::VertexContainer &SVContainer, std::set< xAOD::Vertex * > &svSet)
ToolHandle< Prompt::IVertexMergingTool > m_vertexMerger
ToolHandle< Prompt::VertexFittingTool > m_vertexFitterTool
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameSecVtxLinks
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainerName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inDetTracksKey
bool passMuonCand(const xAOD::Muon &muon) const
SG::ReadHandleKey< xAOD::IParticleContainer > m_leptonContainerKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoratorNameDeepMergedSecVtxLinks
void makeVertexCluster(std::vector< std::unique_ptr< xAOD::Vertex > > &clusterVtxs, std::vector< std::unique_ptr< xAOD::Vertex > > &inputVtxs)
bool passElecCand(const xAOD::Electron &elec) const
std::vector< const xAOD::TrackParticle * > findNearbyTracks(const xAOD::TrackParticle &tracklep, const xAOD::TrackParticleContainer &inDetTracks, const xAOD::Vertex &priVtx) const
Gaudi::Property< std::string > m_refittedVertexTypeName
NonPromptLeptonVertexingAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec(const EventContext &ctx, const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
SG::ReadHandleKey< xAOD::VertexContainer > m_refittedPriVtxContainerName
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition Egamma_v1.cxx:66
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition Egamma_v1.cxx:71
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition Egamma_v1.cxx:76
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Class providing the definition of the 4-vector interface.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float z() const
Returns the z position.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
bool GetAuxVar(const T1 &obj, T2 &value, const std::string &var_name)
Definition PromptUtils.h:83
std::string PrintResetStopWatch(TStopwatch &watch)
std::string truthAsStr(const xAOD::IParticle &particle)
bool getVar(T1 &obj, T2 &value, const std::string &var_name)
Definition PromptUtils.h:62
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
Definition index.py:1
STL namespace.
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
@ PriVtx
Primary vertex.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version:
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Electron_v1 Electron
Definition of the current "egamma version".
const xAOD::Vertex * refittedPriVtxWithoutLep
const xAOD::Vertex * refittedPriVtx
const xAOD::Vertex * priVtx