2 #include <fwk/CentralConfig.h>
3 #include <det/VManager.h>
4 #include <utl/Branch.h>
5 #include <utl/ErrorLogger.h>
6 #include <utl/String.h>
8 #include <mevt/MEvent.h>
9 #include <mevt/Module.h>
18 using namespace MdModuleRejectorAG;
29 std::ostringstream msg;
31 b =
b.GetNextSibling())
33 const size_t counterId = VManager::FindComponent<size_t>(
"counterId",
b.GetAttributes());
34 const size_t moduleId = VManager::FindComponent<size_t>(
"moduleId",
b.GetAttributes());
35 const std::string reason = VManager::FindComponent<std::string>(
"reason",
b.GetAttributes());
37 std::vector<utl::TimeStamp> range;
40 fRejectMap.insert( std::make_pair( range[0], boost::make_tuple(range[1], counterId, moduleId) ) );
42 msg <<
"\n registered: counter = " << counterId <<
", module = " << moduleId;
43 msg <<
" [" << range[0] <<
", " << range[1] <<
") due to " << reason;
53 MdModuleRejector::Run(
Event& event)
61 MEvent& mEvent =
event.GetMEvent();
63 const TimeStamp& time = det::Detector::GetInstance().GetTime();
67 std::vector<std::string> rejectedIds;
68 for (TimeRangeMap::IdCollection::const_iterator it = badIds.begin();
69 it != badIds.end(); ++it)
71 size_t counterId = (*it).first;
77 size_t moduleId = (*it).second;
80 counter.
SetRejected(
"Rejected by MdModuleRejector");
81 std::ostringstream counterModule(
"");
82 counterModule << counterId <<
"-all";
83 rejectedIds.push_back(counterModule.str());
86 std::ostringstream counterModule(
"");
87 counterModule << counterId <<
"-" << moduleId;
88 rejectedIds.push_back(counterModule.str());
96 if (rejectedIds.size()!=0) {
98 msg <<
"rejected counter-module: ";
99 for(std::vector<std::string>::iterator it = rejectedIds.begin(); it!=rejectedIds.end(); ++it) {
109 MdModuleRejector::Finish()
Module & GetModule(const int mId)
Counter level event data.
std::vector< std::pair< size_t, size_t > > IdCollection
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
bool HasCounter(const int cId) const
vector< t2list > out
output of the algorithm: a list of clusters
A TimeStamp holds GPS second and nanosecond for some event.
Class representing a document branch.
bool HasModule(const int mId) const
void SetRejected(const std::string &reason="")
void SetRejected(const std::string &reason="")
Set the status of all modules in this counter to rejected. As described for the muon counter status...
ResultFlag
Flag returned by module methods to the RunController.
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
Branch GetFirstChild() const
Get first child of this Branch.
Counter & GetCounter(const int cId)
Root of the Muon event hierarchy.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)