4 #include <fwk/CentralConfig.h>
5 #include <det/VManager.h>
6 #include <det/Detector.h>
7 #include <rdet/RDetector.h>
9 #include <utl/Branch.h>
10 #include <utl/ErrorLogger.h>
11 #include <utl/String.h>
12 #include <utl/RadioGeometryUtilities.h>
13 #include <utl/Vector.h>
14 #include <utl/Point.h>
16 #include <evt/ShowerRRecData.h>
17 #include <evt/ShowerSRecData.h>
18 #include <evt/ShowerFRecData.h>
19 #include <evt/ShowerRecData.h>
20 #include <evt/ShowerSimData.h>
22 #include <evt/Event.h>
23 #include <revt/REvent.h>
24 #include <revt/Header.h>
25 #include <revt/StationConstants.h>
26 #include <revt/StationRecData.h>
46 const int MAX_CHARS_PER_LINE = 512;
47 char line[MAX_CHARS_PER_LINE];
48 fin.open(fFilename.c_str(), ios::in);
52 sstr <<
"loop through file... filename = " << fFilename;
56 WARNING(
"File could not be opened");
61 fin.getline(line, MAX_CHARS_PER_LINE);
62 stringstream tmp_sstr;
65 if (!std::getline(tmp_sstr, segment,
'\t')) {
68 int runNumber = atoi(segment.c_str());
69 std::getline(tmp_sstr, segment,
'\t');
70 int eventId = atoi(segment.c_str());
71 std::vector<int> tmp_station_ids;
72 output <<
"Event " << runNumber <<
"_" << eventId <<
": ";
73 while (std::getline(tmp_sstr, segment,
'\t')) {
74 tmp_station_ids.push_back(atoi(segment.c_str()));
75 output << atoi(segment.c_str()) <<
" ";
77 std::pair<int, int> event_identifier(runNumber, eventId);
78 fEventSelection[event_identifier] = tmp_station_ids;
100 std::pair<int, int> event_identifier(runNumber, eventId);
102 if (fEventSelection.find(event_identifier) == fEventSelection.end()) {
104 sstr <<
"Event " << event_identifier.first <<
"_" << event_identifier.second
105 <<
" not present in selection, event will be skipped";
107 return eContinueLoop;
111 const int stationId = sIt->GetId();
112 std::vector<int> stationList = fEventSelection[event_identifier];
113 std::vector<int>::iterator it = std::find(stationList.begin(), stationList.end(), stationId);
114 if (it == stationList.end()) {
117 sstr <<
"station " << sIt->GetId() <<
" will be rejected";
127 RdEventAndStationSelector::Finish()
Branch GetTopBranch() const
Interface class to access to the Radio part of an event.
StationIterator StationsEnd()
StationIterator StationsBegin()
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
boost::filter_iterator< StationFilter, AllStationIterator > StationIterator
Iterator over all (non-exculded) stations.
#define INFOIntermediate(y)
Class representing a document branch.
Header & GetHeader()
access to REvent Header
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
ResultFlag
Flag returned by module methods to the RunController.