 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "boost/tokenizer.hpp"
22 const std::string&
prefix) {
28 if ( !ostr.empty() ) ostr +=
"\n";
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) {
44 declareInterface< IBPhysTrackVertexMapTool >(
this );
45 #endif // ASGTOOL_ATHENA
67 ATH_MSG_DEBUG(
"Initializing xAOD::BPhysTrackVertexMapTool" );
92 return StatusCode::SUCCESS;
100 return StatusCode::SUCCESS;
105 ATH_MSG_DEBUG(
"logEvent in xAOD::BPhysTrackVertexMapTool" );
123 return StatusCode::SUCCESS;
141 ATH_MSG_DEBUG(
"BPhysTrackVertexMapTool::cacheEvent -- begin");
153 ATH_MSG_DEBUG(
"BPhysTrackVertexMapTool::cacheEvent: caching now: "
201 return StatusCode::SUCCESS;
208 std::vector<const xAOD::Vertex*>
217 std::vector<const xAOD::Vertex*>
dummy;
226 std::vector<const xAOD::Vertex*>
235 std::vector<const xAOD::Vertex*>
dummy;
244 std::vector<const xAOD::Vertex*>
253 std::vector<const xAOD::Vertex*>
dummy;
270 m_refPVNameMap.clear();
272 m_idTrackNameMap.clear();
273 m_idTrackToPVMap.clear();
274 m_idTrackToRefPVMap.clear();
275 m_idTrackToSVMap.clear();
279 vtxItr != pvc->
end(); ++vtxItr) {
285 addVertexToTrackVertexMap(m_idTrackToPVMap,
track, vtx);
290 vtxItr != rpvc->
end(); ++vtxItr) {
296 addVertexToTrackVertexMap(m_idTrackToRefPVMap,
track, vtx);
302 vtxItr !=
svc->end(); ++vtxItr) {
308 addVertexToTrackVertexMap(m_idTrackToSVMap,
track, vtx);
313 trkItr != tpc->
end(); ++trkItr) {
328 TrackToVertexMap_t::const_iterator
it = map.find(
track);
330 if (
it == map.end() ) {
331 map[
track] = std::vector<const xAOD::Vertex*>();
333 map[
track].push_back(vtx);
386 bool withPV,
bool withRefPV,
389 std::string sind(
indent,
' ');
390 std::string
str =
std::format(
"{} {:<5} {} ({:10.4f}, {:10.4f}, {:10.4f}) VL ",
396 for (
auto vtx :
it->second ) {
408 for (
auto vtx :
it->second ) {
419 for (
auto vtx :
it->second ) {
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(),
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(),
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(),
484 if ( withMasses &&
m_hypoName !=
"__NONE__" ) {
487 for (
const std::string& hypoName : hypoNames ) {
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);
522 std::string sind(
indent,
' ');
524 str += sind + std::string(80-
indent,
'-');
527 trkItr != tpc->
end(); ++trkItr) {
543 std::string sind(
indent,
' ');
545 str += sind + std::string(80-
indent,
'-');
547 vtxItr != pvc->
end(); ++vtxItr) {
564 std::string sind(
indent,
' ');
566 str += sind + std::string(80-
indent,
'-');
568 vtxItr != rpvc->
end(); ++vtxItr) {
585 std::string sind(
indent,
' ');
587 str += sind + std::string(80-
indent,
'-');
589 vtxItr !=
svc->end(); ++vtxItr) {
618 float res = -999999.;
629 ::getTokens(std::string input, std::string seperators) {
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) {
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.
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-physics xAOD helpers.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.