diff --git a/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd67852d5d1d47ed92c21065465cf05726ec0ef0 --- /dev/null +++ b/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt @@ -0,0 +1,29 @@ +################################################################################ +# Package: AthenaPoolTools +################################################################################ + +# Declare the package name: +atlas_subdir( AthenaPoolTools ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PRIVATE + Control/AthenaBaseComps + Control/AthenaKernel + Control/StoreGate + Database/PersistentDataModel + Event/EventInfo + Event/xAOD/xAODEventInfo + GaudiKernel + TestPolicy ) + +# Component(s) in the package: +atlas_add_component( AthenaPoolTools + src/EventCount.cxx + src/RequireUniqueEvent.cxx + src/components/*.cxx + LINK_LIBRARIES AthenaBaseComps AthenaKernel StoreGateLib SGtests PersistentDataModel EventInfo xAODEventInfo GaudiKernel ) + +# Install files from the package: +atlas_install_joboptions( share/*.py ) +atlas_install_runtime( share/PoolMove ) + diff --git a/Database/AthenaPOOL/AthenaPoolTools/cmt/requirements b/Database/AthenaPOOL/AthenaPoolTools/cmt/requirements index 2ab6839611e45c535da01951c605cef1d6f62700..01f9b322f84147f7b55294d343a1a796edad618a 100755 --- a/Database/AthenaPOOL/AthenaPoolTools/cmt/requirements +++ b/Database/AthenaPOOL/AthenaPoolTools/cmt/requirements @@ -19,6 +19,7 @@ use AthenaKernel AthenaKernel-* Control use AthenaBaseComps AthenaBaseComps-* Control use PersistentDataModel PersistentDataModel-* Database use EventInfo EventInfo-* Event +use xAODEventInfo xAODEventInfo-* Event/xAOD use GaudiInterface GaudiInterface-* External use TestPolicy TestPolicy-* diff --git a/Database/AthenaPOOL/AthenaPoolTools/share/EventCount_jobOptions.py b/Database/AthenaPOOL/AthenaPoolTools/share/EventCount_jobOptions.py index d8b5221d590fe7ac405516cf826512a235736a03..691abe8892977b991b60559bf2d1b9dce84eff15 100755 --- a/Database/AthenaPOOL/AthenaPoolTools/share/EventCount_jobOptions.py +++ b/Database/AthenaPOOL/AthenaPoolTools/share/EventCount_jobOptions.py @@ -16,6 +16,11 @@ from AthenaCommon.Constants import INFO from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() +from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg +alg = xAODMaker__EventInfoCnvAlg() +alg.xAODKey = "" +topSequence += alg + from AthenaPoolTools.AthenaPoolToolsConf import EventCount topSequence += EventCount( OutputLevel = INFO, Dump = True ) diff --git a/Database/AthenaPOOL/AthenaPoolTools/src/EventCount.cxx b/Database/AthenaPOOL/AthenaPoolTools/src/EventCount.cxx index 894ad751742c550aeb7e5e5e2b66ff1701e099d5..f3b817531a0e09127867ab823e239298113cc213 100755 --- a/Database/AthenaPOOL/AthenaPoolTools/src/EventCount.cxx +++ b/Database/AthenaPOOL/AthenaPoolTools/src/EventCount.cxx @@ -15,9 +15,10 @@ #include "PersistentDataModel/Token.h" #include "PersistentDataModel/DataHeader.h" #include "EventInfo/EventInfo.h" -#include "EventInfo/EventType.h" -#include "EventInfo/EventID.h" -#include "EventInfo/TriggerInfo.h" +//#include "EventInfo/EventType.h" +//#include "EventInfo/EventID.h" +//#include "EventInfo/TriggerInfo.h" +#include "xAODEventInfo/EventInfo.h" #include "GaudiKernel/IIncidentSvc.h" #include "GaudiKernel/FileIncident.h" @@ -88,11 +89,11 @@ void EventCount::handle(const Incident& inc) StatusCode EventCount::execute() { - StatusCode sc = StatusCode::SUCCESS; ATH_MSG_DEBUG ( "in execute()" ); // Get the event header, print out event and run number - const DataHandle<EventInfo> evt; + ATH_MSG_INFO ( evtStore()->dump() ); + const DataHandle<xAOD::EventInfo> evt; ATH_CHECK( evtStore()->retrieve(evt) ); if (!evt.isValid()) { ATH_MSG_FATAL ( "Could not find event" ); @@ -100,43 +101,43 @@ StatusCode EventCount::execute() } ++m_nev; if (m_nev==1) { - m_first = evt->event_ID()->event_number(); - m_firstlb= evt->event_ID()->lumi_block(); + m_first = evt->eventNumber(); + m_firstlb= evt->lumiBlock(); } std::map<std::string,std::set<EventID> >::iterator kit = m_fileEvents.find(m_currentFile); if (kit==m_fileEvents.end()) { std::set<EventID> ini; - ini.insert(*(evt->event_ID())); + ini.insert(EventID(evt->runNumber(),evt->eventNumber())); m_fileEvents.insert(std::make_pair(m_currentFile,ini)); } else { - kit->second.insert(*(evt->event_ID())); + kit->second.insert(EventID(evt->runNumber(),evt->eventNumber())); } // track final event number - m_final = evt->event_ID()->event_number(); - m_finallb= evt->event_ID()->lumi_block(); + m_final = evt->eventNumber(); + m_finallb= evt->lumiBlock(); // keep list of runs - if (m_currentRun!=static_cast<int>(evt->event_ID()->run_number())) { - m_currentRun =static_cast<int>(evt->event_ID()->run_number()); - m_runs.push_back(static_cast<int>(evt->event_ID()->run_number())); + if (m_currentRun!=static_cast<int>(evt->runNumber())) { + m_currentRun =static_cast<int>(evt->runNumber()); + m_runs.push_back(static_cast<int>(evt->runNumber())); } // keep list of event types - if (evt->event_type()->test(EventType::IS_SIMULATION)) { + if (evt->eventType(xAOD::EventInfo::EventType::IS_SIMULATION)) { m_types.insert("Simulation"); } else {m_types.insert("Data");} - if (evt->event_type()->test(EventType::IS_TESTBEAM)) { + if (evt->eventType(xAOD::EventInfo::EventType::IS_TESTBEAM)) { m_types.insert("Testbeam"); } else {m_types.insert("Detector");} - if (evt->event_type()->test(EventType::IS_CALIBRATION)) { + if (evt->eventType(xAOD::EventInfo::EventType::IS_CALIBRATION)) { m_types.insert("Calibration"); } else {m_types.insert("Physics");} // Keep track of streams - std::vector<TriggerInfo::StreamTag>::const_iterator STit = evt->trigger_info()->streamTags().begin(); - std::vector<TriggerInfo::StreamTag>::const_iterator STend = evt->trigger_info()->streamTags().end(); + std::vector<xAOD::EventInfo::StreamTag>::const_iterator STit = evt->streamTags().begin(); + std::vector<xAOD::EventInfo::StreamTag>::const_iterator STend = evt->streamTags().end(); while (STit != STend) { // check if stream is in list, if not add it, otherwise increment it if (m_streams.find(STit->name()) == m_streams.end()) { @@ -149,8 +150,8 @@ StatusCode EventCount::execute() } - ATH_MSG_DEBUG ( "EventInfo event: " << evt->event_ID()->event_number() - << " run: " << evt->event_ID()->run_number() ); + ATH_MSG_DEBUG( "EventInfo event: " << evt->eventNumber() + << " run: " << evt->runNumber() ); // // Now check what objects are in storegate //