ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTrigNavigationAuxInfoCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: xAODTrigNavigationAuxInfoCnv.cxx 710840 2015-11-26 08:45:42Z will $
6
7// System include(s):
8#include <stdexcept>
9
10#ifndef XAOD_ANALYSIS
11#include "AthenaKernel/ITrigNavigationThinningSvc.h" //thinning only possible in full athena
14#include "GaudiKernel/ThreadLocalContext.h"
15#endif
16
17// EDM include(s):
19
20
21
22// Local include(s):
25
31
35 const std::string& /*key*/) {
36
38#ifndef XAOD_ANALYSIS
39 const ITrigNavigationThinningSvc* thinningSvc = nullptr;
40 // Try to find the thinning service.
41 if (const SG::ThinningCache* cache = SG::getThinningCache()) {
42 thinningSvc = cache->trigNavigationThinningSvc();
43 }
44 if ( thinningSvc ) {
45 ATH_MSG_DEBUG("Doing TrigNavigation slimming");
47 wrapper.setStore(result);
48 std::vector< unsigned int > temp;
49 const EventContext& ctx = Gaudi::Hive::currentContext();
50 if ( thinningSvc->doSlimming(ctx, temp).isFailure() ) {
51 ATH_MSG_WARNING("Failed to slim and store Trigger Navigation data in the output xAODTrigNavigation object");
52 }
53 wrapper.setSerialized(temp);
54 wrapper.setStore((const SG::IConstAuxStore*)nullptr);
55 } else {
56 ATH_MSG_DEBUG("No TrigNavigation slimming");
57 *result = *trans;
58 }
59#else
60 //no navigation thinning in analysis releases
61 *result = *trans;
62#endif
63
64 return result;
65}
66
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
Define interface for doing TrigNavigation thinning.
Define interface for doing TrigNavigation thinning.
virtual StatusCode doSlimming(const EventContext &ctx, std::vector< uint32_t > &slimmed_and_serialized) const =0
Return slimmed data for TrigNavigation.
Cache thinning decisions for converters.
xAODTrigNavigationAuxInfoCnv(ISvcLocator *svcLoc)
Converter constructor.
virtual xAOD::TrigNavigationAuxInfo * createPersistentWithKey(xAOD::TrigNavigationAuxInfo *trans, const std::string &key) override
Function preparing the container to be written out.
void setSerialized(const std::vector< unsigned int > &value)
sets the serialized form of the navigation from the argument
TH1F * trans(TH1F *h, bool t=false)
Helper to copy an aux store while applying thinning.
Helpers to retrieve the current thinning cache from the event context.
const SG::ThinningCache * getThinningCache(const EventContext &ctx)
Retrieve the current thinning cache from the event context.
TrigNavigationAuxInfo_v1 TrigNavigationAuxInfo
Define the latest version of the trigger navigation auxiliary information class.
TrigNavigation_v1 TrigNavigation
Define the latest version of the trigger navigation class.
T_AthenaPoolAuxContainerCnv< xAOD::TrigNavigationAuxInfo > xAODTrigNavigationAuxInfoCnvBase
Base class for the converter.