|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "boost/format.hpp"
8 #include "boost/tokenizer.hpp"
23 const std::string&
prefix) {
29 if ( !ostr.empty() ) ostr +=
"\n";
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) {
45 declareInterface< IBPhysTrackVertexMapTool >(
this );
46 #endif // ASGTOOL_ATHENA
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;
271 m_refPVNameMap.clear();
273 m_idTrackNameMap.clear();
274 m_idTrackToPVMap.clear();
275 m_idTrackToRefPVMap.clear();
276 m_idTrackToSVMap.clear();
280 vtxItr != pvc->
end(); ++vtxItr) {
286 addVertexToTrackVertexMap(m_idTrackToPVMap,
track, vtx);
291 vtxItr != rpvc->
end(); ++vtxItr) {
297 addVertexToTrackVertexMap(m_idTrackToRefPVMap,
track, vtx);
303 vtxItr !=
svc->end(); ++vtxItr) {
309 addVertexToTrackVertexMap(m_idTrackToSVMap,
track, vtx);
314 trkItr != tpc->
end(); ++trkItr) {
329 TrackToVertexMap_t::const_iterator
it = map.find(
track);
331 if (
it == map.end() ) {
332 map[
track] = std::vector<const xAOD::Vertex*>();
334 map[
track].push_back(vtx);
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 ) {
409 for (
auto vtx :
it->second ) {
420 for (
auto vtx :
it->second ) {
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(),
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,
' ');
525 str += sind + std::string(80-
indent,
'-');
528 trkItr != tpc->
end(); ++trkItr) {
544 std::string sind(
indent,
' ');
546 str += sind + std::string(80-
indent,
'-');
548 vtxItr != pvc->
end(); ++vtxItr) {
565 std::string sind(
indent,
' ');
567 str += sind + std::string(80-
indent,
'-');
569 vtxItr != rpvc->
end(); ++vtxItr) {
586 std::string sind(
indent,
' ');
588 str += sind + std::string(80-
indent,
'-');
590 vtxItr !=
svc->end(); ++vtxItr) {
619 float res = -999999.;
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;
636 for (
auto& token : tokenizer) {
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
float x() const
Returns the x position.
Const iterator class for DataVector/DataList.
Temporary container used until we have I/O for AuxStoreInternal.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
uint64_t eventNumber() const
The current event's event number.
Helper class to provide type-safe access to aux data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
VxType::VertexType vertexType() const
The type of the vertex.
float massErr() const
invariant mass error
uint32_t runNumber() const
The current event's run number.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
float mass() const
Get invariant mass and its error.
::StatusCode StatusCode
StatusCode definition for legacy code.
: B-physcis xAOD helpers.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::pair< std::vector< unsigned int >, bool > res
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float z() const
Returns the z position.
AthROOTErrorHandlerSvc * svc
std::string str(const TrigT2MbtsBits_v1 &trigT2MbtsBits)
std::string to_string(const DetectorType &type)
Class describing the basic event information.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Class describing a Vertex.
float y() const
Returns the y position.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing a TrackParticle.
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.