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