Skip to content
Snippets Groups Projects
Commit 1d4aab0a authored by Attila Krasznahorkay's avatar Attila Krasznahorkay Committed by Graeme Stewart
Browse files

Fixing the reading of xAOD::TrigPassBitsContainer from 'problematic files'...

Fixing the reading of xAOD::TrigPassBitsContainer from 'problematic files' (xAODTriggerAthenaPool-00-00-25)

	* Added a custom POOL converter for xAOD::TrigPassBitsContainer.
	  Which fixes the incorrect containers created by ROOT from older
	  files. (Which were written without using a collection proxy
	  for this container.)
	* Cleaned the CMakeLists.txt file slightly.
	* Tagging as xAODTriggerAthenaPool-00-00-25


Former-commit-id: 4e1576fa
parent 3a4f6ecb
No related branches found
No related tags found
No related merge requests found
# $Id: CMakeLists.txt 755768 2016-06-17 13:43:10Z krasznaa $
################################################################################
# Package: xAODTriggerAthenaPool
################################################################################
......@@ -6,20 +7,47 @@
atlas_subdir( xAODTriggerAthenaPool )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Trigger/TrigEvent/TrigNavTools
PRIVATE
Control/AthContainers
Control/AthenaKernel
Database/AthenaPOOL/AthenaPoolCnvSvc
Database/AthenaPOOL/AthenaPoolUtilities
Event/xAOD/xAODTrigger )
atlas_depends_on_subdirs(
PUBLIC
Trigger/TrigEvent/TrigNavTools
PRIVATE
Control/AthContainers
Control/AthenaKernel
Database/AthenaPOOL/AthenaPoolCnvSvc
Database/AthenaPOOL/AthenaPoolUtilities
Event/xAOD/xAODTrigger )
# Component(s) in the package:
atlas_add_poolcnv_library( xAODTriggerAthenaPoolPoolCnv
src/*.cxx
FILES xAODTrigger/MuonRoIContainer.h xAODTrigger/MuonRoIAuxContainer.h xAODTrigger/JetRoIContainer.h xAODTrigger/JetRoIAuxContainer.h xAODTrigger/EmTauRoIContainer.h xAODTrigger/EmTauRoIAuxContainer.h xAODTrigger/JetEtRoI.h xAODTrigger/JetEtRoIAuxInfo.h xAODTrigger/EnergySumRoI.h xAODTrigger/EnergySumRoIAuxInfo.h xAODTrigger/TrigCompositeContainer.h xAODTrigger/TrigCompositeAuxContainer.h xAODTrigger/TriggerMenuContainer.h xAODTrigger/TriggerMenuAuxContainer.h xAODTrigger/TrigConfKeys.h xAODTrigger/TrigDecision.h xAODTrigger/TrigDecisionAuxInfo.h xAODTrigger/TrigNavigation.h xAODTrigger/TrigNavigationAuxInfo.h xAODTrigger/RoiDescriptorStore.h xAODTrigger/RoiDescriptorStoreAuxInfo.h xAODTrigger/BunchConfKey.h xAODTrigger/BunchConfContainer.h xAODTrigger/BunchConfAuxContainer.h xAODTrigger/TrigPassBitsContainer.h xAODTrigger/TrigPassBitsAuxContainer.h
TYPES_WITH_NAMESPACE xAOD::MuonRoIContainer xAOD::MuonRoIAuxContainer xAOD::JetRoIContainer xAOD::JetRoIAuxContainer xAOD::EmTauRoIContainer xAOD::EmTauRoIAuxContainer xAOD::JetEtRoI xAOD::JetEtRoIAuxInfo xAOD::EnergySumRoI xAOD::EnergySumRoIAuxInfo xAOD::TrigCompositeContainer xAOD::TrigCompositeAuxContainer xAOD::TriggerMenuContainer xAOD::TriggerMenuAuxContainer xAOD::TrigConfKeys xAOD::TrigDecision xAOD::TrigDecisionAuxInfo xAOD::TrigNavigation xAOD::TrigNavigationAuxInfo xAOD::RoiDescriptorStore xAOD::RoiDescriptorStoreAuxInfo xAOD::BunchConfKey xAOD::BunchConfContainer xAOD::BunchConfAuxContainer xAOD::TrigPassBitsContainer xAOD::TrigPassBitsAuxContainer
CNV_PFX xAOD
LINK_LIBRARIES TrigNavToolsLib AthContainers AthenaKernel AthenaPoolCnvSvcLib AthenaPoolUtilities xAODTrigger )
src/*.h src/*.cxx
FILES xAODTrigger/MuonRoIContainer.h xAODTrigger/MuonRoIAuxContainer.h
xAODTrigger/JetRoIContainer.h xAODTrigger/JetRoIAuxContainer.h
xAODTrigger/EmTauRoIContainer.h xAODTrigger/EmTauRoIAuxContainer.h
xAODTrigger/JetEtRoI.h xAODTrigger/JetEtRoIAuxInfo.h
xAODTrigger/EnergySumRoI.h xAODTrigger/EnergySumRoIAuxInfo.h
xAODTrigger/TrigCompositeContainer.h xAODTrigger/TrigCompositeAuxContainer.h
xAODTrigger/TriggerMenuContainer.h xAODTrigger/TriggerMenuAuxContainer.h
xAODTrigger/TrigConfKeys.h
xAODTrigger/TrigDecision.h xAODTrigger/TrigDecisionAuxInfo.h
xAODTrigger/TrigNavigation.h xAODTrigger/TrigNavigationAuxInfo.h
xAODTrigger/RoiDescriptorStore.h xAODTrigger/RoiDescriptorStoreAuxInfo.h
xAODTrigger/BunchConfKey.h
xAODTrigger/BunchConfContainer.h xAODTrigger/BunchConfAuxContainer.h
xAODTrigger/TrigPassBitsContainer.h xAODTrigger/TrigPassBitsAuxContainer.h
TYPES_WITH_NAMESPACE xAOD::MuonRoIContainer xAOD::MuonRoIAuxContainer
xAOD::JetRoIContainer xAOD::JetRoIAuxContainer
xAOD::EmTauRoIContainer xAOD::EmTauRoIAuxContainer
xAOD::JetEtRoI xAOD::JetEtRoIAuxInfo
xAOD::EnergySumRoI xAOD::EnergySumRoIAuxInfo
xAOD::TrigCompositeContainer xAOD::TrigCompositeAuxContainer
xAOD::TriggerMenuContainer xAOD::TriggerMenuAuxContainer
xAOD::TrigConfKeys
xAOD::TrigDecision xAOD::TrigDecisionAuxInfo
xAOD::TrigNavigation xAOD::TrigNavigationAuxInfo
xAOD::RoiDescriptorStore xAOD::RoiDescriptorStoreAuxInfo
xAOD::BunchConfKey
xAOD::BunchConfContainer xAOD::BunchConfAuxContainer
xAOD::TrigPassBitsContainer xAOD::TrigPassBitsAuxContainer
CNV_PFX xAOD
LINK_LIBRARIES TrigNavToolsLib AthContainers AthenaKernel AthenaPoolCnvSvcLib
AthenaPoolUtilities xAODTrigger )
......@@ -75,3 +75,4 @@ apply_pattern poolcnv typesWithNamespace="xAOD::MuonRoIContainer \
TrigPassBitsContainer.h \
TrigPassBitsAuxContainer.h" \
cnv_pfx="xAOD"
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODTrigPassBitsContainerCnv.cxx 755768 2016-06-17 13:43:10Z krasznaa $
// System include(s):
#include <memory>
// Local include(s):
#include "xAODTrigPassBitsContainerCnv.h"
xAODTrigPassBitsContainerCnv::
xAODTrigPassBitsContainerCnv( ISvcLocator* svcLoc )
: xAODTrigPassBitsContainerCnvBase( svcLoc ) {
}
xAOD::TrigPassBitsContainer* xAODTrigPassBitsContainerCnv::createTransient() {
// Get the object using the base class:
std::unique_ptr< xAOD::TrigPassBitsContainer >
ondisk( xAODTrigPassBitsContainerCnvBase::createTransient() );
// Create a copy of it:
xAOD::TrigPassBitsContainer* result = new xAOD::TrigPassBitsContainer();
for( size_t i = 0; i < ondisk->size(); ++i ) {
result->push_back( new xAOD::TrigPassBits() );
}
result->setStore( ondisk->getConstStoreLink() );
// Now return it:
return result;
}
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODTrigPassBitsContainerCnv.h 755768 2016-06-17 13:43:10Z krasznaa $
#ifndef XAODTRIGGERATHENAPOOL_XAODTRIGPASSBITSCONTAINERCNV_H
#define XAODTRIGGERATHENAPOOL_XAODTRIGPASSBITSCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolxAODCnv.h"
// EDM include(s):
#include "xAODTrigger/TrigPassBitsContainer.h"
// Base the converter on the helper class:
typedef T_AthenaPoolxAODCnv< xAOD::TrigPassBitsContainer >
xAODTrigPassBitsContainerCnvBase;
/// Custom converter for reading xAOD::TrigPassBitsContainer correctly
///
/// Unfortunately we managed to write quite a lot of AOD files with incorrect
/// xAOD::TrigPassBitsContainer payload in them. (Forgot to declare a container
/// proxy for the type.)
///
/// To overcome this, this converter explicitly creates a new container from
/// scratch. Which has the same size as the one on disk. Connects the new
/// container to the auxiliary store of the original one, and then returns
/// this freshly made container instead of the original one.
///
/// Once incorrectly written files will not be an issue anymore (possibly this
/// will never be the case, as we also wrote some BS files like this...), this
/// hack could be removed.
///
/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
///
/// $Revision: 755768 $
/// $Date: 2016-06-17 15:43:10 +0200 (Fri, 17 Jun 2016) $
///
class xAODTrigPassBitsContainerCnv : public xAODTrigPassBitsContainerCnvBase {
public:
/// Converter constructor
xAODTrigPassBitsContainerCnv( ISvcLocator* svcLoc );
/// Function reading in the persistent object from disk
virtual xAOD::TrigPassBitsContainer* createTransient() override final;
};
#endif // XAODTRIGGERATHENAPOOL_XAODTRIGPASSBITSCONTAINERCNV_H
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