ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigSteeringEvent
Root
TrigPassFlags.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <iostream>
6
#include "
TrigSteeringEvent/TrigPassFlags.h
"
7
8
TrigPassFlags::TrigPassFlags
()
9
:
m_container_ptr
(0) {}
10
11
TrigPassFlags::TrigPassFlags
(
const
unsigned
int
size
,
const
unsigned
int
flagSize
,
const
void
* cont)
12
:
m_container_ptr
(cont) {
13
std::vector<bool> temp(
flagSize
,
false
);
14
m_flagsPerObject
.resize(
size
,temp);
15
}
16
17
18
void
TrigPassFlags::setFlagBit
(
const
unsigned
int
position,
const
unsigned
int
bitPosition,
const
bool
bitValue,
const
void
*cont) {
19
if
(
m_container_ptr
&& cont !=
m_container_ptr
)
20
throw
std::runtime_error(
"Passed container does not match the container that created this TrigPassFlags. No flag bit set."
);
21
22
if
( position >=
size
() )
23
throw
std::runtime_error(
"Specified flag position is larger than the size of the TrigPassFlags object. No flag bit set."
);
24
25
if
( bitPosition >=
flagSize
() )
26
throw
std::runtime_error(
"Specified bitPosition is larger than the flag size. No flag bit set."
);
27
28
m_flagsPerObject
[position][bitPosition] = bitValue;
29
}
30
31
void
TrigPassFlags::setFlag
(
const
unsigned
int
position,
const
std::vector<bool>& flag,
const
void
*cont) {
32
if
(
m_container_ptr
&& cont !=
m_container_ptr
)
33
throw
std::runtime_error(
"Passed container does not match the container that created this TrigPassFlags. No flag set."
);
34
35
if
( position >=
size
() )
36
throw
std::runtime_error(
"Specified flag position is larger than the size of the TrigPassFlags object. No flag set."
);
37
38
if
( flag.size() !=
flagSize
() )
39
throw
std::runtime_error(
"Size of specified flag is different from the flag size of the TrigPassFlags object. No flag set."
);
40
41
m_flagsPerObject
[position] = flag;
42
}
43
44
bool
TrigPassFlags::getFlagBit
(
const
unsigned
int
position,
const
unsigned
int
bitPosition)
const
{
45
if
( position >=
size
() )
46
throw
std::runtime_error(
"Specified object position is larger than the size of the TrigPassFlags objects."
);
47
48
if
( bitPosition >=
flagSize
() )
49
throw
std::runtime_error(
"Specified bitPosition is larger than the flag size."
);
50
51
return
m_flagsPerObject
[position][bitPosition];
52
}
53
54
const
std::vector<bool>&
TrigPassFlags::getFlag
(
const
unsigned
int
position)
const
{
55
if
( position >=
size
() )
56
throw
std::runtime_error(
"Specified object position is larger than the size of the TrigPassFlags objects."
);
57
58
return
m_flagsPerObject
[position];
59
}
60
61
TrigPassFlags.h
TrigPassFlags::flagSize
unsigned int flagSize() const
gets size of the flag vector for the object at index
Definition
TrigPassFlags.h:76
TrigPassFlags::getFlagBit
bool getFlagBit(const unsigned int position, const unsigned int bitPosition) const
Returns the bit 'bitPosition' of the flag at index position.
Definition
TrigPassFlags.cxx:44
TrigPassFlags::getFlag
const std::vector< bool > & getFlag(const unsigned int position) const
Returns the flag (vector<bool>) at index position.
Definition
TrigPassFlags.cxx:54
TrigPassFlags::m_flagsPerObject
std::vector< std::vector< bool > > m_flagsPerObject
list of trainsient n-bit value (STL docu assures that a vector of booleans is efficient)
Definition
TrigPassFlags.h:82
TrigPassFlags::m_container_ptr
const void * m_container_ptr
Definition
TrigPassFlags.h:81
TrigPassFlags::size
unsigned int size() const
gets size of the container object vector
Definition
TrigPassFlags.h:71
TrigPassFlags::setFlag
void setFlag(const unsigned int position, const std::vector< bool > &flag, const void *cont=0)
Set the flag at index position.
Definition
TrigPassFlags.cxx:31
TrigPassFlags::setFlagBit
void setFlagBit(const unsigned int position, const unsigned int bitPosition, const bool bitValue, const void *cont=0)
Set bit of the flag at index position.
Definition
TrigPassFlags.cxx:18
TrigPassFlags::TrigPassFlags
TrigPassFlags()
Definition
TrigPassFlags.cxx:8
Generated on
for ATLAS Offline Software by
1.17.0