Skip to content
Snippets Groups Projects
Commit f9e138b7 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'varHandle.ZdcByteStream-20190201' into 'master'

ZdcByteStream: VarHandle migration.

See merge request atlas/athena!20839
parents c10ca40d a0d92ea1
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
/*
......@@ -17,7 +17,10 @@
#include <map>
#include <string>
#include "AthenaBaseComps/AthAlgorithm.h"
#include "ZdcByteStream/ZdcDefs.h"
#include "xAODTrigL1Calo/TriggerTowerContainer.h"
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "StoreGate/ReadHandleKey.h"
#include "AthContainers/DataVector.h"
class ISvcLocator;
......@@ -28,15 +31,15 @@ class ZdcDigitsCollection;
#include "xAODTrigL1Calo/TriggerTowerContainer.h"
class ZdcByteStreamRawDataV2: public AthAlgorithm
class ZdcByteStreamRawDataV2: public AthReentrantAlgorithm
{
public:
ZdcByteStreamRawDataV2(const std::string& name, ISvcLocator* pSvcLocator);
virtual ~ZdcByteStreamRawDataV2();
virtual StatusCode initialize();
virtual StatusCode execute();
virtual StatusCode finalize();
virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext& ctx) const override;
virtual StatusCode finalize() override;
private:
typedef std::map<unsigned int, const xAOD::TriggerTower*> ZdcTriggerTowersMap;
......@@ -46,7 +49,8 @@ private:
/// ZDC Container and collection
/// StoreGate key
std::string m_ZdcTriggerTowerContainerLocation;
SG::ReadHandleKey<xAOD::TriggerTowerContainer> m_ZdcTriggerTowerContainerLocation
{ this, "ZdcTriggerTowerContainerLocation", ZdcDefs::ZdcTriggerTowerContainerLocation, "" };
//void setupZdcTriggerTowersMap(const xAOD::TriggerTowerContainer* ttCollection);
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
/*
......@@ -15,7 +15,7 @@
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/StatusCode.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/ReadHandle.h"
#include "ZdcEvent/ZdcDigits.h"
#include "ZdcEvent/ZdcDigitsCollection.h"
......@@ -30,9 +30,8 @@
//==================================================================================================
ZdcByteStreamRawDataV2::ZdcByteStreamRawDataV2(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name, pSvcLocator)
AthReentrantAlgorithm(name, pSvcLocator)
{
declareProperty("ZdcTriggerTowerContainerLocation", m_ZdcTriggerTowerContainerLocation = ZdcDefs::ZdcTriggerTowerContainerLocation);
declareProperty("ForceSlicesLUT", m_forceSlicesLut = 0);
declareProperty("ForceSlicesFADC", m_forceSlicesFadc = 0);
}
......@@ -52,28 +51,22 @@ StatusCode ZdcByteStreamRawDataV2::initialize()
msg(MSG::INFO) << "Initializing " << name() << " - package version " << PACKAGE_VERSION
<< endmsg;
ATH_CHECK( m_ZdcTriggerTowerContainerLocation.initialize() );
return StatusCode::SUCCESS;
}
//==================================================================================================
//==================================================================================================
StatusCode ZdcByteStreamRawDataV2::execute()
StatusCode ZdcByteStreamRawDataV2::execute (const EventContext& ctx) const
{
if (!msgLvl(MSG::INFO)) return StatusCode::SUCCESS;
msg(MSG::INFO);
//ZdcDigitsCollection* ttCollection = 0;
const DataHandle<xAOD::TriggerTowerContainer> ttCollection;
msg(MSG::DEBUG) << "Looking for ZDC trigger tower container at " << m_ZdcTriggerTowerContainerLocation.key() << endmsg;
msg(MSG::DEBUG) << "Looking for ZDC trigger tower container at " << m_ZdcTriggerTowerContainerLocation << endmsg;
StatusCode sc = evtStore()->retrieve(ttCollection, m_ZdcTriggerTowerContainerLocation);
if (sc.isFailure() || !ttCollection || ttCollection->empty())
{
msg() << "No Zdc Digits found" << endmsg;
return StatusCode::SUCCESS;
}
SG::ReadHandle<xAOD::TriggerTowerContainer> ttCollection
(m_ZdcTriggerTowerContainerLocation, ctx);
msg(MSG::DEBUG) << ZdcToString(*ttCollection) << endmsg;
......
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