#include <RegionElement.h>
Definition at line 19 of file RegionElement.h.
◆ RegionElement() [1/2]
MuonCalib::RegionElement::RegionElement |
( |
| ) |
|
|
default |
◆ RegionElement() [2/2]
MuonCalib::RegionElement::RegionElement |
( |
const std::string & |
region | ) |
|
|
inline |
◆ ~RegionElement()
MuonCalib::RegionElement::~RegionElement |
( |
| ) |
|
|
default |
◆ GetRegion()
◆ Initialize()
bool MuonCalib::RegionElement::Initialize |
( |
const std::string & |
region | ) |
|
Initialize functions.
Definition at line 16 of file RegionElement.cxx.
18 std::string inner_region(region, 1, region.size() - 2);
27 std::istringstream region_stream(inner_region);
29 for (
int i = 0;
i < 4;
i++) {
30 getline(region_stream,
item,
',');
31 if (region_stream.fail())
break;
34 std::istringstream item_stream(
item);
35 while (!item_stream.eof()) {
37 if (item2.size() == 0)
continue;
50 if (m_ml < 0 || m_ml > 2)
return false;
◆ Print()
void MuonCalib::RegionElement::Print |
( |
std::ostream & |
os | ) |
const |
|
virtual |
◆ print_position()
void MuonCalib::RegionSelectorBase::print_position |
( |
const std::string & |
input, |
|
|
const unsigned int & |
position, |
|
|
MsgStream * |
msgStr |
|
) |
| |
|
staticprivateinherited |
◆ process_int_range()
bool MuonCalib::RegionElement::process_int_range |
( |
std::string & |
range, |
|
|
std::vector< int > & |
target_start, |
|
|
std::vector< int > & |
target_end |
|
) |
| |
|
private |
process a numerical id
Definition at line 118 of file RegionElement.cxx.
120 std::string begin_range[2];
122 bool begin_number(
true);
123 for (
unsigned int i = 0;
i < substr.size();
i++) {
135 begin_range[n_substrings] += substr[
i];
136 begin_number =
false;
140 begin_range[n_substrings] += substr[
i];
141 begin_number =
false;
144 if (n_substrings > 0) {
146 log << MSG::WARNING <<
"Surplus '-' in " << substr <<
endmsg;
154 log << MSG::WARNING <<
"Syntax error in " << substr <<
endmsg;
158 if (begin_range[0].
size() == 0) {
return true; }
159 target_start.push_back(
atoi(begin_range[0].c_str()));
160 if (n_substrings == 0)
161 target_end.push_back(
atoi(begin_range[0].c_str()));
163 target_end.push_back(
atoi(begin_range[1].c_str()));
◆ process_region()
std::unique_ptr< RegionSelectorBase > MuonCalib::RegionSelectorBase::process_region |
( |
const std::string & |
input, |
|
|
unsigned int & |
i, |
|
|
bool |
is_in_braces |
|
) |
| |
|
staticprivateinherited |
Definition at line 18 of file RegionSelectorBase.cxx.
19 unsigned int start_sub(
i);
21 std::unique_ptr<RegionLogicalOperation> new_region = std::make_unique<RegionLogicalOperation>();
22 bool currect_inverse(
false);
33 element.push_back(input[
i]);
34 if (input[
i] ==
']')
break;
37 log << MSG::WARNING <<
"Missing ']' at end of input! Started here:" <<
endmsg;
41 std::unique_ptr<RegionElement> reg_el = std::make_unique<RegionElement>();
43 if (!reg_el->Initialize(element)) {
48 if (!new_region->AddRegion(std::move(reg_el), currect_inverse)) {
49 log << MSG::WARNING <<
"Missing operator!" <<
endmsg;
53 currect_inverse =
false;
60 log << MSG::WARNING <<
"'(' at end of input!" <<
endmsg;
64 std::unique_ptr<RegionSelectorBase> second_region{
process_region(input,
i,
true)};
65 if (!second_region) {
return nullptr; }
66 if (!new_region->AddRegion(std::move(second_region), currect_inverse)) {
67 log << MSG::WARNING <<
"Missing operator!" <<
endmsg;
71 currect_inverse =
false;
76 if (currect_inverse) {
77 log << MSG::WARNING <<
"Surplus '!'" <<
endmsg;
81 currect_inverse =
true;
87 bool next_op(input[
i] ==
'|');
88 if (!new_region->AddOperator(next_op)) {
89 log << MSG::WARNING <<
"Unexpected operator!" <<
endmsg;
97 if (new_region->SurplusOperator()) {
98 log << MSG::WARNING <<
"Surplus operator" <<
endmsg;
102 if (is_in_braces) {
return new_region; }
103 log << MSG::WARNING <<
"Unexpected ')'" <<
endmsg;
114 log << MSG::WARNING <<
"Syntax Error" <<
endmsg;
121 log << MSG::WARNING <<
"Missing ')'" <<
endmsg;
125 if (new_region->SurplusOperator()) {
126 log << MSG::WARNING <<
"Surplus operator" <<
endmsg;
◆ process_station_name()
bool MuonCalib::RegionElement::process_station_name |
( |
std::string & |
name | ) |
|
|
private |
process a astation name string
Definition at line 93 of file RegionElement.cxx.
94 if (substr.size() > 3) {
96 log << MSG::WARNING <<
"Syntax Error '" << substr <<
"'" <<
endmsg;
99 std::string name_template(
"???");
100 for (
unsigned int i = 0;
i < substr.size();
i++) { name_template[
i] = substr[
i]; }
104 for (
int i = 1;
true;
i++) {
108 for (
int j = 0; j < 3; j++) {
109 if (name_template[j] ==
'?')
continue;
◆ Result()
◆ m_eta_end
std::vector<int> MuonCalib::RegionElement::m_eta_end |
|
private |
◆ m_eta_start
std::vector<int> MuonCalib::RegionElement::m_eta_start |
|
private |
◆ m_ml
int MuonCalib::RegionElement::m_ml {-1} |
|
private |
◆ m_phi_end
std::vector<int> MuonCalib::RegionElement::m_phi_end |
|
private |
◆ m_phi_start
std::vector<int> MuonCalib::RegionElement::m_phi_start |
|
private |
◆ m_region
std::string MuonCalib::RegionElement::m_region |
|
private |
◆ m_stations
std::set<int> MuonCalib::RegionElement::m_stations |
|
private |
The documentation for this class was generated from the following files: