#include <RegionLogicalOperation.h>
Definition at line 17 of file RegionLogicalOperation.h.
◆ RegionLogicalOperation()
MuonCalib::RegionLogicalOperation::RegionLogicalOperation |
( |
| ) |
|
|
default |
◆ ~RegionLogicalOperation()
virtual MuonCalib::RegionLogicalOperation::~RegionLogicalOperation |
( |
| ) |
|
|
virtualdefault |
◆ AddOperator()
bool MuonCalib::RegionLogicalOperation::AddOperator |
( |
bool |
op | ) |
|
Set next operator.
- Parameters
-
op | true=or false=and return false if number of operators is too high |
Definition at line 20 of file RegionLogicalOperation.cxx.
◆ AddRegion()
bool MuonCalib::RegionLogicalOperation::AddRegion |
( |
std::unique_ptr< RegionSelectorBase > |
region, |
|
|
bool |
invert = false |
|
) |
| |
Add a region to the operation.
- Parameters
-
region | the region to be added |
invert | inverted logic for this region Returns false when number of operators is insufficient |
Definition at line 13 of file RegionLogicalOperation.cxx.
15 m_regions.emplace_back(std::move(region));
◆ GetRegion()
◆ Print()
void MuonCalib::RegionLogicalOperation::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_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;
◆ Result()
bool MuonCalib::RegionLogicalOperation::Result |
( |
const MuonFixedId & |
region | ) |
const |
|
virtual |
◆ SurplusOperator()
bool MuonCalib::RegionLogicalOperation::SurplusOperator |
( |
| ) |
const |
|
inline |
◆ m_inverse
std::vector<bool> MuonCalib::RegionLogicalOperation::m_inverse |
|
private |
◆ m_operator
std::vector<bool> MuonCalib::RegionLogicalOperation::m_operator |
|
private |
◆ m_regions
std::vector<std::unique_ptr<RegionSelectorBase> > MuonCalib::RegionLogicalOperation::m_regions |
|
private |
The documentation for this class was generated from the following files: