6#include "GaudiKernel/MsgStream.h"
7#include "GaudiKernel/ClassID.h"
21 m_TPTool(
"TrigSerTPTool/TrigSerTPTool"),
22 m_guidTool(
"TrigSerializeGuidHelper/TrigSerializeGuidHelper"),
25 declareInterface<ITrigSerializeConvHelper>(
this );
48 StatusCode sctp =
m_TPTool.retrieve();
49 if (!sctp.isSuccess()){
61 if (!scg.isSuccess()){
68 m_oldEDMmap[
"TrigRoiDescriptor" ] =
"TrigRoiDescriptorCollection_tlp1";
69 m_oldEDMmap[
"TrigInDetTrackCollection" ] =
"TrigInDetTrackCollection_tlp1";
70 m_oldEDMmap[
"TrigVertexCollection" ] =
"TrigVertexCollection_tlp1";
71 m_oldEDMmap[
"CaloCellContainer" ] =
"CaloCompactCellContainer";
72 m_oldEDMmap[
"CaloClusterContainer" ] =
"CaloClusterContainer_p4";
73 m_oldEDMmap[
"CaloShowerContainer" ] =
"CaloShowerContainer_p2";
74 m_oldEDMmap[
"TrackCollection" ] =
"Trk::TrackCollection_tlp2";
75 m_oldEDMmap[
"Rec::TrackParticleContainer" ] =
"Rec::TrackParticleContainer_tlp1";
78 return StatusCode::SUCCESS;
83 ATH_MSG_DEBUG(
"in TrigSerializeConvHelper::createObj for clname " << clname <<
" is xAOD? " << (
isxAOD?
"yes":
"no"));
89 return StatusCode::FAILURE;
95 std::vector<uint32_t> v = addr->
get();
98 std::string cl = clname;
101 cl =
m_TPTool->persClassName(clname);
105 bool versionChange =
false;
109 scid = serializer->
peekCLID(v, guid);
110 if (scid.isFailure()){
116 <<
" instead of " << cl);
122 std::string nclass = cl;
123 StatusCode ai =
m_guidTool->IntsToClassName(guid, nclass);
124 if (ai.isFailure()) {
126 return StatusCode::FAILURE;
130 ATH_MSG_DEBUG(
"Got hint of " << cl <<
" different persistent class from the BS payload. Name from GUID: " << nclass);
133 ATH_MSG_DEBUG(
"This is an xAOD so probably the BS version is an older version of the xAOD type.");
135 versionChange =
true;
144 CxxUtils::FPControl fpcontrol;
145 if (cl ==
"xAOD::BTaggingTrigAuxContainer_v1") {
146 fpcontrol.holdExceptions();
151 ATH_MSG_DEBUG(cl <<
" deserialized to " << ptr <<
" version change detected: " << (versionChange ?
"yes":
"no"));
155 bool isViewVector = cl.substr(0, 11) ==
"ViewVector<";
156 if (
m_doTP and (!
isxAOD or versionChange) and !isViewVector){
157 std::string transclass;
161 void *transObj =
m_TPTool->convertPT(cl,ptr, transclass);
163 ATH_MSG_DEBUG(
"was converted to " << transclass <<
" at " << transObj);
172 return StatusCode::SUCCESS;
178 void *ptr, std::vector<uint32_t> &out,
bool isxAOD){
180 StatusCode
sc(StatusCode::SUCCESS);
182 ATH_MSG_DEBUG(
"in TrigSerializeConvHelper::createRep for clname" << clname <<
" is xAOD? " << (
isxAOD?
"yes":
"no"));
184 std::string cl = clname;
189 std::string persclass(
"");
190 pObj =
m_TPTool->convertTP(clname,ptr, persclass);
191 cl = std::move(persclass);
205 StatusCode ai =
m_guidTool->ClassNameToInts(cl, irep);
207 ATH_MSG_WARNING(
"Cannot store class identification for " << cl <<
" to BS");
210 ATH_MSG_VERBOSE(
"got GUID: " << irep[0] <<
"-" << irep[1] <<
"-" << irep[2] <<
"-" << irep[3]);
212 if (cl !=
"" && pObj){
225 ATH_MSG_DEBUG(
"pObj: " << pObj <<
" of " << cl <<
" payload: " << out.size());
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
Helper to control FP exceptions.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode peekCLID(const std::vector< uint32_t > &v, uint32_t *guid) const =0
access clid of the payload (stored in BS)
virtual void reset()=0
clean internal serializer state.
virtual void serialize(const std::string &nameOfClass, const void *instance, std::vector< uint32_t > &v)=0
serializes an object of a class nameOfClass pointed to by instance and recursively also other objects...
virtual void * deserialize(const std::string &nameOfClass, const std::vector< uint32_t > &v)=0
deserializes an object of a class nameOfClass (and recursively other objects) found in std::vector<ui...
virtual void setCLID(const uint32_t *guid)=0
access clid of the payload virtual CLID getCLID() const = 0;
void Destruct(void *place) const
TrigSerializeConvHelper(const std::string &name, const std::string &type, const IInterface *parent)
virtual ~TrigSerializeConvHelper()
std::map< std::string, std::string > m_oldEDMmap
ToolHandle< TrigSerTPTool > m_TPTool
ToolHandle< ITrigSerializeGuidHelper > m_guidTool
ToolHandle< ITrigSerializerToolBase > m_serializerTool
StatusCode createObj(const std::string &clname, IOpaqueAddress *iAddr, void *&ptr, bool isxAOD=false)
StatusCode createRep(const std::string &clname, void *ptr, std::vector< uint32_t > &out, bool isxAOD=false)
IOpaqueAddress for TrigSerializenCnvSvc.
const std::vector< uint32_t > & get() const