Commit cd37b84f authored by Lukas Alexander Heinrich's avatar Lukas Alexander Heinrich Committed by Graeme Stewart
Browse files

fix for non-xAOD schema evolution (TrigSerializeCnvSvc-00-00-41)

	* fix bug introduced in xAOD transition. detect version change also
	  for non-xAOD types to restore schema evolution
	* tagging TrigSerializeCnvSvc-00-00-41
parent 9702e1d0
......@@ -136,13 +136,18 @@ StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaque
std::vector<uint32_t> v = addr->get();
//we need to find the name of the ob
std::string cl = clname;
if (m_doTP and !isxAOD)
cl = m_TPTool->persClassName(clname);
uint32_t guid[4];
std::string xAODOldVersion = "";
bool versionChange = false;
if (cl!=""){
StatusCode scid;
......@@ -167,42 +172,35 @@ StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaque
return StatusCode::FAILURE;
}
if (cl != nclass){
//cl = nclass;
cl = nclass;
if (msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << "Got hint of " << cl
<< " different persistent class from the BS payload. Name from GUID: " << nclass << endreq;
if(isxAOD){
msg(MSG::DEBUG) << "This is an xAOD so probably the BS version is an older version of the xAOD type. Remember the version in BS so that we can do conversion" << endreq;
xAODOldVersion = nclass;
msg(MSG::DEBUG) << "This is an xAOD so probably the BS version is an older version of the xAOD type." << endreq;
}
versionChange = true;
}
}
if(xAODOldVersion.empty()){
ptr = serializer->deserialize(cl, v);
}
else{
msg(MSG::DEBUG) << "xAOD version change detected. Deserializing first to old version" << endreq;
ptr = serializer->deserialize(xAODOldVersion, v);
}
ptr = serializer->deserialize(cl, v);
if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << (xAODOldVersion.empty() ? cl : xAODOldVersion) << " deserialized to " << ptr << endreq;
if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << cl << " deserialized to " << ptr << " version change detected: " << (versionChange ? "yes":"no") << endreq;
}
// T/P separation
if (m_doTP and (!isxAOD or !xAODOldVersion.empty())){
if (m_doTP and (!isxAOD or versionChange)){
std::string transclass;
std::string toconvert = xAODOldVersion.empty() ? cl : xAODOldVersion;
if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "converting with pername " << toconvert << endreq;
if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "converting with pername " << cl << endreq;
void *transObj = m_TPTool->convertPT(toconvert,ptr, transclass);
void *transObj = m_TPTool->convertPT(cl,ptr, transclass);
if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "was converted to " << transclass << " at " << transObj << endreq;
//persistent object not needed anymore
TClass *persClObj = gROOT->GetClass(toconvert.c_str());
TClass *persClObj = gROOT->GetClass(cl.c_str());
if (persClObj)
persClObj->Destructor(ptr);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment