Skip to content
Snippets Groups Projects
Commit c1105092 authored by Nicholas Styles's avatar Nicholas Styles Committed by Graeme Stewart
Browse files

added EventInfo unlocker (RecAlgs-00-00-19)

parent fd3a01ac
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,8 @@ use RecEvent RecEvent-* Reconstruction
use AthenaBaseComps AthenaBaseComps-* Control
use GaudiInterface GaudiInterface-* External
use AtlasROOT AtlasROOT-* External
use xAODEventInfo xAODEventInfo-* Event/xAOD
use CxxUtils CxxUtils-* Control
end_private
#apply_pattern declare_joboptions files="*.py"
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "EventInfoUnlocker.h"
#include "StoreGate/StoreGateSvc.h"
#include "xAODEventInfo/EventInfo.h"
#include "xAODEventInfo/EventAuxInfo.h"
#include "CxxUtils/make_unique.h"
//================ Constructor =================================================
EventInfoUnlocker::EventInfoUnlocker(const std::string& name, ISvcLocator* pSvcLocator)
:
AthAlgorithm(name,pSvcLocator)
{
}
//================ Initialisation =================================================
StatusCode EventInfoUnlocker::initialize()
{
ATH_MSG_DEBUG( "initialize: Setting up EventInfo Unlocker - **ONLY needed ror running on ESD!**");
// retrieve the StoreGate Service (delete if not needed)
if (!evtStore().retrieve().isSuccess()) {
ATH_MSG_ERROR("Could not retrieve StoreGateSvc!");
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
StatusCode EventInfoUnlocker::execute()
{
const SG::DataProxy* proxy =
evtStore()->proxy (ClassID_traits<xAOD::EventInfo>::ID(),
"EventInfo");
if (!proxy) {
ATH_MSG_WARNING( "No xAOD::EventInfoContainer "
<< "with key EventInfo found" );
return StatusCode::SUCCESS;
}
if (proxy->isConst()) {
const xAOD::EventInfo* ccoll = nullptr;
const xAOD::EventAuxInfo* cauxcoll = nullptr;
ATH_CHECK( evtStore()->retrieve (ccoll,
"EventInfo") );
ATH_CHECK( evtStore()->retrieve (cauxcoll,
"EventInfoAux.") );
xAOD::EventInfo * eventInfo = new xAOD::EventInfo;
xAOD::EventAuxInfo * store = new xAOD::EventAuxInfo;
eventInfo->setStore(store);
*eventInfo = *ccoll;
CHECK( evtStore()->overwrite (eventInfo,
"EventInfo",
true, false) );
CHECK( evtStore()->overwrite (store,
"EventInfoAux.",
true, false) );
}
return StatusCode::SUCCESS;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef RECALGS_EVENTINFOUNLOCKER_H
#define RECALGS_EVENTINFOUNLOCKER_H
// Gaudi includes
#include "GaudiKernel/ServiceHandle.h"
#include "AthenaBaseComps/AthAlgorithm.h"
/** @class EventInfoUnlocker
To be scheduled when running reonstruction from ESD - copies EventInfo container content into new non-const container and overwrites StoreGate
@author Nick Styles <nicholas.styles AT cern.ch>
*/
class EventInfoUnlocker : public AthAlgorithm
{
public:
/** Standard Athena-Algorithm Constructor */
EventInfoUnlocker(const std::string& name, ISvcLocator* pSvcLocator);
/** Default Destructor */
~EventInfoUnlocker() {};
/** standard Athena-Algorithm method */
StatusCode initialize();
/** standard Athena-Algorithm method */
StatusCode execute();
/** standard Athena-Algorithm method */
StatusCode finalize()
{ return StatusCode::SUCCESS; };
};
#endif
......@@ -24,12 +24,12 @@ namespace G__functionscope {
JobInfo::JobInfo(const std::string& name, ISvcLocator* pSvcLocator)
:
AthAlgorithm(name,pSvcLocator),
#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
m_events(0),
m_last_entries(0),
#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
m_max_entries(G__functionscope::sm_tagdefining),
#endif
m_no_warnings(true),
#endif
m_printFATAL(false)
{
declareProperty("PrintFATAL", m_printFATAL,"flag to decide if a FATAL should be printed - protection for Tier0");
......
......@@ -8,6 +8,7 @@
// Gaudi includes
#include "GaudiKernel/ServiceHandle.h"
#include "AthenaBaseComps/AthAlgorithm.h"
#include "RVersion.h"
#include <string>
/** @class JobInfo
......@@ -39,6 +40,7 @@ class JobInfo : public AthAlgorithm
private:
#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
int m_events;
int m_last_entries;
......@@ -46,6 +48,7 @@ class JobInfo : public AthAlgorithm
int m_max_entries;
bool m_no_warnings;
#endif
bool m_printFATAL;
};
......
......@@ -2,13 +2,16 @@
#include "../TimingAlg.h"
#include "../MemoryAlg.h"
#include "../JobInfo.h"
#include "../EventInfoUnlocker.h"
DECLARE_ALGORITHM_FACTORY( TimingAlg )
DECLARE_ALGORITHM_FACTORY( MemoryAlg )
DECLARE_ALGORITHM_FACTORY( JobInfo )
DECLARE_ALGORITHM_FACTORY( EventInfoUnlocker )
DECLARE_FACTORY_ENTRIES( RecAlgs ) {
DECLARE_ALGORITHM( TimingAlg );
DECLARE_ALGORITHM( MemoryAlg );
DECLARE_ALGORITHM( JobInfo );
DECLARE_ALGORITHM( EventInfoUnlocker );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment