Skip to content
Snippets Groups Projects
Commit d545eb57 authored by Ruth Pottgen's avatar Ruth Pottgen Committed by John Derek Chapman
Browse files

Merge branch 'EventInfoUpdate-21.0-20200410' into '21.0'

EventInfo (version 2) Update, 21.0 branch (2020.04.10.)

See merge request atlas/athena!31918

(cherry picked from commit dfc353b7)

9758a0e8 Added xAOD::EventAuxInfo_v2 to xAODEventInfo.
8330bc7c Added the necessary converter(s) for xAOD::EventAuxInfo_v2.
ce394ca5 Made SG::copyAuxStoreThinned be able to deal with single-object auxiliary containers.
parent e6af43c5
No related branches found
No related tags found
No related merge requests found
Showing
with 353 additions and 24 deletions
/* /*
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 * @file AthContainers/Root/copyAuxStoreThinned.cxx
* @author scott snyder <snyder@bnl.gov> * @author scott snyder <snyder@bnl.gov>
...@@ -39,9 +38,11 @@ void copyAuxStoreThinned (const SG::IConstAuxStore& orig, ...@@ -39,9 +38,11 @@ void copyAuxStoreThinned (const SG::IConstAuxStore& orig,
SG::IAuxStore& copy, SG::IAuxStore& copy,
IThinningSvc* svc) IThinningSvc* svc)
{ {
copy.resize(0);
size_t size = orig.size(); size_t size = orig.size();
if (size == 0) return; if (size == 0) {
copy.resize(0);
return;
}
size_t nremaining = 0; size_t nremaining = 0;
std::vector<unsigned char> flags; std::vector<unsigned char> flags;
bool thinned = getThinnedFlags (svc, orig, nremaining, flags); bool thinned = getThinnedFlags (svc, orig, nremaining, flags);
......
/*
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
<!-- $Id: selection.xml 682504 2015-07-13 11:53:50Z krasznaa $ --> <!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -->
<lcgdict> <lcgdict>
<class name="xAOD::EventInfo_v1" <class name="xAOD::EventInfo_v1"
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
</class> </class>
<class name="xAOD::EventAuxInfo_v1" <class name="xAOD::EventAuxInfo_v1"
id="2CFD72A2-D3AA-4C18-9B40-E5ACBA20D785" /> id="2CFD72A2-D3AA-4C18-9B40-E5ACBA20D785" />
<class name="xAOD::EventAuxInfo_v2"
id="FA684B06-EC03-4B0B-9FAE-91423B1ED35D" />
<read sourceClass="xAOD::EventInfo_v1" version="[1-]" <read sourceClass="xAOD::EventInfo_v1" version="[1-]"
targetClass="xAOD::EventInfo_v1" source="" target="" > targetClass="xAOD::EventInfo_v1" source="" target="" >
......
// 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
// Dear emacs, this is -*- c++ -*- // 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 #ifndef XAODEVENTINFO_XAODEVENTINFODICT_H
#define XAODEVENTINFO_XAODEVENTINFODICT_H #define XAODEVENTINFO_XAODEVENTINFODICT_H
...@@ -21,6 +18,7 @@ ...@@ -21,6 +18,7 @@
#include "xAODEventInfo/EventInfoContainer.h" #include "xAODEventInfo/EventInfoContainer.h"
#include "xAODEventInfo/versions/EventInfo_v1.h" #include "xAODEventInfo/versions/EventInfo_v1.h"
#include "xAODEventInfo/versions/EventAuxInfo_v1.h" #include "xAODEventInfo/versions/EventAuxInfo_v1.h"
#include "xAODEventInfo/versions/EventAuxInfo_v2.h"
#include "xAODEventInfo/versions/EventInfoContainer_v1.h" #include "xAODEventInfo/versions/EventInfoContainer_v1.h"
#include "xAODEventInfo/versions/EventInfoAuxContainer_v1.h" #include "xAODEventInfo/versions/EventInfoAuxContainer_v1.h"
......
################################################################################ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Package: xAODEventInfoAthenaPool
################################################################################
# Declare the package name: # Declare the package name:
atlas_subdir( xAODEventInfoAthenaPool ) 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: # Component(s) in the package:
atlas_add_poolcnv_library( xAODEventInfoAthenaPoolPoolCnv atlas_add_poolcnv_library( xAODEventInfoAthenaPoolPoolCnv
src/*.cxx src/*.h src/*.cxx
FILES xAODEventInfo/EventInfo.h xAODEventInfo/EventAuxInfo.h xAODEventInfo/EventInfoContainer.h xAODEventInfo/EventInfoAuxContainer.h FILES xAODEventInfo/EventInfo.h xAODEventInfo/EventAuxInfo.h
TYPES_WITH_NAMESPACE xAOD::EventInfo xAOD::EventAuxInfo xAOD::EventInfoContainer xAOD::EventInfoAuxContainer xAODEventInfo/EventInfoContainer.h xAODEventInfo/EventInfoAuxContainer.h
CNV_PFX xAOD TYPES_WITH_NAMESPACE xAOD::EventInfo xAOD::EventAuxInfo
LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities xAODEventInfo ) xAOD::EventInfoContainer xAOD::EventInfoAuxContainer
CNV_PFX xAOD
LINK_LIBRARIES AthenaPoolCnvSvcLib AthenaPoolUtilities AthContainers
xAODEventInfo )
// 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.
//
// 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
// 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;
}
// 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
// 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 )
File mode changed from 100755 to 100644
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