ATLAS Offline Software
NonPromptLeptonVertexingAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 
21 using namespace std;
22 
23 //======================================================================================================
24 Prompt::NonPromptLeptonVertexingAlg::NonPromptLeptonVertexingAlg(const std::string& name, ISvcLocator *pSvcLocator):
25  AthAlgorithm (name, pSvcLocator),
26  m_countEvents (0)
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());
55  ATH_CHECK(m_primaryVertexContainerName.initialize());
56  ATH_CHECK(m_refittedPriVtxContainerName.initialize());
57 
58  ATH_CHECK(m_svContainerName.initialize());
59 
60  m_decoratorNameIndexVectorDeepMerge = SG::decorKeyFromKey(m_decoratorNameIndexVector.key()) + "DeepMerge";
61  ATH_CHECK(m_decoratorNameIndexVector.initialize());
62  ATH_CHECK(m_decoratorNameIndexVectorDeepMerge.initialize());
63  ATH_CHECK(m_decoratorNameSecVtxLinks.initialize());
64  ATH_CHECK(m_decoratorNameDeepMergedSecVtxLinks.initialize());
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  //
112  TimerScopeHelper timer(m_timerExec);
113 
114  const EventContext& ctx = Gaudi::Hive::currentContext();
115 
116  m_countEvents++;
117 
118  //
119  // Find Inner Detector tracks save them class member variable for convenience.
120  //
121  SG::ReadHandle<xAOD::TrackParticleContainer> h_inDetTracks(m_inDetTracksKey, ctx);
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 
134  SG::WriteHandle<xAOD::VertexContainer> h_SVContainer (m_svContainerName, ctx);
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  //
143  SG::ReadHandle<xAOD::IParticleContainer> leptonContainer (m_leptonContainerKey, ctx);
144  SG::ReadHandle<xAOD::VertexContainer> vertices (m_primaryVertexContainerName, ctx);
145  SG::ReadHandle<xAOD::VertexContainer> refittedVertices(m_refittedPriVtxContainerName, ctx);
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) && muon->inDetTrackParticleLink().isValid()) {
220  tracklep = *(muon->inDetTrackParticleLink());
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->inDetTrackParticleLink() 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  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  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  const bool combined = (muon.muonType() == xAOD::Muon::Combined);
354 
355  ATH_MSG_DEBUG("NonPromptLeptonVertexingAlg::passMuonCand - "
356  << "pT=" << muon.pt() << ", eta=" << muon.eta() << ", phi=" << muon.phi() << std::endl
357  << " Type = " << muon.muonType() << std::endl
358  << " Combined = " << combined << std::endl
359  << " " << truthAsStr(muon));
360 
361  return combined;
362 }
363 
364 //=============================================================================
365 std::vector<const xAOD::TrackParticle*> Prompt::NonPromptLeptonVertexingAlg::findNearbyTracks(
366  const xAOD::TrackParticle &tracklep,
367  const xAOD::TrackParticleContainer &inDetTracks,
368  const xAOD::Vertex &priVtx
369 ) const {
370  //
371  // Select tracks -- avoid using track selection tool since z0 definition is different
372  //
373  std::vector<const xAOD::TrackParticle *> mytracks;
374 
375  for(const xAOD::TrackParticle *track: inDetTracks) {
376  if(!track) {
377  ATH_MSG_WARNING("skip null track pointer - should never happen");
378  continue;
379  }
380 
381  //
382  // Check minimum track and lepton DR: skip the track that is probably the lepton track
383  //
384  if(tracklep.p4().DeltaR(track->p4()) < m_minTrackLeptonDR) {
385  ATH_MSG_DEBUG("skip the track very close to the lepton ");
386  continue;
387  }
388 
389  //
390  // Check track and lepton maximum DR
391  //
392  if(tracklep.p4().DeltaR(track->p4()) > m_maxTrackLeptonDR) {
393  continue;
394  }
395 
396  const double delta_z0 = track->z0() + track->vz() - priVtx.z();
397  const double Z0Sin = std::abs(delta_z0*std::sin(track->theta()));
398  const double abs_eta = std::abs(track->eta());
399 
406 
407  if(!(track->summaryValue(numberOfPixelHits, xAOD::numberOfPixelHits))) continue;
408  if(!(track->summaryValue(numberOfSCTHits, xAOD::numberOfSCTHits))) continue;
409  if(!(track->summaryValue(numberOfPixelHoles, xAOD::numberOfPixelHoles))) continue;
410  if(!(track->summaryValue(numberOfSCTHoles, xAOD::numberOfSCTHoles))) continue;
411  if(!(track->summaryValue(numberOfPixelSharedHits, xAOD::numberOfPixelSharedHits))) continue;
412  if(!(track->summaryValue(numberOfSCTSharedHits, xAOD::numberOfSCTSharedHits))) continue;
413 
414  const uint8_t NSiHits = numberOfPixelHits + numberOfSCTHits;
415  const uint8_t NSiHoles = numberOfPixelHoles + numberOfSCTHoles;
416  const float NSiShHits = float(numberOfPixelSharedHits) + float(numberOfSCTSharedHits)/2.0;
417 
418  if(m_selectTracks) {
419  //
420  // Kinematic track selection
421  //
422  if(track->pt() < m_minTrackpT) continue;
423  if(abs_eta > m_maxTrackEta) continue;
424  if(Z0Sin > m_maxTrackZ0Sin) continue;
425 
426  //
427  // Hit quality track selection
428  //
429  if(NSiHits < m_minTrackSiHits) continue;
430  if(NSiShHits > m_maxTrackSharedSiHits) continue;
431  if(NSiHoles > m_maxTrackSiHoles ) continue;
432  if(numberOfPixelHoles > m_maxTrackPixHoles ) continue;
433  }
434 
435  mytracks.push_back(track);
436  }
437 
438  return mytracks;
439 }
440 
441 //=============================================================================
442 std::vector<std::unique_ptr<xAOD::Vertex>> Prompt::NonPromptLeptonVertexingAlg::prepLepWithTwoTrkSVVec(
443  const FittingInput &input,
444  const xAOD::TrackParticle* tracklep,
445  const std::vector<const xAOD::TrackParticle*> &tracks
446 )
447 {
448  //
449  // Decorate lepton with vector of two-track vertices.
450  // Return vector of finding vertices
451  //
452  std::vector<std::unique_ptr<xAOD::Vertex>> twoTrkVertices;
453  std::vector<const xAOD::TrackParticle*> tracksForFit;
454 
455  if(!input.priVtx) {
456  ATH_MSG_WARNING("prepLepWithTwoTrkSVVec -- invalid primary vertex: nothing to do");
457  return twoTrkVertices;
458  }
459 
460  for(const xAOD::TrackParticle *selectedtrack: tracks) {
461  tracksForFit.clear();
462  tracksForFit.push_back(tracklep);
463  tracksForFit.push_back(selectedtrack);
464 
465  std::unique_ptr<xAOD::Vertex> newSecondaryVertex = m_vertexFitterTool->fitVertexWithPrimarySeed(
466  input, tracksForFit, kTwoTrackVtx
467  );
468 
469  if(!newSecondaryVertex) {
470  ATH_MSG_DEBUG("prepLepWithTwoTrkSVVec -- failed to fit 2-track vertex");
471  continue;
472  }
473 
474  twoTrkVertices.push_back(std::move(newSecondaryVertex));
475  }
476 
477  return twoTrkVertices;
478 }
479 
480 //=============================================================================
482  std::vector<std::unique_ptr<xAOD::Vertex>> &clusterVtxs,
483  std::vector<std::unique_ptr<xAOD::Vertex>> &inputVtxs
484 )
485 {
486  ATH_MSG_DEBUG("makeVertexCluster - before: clusterVtxs.size()=" << clusterVtxs.size() << ", inputVtxs.size()=" << inputVtxs.size());
487 
488  std::vector<std::unique_ptr<xAOD::Vertex>>::iterator vit = inputVtxs.begin();
489 
490  while(vit != inputVtxs.end()) {
491  bool pass = false;
492 
493  for(std::vector<std::unique_ptr<xAOD::Vertex>>::const_iterator cit = clusterVtxs.begin(); cit != clusterVtxs.end(); ++cit) {
494  if(vit->get() == cit->get()) {
495  ATH_MSG_DEBUG("makeVertexCluster - logic error - found the same vertex twice: " << ((*vit).get()));
496  continue;
497  }
498 
499  const double vdist = getDistance((*vit)->position(), (*cit)->position());
500 
501  ATH_MSG_DEBUG("makeVertexCluster - vdist=" << vdist );
502 
503  if(vdist < m_mergeMinVtxDist) {
504  pass = true;
505  break;
506  }
507  }
508 
509  if(pass) {
510  clusterVtxs.push_back(std::move(*vit));
511  inputVtxs.erase(vit);
512 
513  vit = inputVtxs.begin();
514  }
515  else {
516  ++vit;
517  }
518  }
519 
520  ATH_MSG_DEBUG("makeVertexCluster - after: clusterVtxs.size()=" << clusterVtxs.size() << ", inputVtxs.size()=" << inputVtxs.size());
521 }
522 
523 //=============================================================================
525  std::vector<std::unique_ptr<xAOD::Vertex>> &vtxs,
526  std::vector<int> &indexVector,
527  std::vector<ElementLink<xAOD::VertexContainer> > &svLinks,
528  xAOD::VertexContainer &SVContainer,
529  std::set< xAOD::Vertex* >& svSet
530 )
531 {
532  //
533  // Record created xAOD::Vertex in output vertex container
534  //
535  ATH_MSG_DEBUG("saveSecondaryVertices - will save " << vtxs.size() << " vertexes");
536 
537  for(std::unique_ptr<xAOD::Vertex> &vtx: vtxs) {
538  int index = -99;
539  if(getVar(vtx, index, "SecondaryVertexIndex")) {
540  indexVector.push_back(index);
541  }
542  else {
543  ATH_MSG_WARNING("saveSecondaryVertices - missing \"SecondaryVertexIndex\" variable");
544  }
545 
546  if(svSet.insert(vtx.get()).second) {
547  //
548  // First time seeing this this vertex - record it in output container
549  //
550  SVContainer.push_back(std::move(vtx));
551  ElementLink<xAOD::VertexContainer> svLink(SVContainer,SVContainer.size()-1);
552  svLinks.push_back(svLink);
553  } else {
554  ATH_MSG_ERROR("saveSecondaryVertices --- the same vertex has been encountered more than once! Is this a logic error?");
555  }
556  }
557 
558  ATH_MSG_DEBUG("saveSecondaryVertices - all done");
559 }
560 
561 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:74
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:262
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
PromptUtils.h
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
Prompt::FittingInput::refittedPriVtxWithoutLep
const xAOD::Vertex * refittedPriVtxWithoutLep
Definition: IVertexFittingTool.h:73
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:273
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
Prompt::GetAuxVar
bool GetAuxVar(const T1 &obj, T2 &value, const std::string &var_name)
Definition: PromptUtils.h:93
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
Prompt::getVar
bool getVar(T1 &obj, T2 &value, const std::string &var_name)
Definition: PromptUtils.h:72
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:260
xAOD::Electron_v1::trackParticle
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Definition: Electron_v1.cxx:55
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
Prompt::FittingInput
Definition: IVertexFittingTool.h:60
Prompt::NonPromptLeptonVertexingAlg::prepLepWithTwoTrkSVVec
std::vector< std::unique_ptr< xAOD::Vertex > > prepLepWithTwoTrkSVVec(const FittingInput &input, const xAOD::TrackParticle *tracklep, const std::vector< const xAOD::TrackParticle * > &tracks)
Definition: NonPromptLeptonVertexingAlg.cxx:442
Prompt::NonPromptLeptonVertexingAlg::initialize
virtual StatusCode initialize() override
Definition: NonPromptLeptonVertexingAlg.cxx:30
Prompt::PrintResetStopWatch
std::string PrintResetStopWatch(TStopwatch &watch)
Definition: PromptUtils.cxx:244
DecorKeyHelpers.h
Some common helper functions used by decoration handles.
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:85
Prompt::Def::Z0Sin
@ Z0Sin
Definition: VarHolder.h:86
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Prompt::MergeResultNotOwner::vtxsInitPassedNotMerged
std::vector< std::unique_ptr< xAOD::Vertex > > vtxsInitPassedNotMerged
Definition: PhysicsAnalysis/AnalysisCommon/LeptonTaggers/LeptonTaggers/IVertexMergingTool.h:73
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:130
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:263
EgammaxAODHelpers.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Prompt::getDistance
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
Definition: PromptUtils.cxx:41
Prompt::NonPromptLeptonVertexingAlg::passElecCand
bool passElecCand(const xAOD::Electron &elec) const
Definition: NonPromptLeptonVertexingAlg.cxx:326
Prompt::FittingInput::priVtx
const xAOD::Vertex * priVtx
Definition: IVertexFittingTool.h:71
Prompt::NonPromptLeptonVertexingAlg::saveSecondaryVertices
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)
Definition: NonPromptLeptonVertexingAlg.cxx:524
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
WriteDecorHandle.h
Handle class for adding a decoration to an object.
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:572
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::Egamma_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition: Egamma_v1.cxx:75
NonPromptLeptonVertexingAlg.h
xAOD::Vertex_v1::z
float z() const
Returns the z position.
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:271
Prompt::NonPromptLeptonVertexingAlg::findNearbyTracks
std::vector< const xAOD::TrackParticle * > findNearbyTracks(const xAOD::TrackParticle &tracklep, const xAOD::TrackParticleContainer &inDetTracks, const xAOD::Vertex &priVtx) const
Definition: NonPromptLeptonVertexingAlg.cxx:365
SG::decorKeyFromKey
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
Definition: DecorKeyHelpers.cxx:42
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Prompt::FittingInput::refittedPriVtx
const xAOD::Vertex * refittedPriVtx
Definition: IVertexFittingTool.h:72
Prompt::NonPromptLeptonVertexingAlg::execute
virtual StatusCode execute() override
Definition: NonPromptLeptonVertexingAlg.cxx:107
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
Prompt::truthAsStr
std::string truthAsStr(const xAOD::IParticle &particle)
Definition: PromptUtils.cxx:213
Prompt::NonPromptLeptonVertexingAlg::finalize
virtual StatusCode finalize() override
Definition: NonPromptLeptonVertexingAlg.cxx:91
Prompt::NonPromptLeptonVertexingAlg::passMuonCand
bool passMuonCand(const xAOD::Muon &muon) const
Definition: NonPromptLeptonVertexingAlg.cxx:348
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF
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...
Definition: ElectronxAODHelpers.cxx:22
xAOD::Electron_v1
Definition: Electron_v1.h:34
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
Prompt::MergeResultNotOwner::vtxsNewMerged
std::vector< std::unique_ptr< xAOD::Vertex > > vtxsNewMerged
Definition: PhysicsAnalysis/AnalysisCommon/LeptonTaggers/LeptonTaggers/IVertexMergingTool.h:70
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:269
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
Prompt::NonPromptLeptonVertexingAlg::makeVertexCluster
void makeVertexCluster(std::vector< std::unique_ptr< xAOD::Vertex >> &clusterVtxs, std::vector< std::unique_ptr< xAOD::Vertex >> &inputVtxs)
Definition: NonPromptLeptonVertexingAlg.cxx:481
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Prompt::TimerScopeHelper
Definition: PromptUtils.h:112
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
VertexAuxContainer.h
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
Prompt::kTwoTrackVtx
@ kTwoTrackVtx
Definition: IVertexFittingTool.h:59
Prompt::NonPromptLeptonVertexingAlg::NonPromptLeptonVertexingAlg
NonPromptLeptonVertexingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: NonPromptLeptonVertexingAlg.cxx:24
Prompt::MergeResultNotOwner
Definition: PhysicsAnalysis/AnalysisCommon/LeptonTaggers/LeptonTaggers/IVertexMergingTool.h:69