28 return StatusCode::SUCCESS;
35 return StatusCode::SUCCESS;
57 if(!isMC)
ATH_MSG_ERROR(
"This is data, no scale factors should be used on the data!");
70 auto umyphotons = std::make_unique<xAOD::PhotonContainer>();
71 auto myphotonsAux = std::make_unique<xAOD::PhotonAuxContainer>();
73 umyphotons->setStore( myphotonsAux.get() );
86 ATH_MSG_DEBUG(
" photon pt = " << ph->pt() <<
", photon eta = " << ph->eta() );
89 if(!
m_photonSF->getEfficiencyScaleFactor(*ph,SF)){
93 if(!
m_photonSF->getEfficiencyScaleFactorError(*ph,SFerr)){
97 ATH_MSG_DEBUG(
" photon SF = " << SF <<
", photon SF sys error = " << SFerr );
101 ATH_MSG_ERROR(
"PhotonEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
102 return StatusCode::FAILURE;
106 myphotons->
push_back(std::make_unique<xAOD::Photon>());
107 *(myphotons->
back()) = *ph;
110 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
@ Error
Some error happened during the object correction.
const T * back() const
Access the last element in the collection as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode initialize()
virtual StatusCode execute()
virtual ~testAthenaPhotonAlg()
testAthenaPhotonAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize()
ToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_photonSF
The tool handle to our photon efficiency correction.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
Photon_v1 Photon
Definition of the current "egamma version".