diff --git a/Simulation/Tests/DigitizationTests/CMakeLists.txt b/Simulation/Tests/DigitizationTests/CMakeLists.txt index 06c3cf0c96bfd795808d9ab8eec7720b6256fbc2..455235174d1861973b8ecefa7bb9c3a276a22099 100644 --- a/Simulation/Tests/DigitizationTests/CMakeLists.txt +++ b/Simulation/Tests/DigitizationTests/CMakeLists.txt @@ -11,7 +11,7 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel PRIVATE Control/AthenaKernel - Event/EventInfo + Event/xAOD/xAODEventInfo Generators/GeneratorObjects InnerDetector/InDetDetDescr/InDetIdentifier InnerDetector/InDetRawEvent/InDetRawData @@ -26,7 +26,7 @@ atlas_add_component( DigitizationTests src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel AthenaKernel EventInfo GeneratorObjects InDetIdentifier InDetRawData InDetSimData ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel AthenaKernel GeneratorObjects InDetIdentifier InDetRawData InDetSimData xAODEventInfo ) # Install files from the package: atlas_install_headers( DigitizationTests ) diff --git a/Simulation/Tests/DigitizationTests/DigitizationTests/EventInfoTest.h b/Simulation/Tests/DigitizationTests/DigitizationTests/EventInfoTest.h new file mode 100644 index 0000000000000000000000000000000000000000..7bad30f58a5b23b609f618db6dfb42adf1a174f2 --- /dev/null +++ b/Simulation/Tests/DigitizationTests/DigitizationTests/EventInfoTest.h @@ -0,0 +1,24 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DIGITIZATIONTESTS_EVENTINFOTEST_H +#define DIGITIZATIONTESTS_EVENTINFOTEST_H + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "xAODEventInfo/EventInfo.h" + +class EventInfoTest : public AthAlgorithm { + public: + EventInfoTest(const std::string& name, ISvcLocator* pSvcLocator); + + StatusCode initialize(); + StatusCode execute(); + + private: + // SG::ReadHandleKey<xAOD::EventInfo> m_rhkEventInfo; + SG::ReadHandleKey<xAOD::EventInfo> m_rhkEventInfo{ + this, "EventInfoName", "EventInfo", "EventInfo name"}; +}; + +#endif diff --git a/Simulation/Tests/DigitizationTests/DigitizationTests/PileUpEventInfoTest.h b/Simulation/Tests/DigitizationTests/DigitizationTests/PileUpEventInfoTest.h deleted file mode 100644 index ad4453847d8e8a2afc507a12204b648a624a671c..0000000000000000000000000000000000000000 --- a/Simulation/Tests/DigitizationTests/DigitizationTests/PileUpEventInfoTest.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef DIGITIZATIONTESTS_PILEUPEVENTINFOTEST_H -#define DIGITIZATIONTESTS_PILEUPEVENTINFOTEST_H - -#include "AthenaBaseComps/AthAlgorithm.h" - -class PileUpEventInfoTest : public AthAlgorithm { - -public: - - PileUpEventInfoTest(const std::string& name, ISvcLocator* pSvcLocator); - - StatusCode initialize(); - StatusCode execute(); - StringProperty m_pileupInfo; -}; - -#endif diff --git a/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfig.py b/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfig.py index d9f3d2d69f8a98e9c78e622d855e523d69a00940..08255549d106c5d394867146231c20e28f727651 100644 --- a/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfig.py +++ b/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfig.py @@ -1,15 +1,23 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr + def McEventCollectionTestTool(name="McEventCollectionTestTool", **kwargs): return CfgMgr.McEventCollectionTestTool(name, **kwargs) -def PileUpEventInfoTestTool(name="PileUpEventInfoTestTool", **kwargs): - return CfgMgr.PileUpEventInfoTestTool(name, **kwargs) + + +def EventInfoTestTool(name="EventInfoTestTool", **kwargs): + return CfgMgr.EventInfoTestTool(name, **kwargs) + + def PixelRDOsTestTool(name="PixelRDOsTestTool", **kwargs): return CfgMgr.PixelRDOsTestTool(name, **kwargs) + + def SCT_RDOsTestTool(name="SCT_RDOsTestTool", **kwargs): return CfgMgr.SCT_RDOsTestTool(name, **kwargs) + + def TRT_RDOsTestTool(name="TRT_RDOsTestTool", **kwargs): return CfgMgr.TRT_RDOsTestTool(name, **kwargs) - diff --git a/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfigDb.py b/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfigDb.py index 3f440b76a0e7e74acf6c926089c3b3b05ea40064..1ab8de5490538ecd9d41e01206ee0af4d8f36dd6 100644 --- a/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfigDb.py +++ b/Simulation/Tests/DigitizationTests/python/DigitizationTestsConfigDb.py @@ -1,9 +1,14 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.CfgGetter import addTool -addTool("DigitizationTests.DigitizationTestsConfig.McEventCollectionTestTool", "McEventCollectionTestTool") -addTool("DigitizationTests.DigitizationTestsConfig.PileUpEventInfoTestTool", "PileUpEventInfoTestTool") -addTool("DigitizationTests.DigitizationTestsConfig.PixelRDOsTestTool", "PixelRDOsTestTool") -addTool("DigitizationTests.DigitizationTestsConfig.SCT_RDOsTestTool", "SCT_RDOsTestTool") -addTool("DigitizationTests.DigitizationTestsConfig.TRT_RDOsTestTool", "TRT_RDOsTestTool") +addTool("DigitizationTests.DigitizationTestsConfig.McEventCollectionTestTool", + "McEventCollectionTestTool") +addTool("DigitizationTests.DigitizationTestsConfig.EventInfoTestTool", + "EventInfoTestTool") +addTool("DigitizationTests.DigitizationTestsConfig.PixelRDOsTestTool", + "PixelRDOsTestTool") +addTool("DigitizationTests.DigitizationTestsConfig.SCT_RDOsTestTool", + "SCT_RDOsTestTool") +addTool("DigitizationTests.DigitizationTestsConfig.TRT_RDOsTestTool", + "TRT_RDOsTestTool") diff --git a/Simulation/Tests/DigitizationTests/share/postInclude.RDO_Plots.py b/Simulation/Tests/DigitizationTests/share/postInclude.RDO_Plots.py index 78144701fef699d6959dd193041e86326071dc76..c009af60b1c8b2be5b246130eba842ed3616c9cc 100644 --- a/Simulation/Tests/DigitizationTests/share/postInclude.RDO_Plots.py +++ b/Simulation/Tests/DigitizationTests/share/postInclude.RDO_Plots.py @@ -1,22 +1,27 @@ +from DigitizationTests.DigitizationTestsConf import DigiTestAlg, McEventCollectionTestTool, PixelRDOsTestTool, SCT_RDOsTestTool, TRT_RDOsTestTool +from AthenaCommon import CfgGetter +from AthenaCommon.AlgSequence import AlgSequence from AthenaCommon.AppMgr import ServiceMgr from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc("THistSvc") #ServiceMgr.THistSvc.Output = ["atlasTest DATAFILE='atlasTest.muons.histo.root' OPT='RECREATE'"]; -ServiceMgr.THistSvc.Output = ["truth DATAFILE='RDO_truth.root' OPT='RECREATE'"]; +ServiceMgr.THistSvc.Output = ["truth DATAFILE='RDO_truth.root' OPT='RECREATE'"] -from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() -from AthenaCommon import CfgGetter -from DigitizationTests.DigitizationTestsConf import DigiTestAlg,McEventCollectionTestTool,PixelRDOsTestTool,SCT_RDOsTestTool,TRT_RDOsTestTool job += DigiTestAlg() if DetFlags.Truth_on(): - job.DigiTestAlg.DigiTestTools += [CfgGetter.getPublicTool("McEventCollectionTestTool", checkType=True)] + job.DigiTestAlg.DigiTestTools += [CfgGetter.getPublicTool( + "McEventCollectionTestTool", checkType=True)] if DetFlags.Truth_on(): - if DetFlags.pileup.any_on(): - job.DigiTestAlg.DigiTestTools += [CfgGetter.getPublicTool("PileUpEventInfoTestTool", checkType=True)] + if DetFlags.pileup.any_on(): + job.DigiTestAlg.DigiTestTools += [ + CfgGetter.getPublicTool("EventInfoTestTool", checkType=True)] if DetFlags.pixel_on(): - job.DigiTestAlg.DigiTestTools += [CfgGetter.getPublicTool("PixelRDOsTestTool", checkType=True)] + job.DigiTestAlg.DigiTestTools += [ + CfgGetter.getPublicTool("PixelRDOsTestTool", checkType=True)] if DetFlags.SCT_on(): - job.DigiTestAlg.DigiTestTools += [CfgGetter.getPublicTool("SCT_RDOsTestTool", checkType=True)] + job.DigiTestAlg.DigiTestTools += [ + CfgGetter.getPublicTool("SCT_RDOsTestTool", checkType=True)] if DetFlags.TRT_on(): - job.DigiTestAlg.DigiTestTools += [CfgGetter.getPublicTool("TRT_RDOsTestTool", checkType=True)] + job.DigiTestAlg.DigiTestTools += [ + CfgGetter.getPublicTool("TRT_RDOsTestTool", checkType=True)] diff --git a/Simulation/Tests/DigitizationTests/src/EventInfoTest.cxx b/Simulation/Tests/DigitizationTests/src/EventInfoTest.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6457d3aab0249b4cd460d2fe88ba4711d19b702c --- /dev/null +++ b/Simulation/Tests/DigitizationTests/src/EventInfoTest.cxx @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DigitizationTests/EventInfoTest.h" + +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include "AthenaKernel/errorcheck.h" + +EventInfoTest::EventInfoTest(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) { + declareProperty("EventInfoName", m_rhkEventInfo); +} + +StatusCode EventInfoTest::initialize() { + ATH_MSG_INFO("Initializing " << name() << " - package version " + << PACKAGE_VERSION); + ATH_CHECK(m_rhkEventInfo.initialize()); + return StatusCode::SUCCESS; +} + +StatusCode EventInfoTest::execute() { + SG::ReadHandle<xAOD::EventInfo> pevt(m_rhkEventInfo); + if (!pevt.isValid()) { + ATH_MSG_ERROR("Could not get xAOD::EventInfo with key " + << m_rhkEventInfo.key()); + return StatusCode::SUCCESS; + } + + ATH_MSG_DEBUG("Successfully retrieved event info as xAOD::EventInfo"); + + //+++ Get sub-event info object + ATH_MSG_DEBUG("Main Event Info: "); + ATH_MSG_INFO("RunNumber = " << pevt->runNumber()); + ATH_MSG_INFO("Event Number = " << pevt->eventNumber()); + ATH_MSG_INFO("LumiBlock = " << pevt->lumiBlock()); + ATH_MSG_INFO("TimeStamp = " << pevt->timeStamp()); + ATH_MSG_INFO("BCID = " << pevt->bcid()); + ATH_MSG_INFO("mu = " << pevt->actualInteractionsPerCrossing()); + ATH_MSG_INFO("<mu> = " << pevt->averageInteractionsPerCrossing()); + + ATH_MSG_INFO("xAOD::EventInfo::SubEvent info: "); + std::vector<xAOD::EventInfo::SubEvent>::const_iterator it = + pevt->subEvents().begin(); + std::vector<xAOD::EventInfo::SubEvent>::const_iterator end = + pevt->subEvents().end(); + if (it == end) ATH_MSG_INFO("No xAOD::EventInfo::SubEvent found"); + for (auto sevt : pevt->subEvents()) { + if (sevt.ptr() != NULL) { + ATH_MSG_INFO("SubEvent info:"); + ATH_MSG_INFO(" Time : " + << (*it).time() << endmsg + << " Index : " << (*it).index() << endmsg + << " Run Number : " << sevt.ptr()->runNumber() << endmsg + << " Event Number : " << sevt.ptr()->eventNumber() << endmsg + << " ns Offset : " << sevt.ptr()->timeStampNSOffset() + << endmsg << " Lumi Block : " << sevt.ptr()->lumiBlock() + << endmsg << " BCID : " << sevt.ptr()->bcid() + << endmsg << " PileUpType : " << (*it).type()); + ++it; + } else + ATH_MSG_INFO("xAOD::EventInfo::SubEvent is null"); + } + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tests/DigitizationTests/src/EventInfoTestTool.cxx b/Simulation/Tests/DigitizationTests/src/EventInfoTestTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..59fcf8c3e0b3c1c8459b8df7e624fe3fe38ddc0a --- /dev/null +++ b/Simulation/Tests/DigitizationTests/src/EventInfoTestTool.cxx @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "EventInfoTestTool.h" + +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include "AthenaKernel/errorcheck.h" + +EventInfoTestTool::EventInfoTestTool(const std::string& type, + const std::string& name, + const IInterface* parent) + : DigiTestToolBase(type, name, parent) { + declareProperty("EventInfoName", m_rhkEventInfo); +} + +StatusCode EventInfoTestTool::initialize() { + ATH_MSG_INFO("Initializing " << name() << " - package version " + << PACKAGE_VERSION); + ATH_CHECK(m_rhkEventInfo.initialize()); + return StatusCode::SUCCESS; +} + +StatusCode EventInfoTestTool::processEvent() { + SG::ReadHandle<xAOD::EventInfo> pevt(m_rhkEventInfo); + if (!pevt.isValid()) { + ATH_MSG_ERROR("Could not get xAOD::EventInfo with key " + << m_rhkEventInfo.key()); + return StatusCode::SUCCESS; + } + + ATH_MSG_DEBUG("Successfully retrieved event info as xAOD::EventInfo"); + + //+++ Get sub-event info object + ATH_MSG_DEBUG("Main Event Info: "); + ATH_MSG_INFO("RunNumber = " << pevt->runNumber()); + ATH_MSG_INFO("Event Number = " << pevt->eventNumber()); + ATH_MSG_INFO("LumiBlock = " << pevt->lumiBlock()); + ATH_MSG_INFO("TimeStamp = " << pevt->timeStamp()); + ATH_MSG_INFO("BCID = " << pevt->bcid()); + ATH_MSG_INFO("mu = " << pevt->actualInteractionsPerCrossing()); + ATH_MSG_INFO("<mu> = " << pevt->averageInteractionsPerCrossing()); + + ATH_MSG_INFO("xAOD::EventInfo::SubEvent info: "); + std::vector<xAOD::EventInfo::SubEvent>::const_iterator it = + pevt->subEvents().begin(); + std::vector<xAOD::EventInfo::SubEvent>::const_iterator end = + pevt->subEvents().end(); + if (it == end) ATH_MSG_INFO("No xAOD::EventInfo::SubEvent found"); + for (auto sevt : pevt->subEvents()) { + if (sevt.ptr() != NULL) { + ATH_MSG_INFO("SubEvent info:"); + ATH_MSG_INFO(" Time : " + << (*it).time() << endmsg + << " Index : " << (*it).index() << endmsg + << " Run Number : " << sevt.ptr()->runNumber() << endmsg + << " Event Number : " << sevt.ptr()->eventNumber() << endmsg + << " ns Offset : " << sevt.ptr()->timeStampNSOffset() + << endmsg << " Lumi Block : " << sevt.ptr()->lumiBlock() + << endmsg << " BCID : " << sevt.ptr()->bcid() + << endmsg << " PileUpType : " << (*it).type()); + ++it; + } else + ATH_MSG_INFO("xAOD::EventInfo::SubEvent is null"); + } + + return StatusCode::SUCCESS; +} + +StatusCode EventInfoTestTool::finalize() { return StatusCode::SUCCESS; } diff --git a/Simulation/Tests/DigitizationTests/src/EventInfoTestTool.h b/Simulation/Tests/DigitizationTests/src/EventInfoTestTool.h new file mode 100644 index 0000000000000000000000000000000000000000..014a713f55e1c8e531676c92b2fb1531104a5b18 --- /dev/null +++ b/Simulation/Tests/DigitizationTests/src/EventInfoTestTool.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef G4AT_EVENTINFOTESTTOOL +#define G4AT_EVENTINFOTESTTOOL + +#include "DigiTestToolBase.h" +#include "xAODEventInfo/EventInfo.h" + +class EventInfoTestTool : public DigiTestToolBase { + public: + EventInfoTestTool(const std::string& name, const std::string& type, + const IInterface* parent); + + StatusCode initialize(); + + StatusCode processEvent(); + + StatusCode finalize(); + + private: + SG::ReadHandleKey<xAOD::EventInfo> m_rhkEventInfo{ + this, "EventInfoName", "EventInfo", "EventInfo name"}; +}; + +#endif diff --git a/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTest.cxx b/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTest.cxx deleted file mode 100644 index 8988f89fd5b9358657fbe82703382932c0462dd7..0000000000000000000000000000000000000000 --- a/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTest.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#include "DigitizationTests/PileUpEventInfoTest.h" - -#include "EventInfo/PileUpEventInfo.h" -#include "EventInfo/EventInfo.h" -#include "EventInfo/EventID.h" -#include "EventInfo/PileUpTimeEventIndex.h" -#include "EventInfo/EventType.h" - -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include "AthenaKernel/errorcheck.h" -PileUpEventInfoTest::PileUpEventInfoTest(const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm(name, pSvcLocator), - m_pileupInfo("McEventInfo") -{ - declareProperty("EventInfoName", m_pileupInfo); -} - - -StatusCode PileUpEventInfoTest::initialize() -{ - ATH_MSG_INFO ( "Initializing " << name() << " - package version " << PACKAGE_VERSION ); - return StatusCode::SUCCESS; -} - - -StatusCode PileUpEventInfoTest::execute() -{ - const PileUpEventInfo* pevt = 0; - if ( evtStore()->retrieve(pevt, m_pileupInfo.value()).isFailure() ) { - ATH_MSG_ERROR ( "** Could not get pileup event info" ); - return StatusCode::SUCCESS; - } - else { - ATH_MSG_DEBUG ( "Pileup Info Retrieved Successfully as 'PileUpEventInfo' Object " ); - //+++ Get sub-event info object - const EventID *eventid = pevt->event_ID(); - ATH_MSG_DEBUG ( "Main Event Info: " ); - ATH_MSG_INFO ( "RunNumber = " << eventid->run_number() ); - ATH_MSG_INFO ( "Event Number = " << eventid->event_number() ); - ATH_MSG_INFO ( "LumiBlock = " << eventid->lumi_block() ); - ATH_MSG_INFO ( "TimeStamp = " << eventid->time_stamp() ); - ATH_MSG_INFO ( "BCID = " << eventid->bunch_crossing_id() ); - ATH_MSG_INFO ( "mu = " << pevt->actualInteractionsPerCrossing() ); - ATH_MSG_INFO ( "<mu> = " << pevt->averageInteractionsPerCrossing() ); - - ATH_MSG_INFO ( "Sub Event Infos: " ); - PileUpEventInfo::SubEvent::const_iterator it = pevt->beginSubEvt(); - PileUpEventInfo::SubEvent::const_iterator end = pevt->endSubEvt(); - if (it == end) ATH_MSG_INFO ( "None found" ); - for (; it != end; ++it) { - const EventInfo* sevt = (*it).pSubEvt; - if (sevt!=NULL) { - ATH_MSG_INFO ( "Sub Event Info:" ); - ATH_MSG_INFO ( " Time : " << (*it).time() << endmsg - << " Index : " << (*it).index() << endmsg - << " Provenance : " << (*it).type() << endmsg // This is the provenance stuff: signal, minbias, cavern, etc - << " Run Number : " << sevt->event_ID()->run_number() << endmsg - << " Event Number : " << sevt->event_ID()->event_number() << endmsg - << " ns Offset : " << sevt->event_ID()->time_stamp_ns_offset() << endmsg - << " Lumi Block : " << sevt->event_ID()->lumi_block() << endmsg - << " BCID : " << sevt->event_ID()->bunch_crossing_id() << endmsg - << " User Type : " << sevt->event_type()->user_type() ); - // if ((*it).time() == 0) { - // NInTimeEvents++; - // if ((*it).index() > 0) NInTimePileup++; - // } - } - else ATH_MSG_INFO ( "Subevent is null ptr " ); - } - } - return StatusCode::SUCCESS; -} - diff --git a/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTestTool.cxx b/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTestTool.cxx deleted file mode 100644 index 0ded0d32a81bffc8272847ffc105304f07f9ed8a..0000000000000000000000000000000000000000 --- a/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTestTool.cxx +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "PileUpEventInfoTestTool.h" - -#include "EventInfo/PileUpEventInfo.h" -#include "EventInfo/EventInfo.h" -#include "EventInfo/EventID.h" -#include "EventInfo/PileUpTimeEventIndex.h" -#include "EventInfo/EventType.h" - -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include "AthenaKernel/errorcheck.h" - -PileUpEventInfoTestTool::PileUpEventInfoTestTool(const std::string& type, - const std::string& name, - const IInterface* parent) - : DigiTestToolBase(type, name, parent), - //m_numberOfEventsSelected(0), - //m_collection("TruthEvent"), //("GEN_EVENT"), - m_pileupInfo("McEventInfo") -{ - declareProperty("PileUpEventInfoName", m_pileupInfo); -} - -StatusCode PileUpEventInfoTestTool::initialize() -{ - ATH_MSG_INFO ( "Initializing " << name() << " - package version " << PACKAGE_VERSION ); - return StatusCode::SUCCESS; -} - -StatusCode PileUpEventInfoTestTool::processEvent() { - - const PileUpEventInfo* pevt; - if ( evtStore()->retrieve(pevt, m_pileupInfo.value()).isFailure() ) { - ATH_MSG_ERROR ( "** Could not get pileup event info" ); - return StatusCode::SUCCESS; - } - - - ATH_MSG_DEBUG ( "Pileup Info Retrieved Successfully as 'PileUpEventInfo' Object " ); - //+++ Get sub-event info object - const EventID *eventid = pevt->event_ID(); - ATH_MSG_DEBUG ( "Main Event Info: " ); - ATH_MSG_INFO ( "RunNumber = " << eventid->run_number() ); - ATH_MSG_INFO ( "Event Number = " << eventid->event_number() ); - ATH_MSG_INFO ( "LumiBlock = " << eventid->lumi_block() ); - ATH_MSG_INFO ( "TimeStamp = " << eventid->time_stamp() ); - ATH_MSG_INFO ( "BCID = " << eventid->bunch_crossing_id() ); - ATH_MSG_INFO ( "mu = " << pevt->actualInteractionsPerCrossing() ); - ATH_MSG_INFO ( "<mu> = " << pevt->averageInteractionsPerCrossing() ); - - ATH_MSG_INFO ( "Sub Event Infos: " ); - PileUpEventInfo::SubEvent::const_iterator it = pevt->beginSubEvt(); - PileUpEventInfo::SubEvent::const_iterator end = pevt->endSubEvt(); - if (it == end) ATH_MSG_INFO ( "None found" ); - for (; it != end; ++it) { - const EventInfo* sevt = (*it).pSubEvt; - if (sevt!=NULL) { - ATH_MSG_INFO ( "Sub Event Info:" ); - ATH_MSG_INFO ( " Time : " << (*it).time() << endmsg - << " Index : " << (*it).index() << endmsg - << " Provenance : " << (*it).type() << endmsg // This is the provenance stuff: signal, minbias, cavern, etc - << " Run Number : " << sevt->event_ID()->run_number() << endmsg - << " Event Number : " << sevt->event_ID()->event_number() << endmsg - << " ns Offset : " << sevt->event_ID()->time_stamp_ns_offset() << endmsg - << " Lumi Block : " << sevt->event_ID()->lumi_block() << endmsg - << " BCID : " << sevt->event_ID()->bunch_crossing_id() << endmsg - << " User Type : " << sevt->event_type()->user_type() ); - // if ((*it).time() == 0) { - // NInTimeEvents++; - // if ((*it).index() > 0) NInTimePileup++; - // } - } - else ATH_MSG_INFO ( "Subevent is null ptr " ); - } - - - return StatusCode::SUCCESS; -} - -StatusCode PileUpEventInfoTestTool::finalize() -{ - return StatusCode::SUCCESS; -} - diff --git a/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTestTool.h b/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTestTool.h deleted file mode 100644 index 9615965b257f9afa4e6b3bd115388e6790f818af..0000000000000000000000000000000000000000 --- a/Simulation/Tests/DigitizationTests/src/PileUpEventInfoTestTool.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4AT_PILEUPEVENTINFOTESTTOOL -#define G4AT_PILEUPEVENTINFOTESTTOOL - -#include "DigiTestToolBase.h" - -class PixelID; - -class PileUpEventInfoTestTool : public DigiTestToolBase { - - public: - - PileUpEventInfoTestTool(const std::string& name, - const std::string& type, - const IInterface* parent); - - StatusCode initialize(); - - StatusCode processEvent(); - - StatusCode finalize(); - - private: - - StringProperty m_pileupInfo; - -}; - -#endif diff --git a/Simulation/Tests/DigitizationTests/src/components/DigitizationTests_entries.cxx b/Simulation/Tests/DigitizationTests/src/components/DigitizationTests_entries.cxx index 4586a77e4294bc8ac4c6dd41b7271c2dfd34e819..4bb919fcc93ebc2f769694b44aad2c8f60b54899 100644 --- a/Simulation/Tests/DigitizationTests/src/components/DigitizationTests_entries.cxx +++ b/Simulation/Tests/DigitizationTests/src/components/DigitizationTests_entries.cxx @@ -1,17 +1,13 @@ -#include "DigitizationTests/DigiTestAlg.h" -//#include "DigitizationTests/PileUpEventInfoTest.h" +#include "../EventInfoTestTool.h" #include "../McEventCollectionTestTool.h" -#include "../PileUpEventInfoTestTool.h" #include "../PixelRDOsTestTool.h" #include "../SCT_RDOsTestTool.h" #include "../TRT_RDOsTestTool.h" +#include "DigitizationTests/DigiTestAlg.h" - -DECLARE_COMPONENT( McEventCollectionTestTool ) -DECLARE_COMPONENT( PileUpEventInfoTestTool ) -DECLARE_COMPONENT( PixelRDOsTestTool ) -DECLARE_COMPONENT( SCT_RDOsTestTool ) -DECLARE_COMPONENT( TRT_RDOsTestTool ) -DECLARE_COMPONENT( DigiTestAlg ) -//DECLARE_COMPONENT( PileUpEventInfoTest ) - +DECLARE_COMPONENT(McEventCollectionTestTool) +DECLARE_COMPONENT(EventInfoTestTool) +DECLARE_COMPONENT(PixelRDOsTestTool) +DECLARE_COMPONENT(SCT_RDOsTestTool) +DECLARE_COMPONENT(TRT_RDOsTestTool) +DECLARE_COMPONENT(DigiTestAlg)