3 #include <fwk/CentralConfig.h>
4 #include <sdet/SDetector.h>
5 #include <utl/Reader.h>
6 #include <utl/String.h>
8 #include <sevt/SEvent.h>
9 #include <sevt/Station.h>
10 #include <sevt/StationSimData.h>
20 namespace SdMonteCarloEventSelectorOG {
23 MakeInfo(
const vector<int>& ids,
const string& message)
37 CentralConfig::GetInstance()->
GetTopBranch(
"SdMonteCarloEventSelector");
41 if (arrayLayout ==
"KeepOnlyDenseArray")
42 fArrayLayout = eKeepOnlyDenseArray;
43 else if (arrayLayout ==
"KeepOnlyRegularArray")
44 fArrayLayout = eKeepOnlyRegularArray;
46 fArrayLayout = eKeepAll;
48 string innerRadiusTreatment;
50 if (innerRadiusTreatment ==
"KeepInnerRadiusStation")
51 fInnerRadiusTreatment = eKeepInnerRadiusStation;
52 else if (innerRadiusTreatment ==
"RejectInnerRadiusStation")
53 fInnerRadiusTreatment = eRejectInnerRadiusStation;
62 SdMonteCarloEventSelector::Run(
Event& event)
64 const sdet::SDetector& sDetector = det::Detector::GetInstance().GetSDetector();
68 vector<int> svInnerRadiusTreatment;
69 vector<int> svArrayLayout;
78 if (sIt->HasSimData()) {
81 svInnerRadiusTreatment.push_back(sIt->GetId());
82 if (fInnerRadiusTreatment == eRejectInnerRadiusStation)
87 const int sId = sIt->GetId();
92 switch (fArrayLayout) {
94 if (isDense && sIt->IsRejected() &&
95 sIt->GetRejectionStatus() ==
99 case eKeepOnlyDenseArray:
101 if (sIt->IsRejected() &&
102 sIt->GetRejectionStatus() ==
104 if (sIt->HasRecData())
110 svArrayLayout.push_back(sId);
114 case eKeepOnlyRegularArray:
116 svArrayLayout.push_back(sId);
123 if (!svInnerRadiusTreatment.empty()) {
124 MakeInfo(svInnerRadiusTreatment,
string(
"within inner radius cut") +
125 (fInnerRadiusTreatment == eKeepInnerRadiusStation ?
127 (fInnerRadiusTreatment == eRejectInnerRadiusStation ?
128 " rejected: " :
", event skipped.")));
130 return eContinueLoop;
133 if (!svArrayLayout.empty()) {
134 MakeInfo(svArrayLayout,
string(
"not in ") +
135 (fArrayLayout == eKeepOnlyDenseArray ?
136 "dense " :
"regular ") +
138 }
else if (fArrayLayout == eKeepAll)
139 INFO(
"Keeping both dense and regular stations.");
146 SdMonteCarloEventSelector::Finish()
Branch GetTopBranch() const
Station Level Simulated Data
StationIterator StationsEnd()
End of all stations.
bool IsInsideMinRadius() const
Check whether the station is in the shower hole.
Interface class to access to the SD part of an event.
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
const char * Plural(const T n)
Class representing a document branch.
void GetData(bool &b) const
Overloads of the GetData member template function.
void MakeInfo(const vector< int > &ids, const string &message)
ResultFlag
Flag returned by module methods to the RunController.
StationIterator StationsBegin()
Beginning of all stations.
bool IsDense() const
Tells whether the station belongs to set of hypothetical "dense" stations.
Detector description interface for SDetector-related data.
boost::indirect_iterator< InternalStationIterator, Station & > StationIterator
Iterator over all stations.
string OfSortedIds(vector< int > ids)
const Station & GetStation(const int stationId) const
Get station by Station Id.