ATLAS Offline Software
BPhysTrackVertexMapTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // system include:
6 #include <format>
7 #include "boost/tokenizer.hpp"
8 
9 // EDM includes:
12 
13 // Local include(s):
15 
16 namespace xAOD {
17 
18  //--------------------------------------------------------------------------
19  // Static utility method to prefix every line by a certain string
20  //--------------------------------------------------------------------------
21  std::string BPhysTrackVertexMapTool::wrapLines(const std::string& lines,
22  const std::string& prefix) {
23 
24  std::string ostr;
25  std::istringstream stream(lines);
26  std::string line;
27  while ( std::getline(stream, line) ) {
28  if ( !ostr.empty() ) ostr += "\n";
29  ostr += prefix + line;
30  }
31  return ostr;
32  }
33  //--------------------------------------------------------------------------
34  // Constructor
35  //--------------------------------------------------------------------------
37  : asg::AsgTool( name ),
38  m_tracks(NULL), m_tracksAux(NULL), m_pvtxContainer(NULL),
39  m_svtxContainer(NULL), m_svtxAuxContainer(NULL), m_refPVContainer(NULL),
40  m_refPVAuxContainer(NULL),
41  m_nEvtsSeen (0), m_cachedRun(-1), m_cachedEvent(-1) {
42 
43 #ifdef ASGTOOL_ATHENA
44  declareInterface< IBPhysTrackVertexMapTool >( this );
45 #endif // ASGTOOL_ATHENA
46 
47  // Necessary containers
48  declareProperty("VertexContainerName", m_vertexContainerName);
49  declareProperty("TrackParticleContainerName",
50  m_trackParticleContainerName="InDetTrackParticles");
51  declareProperty("PVContainerName", m_pvContainerName = "PrimaryVertices");
52  declareProperty("RefPVContainerName", m_refPVContainerName);
53 
54  // Maximum number of events to dump maps to log file for
55  declareProperty("DebugTrkToVtxMaxEvents", m_debugTrkToVtxMaxEvents = 0);
56 
57  // Prefix for log dump lines
58  declareProperty("DumpPrefix", m_dumpPrefix="TTV> ");
59 
60  // Hypothesis name (for mass value pickup)
61  declareProperty("HypoName", m_hypoName="__NONE__");
62  }
63  //--------------------------------------------------------------------------
65 
66  // Greet the user:
67  ATH_MSG_DEBUG( "Initializing xAOD::BPhysTrackVertexMapTool" );
68 
69  if ( m_vertexContainerName == "" ) {
70  ATH_MSG_ERROR("No vertex container name provided!");
71  }
72  if ( m_refPVContainerName == "" ) {
73  ATH_MSG_ERROR("No refitted PV container name provided!");
74  }
75  if ( m_trackParticleContainerName == "" ) {
76  ATH_MSG_ERROR("No track particle container name provided!");
77  }
78  if ( m_pvContainerName == "" ) {
79  ATH_MSG_ERROR("No PV container name provided!");
80  }
81  // some info for the job log
82  ATH_MSG_INFO("VertexContainerName : " << m_vertexContainerName);
83  ATH_MSG_INFO("PVContainerName : " << m_pvContainerName);
84  ATH_MSG_INFO("RefPVContainerName : " << m_refPVContainerName);
85  ATH_MSG_INFO("TrackParticleContainerName : "
87  ATH_MSG_INFO("DebugTrkToVtxMaxEvents : " << m_debugTrkToVtxMaxEvents);
88  ATH_MSG_INFO("DumpPrefix : " << m_dumpPrefix);
89  ATH_MSG_INFO("HypoName : " << m_hypoName);
90 
91  // Return gracefully:
92  return StatusCode::SUCCESS;
93  }
94  //--------------------------------------------------------------------------
96 
97  ATH_MSG_DEBUG( "Finalizing xAOD::BPhysTrackVertexMapTool" );
98 
99  // Return gracefully:
100  return StatusCode::SUCCESS;
101  }
102  //--------------------------------------------------------------------------
104 
105  ATH_MSG_DEBUG( "logEvent in xAOD::BPhysTrackVertexMapTool" );
106 
107  // read info into maps cache
109 
110  // dump info from maps if requested
111  if ( doLog() ) {
112 
113  ATH_MSG_INFO("Track-to-vertex association map:");
114 
115  std::cout << summaryToString(m_dumpPrefix) << std::endl;
116 
117  } // if requested
118 
119  // increment counter
120  m_nEvtsSeen++;
121 
122  // Return gracefully:
123  return StatusCode::SUCCESS;
124  }
125  //--------------------------------------------------------------------------
127 
128  return ( m_debugTrkToVtxMaxEvents < 0 ||
130  }
131  //--------------------------------------------------------------------------
132  //
133  // Cache maps for current event.
134  //
135  // Call this once per event.
136  // Repeated calls for the same run/event are not updating the cache again.
137  //
138  //--------------------------------------------------------------------------
140 
141  ATH_MSG_DEBUG("BPhysTrackVertexMapTool::cacheEvent -- begin");
142 
143  const xAOD::EventInfo* eventInfo = NULL;
144  ATH_CHECK(evtStore()->retrieve(eventInfo, "EventInfo"));
145 
146  if ( m_cachedRun != (int)eventInfo->runNumber() ||
147  m_cachedEvent != (int)eventInfo->eventNumber() ) {
148 
149  // note update
150  m_cachedRun = eventInfo->runNumber();
151  m_cachedEvent = eventInfo->eventNumber();
152 
153  ATH_MSG_DEBUG("BPhysTrackVertexMapTool::cacheEvent: caching now: "
154  << "run " << m_cachedRun << " event " << m_cachedEvent);
155 
156  // retrieve primary vertices container
157  m_pvtxContainer = NULL;
159  ATH_MSG_DEBUG("Found PV collection with key " << m_pvContainerName);
160 
161  // retrieve ID track container
162  m_tracks = NULL;
163  m_tracksAux = NULL;
165  if (evtStore()->contains<xAOD::
169  } else {
170  ATH_MSG_DEBUG("No aux track collection with key "
171  << m_trackParticleContainerName+"Aux.");
172  }
173  ATH_MSG_DEBUG("Found track collection with key "
175 
176  // vertex container and its auxilliary store
177  m_svtxContainer = NULL;
178  m_svtxAuxContainer = NULL;
181  m_vertexContainerName+"Aux."));
182  ATH_MSG_DEBUG("Found SV collection with key " << m_vertexContainerName);
183 
184  // refitted primary vertex container and its auxilliary store
185  m_refPVContainer = NULL;
186  m_refPVAuxContainer = NULL;
189  m_refPVContainerName+"Aux."));
190  ATH_MSG_DEBUG("Found refitted PV collection with key "
192 
193  // initialize track, PV and refPV maps
196  } // if new run/event
197 
198  ATH_MSG_DEBUG("BPhysTrackVertexMapTool::cacheEvent -- end");
199 
200  // Return gracefully:
201  return StatusCode::SUCCESS;
202  }
203  //--------------------------------------------------------------------------
204  //
205  // Retrieve primary vertices for ID track from map.
206  //
207  //--------------------------------------------------------------------------
208  std::vector<const xAOD::Vertex*>
210  const {
211 
212  TrackToVertexMap_t::const_iterator it = m_idTrackToPVMap.find(track);
213 
214  if ( it != m_idTrackToPVMap.end() ) {
215  return it->second;
216  } else {
217  std::vector<const xAOD::Vertex*> dummy;
218  return dummy;
219  }
220  }
221  //--------------------------------------------------------------------------
222  //
223  // Retrieve refitted primary vertices for ID track from map.
224  //
225  //--------------------------------------------------------------------------
226  std::vector<const xAOD::Vertex*>
228  const {
229 
230  TrackToVertexMap_t::const_iterator it = m_idTrackToRefPVMap.find(track);
231 
232  if ( it != m_idTrackToRefPVMap.end() ) {
233  return it->second;
234  } else {
235  std::vector<const xAOD::Vertex*> dummy;
236  return dummy;
237  }
238  }
239  //--------------------------------------------------------------------------
240  //
241  // Retrieve secondary vertices for ID track from map.
242  //
243  //--------------------------------------------------------------------------
244  std::vector<const xAOD::Vertex*>
246  const {
247 
248  TrackToVertexMap_t::const_iterator it = m_idTrackToSVMap.find(track);
249 
250  if ( it != m_idTrackToSVMap.end() ) {
251  return it->second;
252  } else {
253  std::vector<const xAOD::Vertex*> dummy;
254  return dummy;
255  }
256  }
257  //--------------------------------------------------------------------------
258  //
259  // Initialize ID tracks, PV and refPV related maps.
260  //
261  //--------------------------------------------------------------------------
264  const xAOD::VertexContainer* pvc,
265  const xAOD::VertexContainer* rpvc,
266  const xAOD::VertexContainer* svc) {
267 
268  // clear previous entries
269  m_pvNameMap.clear();
270  m_refPVNameMap.clear();
271  m_svNameMap.clear();
272  m_idTrackNameMap.clear();
273  m_idTrackToPVMap.clear();
274  m_idTrackToRefPVMap.clear();
275  m_idTrackToSVMap.clear();
276 
277  // initialize maps for PVs
278  for (xAOD::VertexContainer::const_iterator vtxItr = pvc->begin();
279  vtxItr != pvc->end(); ++vtxItr) {
280  const xAOD::Vertex* vtx = *vtxItr;
281  pvName(vtx);
282  for (size_t i = 0; i < vtx->nTrackParticles(); ++i) {
283  const xAOD::TrackParticle* track = vtx->trackParticle(i);
284  // m_idTrackToPVMap[track] = vtx;
285  addVertexToTrackVertexMap(m_idTrackToPVMap, track, vtx);
286  }
287  }
288  // initialize maps for refitted PVs
289  for (xAOD::VertexContainer::const_iterator vtxItr = rpvc->begin();
290  vtxItr != rpvc->end(); ++vtxItr) {
291  const xAOD::Vertex* vtx = *vtxItr;
292  refPVName(vtx);
293  for (size_t i = 0; i < vtx->nTrackParticles(); ++i) {
294  const xAOD::TrackParticle* track = vtx->trackParticle(i);
295  // m_idTrackToRefPVMap[track] = vtx;
296  addVertexToTrackVertexMap(m_idTrackToRefPVMap, track, vtx);
297  }
298  }
299 
300  // initialize maps for SVs
301  for (xAOD::VertexContainer::const_iterator vtxItr = svc->begin();
302  vtxItr != svc->end(); ++vtxItr) {
303  const xAOD::Vertex* vtx = *vtxItr;
304  svName(vtx);
305  for (size_t i = 0; i < vtx->nTrackParticles(); ++i) {
306  const xAOD::TrackParticle* track = vtx->trackParticle(i);
307  // m_idTrackToSVMap[track] = vtx;
308  addVertexToTrackVertexMap(m_idTrackToSVMap, track, vtx);
309  }
310  }
311  // initialize maps for ID tracks
313  trkItr != tpc->end(); ++trkItr) {
314  const xAOD::TrackParticle* track = *trkItr;
315  idTrackName(track);
316  }
317  }
318  //--------------------------------------------------------------------------
319  //
320  // Add vertex to track-to-vertex map with vector of vertices.
321  //
322  //--------------------------------------------------------------------------
325  const xAOD::TrackParticle* track,
326  const xAOD::Vertex* vtx) {
327 
328  TrackToVertexMap_t::const_iterator it = map.find(track);
329 
330  if ( it == map.end() ) {
331  map[track] = std::vector<const xAOD::Vertex*>();
332  }
333  map[track].push_back(vtx);
334  }
335  //--------------------------------------------------------------------------
336  // Lookup name for PV -- add as next if not yet known
337  //--------------------------------------------------------------------------
339 
340  if ( m_pvNameMap.find(vtx) == m_pvNameMap.end() ) {
341  std::string f = std::format("PV{:03d}", m_pvNameMap.size());
342  m_pvNameMap[vtx] = f;
343  }
344  return m_pvNameMap[vtx];
345  }
346  //--------------------------------------------------------------------------
347  // Lookup name for refitted PV -- add as next if not yet known
348  //--------------------------------------------------------------------------
350 
351  if ( m_refPVNameMap.find(vtx) == m_refPVNameMap.end() ) {
352  std::string f = std::format("RV{:03d}", m_refPVNameMap.size());
353  m_refPVNameMap[vtx] = f;
354  }
355  return m_refPVNameMap[vtx];
356  }
357  //--------------------------------------------------------------------------
358  // Lookup name for SV -- add as next if not yet known
359  //--------------------------------------------------------------------------
361 
362  if ( m_svNameMap.find(vtx) == m_svNameMap.end() ) {
363  std::string f = std::format("SV{:03d}", m_svNameMap.size());
364  m_svNameMap[vtx] = f;
365  }
366  return m_svNameMap[vtx];
367  }
368  //--------------------------------------------------------------------------
369  // Lookup name for ID track -- add as next if not yet known
370  //--------------------------------------------------------------------------
371  std::string
373 
374  if ( m_idTrackNameMap.find(track) == m_idTrackNameMap.end() ) {
375  std::string f = std::format("T{:04d}", m_idTrackNameMap.size());
377  }
378  return m_idTrackNameMap[track];
379  }
380  //--------------------------------------------------------------------------
381  // Print Track information to string -- optionally adding PVs or refPVs
382  //--------------------------------------------------------------------------
383  std::string
385  unsigned int indent,
386  bool withPV, bool withRefPV,
387  bool withSV) {
388 
389  std::string sind(indent, ' ');
390  std::string str = std::format("{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) VL ",
391  sind, idTrackName(track), static_cast<const void*>(track),
392  track->pt(),track->eta(), track->phi());
393  if ( withPV ) {
395  if ( it != m_idTrackToPVMap.end() ) {
396  for ( auto vtx : it->second ) {
397  str += "\n" + pvToString(vtx, indent+2, false);
398  }
399  } else {
400  std::string f = std::format("\n{} {}", sind, "NOPV");
401  str += f;
402 
403  }
404  }
405  if ( withRefPV ) {
407  if ( it != m_idTrackToRefPVMap.end() ) {
408  for ( auto vtx : it->second ) {
409  str += "\n" + refPVToString(vtx, indent+2, false);
410  }
411  } else {
412  std::string f = std::format("\n{} {}", sind, "NORV");
413  str += f;
414  }
415  }
416  if ( withSV ) {
418  if ( it != m_idTrackToSVMap.end() ) {
419  for ( auto vtx : it->second ) {
420  str += "\n" + svToString(vtx, indent+2, false);
421  }
422  } else {
423  std::string f2 = std::format("\n{} {}", sind, "NOSV");
424  str += f2;
425  }
426  }
427  return str;
428  }
429  //--------------------------------------------------------------------------
430  // Print PV information to string -- optionally adding tracks
431  //--------------------------------------------------------------------------
432  std::string
434  unsigned int indent,
435  bool withTracks) {
436 
437  std::string sind(indent, ' ');
438  std::string str = std::format("{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) NT {:4d} VT {}",
439  sind, pvName(vtx), static_cast<const void*>(vtx), vtx->x(), vtx->y(), vtx->z(),
440  vtx->nTrackParticles(), static_cast<int>(vtx->vertexType()));
441  if ( withTracks ) {
442  for (size_t i=0; i < vtx->nTrackParticles(); ++i) {
443  std::string f2 = std::format("\n{} {:4d} {}",
444  sind, i, idTrackToString(vtx->trackParticle(i), 0, false, false));
445  str += f2;
446  } // for
447  }
448 
449  return str;
450  }
451  //--------------------------------------------------------------------------
452  // Print refitted PV information to string -- optionally adding tracks
453  //--------------------------------------------------------------------------
454  std::string
456  unsigned int indent,
457  bool withTracks) {
458 
459  std::string sind(indent, ' ');
460  std::string str = std::format("{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) NT {:4d} VT {}",
461  sind,refPVName(vtx), static_cast<const void*>(vtx), vtx->x(), vtx->y(), vtx->z(),
462  vtx->nTrackParticles(), static_cast<int>(vtx->vertexType()));
463  if ( withTracks ) {
464  for (size_t i=0; i < vtx->nTrackParticles(); ++i) {
465  str += std::format("\n{} {:4} {}", sind, i, idTrackToString(vtx->trackParticle(i), 0, false, false));
466  } // for
467  }
468 
469  return str;
470  }
471  //--------------------------------------------------------------------------
472  // Print SV information to string -- optionally adding tracks
473  //--------------------------------------------------------------------------
474  std::string
476  unsigned int indent,
477  bool withTracks,
478  bool withMasses) {
479 
480  std::string sind(indent, ' ');
481  std::string str = std::format("{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) NT {:4} VT {}",
482  sind, svName(vtx), static_cast<const void*>(vtx), vtx->x(), vtx->y(), vtx->z(),
483  vtx->nTrackParticles(), static_cast<int>(vtx->vertexType()));
484  if ( withMasses && m_hypoName != "__NONE__" ) {
485  // vector of possible hypo names
486  std::vector<std::string> hypoNames = getTokens(m_hypoName, "|;/");
487  for ( const std::string& hypoName : hypoNames ) {
488  BPhysHypoHelper bhh(hypoName, vtx);
489  float bMass = bhh.mass();
490  float bMassErr = bhh.massErr();
491  float bMucMass = getFloat(hypoName+"_MUCALC_mass", vtx);
492  float bMucMassErr = getFloat(hypoName+"_MUCALC_massErr", vtx);
493  if ( bMass > 0. || bMassErr > 0.
494  || bMucMass > 0. || bMucMassErr > 0. ) {
495  str += std::format("\n{} {:<10} : mass : ({:15.4f} +/- {:15.4f}) MeV",
496  sind, hypoName, bMass, bMassErr);
497  str += std::format("\n{} {:<10} : m(MUCALC): ({:15.4f} +/- {:15.4f}) MeV",
498  sind, hypoName, bMucMass, bMucMassErr);
499  } // if one > 0.
500  } // for hypoNames
501  } // if withMasses
502  if ( withTracks ) {
503  for (size_t i=0; i < vtx->nTrackParticles(); ++i) {
504  str += std::format("\n{} {:4} {}", sind, i, idTrackToString(vtx->trackParticle(i), 0, false, false));
505  } // for
506  }
507  return str;
508  }
509  //--------------------------------------------------------------------------
510  // Print track container information to string
511  // -- optionally adding PVs and refitted PVs
512  //--------------------------------------------------------------------------
513  std::string
515  tpc,
516  unsigned int indent,
517  bool withPV,
518  bool withRefPV,
519  bool withSV) {
520 
521  std::string str;
522  std::string sind(indent, ' ');
523  str += sind + "ID tracks: (" + std::to_string(tpc->size()) + ")\n";
524  str += sind + std::string(80-indent, '-');
525  // loop over ID tracks
527  trkItr != tpc->end(); ++trkItr) {
528  const xAOD::TrackParticle* track = *trkItr;
529  str += "\n"
530  + idTrackToString(track, indent+2, withPV, withRefPV, withSV);
531  }
532  return str;
533  }
534  //--------------------------------------------------------------------------
535  // Print PV container information to string -- optionally adding tracks
536  //--------------------------------------------------------------------------
537  std::string
539  unsigned int indent,
540  bool withTracks) {
541 
542  std::string str;
543  std::string sind(indent, ' ');
544  str += sind + "Primary vertices: (" + std::to_string(pvc->size()) + ")\n";
545  str += sind + std::string(80-indent, '-');
546  for (xAOD::VertexContainer::const_iterator vtxItr = pvc->begin();
547  vtxItr != pvc->end(); ++vtxItr) {
548  const xAOD::Vertex* vtx = *vtxItr;
549  str += "\n" + pvToString(vtx, indent+2, withTracks);
550  } // for
551 
552  return str;
553  }
554  //--------------------------------------------------------------------------
555  // Print refitted PV container information to string
556  // -- optionally adding tracks
557  //--------------------------------------------------------------------------
558  std::string
560  unsigned int indent,
561  bool withTracks) {
562 
563  std::string str;
564  std::string sind(indent, ' ');
565  str += sind + "Refitted primary vertices: (" + std::to_string(rpvc->size()) + ")\n";
566  str += sind + std::string(80-indent, '-');
567  for (xAOD::VertexContainer::const_iterator vtxItr = rpvc->begin();
568  vtxItr != rpvc->end(); ++vtxItr) {
569  const xAOD::Vertex* vtx = *vtxItr;
570  str += "\n" + refPVToString(vtx, indent+2, withTracks);
571  } // for
572 
573  return str;
574  }
575  //--------------------------------------------------------------------------
576  // Print SV container information to string -- optionally adding tracks
577  //--------------------------------------------------------------------------
578  std::string
580  unsigned int indent,
581  bool withTracks,
582  bool withMasses) {
583 
584  std::string str;
585  std::string sind(indent, ' ');
586  str += sind + "Secondary vertices: (" + std::to_string(svc->size()) + ")\n";
587  str += sind + std::string(80-indent, '-');
588  for (xAOD::VertexContainer::const_iterator vtxItr = svc->begin();
589  vtxItr != svc->end(); ++vtxItr) {
590  const xAOD::Vertex* vtx = *vtxItr;
591  str += "\n" + svToString(vtx, indent+2, withTracks, withMasses);
592  } // for
593 
594  return str;
595  }
596  //--------------------------------------------------------------------------
597  // Print a summary of all maps to string -- optionally adding a prefix
598  //--------------------------------------------------------------------------
600 
601  std::string form_str = std::format("{}\n\nRun: {} Event: {}\n\n", name(), m_cachedRun, m_cachedEvent);
602  std::string dstr =
603  wrapLines("\n"+form_str +
604  pvsToString(m_pvtxContainer, 0, true) + "\n\n" +
605  refPVsToString(m_refPVContainer, 0, true) + "\n\n" +
606  svsToString(m_svtxContainer, 0, true, true) + "\n\n" +
607  idTracksToString(m_tracks, 0, true, true, true) + "\n",
608  prefix);
609 
610  return dstr;
611  }
612  //--------------------------------------------------------------------------
613  // Pick up a float from StoreGate.
614  //--------------------------------------------------------------------------
616  const xAOD::Vertex* b) {
617 
618  float res = -999999.;
619 
621  if ( floatAcc.isAvailable(*b) ) res = floatAcc(*b);
622 
623  return res;
624  }
625  //--------------------------------------------------------------------------
626  // Tokenize a string using certain separators
627  //--------------------------------------------------------------------------
628  std::vector<std::string> BPhysTrackVertexMapTool
629  ::getTokens(std::string input, std::string seperators) {
630 
631  std::vector<std::string> tokens;
632  boost::char_separator<char> sep(seperators.c_str());
633  typedef boost::tokenizer<boost::char_separator<char> > Tokenizer_t;
634  Tokenizer_t tokenizer(input, sep);
635  for (auto& token : tokenizer) {
636  tokens.push_back(token);
637  }
638  return tokens;
639  }
640  //--------------------------------------------------------------------------
641 } // namespace xAOD
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::BPhysTrackVertexMapTool::refPVToString
virtual std::string refPVToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:455
xAOD::BPhysTrackVertexMapTool::m_dumpPrefix
std::string m_dumpPrefix
Definition: BPhysTrackVertexMapTool.h:161
xAOD::BPhysTrackVertexMapTool::m_debugTrkToVtxMaxEvents
int m_debugTrkToVtxMaxEvents
Definition: BPhysTrackVertexMapTool.h:160
xAOD::Vertex_v1::x
float x() const
Returns the x position.
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
xAOD::BPhysTrackVertexMapTool::m_hypoName
std::string m_hypoName
Definition: BPhysTrackVertexMapTool.h:162
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::BPhysTrackVertexMapTool::finalize
virtual StatusCode finalize() override
Function finalizing the tool.
Definition: BPhysTrackVertexMapTool.cxx:95
xAOD::TrackParticleAuxContainer_v5
Temporary container used until we have I/O for AuxStoreInternal.
Definition: TrackParticleAuxContainer_v5.h:35
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
xAOD::BPhysTrackVertexMapTool::m_tracks
const xAOD::TrackParticleContainer * m_tracks
Definition: BPhysTrackVertexMapTool.h:165
xAOD::BPhysTrackVertexMapTool::pvToString
virtual std::string pvToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:433
xAOD::BPhysTrackVertexMapTool::m_tracksAux
const xAOD::TrackParticleAuxContainer * m_tracksAux
Definition: BPhysTrackVertexMapTool.h:166
xAOD::BPhysTrackVertexMapTool::refPVsToString
virtual std::string refPVsToString(const xAOD::VertexContainer *rpvc, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:559
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
xAOD::BPhysTrackVertexMapTool::wrapLines
static std::string wrapLines(const std::string &lines, const std::string &prefix)
convenience method to wrap output lines by a prefix
Definition: BPhysTrackVertexMapTool.cxx:21
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
xAOD::BPhysTrackVertexMapTool::logEvent
virtual StatusCode logEvent() override
Function being excuted for each event.
Definition: BPhysTrackVertexMapTool.cxx:103
xAOD::BPhysTrackVertexMapTool::m_svNameMap
VertexNameMap_t m_svNameMap
Definition: BPhysTrackVertexMapTool.h:183
xAOD::BPhysTrackVertexMapTool::m_cachedEvent
int m_cachedEvent
Definition: BPhysTrackVertexMapTool.h:176
skel.it
it
Definition: skel.GENtoEVGEN.py:407
asg
Definition: DataHandleTestTool.h:28
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::BPhysTrackVertexMapTool::pvsToString
virtual std::string pvsToString(const xAOD::VertexContainer *pvc, unsigned int indent=0, bool withTracks=false) override
Definition: BPhysTrackVertexMapTool.cxx:538
beamspotman.tokens
tokens
Definition: beamspotman.py:1280
xAOD::Vertex_v1::vertexType
VxType::VertexType vertexType() const
The type of the vertex.
dq_defect_bulk_create_defects.line
line
Definition: dq_defect_bulk_create_defects.py:27
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
xAOD::BPhysTrackVertexMapTool::m_refPVContainerName
std::string m_refPVContainerName
Definition: BPhysTrackVertexMapTool.h:157
xAOD::BPhysTrackVertexMapTool::m_idTrackNameMap
TrackNameMap_t m_idTrackNameMap
Definition: BPhysTrackVertexMapTool.h:186
xAOD::BPhysHypoHelper::massErr
float massErr() const
invariant mass error
Definition: BPhysHypoHelper.cxx:47
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
xAOD::BPhysTrackVertexMapTool::m_cachedRun
int m_cachedRun
Definition: BPhysTrackVertexMapTool.h:175
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
xAOD::BPhysTrackVertexMapTool::TrackToVertexMap_t
std::map< const xAOD::TrackParticle *, std::vector< const xAOD::Vertex * > > TrackToVertexMap_t
Definition: BPhysTrackVertexMapTool.h:140
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::BPhysTrackVertexMapTool::m_nEvtsSeen
unsigned int m_nEvtsSeen
Definition: BPhysTrackVertexMapTool.h:173
xAOD::BPhysHypoHelper
Definition: BPhysHypoHelper.h:73
xAOD::BPhysHypoHelper::mass
float mass() const
Get invariant mass and its error.
Definition: BPhysHypoHelper.cxx:42
xAOD::BPhysTrackVertexMapTool::m_idTrackToSVMap
TrackToVertexMap_t m_idTrackToSVMap
Definition: BPhysTrackVertexMapTool.h:190
xAOD::BPhysTrackVertexMapTool::summaryToString
virtual std::string summaryToString(std::string prefix) override
Definition: BPhysTrackVertexMapTool.cxx:599
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCondBlobAlgs_fillNoiseFromASCII.lines
lines
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:103
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:37
xAOD::BPhysTrackVertexMapTool::m_refPVContainer
const xAOD::VertexContainer * m_refPVContainer
Definition: BPhysTrackVertexMapTool.h:170
xAOD::BPhysTrackVertexMapTool::m_vertexContainerName
std::string m_vertexContainerName
Definition: BPhysTrackVertexMapTool.h:156
xAOD::BPhysTrackVertexMapTool::idTrackToString
virtual std::string idTrackToString(const xAOD::TrackParticle *track, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
Definition: BPhysTrackVertexMapTool.cxx:384
xAOD::BPhysTrackVertexMapTool::refPVName
virtual std::string refPVName(const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:349
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::BPhysTrackVertexMapTool::doLog
virtual bool doLog() const override
Function indicating whether log counter allows logging of current event.
Definition: BPhysTrackVertexMapTool.cxx:126
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
BPhysHypoHelper.h
: B-physics xAOD helpers.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::BPhysTrackVertexMapTool::m_refPVAuxContainer
const xAOD::VertexAuxContainer * m_refPVAuxContainer
Definition: BPhysTrackVertexMapTool.h:171
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:11
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:140
xAOD::BPhysTrackVertexMapTool::initTrackVertexMaps
virtual void initTrackVertexMaps(const xAOD::TrackParticleContainer *tpc, const xAOD::VertexContainer *pvc, const xAOD::VertexContainer *rpvc, const xAOD::VertexContainer *svc)
Definition: BPhysTrackVertexMapTool.cxx:263
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
xAOD::Vertex_v1::z
float z() const
Returns the z position.
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
xAOD::BPhysTrackVertexMapTool::getFloat
virtual float getFloat(std::string name, const xAOD::Vertex *b)
Definition: BPhysTrackVertexMapTool.cxx:615
xAOD::BPhysTrackVertexMapTool::m_svtxAuxContainer
const xAOD::VertexAuxContainer * m_svtxAuxContainer
Definition: BPhysTrackVertexMapTool.h:169
xAOD::str
std::string str(const TrigT2MbtsBits_v1 &trigT2MbtsBits)
Definition: TrigT2MbtsBits_v1.cxx:37
xAOD::BPhysTrackVertexMapTool::refPVsForIDTrack
virtual std::vector< const xAOD::Vertex * > refPVsForIDTrack(const xAOD::TrackParticle *track) const override
obtain refitted primary vertices for a given ID track (may return empty vector)
Definition: BPhysTrackVertexMapTool.cxx:227
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAOD::BPhysTrackVertexMapTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: BPhysTrackVertexMapTool.cxx:64
xAOD::BPhysTrackVertexMapTool::getTokens
virtual std::vector< std::string > getTokens(std::string input, std::string seperators)
Definition: BPhysTrackVertexMapTool.cxx:629
xAOD::BPhysTrackVertexMapTool::m_svtxContainer
const xAOD::VertexContainer * m_svtxContainer
Definition: BPhysTrackVertexMapTool.h:168
grepfile.sep
sep
Definition: grepfile.py:38
BPhysTrackVertexMapTool.h
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
xAOD::BPhysTrackVertexMapTool::m_idTrackToPVMap
TrackToVertexMap_t m_idTrackToPVMap
Definition: BPhysTrackVertexMapTool.h:188
xAOD::BPhysTrackVertexMapTool::m_idTrackToRefPVMap
TrackToVertexMap_t m_idTrackToRefPVMap
Definition: BPhysTrackVertexMapTool.h:189
xAOD::BPhysTrackVertexMapTool::m_pvtxContainer
const xAOD::VertexContainer * m_pvtxContainer
Definition: BPhysTrackVertexMapTool.h:167
xAOD::BPhysTrackVertexMapTool::svToString
virtual std::string svToString(const xAOD::Vertex *vtx, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
Definition: BPhysTrackVertexMapTool.cxx:475
EventInfo.h
xAOD::BPhysTrackVertexMapTool::svName
virtual std::string svName(const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:360
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::BPhysTrackVertexMapTool::pvName
virtual std::string pvName(const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:338
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::BPhysTrackVertexMapTool::svsToString
virtual std::string svsToString(const xAOD::VertexContainer *svc, unsigned int indent=0, bool withTracks=false, bool withMasses=false) override
Definition: BPhysTrackVertexMapTool.cxx:579
xAOD::BPhysTrackVertexMapTool::pvsForIDTrack
virtual std::vector< const xAOD::Vertex * > pvsForIDTrack(const xAOD::TrackParticle *track) const override
obtain primary vertices for a given ID track (may return empty vector)
Definition: BPhysTrackVertexMapTool.cxx:209
xAOD::BPhysTrackVertexMapTool::cacheEvent
virtual StatusCode cacheEvent() override
Definition: BPhysTrackVertexMapTool.cxx:139
xAOD::Vertex_v1::y
float y() const
Returns the y position.
xAOD::BPhysTrackVertexMapTool::svsForIDTrack
virtual std::vector< const xAOD::Vertex * > svsForIDTrack(const xAOD::TrackParticle *track) const override
obtain secondary vertices for a given ID track (may return empty vector)
Definition: BPhysTrackVertexMapTool.cxx:245
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
xAOD::BPhysTrackVertexMapTool::m_refPVNameMap
VertexNameMap_t m_refPVNameMap
Definition: BPhysTrackVertexMapTool.h:182
str
Definition: BTagTrackIpAccessor.cxx:11
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::BPhysTrackVertexMapTool::m_pvContainerName
std::string m_pvContainerName
Definition: BPhysTrackVertexMapTool.h:158
xAOD::BPhysTrackVertexMapTool::idTracksToString
virtual std::string idTracksToString(const xAOD::TrackParticleContainer *tpc, unsigned int indent=0, bool withPV=false, bool withRefPV=false, bool withSV=false) override
Definition: BPhysTrackVertexMapTool.cxx:514
xAOD::BPhysTrackVertexMapTool::idTrackName
virtual std::string idTrackName(const xAOD::TrackParticle *vtx)
Definition: BPhysTrackVertexMapTool.cxx:372
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::BPhysTrackVertexMapTool::BPhysTrackVertexMapTool
BPhysTrackVertexMapTool(const std::string &name="BPhysTrackVertexMapTool")
Declare the correct constructor for Athena.
Definition: BPhysTrackVertexMapTool.cxx:36
xAOD::BPhysTrackVertexMapTool::m_trackParticleContainerName
std::string m_trackParticleContainerName
Definition: BPhysTrackVertexMapTool.h:159
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::BPhysTrackVertexMapTool::addVertexToTrackVertexMap
virtual void addVertexToTrackVertexMap(TrackToVertexMap_t &map, const xAOD::TrackParticle *track, const xAOD::Vertex *vtx)
Definition: BPhysTrackVertexMapTool.cxx:324
xAOD::BPhysTrackVertexMapTool::m_pvNameMap
VertexNameMap_t m_pvNameMap
Definition: BPhysTrackVertexMapTool.h:181