ATLAS Offline Software
Loading...
Searching...
No Matches
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
15
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
35public:
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
85private:
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
102 const StatusCode initializeCorrectionTools();
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
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Return value from object correction CP tools.
EGammaObjects
Define the categories of EGamma objects tool can be applied to.
std::vector< std::string > m_electronConfFiles
The configuration files for the base class - electrons.
std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase > > m_electronTools
The base class instances for single variable correction - electrons.
const StatusCode initializeCorrectionTools()
Configure, initialize, and check the base class instances saved in the m_*Tools members.
std::vector< std::string > m_unconvertedPhotonConfFiles
The configuration files for the base class - unconverted photons.
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.
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 ...
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.
virtual StatusCode initialize() override
Initialize the tool instance.
ElectronPhotonVariableCorrectionTool(const std::string &myname)
Declare the interface that the class provides.
std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase > > m_unconvertedPhotonTools
The base class instances for single variable correction - unconverted photons.
std::string m_configFile
The configuration file for the tool.
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...
std::vector< std::string > m_convertedPhotonConfFiles
The configuration files for the base class - converted photons.
virtual const CP::CorrectionCode applyCorrection(xAOD::Photon &photon) const override
Apply the correction given in the conf file to the passed photon.
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,...
std::vector< std::unique_ptr< ElectronPhotonVariableCorrectionBase > > m_convertedPhotonTools
The base class instances for single variable correction - converted photons.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".