ATLAS Offline Software
TriggerEDMDeserialiserAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRIGOUTPUTHANDLING_TRIGGEREDMDESERIALISERALG_H
5 #define TRIGOUTPUTHANDLING_TRIGGEREDMDESERIALISERALG_H
6 
7 #include <string>
8 
9 #include "GaudiKernel/IClassIDSvc.h"
14 
15 #include "TList.h"
16 
17 
29 public:
30  class WritableAuxStore;
31 
32  using Payload = std::vector<uint32_t>;
33  using PayloadIterator = Payload::const_iterator;
34  static constexpr size_t CLIDOffset = 1;
35  static constexpr size_t NameLengthOffset = 2;
36  static constexpr size_t NameOffset = 3;
37  static std::unique_ptr<TList> s_streamerInfoList ATLAS_THREAD_SAFE;
39 
40  TriggerEDMDeserialiserAlg(const std::string& name, ISvcLocator* pSvcLocator);
41  virtual ~TriggerEDMDeserialiserAlg() override = default;
42 
43  virtual StatusCode initialize() override;
44  virtual StatusCode execute(const EventContext& context) const override;
45  virtual StatusCode finalize() override;
46 
47 private:
49 
50  void add_bs_streamerinfos();
51 
52  SG::ReadHandleKey<HLT::HLTResultMT> m_resultKey { this, "ResultKey", "HLTResultMT",
53  "Key of the HLT result object" };
54  Gaudi::Property<std::string> m_prefix{ this, "Prefix", "",
55  "Set for testing to avoid clash with the input collections" };
56  Gaudi::Property<int> m_moduleID{ this, "ModuleID", 0,
57  "Module ID of HLT result ROB, default 0 is the main HLT result, others are for TLA, calibration etc." };
58  Gaudi::Property<int> m_initialSerialisationBufferSize{ this, "InitialSerialisationBufferSize", 1024*1024,
59  "Initial serialisation buffer size in bytes, can be set large to avoid reallocations in every event" };
60  Gaudi::Property<bool> m_skipDuplicates{ this, "SkipDuplicateRecords", false,
61  "Silently ignore collections that ware already in StoreGate (when handling multiple HLT results)" };
62  Gaudi::Property<bool> m_permitMissingModule{ this, "PermitMissingModule", false,
63  "Silently ignore absent HLT results (when handling multiple HLT results)" };
64 
65  ServiceHandle<IClassIDSvc> m_clidSvc{ this, "ClassIDSvc", "ClassIDSvc",
66  "Service to translate CLID to class name" };
67 
68  ServiceHandle<IAthenaSerializeSvc> m_serializerSvc{ this, "Serializer", "AthenaRootSerializeSvc",
69  "Service that translates persistent to transient representation" };
70 
71  ToolHandle<TrigSerTPTool> m_tpTool{ this, "TPTool", "TrigSerTPTool/TrigSerTPTool",
72  "Tool to do Transient/Persistent conversion (Old EDM)"};
73 
77  StatusCode deserialise( const Payload* dataptr ) const;
78 
82  StatusCode deserialiseDynAux( const std::string& transientTypeName, const std::string& persistentTypeName,
83  const std::string& decorationName, void* obj,
84  WritableAuxStore* currentAuxStore, SG::AuxVectorBase* interface ) const;
85 
90  StatusCode checkSanity( const std::string& transientTypeName, bool isxAODInterfaceContainer,
91  bool isxAODAuxContainer, bool isDecoration, bool isTPContainer ) const;
92 
93 };
94 
95 #endif // TRIGOUTPUTHANDLING_TRIGGEREDMDESERIALISERALG_H
TrigSerTPTool.h
TriggerEDMDeserialiserAlg::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: TriggerEDMDeserialiserAlg.cxx:243
TriggerEDMDeserialiserAlg::s_mutex
static std::mutex s_mutex
Definition: TriggerEDMDeserialiserAlg.h:38
TriggerEDMDeserialiserAlg::m_tpTool
ToolHandle< TrigSerTPTool > m_tpTool
Definition: TriggerEDMDeserialiserAlg.h:71
TriggerEDMDeserialiserAlg::ATLAS_THREAD_SAFE
static std::unique_ptr< TList > s_streamerInfoList ATLAS_THREAD_SAFE
Definition: TriggerEDMDeserialiserAlg.h:37
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
TriggerEDMDeserialiserAlg::initialize
virtual StatusCode initialize() override
Definition: TriggerEDMDeserialiserAlg.cxx:227
TriggerEDMDeserialiserAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: TriggerEDMDeserialiserAlg.h:54
SG::ReadHandleKey< HLT::HLTResultMT >
SG::AuxVectorBase
Manage index tracking and synchronization of auxiliary data.
Definition: AuxVectorBase.h:98
TriggerEDMDeserialiserAlg::m_initialSerialisationBufferSize
Gaudi::Property< int > m_initialSerialisationBufferSize
Definition: TriggerEDMDeserialiserAlg.h:58
TriggerEDMDeserialiserAlg::m_moduleID
Gaudi::Property< int > m_moduleID
Definition: TriggerEDMDeserialiserAlg.h:56
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TriggerEDMDeserialiserAlg::m_serializerSvc
ServiceHandle< IAthenaSerializeSvc > m_serializerSvc
Definition: TriggerEDMDeserialiserAlg.h:68
TriggerEDMDeserialiserAlg::PayloadIterator
Payload::const_iterator PayloadIterator
Definition: TriggerEDMDeserialiserAlg.h:33
TriggerEDMDeserialiserAlg::CLIDOffset
static constexpr size_t CLIDOffset
Definition: TriggerEDMDeserialiserAlg.h:34
TriggerEDMDeserialiserAlg::add_bs_streamerinfos
void add_bs_streamerinfos()
Definition: TriggerEDMDeserialiserAlg.cxx:500
TriggerEDMDeserialiserAlg::WritableAuxStore
Definition: TriggerEDMDeserialiserAlg.cxx:56
TriggerEDMDeserialiserAlg::Payload
std::vector< uint32_t > Payload
Definition: TriggerEDMDeserialiserAlg.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TriggerEDMDeserialiserAlg::deserialiseDynAux
StatusCode deserialiseDynAux(const std::string &transientTypeName, const std::string &persistentTypeName, const std::string &decorationName, void *obj, WritableAuxStore *currentAuxStore, SG::AuxVectorBase *interface) const
Handle decoration.
Definition: TriggerEDMDeserialiserAlg.cxx:435
IAthenaSerializeSvc.h
TriggerEDMDeserialiserAlg
Definition: TriggerEDMDeserialiserAlg.h:28
TriggerEDMDeserialiserAlg::TriggerEDMDeserialiserAlg
TriggerEDMDeserialiserAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TriggerEDMDeserialiserAlg.cxx:224
AthReentrantAlgorithm.h
TriggerEDMDeserialiserAlg::deserialise
StatusCode deserialise(const Payload *dataptr) const
Performs actual deserialisation loop.
Definition: TriggerEDMDeserialiserAlg.cxx:266
TriggerEDMDeserialiserAlg::finalize
virtual StatusCode finalize() override
Definition: TriggerEDMDeserialiserAlg.cxx:237
TriggerEDMDeserialiserAlg::NameOffset
static constexpr size_t NameOffset
Definition: TriggerEDMDeserialiserAlg.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TriggerEDMDeserialiserAlg::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
Definition: TriggerEDMDeserialiserAlg.h:65
TriggerEDMDeserialiserAlg::tester
friend StatusCode tester(TriggerEDMDeserialiserAlg *)
TriggerEDMDeserialiserAlg::m_permitMissingModule
Gaudi::Property< bool > m_permitMissingModule
Definition: TriggerEDMDeserialiserAlg.h:62
HLTResultMT.h
TriggerEDMDeserialiserAlg::m_resultKey
SG::ReadHandleKey< HLT::HLTResultMT > m_resultKey
Definition: TriggerEDMDeserialiserAlg.h:52
TriggerEDMDeserialiserAlg::checkSanity
StatusCode checkSanity(const std::string &transientTypeName, bool isxAODInterfaceContainer, bool isxAODAuxContainer, bool isDecoration, bool isTPContainer) const
Checker for data integrity, one and only one of the passed booleans can be true, else FAILURE is retu...
Definition: TriggerEDMDeserialiserAlg.cxx:474
TriggerEDMDeserialiserAlg::NameLengthOffset
static constexpr size_t NameLengthOffset
Definition: TriggerEDMDeserialiserAlg.h:35
TriggerEDMDeserialiserAlg::m_skipDuplicates
Gaudi::Property< bool > m_skipDuplicates
Definition: TriggerEDMDeserialiserAlg.h:60
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TriggerEDMDeserialiserAlg::~TriggerEDMDeserialiserAlg
virtual ~TriggerEDMDeserialiserAlg() override=default
ServiceHandle< IClassIDSvc >