diff --git a/Control/AthContainers/src/copyAuxStoreThinned.cxx b/Control/AthContainers/src/copyAuxStoreThinned.cxx index d93006a0a3f11f014090283fd1c70984c9284a1d..3d7c079a15ec8f37e62c25485f19b16faad9756f 100644 --- a/Control/AthContainers/src/copyAuxStoreThinned.cxx +++ b/Control/AthContainers/src/copyAuxStoreThinned.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// $Id$ /** * @file AthContainers/Root/copyAuxStoreThinned.cxx * @author scott snyder <snyder@bnl.gov> @@ -39,9 +38,11 @@ void copyAuxStoreThinned (const SG::IConstAuxStore& orig, SG::IAuxStore& copy, IThinningSvc* svc) { - copy.resize(0); size_t size = orig.size(); - if (size == 0) return; + if (size == 0) { + copy.resize(0); + return; + } size_t nremaining = 0; std::vector<unsigned char> flags; bool thinned = getThinnedFlags (svc, orig, nremaining, flags); diff --git a/Event/xAOD/xAODEventInfo/Root/EventAuxInfo_v2.cxx b/Event/xAOD/xAODEventInfo/Root/EventAuxInfo_v2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cad8d11221709c06cea12428d0df1264078cab0c --- /dev/null +++ b/Event/xAOD/xAODEventInfo/Root/EventAuxInfo_v2.cxx @@ -0,0 +1,97 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// Local include(s): +#include "xAODEventInfo/versions/EventAuxInfo_v2.h" + +namespace xAOD { + + EventAuxInfo_v2::EventAuxInfo_v2() + : AuxInfoBase(), + runNumber(0), + eventNumber(0), + lumiBlock(0), + timeStamp(0), + timeStampNSOffset(0), + bcid(0), + detectorMask0(0), + detectorMask1(0), + detectorMask2(0), + detectorMask3(0), + eventTypeBitmask(0), + statusElement(0), + extendedLevel1ID(0), + level1TriggerType(0), + pixelFlags(0), + sctFlags(0), + trtFlags(0), + larFlags(0), + tileFlags(0), + muonFlags(0), + forwardDetFlags(0), + coreFlags(0), + backgroundFlags(0), + lumiFlags(0), + beamPosX(0), + beamPosY(0), + beamPosZ(0), + beamPosSigmaX(0), + beamPosSigmaY(0), + beamPosSigmaZ(0), + beamPosSigmaXY(0), + beamTiltXZ(0), + beamTiltYZ(0), + beamStatus(0) + { + + // Basic event information: + AUX_VARIABLE( runNumber ); + AUX_VARIABLE( eventNumber ); + AUX_VARIABLE( lumiBlock ); + AUX_VARIABLE( timeStamp ); + AUX_VARIABLE( timeStampNSOffset ); + AUX_VARIABLE( bcid ); + AUX_VARIABLE( detectorMask0 ); + AUX_VARIABLE( detectorMask1 ); + AUX_VARIABLE( detectorMask2 ); + AUX_VARIABLE( detectorMask3 ); + + // Event type information: + AUX_VARIABLE( detDescrTags ); + AUX_VARIABLE( eventTypeBitmask ); + + // Trigger related information: + AUX_VARIABLE( statusElement ); + AUX_VARIABLE( extendedLevel1ID ); + AUX_VARIABLE( level1TriggerType ); + AUX_VARIABLE( streamTagNames ); + AUX_VARIABLE( streamTagTypes ); + AUX_VARIABLE( streamTagObeysLumiblock ); + + // Beam spot information: + AUX_VARIABLE( beamPosX ); + AUX_VARIABLE( beamPosY ); + AUX_VARIABLE( beamPosZ ); + AUX_VARIABLE( beamPosSigmaX ); + AUX_VARIABLE( beamPosSigmaY ); + AUX_VARIABLE( beamPosSigmaZ ); + AUX_VARIABLE( beamPosSigmaXY ); + AUX_VARIABLE( beamTiltXZ ); + AUX_VARIABLE( beamTiltYZ ); + AUX_VARIABLE( beamStatus ); + + // Detector flags: + AUX_VARIABLE( pixelFlags ); + AUX_VARIABLE( sctFlags ); + AUX_VARIABLE( trtFlags ); + AUX_VARIABLE( larFlags ); + AUX_VARIABLE( tileFlags ); + AUX_VARIABLE( muonFlags ); + AUX_VARIABLE( forwardDetFlags ); + AUX_VARIABLE( coreFlags ); + AUX_VARIABLE( backgroundFlags ); + AUX_VARIABLE( lumiFlags ); + } + +} // namespace xAOD diff --git a/Event/xAOD/xAODEventInfo/xAODEventInfo/selection.xml b/Event/xAOD/xAODEventInfo/xAODEventInfo/selection.xml index 4bc4e5ba5b7719b6357b2025e552e3867e68ac6a..9cf60aeb816546da0934afd2bd68adb7660d69de 100644 --- a/Event/xAOD/xAODEventInfo/xAODEventInfo/selection.xml +++ b/Event/xAOD/xAODEventInfo/xAODEventInfo/selection.xml @@ -1,4 +1,4 @@ -<!-- $Id: selection.xml 682504 2015-07-13 11:53:50Z krasznaa $ --> +<!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration --> <lcgdict> <class name="xAOD::EventInfo_v1" @@ -11,6 +11,8 @@ </class> <class name="xAOD::EventAuxInfo_v1" id="2CFD72A2-D3AA-4C18-9B40-E5ACBA20D785" /> + <class name="xAOD::EventAuxInfo_v2" + id="FA684B06-EC03-4B0B-9FAE-91423B1ED35D" /> <read sourceClass="xAOD::EventInfo_v1" version="[1-]" targetClass="xAOD::EventInfo_v1" source="" target="" > diff --git a/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventAuxInfo_v2.h b/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventAuxInfo_v2.h new file mode 100644 index 0000000000000000000000000000000000000000..271f5e37021b8dc8410a2aa6cef3fd2f6f0237f9 --- /dev/null +++ b/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventAuxInfo_v2.h @@ -0,0 +1,101 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef XAODEVENTINFO_VERSIONS_EVENTAUXINFO_V2_H +#define XAODEVENTINFO_VERSIONS_EVENTAUXINFO_V2_H + +// System include(s): +extern "C" { +# include <stdint.h> +} +#include <vector> +#include <string> + +// EDM include(s): +#include "xAODCore/AuxInfoBase.h" + +namespace xAOD { + + /// Auxiliary information about the event + /// + /// This object describes the "static" auxiliary information about + /// an event. + /// + /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> + /// + class EventAuxInfo_v2 : public AuxInfoBase { + + public: + /// Default constructor + EventAuxInfo_v2(); + + /// @name Basic event information + /// @{ + uint32_t runNumber; + unsigned long long eventNumber; + uint32_t lumiBlock; + uint32_t timeStamp; + uint32_t timeStampNSOffset; + uint32_t bcid; + uint32_t detectorMask0; + uint32_t detectorMask1; + uint32_t detectorMask2; + uint32_t detectorMask3; + /// @} + + /// @name Event type information + /// @{ + std::vector< std::pair< std::string, std::string > > detDescrTags; + uint32_t eventTypeBitmask; + /// @} + + /// @name Trigger related information + /// @{ + uint32_t statusElement; + uint32_t extendedLevel1ID; + uint16_t level1TriggerType; + std::vector< std::string > streamTagNames; + std::vector< std::string > streamTagTypes; + std::vector< char > streamTagObeysLumiblock; + /// @} + + /// @name Detector flags + /// @{ + uint32_t pixelFlags; + uint32_t sctFlags; + uint32_t trtFlags; + uint32_t larFlags; + uint32_t tileFlags; + uint32_t muonFlags; + uint32_t forwardDetFlags; + uint32_t coreFlags; + uint32_t backgroundFlags; + uint32_t lumiFlags; + /// @} + + /// @name Beam spot information + /// @{ + float beamPosX; + float beamPosY; + float beamPosZ; + float beamPosSigmaX; + float beamPosSigmaY; + float beamPosSigmaZ; + float beamPosSigmaXY; + float beamTiltXZ; + float beamTiltYZ; + uint32_t beamStatus; + /// @} + + }; // class EventAuxInfo_v2 + +} // namespace xAOD + +// Declare the inheritance of the type: +#include "xAODCore/BaseInfo.h" +SG_BASE( xAOD::EventAuxInfo_v2, xAOD::AuxInfoBase ); + +#endif // XAODEVENTINFO_VERSIONS_EVENTAUXINFO_V2_H diff --git a/Event/xAOD/xAODEventInfo/xAODEventInfo/xAODEventInfoDict.h b/Event/xAOD/xAODEventInfo/xAODEventInfo/xAODEventInfoDict.h index 23dd8bb01be24626adea286d71e56fcad4d63d8b..6a0cb35e41e8e6c8aea817f30c160c231be4b754 100644 --- a/Event/xAOD/xAODEventInfo/xAODEventInfo/xAODEventInfoDict.h +++ b/Event/xAOD/xAODEventInfo/xAODEventInfo/xAODEventInfoDict.h @@ -1,10 +1,7 @@ // Dear emacs, this is -*- c++ -*- - /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - -// $Id: xAODEventInfoDict.h 630576 2014-11-24 12:36:44Z krasznaa $ #ifndef XAODEVENTINFO_XAODEVENTINFODICT_H #define XAODEVENTINFO_XAODEVENTINFODICT_H @@ -21,6 +18,7 @@ #include "xAODEventInfo/EventInfoContainer.h" #include "xAODEventInfo/versions/EventInfo_v1.h" #include "xAODEventInfo/versions/EventAuxInfo_v1.h" +#include "xAODEventInfo/versions/EventAuxInfo_v2.h" #include "xAODEventInfo/versions/EventInfoContainer_v1.h" #include "xAODEventInfo/versions/EventInfoAuxContainer_v1.h" diff --git a/Event/xAOD/xAODEventInfoAthenaPool/CMakeLists.txt b/Event/xAOD/xAODEventInfoAthenaPool/CMakeLists.txt index 117796b21cce6a2855042bfd5cb91d7894891559..7bd33def7ce52d831e83aa476a36422ce3c82840 100644 --- a/Event/xAOD/xAODEventInfoAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODEventInfoAthenaPool/CMakeLists.txt @@ -1,21 +1,15 @@ -################################################################################ -# Package: xAODEventInfoAthenaPool -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODEventInfoAthenaPool ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - Database/AthenaPOOL/AthenaPoolCnvSvc - Database/AthenaPOOL/AthenaPoolUtilities - Event/xAOD/xAODEventInfo ) - # Component(s) in the package: atlas_add_poolcnv_library( xAODEventInfoAthenaPoolPoolCnv - src/*.cxx - FILES xAODEventInfo/EventInfo.h xAODEventInfo/EventAuxInfo.h xAODEventInfo/EventInfoContainer.h xAODEventInfo/EventInfoAuxContainer.h - TYPES_WITH_NAMESPACE xAOD::EventInfo xAOD::EventAuxInfo xAOD::EventInfoContainer xAOD::EventInfoAuxContainer - CNV_PFX xAOD - LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities xAODEventInfo ) - + src/*.h src/*.cxx + FILES xAODEventInfo/EventInfo.h xAODEventInfo/EventAuxInfo.h + xAODEventInfo/EventInfoContainer.h xAODEventInfo/EventInfoAuxContainer.h + TYPES_WITH_NAMESPACE xAOD::EventInfo xAOD::EventAuxInfo + xAOD::EventInfoContainer xAOD::EventInfoAuxContainer + CNV_PFX xAOD + LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities AthContainers + xAODEventInfo ) diff --git a/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv.cxx b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2007c1eb1a923163df648215cd8a1f9d8db0ea5a --- /dev/null +++ b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv.cxx @@ -0,0 +1,4 @@ +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// +// Dummy source file so that cmake will know that this is a custom converter. +// diff --git a/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv.h b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv.h new file mode 100644 index 0000000000000000000000000000000000000000..c6e87e682f7a8f94c83dfce96f81ab36b97a3f7c --- /dev/null +++ b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv.h @@ -0,0 +1,22 @@ +// Dear emacs, this is -*- c++ -*- +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// +#ifndef XAODEVENTINFOATHENAPOOL_XAODEVENTAUXINFOCNV_H +#define XAODEVENTINFOATHENAPOOL_XAODEVENTAUXINFOCNV_H + +// Local include(s). +#include "xAODEventAuxInfoCnv_v2.h" + +// EDM include(s). +#include "xAODEventInfo/EventAuxInfo.h" + +// Framework include(s). +#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h" + +// Declare the POOL converter. +typedef T_AthenaPoolAuxContainerCnv< xAOD::EventAuxInfo, + xAODEventAuxInfoCnv_v2 > + xAODEventAuxInfoCnv; + +#endif // XAODEVENTINFOATHENAPOOL_XAODEVENTAUXINFOCNV_H diff --git a/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv_v2.cxx b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv_v2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c3016bef06970ead225c1dccc89d1f14275c9bc6 --- /dev/null +++ b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv_v2.cxx @@ -0,0 +1,51 @@ +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +// Local include(s). +#include "xAODEventAuxInfoCnv_v2.h" + +// Core EDM include(s): +#include "AthContainers/tools/copyAuxStoreThinned.h" + +// System include(s). +#include <stdexcept> + +/// Convenience macro for setting the level of output messages +#define MSGLVL MSG::DEBUG + +/// Another convenience macro for printing messages in the converter +#define ATH_MSG( MSG ) \ + do { \ + if( log.level() <= MSGLVL ) { \ + log << MSGLVL << MSG << endmsg; \ + } \ + } while( 0 ) + +void xAODEventAuxInfoCnv_v2::persToTrans( const xAOD::EventAuxInfo_v2* oldObj, + xAOD::EventAuxInfo* newObj, + MsgStream& log ) { + + // Greet the user. + ATH_MSG( "Converting xAOD::EventAuxInfo_v2 to the current version..." ); + + // Copy the payload of the v2 object into the latest one by misusing + // the thinning code a bit... + SG::copyAuxStoreThinned( *oldObj, *newObj, + static_cast< IThinningSvc* >( nullptr ) ); + + // Print what happened: + ATH_MSG( "Converting xAOD::EventAuxInfo_v2 to the current version... " + "[OK]" ); + return; +} + +void xAODEventAuxInfoCnv_v2::transToPers( const xAOD::EventAuxInfo*, + xAOD::EventAuxInfo_v2*, + MsgStream& log ) { + + log << MSG::ERROR + << "Somebody called xAODEventAuxInfoCnv_v2::transToPers" + << endmsg; + throw std::runtime_error( "Somebody called xAODEventAuxInfoCnv_v2::" + "transToPers" ); + return; +} diff --git a/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv_v2.h b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv_v2.h new file mode 100644 index 0000000000000000000000000000000000000000..f719748ac26e9eb6da0a36c9cb5eb7262c0670c3 --- /dev/null +++ b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventAuxInfoCnv_v2.h @@ -0,0 +1,42 @@ +// Dear emacs, this is -*- c++ -*- +// +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// +#ifndef XAODEVENTINFOATHENAPOOL_XAODEVENAUXINFOCNV_V2_H +#define XAODEVENTINFOATHENAPOOL_XAODEVENAUXINFOCNV_V2_H + +// Gaudi/Athena include(s). +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// EDM include(s). +#include "xAODEventInfo/versions/EventAuxInfo_v2.h" +#include "xAODEventInfo/EventAuxInfo.h" + +/// Converter for reading @c xAOD::EventAuxInfo_v2 +/// +/// This converter takes care of reading @c xAOD::EventAuxInfo_v2 into +/// the "current" version of @c xAOD::EventAuxInfo. (Which is +/// @c xAOD::EventAuxInfo_v1 in this branch.) +/// +/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> +/// +class xAODEventAuxInfoCnv_v2 : + public T_AthenaPoolTPCnvBase< xAOD::EventAuxInfo, + xAOD::EventAuxInfo_v2 > { + +public: + /// Default constructor + xAODEventAuxInfoCnv_v2() = default; + + /// Function converting from the old type to the current one + virtual void persToTrans( const xAOD::EventAuxInfo_v2* oldObj, + xAOD::EventAuxInfo* newObj, + MsgStream& log ) override; + /// Dummy function inherited from the base class + virtual void transToPers( const xAOD::EventAuxInfo*, + xAOD::EventAuxInfo_v2*, + MsgStream& log ) override; + +}; // class xAODEventAuxInfoCnv_v2 + +#endif // XAODEVENTINFOATHENAPOOL_XAODEVENAUXINFOCNV_V2_H diff --git a/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventInfoAthenaPoolTPCnv.cxx b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventInfoAthenaPoolTPCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..af85c5c599a19ad1de07aedd68aa7cb29bc7349f --- /dev/null +++ b/Event/xAOD/xAODEventInfoAthenaPool/src/xAODEventInfoAthenaPoolTPCnv.cxx @@ -0,0 +1,17 @@ +// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +// Gaudi/Athena include(s). +#include "AthenaKernel/TPCnvFactory.h" + +// EDM include(s). +#include "xAODEventInfo/EventAuxInfo.h" +#include "xAODEventInfo/versions/EventAuxInfo_v2.h" + +// Local include(s). +#include "xAODEventAuxInfoCnv_v2.h" + +// Declare the T/P converter(s). +DECLARE_TPCNV_FACTORY( xAODEventAuxInfoCnv_v2, + xAOD::EventAuxInfo, + xAOD::EventAuxInfo_v2, + Athena::TPCnvVers::Old ) diff --git a/Simulation/G4Sim/FADS/FadsKinematics/cmt/Makefile b/Simulation/G4Sim/FADS/FadsKinematics/cmt/Makefile old mode 100755 new mode 100644