ATLAS Offline Software
BPhysBlindingTool.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
14 // $Id: $
15 #ifndef BPHYSTOOLS_BPHYSBLINDINGTOOL_H
16 #define BPHYSTOOLS_BPHYSBLINDINGTOOL_H
17 
18 // Framework includes
19 #include "AsgTools/AsgTool.h"
20 
21 // System include(s):
22 #include <memory>
23 
24 // Local includes
27 
28 
29 // EDM includes
31 
32 namespace xAOD {
86  public asg::AsgTool, virtual public xAOD::IBPhysBlindingTool {
87 
90 
91  public:
94  BPhysBlindingTool(const std::string& name = "BPhysBlindingTool");
97  virtual StatusCode initialize() override;
98 
101  virtual StatusCode finalize() override;
102 
109  virtual float doBlind(const float& val) override;
110 
120  virtual float doUnblind(const float& val) override;
121 
131  virtual float doBlind(const float& val,
132  const bool& negativeSign,
133  const float& offset,
134  const float& factor) override;
135 
148  virtual float doUnblind(const float& val,
149  const bool& negativeSign,
150  const float& offset,
151  const float& factor) override;
152 
155  virtual StatusCode doBlind() override;
156 
159  virtual StatusCode doUnblind() override;
160 
161  protected:
165  virtual StatusCode doBlindingAction(bool unblind=false);
172  virtual bool pass(const SG::AuxElement& em, std::string hypo);
173 
177  virtual std::vector<std::string> getTokens(std::string input,
178  std::string seperators);
182  virtual std::string vecToString(const std::vector<float>& v) const;
186  virtual std::string vecToString(const std::vector<bool>& v) const;
190  virtual StatusCode cacheEvent();
192 
193  protected:
204  std::string m_varToBlindNames;
209  std::string m_blindingFlag;
215  std::vector<float> m_vOffsets;
221  std::vector<float> m_vFactors;
227  std::vector<bool> m_vNegSigns;
230  std::string m_blindKey;
233  std::string m_unblindKey;
235 
241 
248 
262  private:
267  std::vector<std::string> m_vVarNames;
268 
273 
274  }; // class BPhysBlindingTool
275 
276 } // namespace xAOD
277 
278 #endif // BPHYSTOOLS_BPHYSBLINDINGTOOL_H
xAOD::BPhysBlindingTool::doBlindingAction
virtual StatusCode doBlindingAction(bool unblind=false)
Definition: BPhysBlindingTool.cxx:271
xAOD::BPhysBlindingTool::m_vtxAuxContainer
xAOD::VertexAuxContainer * m_vtxAuxContainer
Definition: BPhysBlindingTool.h:240
xAOD::BPhysBlindingTool::m_vtxContainer
xAOD::VertexContainer * m_vtxContainer
Definition: BPhysBlindingTool.h:239
xAOD::BPhysBlindingTool::m_eventsForUnblindingSeen
long m_eventsForUnblindingSeen
Definition: BPhysBlindingTool.h:256
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
xAOD::BPhysBlindingTool::m_varToBlindNames
std::string m_varToBlindNames
List of variables to blind.
Definition: BPhysBlindingTool.h:204
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:446
xAOD::BPhysBlindingTool::doUnblind
virtual StatusCode doUnblind() override
Perform unblinding of requested variables.
Definition: BPhysBlindingTool.cxx:251
xAOD::BPhysBlindingTool::m_cachedRun
int m_cachedRun
Definition: BPhysBlindingTool.h:246
xAOD::BPhysBlindingTool::m_eventsForBlindingSeen
long m_eventsForBlindingSeen
Definition: BPhysBlindingTool.h:254
SimpleEncrypter.h
Provide simple asymmetric encryption for blinding of float values.
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::BPhysBlindingTool::doBlind
virtual StatusCode doBlind() override
Perform blinding of requested variables.
Definition: BPhysBlindingTool.cxx:237
xAOD::SimpleEncrypter
Provide simple asymmetric encryption for blinding of float values.
Definition: SimpleEncrypter.h:36
xAOD::BPhysBlindingTool::vecToString
virtual std::string vecToString(const std::vector< float > &v) const
Convert vector of floats to string.
Definition: BPhysBlindingTool.cxx:440
xAOD::BPhysBlindingTool::m_senc
SimpleEncrypter m_senc
Instance of SimpleEncrypter.
Definition: BPhysBlindingTool.h:272
xAOD::BPhysBlindingTool::m_blindingFlag
std::string m_blindingFlag
Flag to indicate candidates for blinding.
Definition: BPhysBlindingTool.h:209
xAOD::BPhysBlindingTool::m_vNegSigns
std::vector< bool > m_vNegSigns
Flip signs to negative range?
Definition: BPhysBlindingTool.h:227
xAOD::BPhysBlindingTool::m_candidatesUnblinded
long m_candidatesUnblinded
Definition: BPhysBlindingTool.h:261
IBPhysBlindingTool.h
Interface for dual-use tool for (un-)blinding of float values.
xAOD::BPhysBlindingTool::m_unblindKey
std::string m_unblindKey
Key for unblinding.
Definition: BPhysBlindingTool.h:233
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
xAOD::BPhysBlindingTool::m_vertexContainerName
std::string m_vertexContainerName
Definition: BPhysBlindingTool.h:199
xAOD::BPhysBlindingTool::m_candidatesForUnblindingSeen
long m_candidatesForUnblindingSeen
Definition: BPhysBlindingTool.h:257
xAOD::BPhysBlindingTool::m_cachedEvent
int m_cachedEvent
Definition: BPhysBlindingTool.h:247
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::IBPhysBlindingTool
Interface for dual-use tool for blinding and unblinding certain float values provided as variables in...
Definition: IBPhysBlindingTool.h:35
xAOD::BPhysBlindingTool::m_vOffsets
std::vector< float > m_vOffsets
Offsets applied to values before blinding.
Definition: BPhysBlindingTool.h:215
xAOD::BPhysBlindingTool
Definition: BPhysBlindingTool.h:86
xAOD::BPhysBlindingTool::getTokens
virtual std::vector< std::string > getTokens(std::string input, std::string seperators)
Tokenize a string using certain separators.
Definition: BPhysBlindingTool.cxx:426
python.PyAthena.v
v
Definition: PyAthena.py:157
xAOD::BPhysBlindingTool::pass
virtual bool pass(const SG::AuxElement &em, std::string hypo)
Definition: BPhysBlindingTool.cxx:415
xAOD::BPhysBlindingTool::m_blindKey
std::string m_blindKey
Key for blinding.
Definition: BPhysBlindingTool.h:230
xAOD::BPhysBlindingTool::m_vFactors
std::vector< float > m_vFactors
Scale factors applied before blinding.
Definition: BPhysBlindingTool.h:221
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
xAOD::BPhysBlindingTool::m_eventsUnblinded
long m_eventsUnblinded
Definition: BPhysBlindingTool.h:260
xAOD::BPhysBlindingTool::m_vVarNames
std::vector< std::string > m_vVarNames
Vector of variable names.
Definition: BPhysBlindingTool.h:267
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
xAOD::BPhysBlindingTool::initialize
virtual StatusCode initialize() override
Method initialising the tool.
Definition: BPhysBlindingTool.cxx:72
xAOD::BPhysBlindingTool::BPhysBlindingTool
BPhysBlindingTool(const std::string &name="BPhysBlindingTool")
Declare the correct constructor for Athena.
Definition: BPhysBlindingTool.cxx:25
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
xAOD::BPhysBlindingTool::m_eventsBlinded
long m_eventsBlinded
Definition: BPhysBlindingTool.h:258
xAOD::BPhysBlindingTool::m_candidatesBlinded
long m_candidatesBlinded
Definition: BPhysBlindingTool.h:259
xAOD::BPhysBlindingTool::m_candidatesForBlindingSeen
long m_candidatesForBlindingSeen
Definition: BPhysBlindingTool.h:255
xAOD::BPhysBlindingTool::finalize
virtual StatusCode finalize() override
Method finalizing the tool.
Definition: BPhysBlindingTool.cxx:144
AsgTool.h
xAOD::BPhysBlindingTool::cacheEvent
virtual StatusCode cacheEvent()
Definition: BPhysBlindingTool.cxx:351
VertexAuxContainer.h