ATLAS Offline Software
ElectronPhotonVariableCorrectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ElectronPhotonVariableCorrectionTool_H
6 #define ElectronPhotonVariableCorrectionTool_H
7 
16 //ATLAS includes
17 #include "AsgTools/AsgTool.h"
20 
21 //EDM includes
22 #include "xAODEgamma/Electron.h"
23 #include "xAODEgamma/Photon.h"
24 
25 // ===========================================================================
26 // Class ElectronPhotonVariableCorrectionTool
27 // ===========================================================================
28 
30 {
31 
34 
35 public:
39  ElectronPhotonVariableCorrectionTool(const std::string& myname);
42 
47  virtual StatusCode initialize() override;
48 
57  virtual const CP::CorrectionCode applyCorrection( xAOD::Photon& photon ) const override;
58 
67  virtual const CP::CorrectionCode applyCorrection( xAOD::Electron& electron ) const override;
68 
75  virtual const CP::CorrectionCode correctedCopy( const xAOD::Photon& in_photon, xAOD::Photon*& out_photon ) const override;
76 
83  virtual const CP::CorrectionCode correctedCopy( const xAOD::Electron& in_electron, xAOD::Electron*& out_electron) const override;
84 
85 private:
87  std::string m_configFile;
89  std::vector<std::string> m_convertedPhotonConfFiles;
91  std::vector<std::string> m_unconvertedPhotonConfFiles;
93  std::vector<std::string> m_electronConfFiles;
95  std::vector<std::unique_ptr<ElectronPhotonVariableCorrectionBase>> m_convertedPhotonTools;
97  std::vector<std::unique_ptr<ElectronPhotonVariableCorrectionBase>> m_unconvertedPhotonTools;
99  std::vector<std::unique_ptr<ElectronPhotonVariableCorrectionBase>> m_electronTools;
100 
103 
109  const StatusCode initializeTools( const std::string& name, const std::vector<std::string>& confFiles, std::vector<std::unique_ptr<ElectronPhotonVariableCorrectionBase>>& toolHolder );
110 
115  const StatusCode getCorrectionVariableName( std::string &variableName, const std::string& confFile ) const;
116 
120  const StatusCode findAllConfigFiles( std::vector<std::string>& confFiles );
121 
127  const StatusCode applyToFlagMatchesToolHolder( const std::vector<std::string>& confFiles, const std::vector<std::unique_ptr<ElectronPhotonVariableCorrectionBase>>& toolHolder, ElectronPhotonVariableCorrectionBase::EGammaObjects toolHolderType );
128 
129 }; //end class ElectronPhotonVariableCorrectionTool
130 
131 #endif
ElectronPhotonVariableCorrectionTool::m_unconvertedPhotonTools
std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase > > m_unconvertedPhotonTools
The base class instances for single variable correction - unconverted photons.
Definition: ElectronPhotonVariableCorrectionTool.h:97
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
ElectronPhotonVariableCorrectionTool::~ElectronPhotonVariableCorrectionTool
~ElectronPhotonVariableCorrectionTool()
Standard destructor.
Definition: ElectronPhotonVariableCorrectionTool.h:41
ElectronPhotonVariableCorrectionTool::getCorrectionVariableName
const StatusCode getCorrectionVariableName(std::string &variableName, const std::string &confFile) const
Get current name of the variable to be corrected by the current base class instance,...
Definition: ElectronPhotonVariableCorrectionTool.cxx:239
ElectronPhotonVariableCorrectionTool::correctedCopy
virtual const CP::CorrectionCode correctedCopy(const xAOD::Photon &in_photon, xAOD::Photon *&out_photon) const override
Make a corrected copy of the passed photon according to the given conf file.
Definition: ElectronPhotonVariableCorrectionTool.cxx:221
ElectronPhotonVariableCorrectionTool
Tool to correct electron and photon MC variables using the ElectronPhotonVariableCorrectionBase class...
Definition: ElectronPhotonVariableCorrectionTool.h:30
IElectronPhotonShowerShapeFudgeTool
Definition: IElectronPhotonShowerShapeFudgeTool.h:30
ElectronPhotonVariableCorrectionTool::m_electronTools
std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase > > m_electronTools
The base class instances for single variable correction - electrons.
Definition: ElectronPhotonVariableCorrectionTool.h:99
ElectronPhotonVariableCorrectionTool::m_convertedPhotonConfFiles
std::vector< std::string > m_convertedPhotonConfFiles
The configuration files for the base class - converted photons.
Definition: ElectronPhotonVariableCorrectionTool.h:89
ElectronPhotonVariableCorrectionTool::m_electronConfFiles
std::vector< std::string > m_electronConfFiles
The configuration files for the base class - electrons.
Definition: ElectronPhotonVariableCorrectionTool.h:93
IElectronPhotonShowerShapeFudgeTool.h
ElectronPhotonVariableCorrectionTool::applyToFlagMatchesToolHolder
const StatusCode applyToFlagMatchesToolHolder(const std::vector< std::string > &confFiles, const std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase >> &toolHolder, ElectronPhotonVariableCorrectionBase::EGammaObjects toolHolderType)
Check if the ApplyTo flag from the base class conf file does match with the container type spcified i...
Definition: ElectronPhotonVariableCorrectionTool.cxx:141
ElectronPhotonVariableCorrectionTool::findAllConfigFiles
const StatusCode findAllConfigFiles(std::vector< std::string > &confFiles)
Locate all config files for the base class instances passed to the tool in m_configFile in the ATLAS ...
Definition: ElectronPhotonVariableCorrectionTool.cxx:102
ElectronPhotonVariableCorrectionTool::m_unconvertedPhotonConfFiles
std::vector< std::string > m_unconvertedPhotonConfFiles
The configuration files for the base class - unconverted photons.
Definition: ElectronPhotonVariableCorrectionTool.h:91
Photon.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ElectronPhotonVariableCorrectionBase::EGammaObjects
EGammaObjects
Define the categories of EGamma objects tool can be applied to.
Definition: ElectronPhotonVariableCorrectionBase.h:102
ElectronPhotonVariableCorrectionTool::applyCorrection
virtual const CP::CorrectionCode applyCorrection(xAOD::Photon &photon) const override
Apply the correction given in the conf file to the passed photon.
Definition: ElectronPhotonVariableCorrectionTool.cxx:166
ElectronPhotonVariableCorrectionTool::initializeCorrectionTools
const StatusCode initializeCorrectionTools()
Configure, initialize, and check the base class instances saved in the m_*Tools members.
Definition: ElectronPhotonVariableCorrectionTool.cxx:87
ElectronPhotonVariableCorrectionTool::m_configFile
std::string m_configFile
The configuration file for the tool.
Definition: ElectronPhotonVariableCorrectionTool.h:87
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::Electron_v1
Definition: Electron_v1.h:34
ElectronPhotonVariableCorrectionTool::ElectronPhotonVariableCorrectionTool
ElectronPhotonVariableCorrectionTool(const std::string &myname)
Declare the interface that the class provides.
Definition: ElectronPhotonVariableCorrectionTool.cxx:21
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
xAOD::Photon_v1
Definition: Photon_v1.h:37
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
ElectronPhotonVariableCorrectionTool::m_convertedPhotonTools
std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase > > m_convertedPhotonTools
The base class instances for single variable correction - converted photons.
Definition: ElectronPhotonVariableCorrectionTool.h:95
ElectronPhotonVariableCorrectionTool::initialize
virtual StatusCode initialize() override
Initialize the tool instance.
Definition: ElectronPhotonVariableCorrectionTool.cxx:28
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
Electron.h
AsgTool.h
ElectronPhotonVariableCorrectionBase.h
ElectronPhotonVariableCorrectionTool::initializeTools
const StatusCode initializeTools(const std::string &name, const std::vector< std::string > &confFiles, std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase >> &toolHolder)
Initialize the base clase instances saved in the m_*Tools members.
Definition: ElectronPhotonVariableCorrectionTool.cxx:119