ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MuonCalibStandAlone
MuonCalibStandAloneBase
src
RegionLogicalOperation.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonCalibStandAloneBase/RegionLogicalOperation.h
"
6
7
#include <cstdlib>
8
9
#include "iostream"
10
11
namespace
MuonCalib
{
12
13
bool
RegionLogicalOperation::AddRegion
(std::unique_ptr<RegionSelectorBase> region,
bool
invert) {
14
if
(
m_regions
.size() >
m_operator
.size())
return
false
;
15
m_regions
.emplace_back(std::move(region));
16
m_inverse
.push_back(invert);
17
return
true
;
18
}
19
20
bool
RegionLogicalOperation::AddOperator
(
bool
op) {
21
if
((
m_regions
.size() <=
m_operator
.size()))
return
false
;
22
m_operator
.push_back(op);
23
return
true
;
24
}
25
26
bool
RegionLogicalOperation::Result
(
const
MuonFixedId
&
id
)
const
{
27
if
(
m_regions
.size() == 0)
return
true
;
28
bool
ret(
m_inverse
[0] xor
m_regions
[0]->
Result
(
id
));
29
for
(
unsigned
int
i = 0; i <
m_operator
.size(); i++) {
30
bool
this_region_result(
m_inverse
[i + 1] xor
m_regions
[i + 1]->
Result
(
id
));
31
if
(
m_operator
[i]) {
32
ret = ret || this_region_result;
33
}
else
{
34
ret = ret && this_region_result;
35
}
36
}
37
return
ret;
38
}
39
40
void
RegionLogicalOperation::Print
(std::ostream &os)
const
{
41
os <<
"("
;
42
for
(
unsigned
int
i = 0; i <
m_regions
.size(); i++) {
43
if
(
m_inverse
[i]) os <<
"!"
;
44
m_regions
[i]->Print(os);
45
if
(i <
m_operator
.size()) {
46
if
(
m_operator
[i])
47
os <<
" | "
;
48
else
49
os <<
" & "
;
50
}
51
}
52
os <<
")"
;
53
}
54
55
}
// namespace MuonCalib
Result
ICscStripFitter::Result Result
Definition
CalibCscStripFitter.cxx:13
RegionLogicalOperation.h
MuonCalib::MuonFixedId
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition
MuonFixedId.h:50
MuonCalib::RegionLogicalOperation::m_operator
std::vector< bool > m_operator
region operator - true=or false=and
Definition
RegionLogicalOperation.h:47
MuonCalib::RegionLogicalOperation::AddRegion
bool AddRegion(std::unique_ptr< RegionSelectorBase > region, bool invert=false)
Add a region to the operation.
Definition
RegionLogicalOperation.cxx:13
MuonCalib::RegionLogicalOperation::Print
void Print(std::ostream &os) const
character output of region
Definition
RegionLogicalOperation.cxx:40
MuonCalib::RegionLogicalOperation::m_regions
std::vector< std::unique_ptr< RegionSelectorBase > > m_regions
region data
Definition
RegionLogicalOperation.h:45
MuonCalib::RegionLogicalOperation::AddOperator
bool AddOperator(bool op)
Set next operator.
Definition
RegionLogicalOperation.cxx:20
MuonCalib::RegionLogicalOperation::m_inverse
std::vector< bool > m_inverse
inverse region selection
Definition
RegionLogicalOperation.h:49
MuonCalib::RegionLogicalOperation::Result
bool Result(const MuonFixedId ®ion) const
return the reslut of the logical operation
Definition
RegionLogicalOperation.cxx:26
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
Generated on
for ATLAS Offline Software by
1.17.0