23 const std::string& prefix) {
26 std::istringstream stream(lines);
28 while ( std::getline(stream, line) ) {
29 if ( !ostr.empty() ) ostr +=
"\n";
30 ostr += prefix + line;
45 declareInterface< IBPhysTrackVertexMapTool >(
this );
68 ATH_MSG_DEBUG(
"Initializing xAOD::BPhysTrackVertexMapTool" );
93 return StatusCode::SUCCESS;
101 return StatusCode::SUCCESS;
106 ATH_MSG_DEBUG(
"logEvent in xAOD::BPhysTrackVertexMapTool" );
124 return StatusCode::SUCCESS;
142 ATH_MSG_DEBUG(
"BPhysTrackVertexMapTool::cacheEvent -- begin");
154 ATH_MSG_DEBUG(
"BPhysTrackVertexMapTool::cacheEvent: caching now: "
202 return StatusCode::SUCCESS;
209 std::vector<const xAOD::Vertex*>
218 std::vector<const xAOD::Vertex*> dummy;
227 std::vector<const xAOD::Vertex*>
236 std::vector<const xAOD::Vertex*> dummy;
245 std::vector<const xAOD::Vertex*>
254 std::vector<const xAOD::Vertex*> dummy;
263 void BPhysTrackVertexMapTool
280 vtxItr != pvc->
end(); ++vtxItr) {
291 vtxItr != rpvc->
end(); ++vtxItr) {
303 vtxItr != svc->end(); ++vtxItr) {
314 trkItr != tpc->
end(); ++trkItr) {
324 void BPhysTrackVertexMapTool
329 TrackToVertexMap_t::const_iterator it =
map.find(
track);
331 if ( it ==
map.end() ) {
332 map[
track] = std::vector<const xAOD::Vertex*>();
342 std::string f = std::format(
"PV{:03d}",
m_pvNameMap.size());
364 std::string f = std::format(
"SV{:03d}",
m_svNameMap.size());
387 bool withPV,
bool withRefPV,
390 std::string sind(indent,
' ');
391 std::string
str = std::format(
"{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) VL ",
397 for (
auto vtx : it->second ) {
401 std::string f = std::format(
"\n{} {}", sind,
"NOPV");
409 for (
auto vtx : it->second ) {
413 std::string f = std::format(
"\n{} {}", sind,
"NORV");
420 for (
auto vtx : it->second ) {
424 std::string f2 = std::format(
"\n{} {}", sind,
"NOSV");
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(),
444 std::string f2 = std::format(
"\n{} {:4d} {}",
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(),
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(),
485 if ( withMasses &&
m_hypoName !=
"__NONE__" ) {
488 for (
const std::string& hypoName : hypoNames ) {
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);
523 std::string sind(indent,
' ');
524 str += sind +
"ID tracks: (" + std::to_string(tpc->
size()) +
")\n";
525 str += sind + std::string(80-indent,
'-');
528 trkItr != tpc->
end(); ++trkItr) {
544 std::string sind(indent,
' ');
545 str += sind +
"Primary vertices: (" + std::to_string(pvc->
size()) +
")\n";
546 str += sind + std::string(80-indent,
'-');
548 vtxItr != pvc->
end(); ++vtxItr) {
565 std::string sind(indent,
' ');
566 str += sind +
"Refitted primary vertices: (" + std::to_string(rpvc->
size()) +
")\n";
567 str += sind + std::string(80-indent,
'-');
569 vtxItr != rpvc->
end(); ++vtxItr) {
586 std::string sind(indent,
' ');
587 str += sind +
"Secondary vertices: (" + std::to_string(svc->size()) +
")\n";
588 str += sind + std::string(80-indent,
'-');
590 vtxItr != svc->end(); ++vtxItr) {
592 str +=
"\n" +
svToString(vtx, indent+2, withTracks, withMasses);
619 float res = -999999.;
629 std::vector<std::string> BPhysTrackVertexMapTool
630 ::getTokens(std::string input, std::string seperators) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
: B-physics xAOD helpers.
std::pair< std::vector< unsigned int >, bool > res
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Helper class to provide type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
float z() const
Returns the z position.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float y() const
Returns the y position.
VxType::VertexType vertexType() const
The type of the vertex.
float x() const
Returns the x position.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.