diff --git a/core/data/CbmEvent.cxx b/core/data/CbmEvent.cxx index f9e86722cdb0c5575821400c410aa2546da8a10b..42b03a77da7700eabbd61e659c6d6aa633a56cac 100644 --- a/core/data/CbmEvent.cxx +++ b/core/data/CbmEvent.cxx @@ -60,7 +60,9 @@ std::string CbmEvent::ToString() const std::stringstream ss; ss << "Event " << fNumber << " at t = " << fTimeStart << " ns. Registered data types: " << fIndexMap.size() - << ", data objects: " << fNofData << "\n"; + << ", data objects: " << fNofData + << ( nullptr != fMatch ? ", with matches" : ", without matches" ) + << "\n"; for (auto it = fIndexMap.begin(); it != fIndexMap.end(); it++) { ss << " -- Data type " << it->first << ", number of data " << it->second.size() << "\n"; diff --git a/core/data/CbmEvent.h b/core/data/CbmEvent.h index e93a5eb928becb286b28ae6157bf7558918301da..2031bd18e573bb458634b4ea65251bac918d5874 100644 --- a/core/data/CbmEvent.h +++ b/core/data/CbmEvent.h @@ -18,7 +18,7 @@ #include "CbmDefs.h" // for ECbmDataType, ECbmModuleId::kStsTrack #include "CbmMatch.h" // for CbmMatch -#include "CbmVertex.h" // for CbmVertex +#include "CbmVertex.h" // for CbmVertex, found in core/data/global /** @class CbmEvent ** @brief Class characterising one event by a collection of links (indices) @@ -51,6 +51,9 @@ class CbmEvent: public TObject { if ( fMatch ) delete fMatch; } + /** Overload TObject Clear to clear the map! **/ + void Clear( Option_t * /*option*/ ) { fIndexMap.clear(); } + /** Add a data object to the index map ** @param DataType Type of data (for values see CbmDetectorList.h) diff --git a/core/data/test/_GTestCbmEvent.cxx b/core/data/test/_GTestCbmEvent.cxx index 984c2856d61340e2499a8ef28dd9aac13658ef64..0c6a852a34a3d7d4f00659ecfd1429844885d999 100644 --- a/core/data/test/_GTestCbmEvent.cxx +++ b/core/data/test/_GTestCbmEvent.cxx @@ -265,7 +265,7 @@ TEST(_GTestCbmEvent, CheckSettersAndGetters) compareEventMap(test, 9, 3, ECbmDataType::kStsTrack, ststrack); } - EXPECT_STREQ("Event -111 at t = 1 ns. Registered data types: 6, data objects: 9\n -- Data type 0, number of data 2\n -- Data type 200, number of data 1\n -- Data type 201, number of data 1\n -- Data type 202, number of data 1\n -- Data type 203, number of data 1\n -- Data type 204, number of data 3\n", test.ToString().c_str()); + EXPECT_STREQ("Event -111 at t = 1 ns. Registered data types: 6, data objects: 9, without matches\n -- Data type 0, number of data 2\n -- Data type 200, number of data 1\n -- Data type 201, number of data 1\n -- Data type 202, number of data 1\n -- Data type 203, number of data 1\n -- Data type 204, number of data 3\n", test.ToString().c_str()); }