#include <AcceptInfo.h>
|
| | AcceptInfo (const char *name="AcceptInfo") |
| | Standard constructor.
|
| const char * | getName () const |
| | Get the name of the class instance.
|
| unsigned int | getNCuts () const |
| | Get the number of cuts defined.
|
| const std::bitset< NBITS > & | getCutMask () const |
| | Get a bitmask for all cuts defined.
|
| int | addCut (const std::string &cutName, const std::string &cutDescription) |
| | Add a cut; returning the cut position.
|
| unsigned int | getCutPosition (const std::string &cutName) const |
| | Get the bit position of a cut.
|
| const std::string & | getCutName (unsigned int cutPosition) const |
| | Get the name of a cut, based on the cut position (slow, avoid usage)
|
| const std::string & | getCutDescription (const std::string &cutName) const |
| | Get the description of a cut, based on the cut name.
|
| const std::string & | getCutDescription (unsigned int cutPosition) const |
| | Get the description of a cut, based on the cut position.
|
| void | setCutDescription (const std::string &cutName, const std::string &cutDescription) |
| | Set the result of a cut, based on the cut name (safer)
|
| void | setCutDescription (unsigned int cutPosition, const std::string &cutDescription) |
| | Get the result of a cut, based on the cut position (faster)
|
|
| static const unsigned int | NBITS =32 |
| | The number of bits for cuts.
|
|
| std::string | m_name |
| | The name of the class instance.
|
| std::map< std::string, std::pair< std::string, unsigned int > > | m_cutMap |
| | The map for mapping cut names to their description and position.
|
| std::bitset< NBITS > | m_cutMask |
| | A bitmap that provides a mask that only leaves defined cuts.
|
Definition at line 27 of file AcceptInfo.h.
◆ AcceptInfo()
| asg::AcceptInfo::AcceptInfo |
( |
const char * | name = "AcceptInfo" | ) |
|
|
inline |
Standard constructor.
Definition at line 35 of file AcceptInfo.h.
38 {}
std::string m_name
The name of the class instance.
std::map< std::string, std::pair< std::string, unsigned int > > m_cutMap
The map for mapping cut names to their description and position.
◆ addCut()
| int asg::AcceptInfo::addCut |
( |
const std::string & | cutName, |
|
|
const std::string & | cutDescription ) |
|
inline |
Add a cut; returning the cut position.
Definition at line 53 of file AcceptInfo.h.
54 {
55
57 {
58 return -1;
59 }
60
61
62 std::pair< std::string, unsigned int > cutPair = std::make_pair( cutDescription,
m_cutMap.size() );
63 m_cutMap.insert( std::make_pair( cutName, cutPair ) );
64
65
69 }
static const unsigned int NBITS
The number of bits for cuts.
std::bitset< NBITS > m_cutMask
A bitmap that provides a mask that only leaves defined cuts.
◆ getCutDescription() [1/2]
| const std::string & AcceptInfo::getCutDescription |
( |
const std::string & | cutName | ) |
const |
Get the description of a cut, based on the cut name.
Definition at line 119 of file AcceptInfo.cxx.
120{
121 static const std::string emptyString;
123 return (it !=
m_cutMap.end()) ? (
it->second).first : emptyString;
124}
◆ getCutDescription() [2/2]
| const std::string & AcceptInfo::getCutDescription |
( |
unsigned int | cutPosition | ) |
const |
Get the description of a cut, based on the cut position.
Definition at line 66 of file AcceptInfo.cxx.
67{
68 static const std::string emptyString;
69
70
71 if ( cutPosition >=
m_cutMap.size() )
72 {
73 return emptyString;
74 }
75
76
79 for ( ;
it != itEnd; ++
it )
80 {
81 if ( (
it->second).second == cutPosition )
82 {
83 return (
it->second).first;
84 }
85 }
86
87 return emptyString;
88}
◆ getCutMask()
| const std::bitset< NBITS > & asg::AcceptInfo::getCutMask |
( |
| ) |
const |
|
inline |
Get a bitmask for all cuts defined.
Definition at line 49 of file AcceptInfo.h.
◆ getCutName()
| const std::string & AcceptInfo::getCutName |
( |
unsigned int | cutPosition | ) |
const |
Get the name of a cut, based on the cut position (slow, avoid usage)
Definition at line 36 of file AcceptInfo.cxx.
37{
38 static const std::string emptyString;
39
40
41 if ( cutPosition >=
m_cutMap.size() )
42 {
43 return emptyString;
44 }
45
46
49 for ( ;
it != itEnd; ++
it )
50 {
51 if ( (
it->second).second == cutPosition )
52 {
54 }
55 }
56
57 return emptyString;
58}
◆ getCutPosition()
| unsigned int asg::AcceptInfo::getCutPosition |
( |
const std::string & | cutName | ) |
const |
|
inline |
Get the bit position of a cut.
Definition at line 73 of file AcceptInfo.h.
74 {
76 return (it !=
m_cutMap.end()) ? (
it->second).second : 999999;
77 }
◆ getName()
| const char * asg::AcceptInfo::getName |
( |
| ) |
const |
|
inline |
Get the name of the class instance.
Definition at line 43 of file AcceptInfo.h.
◆ getNCuts()
| unsigned int asg::AcceptInfo::getNCuts |
( |
| ) |
const |
|
inline |
Get the number of cuts defined.
Definition at line 46 of file AcceptInfo.h.
◆ setCutDescription() [1/2]
| void asg::AcceptInfo::setCutDescription |
( |
const std::string & | cutName, |
|
|
const std::string & | cutDescription ) |
|
inline |
Set the result of a cut, based on the cut name (safer)
Definition at line 92 of file AcceptInfo.h.
93 {
96 }
unsigned int getCutPosition(const std::string &cutName) const
Get the bit position of a cut.
void setCutDescription(const std::string &cutName, const std::string &cutDescription)
Set the result of a cut, based on the cut name (safer)
◆ setCutDescription() [2/2]
| void AcceptInfo::setCutDescription |
( |
unsigned int | cutPosition, |
|
|
const std::string & | cutDescription ) |
Get the result of a cut, based on the cut position (faster)
Definition at line 97 of file AcceptInfo.cxx.
98{
99
102 for ( ;
it != itEnd; ++
it )
103 {
104 if ( (
it->second).second == cutPosition )
105 {
106 ((
it->second).first) = cutDescription;
107 return;
108 }
109 }
110
111 return;
112}
◆ m_cutMap
| std::map< std::string, std::pair< std::string, unsigned int > > asg::AcceptInfo::m_cutMap |
|
private |
The map for mapping cut names to their description and position.
Definition at line 109 of file AcceptInfo.h.
◆ m_cutMask
| std::bitset<NBITS> asg::AcceptInfo::m_cutMask |
|
private |
A bitmap that provides a mask that only leaves defined cuts.
Definition at line 112 of file AcceptInfo.h.
◆ m_name
| std::string asg::AcceptInfo::m_name |
|
private |
The name of the class instance.
Definition at line 106 of file AcceptInfo.h.
◆ NBITS
| const unsigned int asg::AcceptInfo::NBITS =32 |
|
static |
The number of bits for cuts.
Definition at line 32 of file AcceptInfo.h.
The documentation for this class was generated from the following files: