|
ATLAS Offline Software
|
Go to the documentation of this file.
25 #include <unordered_map>
35 std::vector<std::string>
38 std::vector<std::string>
result;
55 std::unique_ptr<ISelectionReadAccessor>&
accessor,
58 using namespace msgSelectionHelpers;
62 accessor = std::make_unique<SelectionReadAccessorNull> (
true);
63 return StatusCode::SUCCESS;
70 ANA_MSG_FATAL(
"Failure to parse expression: '" << expr <<
"': " <<
e.what());
71 return StatusCode::FAILURE;
74 return StatusCode::SUCCESS;
80 struct SplitData final
89 using namespace msgSelectionHelpers;
98 }
else if (option ==
"as_char")
106 }
else if (option ==
"as_bits")
109 }
else if (option ==
"invert")
114 ANA_MSG_ERROR (
"invalid option " << option <<
"for selection decoration");
115 return StatusCode::FAILURE;
119 if (asChar && asBits)
121 ANA_MSG_ERROR (
"can't specify both 'as_bits' and 'as_char' for the same selection decoration, pick one!!!");
122 return StatusCode::FAILURE;
125 if (!asChar && !asBits)
132 return StatusCode::SUCCESS;
140 std::unique_ptr<ISelectionReadAccessor>&
accessor,
143 using namespace msgSelectionHelpers;
145 if (
name.find (
"%SYS%") != std::string::npos)
147 accessor = std::make_unique<SelectionAccessorReadSys>(
name);
148 return StatusCode::SUCCESS;
154 if (splitData.asChar)
155 accessor = std::make_unique<SelectionReadAccessorChar> (splitData.var);
157 accessor = std::make_unique<SelectionReadAccessorBits> (splitData.var);
159 if (splitData.invert)
161 accessor = std::make_unique<SelectionReadAccessorInvert>
165 return StatusCode::SUCCESS;
171 std::unique_ptr<ISelectionWriteAccessor>&
accessor,
174 using namespace msgSelectionHelpers;
176 if (
name.find (
"%SYS%") != std::string::npos)
178 accessor = std::make_unique<SelectionWriteAccessorSys>(
name);
179 return StatusCode::SUCCESS;
185 if (splitData.asChar)
186 accessor = std::make_unique<SelectionWriteAccessorChar> (splitData.var);
188 accessor = std::make_unique<SelectionWriteAccessorBits> (splitData.var);
190 if (splitData.invert)
192 accessor = std::make_unique<SelectionWriteAccessorInvert>
196 return StatusCode::SUCCESS;
std::vector< std::string > splitString(const std::string &in, const std::string &delim)
Public interface for the expression parsing facility.
StatusCode makeSelectionWriteAccessor(const std::string &name, std::unique_ptr< ISelectionWriteAccessor > &accessor, bool defaultToChar)
Produces a simple ISelectionWriteAccessor accessing the given decoration.
Select isolated Photons, Electrons and Muons.
::StatusCode StatusCode
StatusCode definition for legacy code.
void fill(H5::Group &out_file, size_t iterations)
StatusCode makeSelectionReadAccessor(const std::string &expr, std::unique_ptr< ISelectionReadAccessor > &accessor, bool defaultToChar)
make the ISelectionReadAccessor for the given name
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
StatusCode makeSelectionReadAccessorVar(const std::string &name, std::unique_ptr< ISelectionReadAccessor > &accessor, bool defaultToChar)
Produces a simple ISelectionReadAccessor accessing the given decoration.