6#include "boost/tokenizer.hpp"
7#include <boost/algorithm/string.hpp>
39 declareInterface< IBPhysBlindingTool >(
this );
88 ATH_MSG_ERROR(
"You must at least set a key for blinding or unblinding!");
141 return StatusCode::SUCCESS;
157 ATH_MSG_INFO(Form(
"N_candidatesForBlindingSeen : %10ld",
161 ATH_MSG_INFO(Form(
"N_candidatesForUnblindingSeen : %10ld",
167 return StatusCode::SUCCESS;
174 return m_senc.encrypt(val);
181 return m_senc.decrypt(val);
187 const bool& negativeSign,
189 const float& factor) {
193 float cval = val*factor + offset;
196 bval =
m_senc.encrypt(cval);
197 if (negativeSign) bval *= -1.;
200 << val << Form(
" (%a) -> ", val)
201 << cval << Form(
" (%a)", cval));
210 const bool& negativeSign,
212 const float& factor) {
214 float bval(val), cval(val);
215 if (negativeSign) bval *= -1.;
217 if ( bval > 0. || !std::isnormal(bval) ) {
219 cval =
m_senc.decrypt(bval);
220 if ( factor != 0. ) {
221 cval = (cval - offset)/factor;
224 << val << Form(
" (%a)", val));
228 << val << Form(
" (%a) -> ", val)
229 << bval << Form(
" (%a)", bval));
246 return StatusCode::SUCCESS;
260 return StatusCode::SUCCESS;
283 long candidatesBlinded(0);
284 long candidatesUnblinded(0);
301 ++candidatesUnblinded;
310 float val = floatDec(*vtx);
317 << Form(
" (%a)", floatDec(*vtx)));
324 << Form(
" (%a)", floatDec(*vtx)));
343 return StatusCode::SUCCESS;
390 for (
const xAOD::Vertex* constVtx : *constVtxContainer) {
409 return StatusCode::SUCCESS;
417 if ( !hypo.starts_with(
"passed_") )
418 hypo =
"passed_" + hypo;
420 return flagAcc.
isAvailable(em) && flagAcc(em) != 0;
425 std::vector<std::string>
428 std::vector<std::string> tokens;
429 boost::char_separator<char> sep(seperators.c_str());
430 typedef boost::tokenizer<boost::char_separator<char> > Tokenizer_t;
431 Tokenizer_t tokenizer(input, sep);
432 for (
auto& token : tokenizer) {
433 tokens.push_back(token);
442 std::string
str(
"[");
443 for (
unsigned int i=0; i<v.size(); ++i) {
444 str += std::to_string(v[i]);
445 if ( i < v.size()-1 )
str +=
",";
455 std::string
str(
"[");
456 for (
unsigned int i=0; i<v.size(); ++i) {
457 str += std::to_string(v[i]);
458 if ( i < v.size()-1 )
str +=
",";
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
Base class for elements of a container that can have aux data.
SG::Decorator< T, ALLOC > Decorator
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
EventInfo_v1 EventInfo
Definition of the latest event info version.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.