diff --git a/Control/xAODRootAccess/Root/TAuxStore.cxx b/Control/xAODRootAccess/Root/TAuxStore.cxx index c28951eec915a0abec3aba2c3c06a181ca2dacaf..87e8a6115a799d7a55be5bcaff91fca06a69fb73 100644 --- a/Control/xAODRootAccess/Root/TAuxStore.cxx +++ b/Control/xAODRootAccess/Root/TAuxStore.cxx @@ -13,6 +13,9 @@ #include <TClass.h> #include <TROOT.h> #include <TVirtualCollectionProxy.h> +#include <TBranchElement.h> +#include <TStreamerInfo.h> +#include <TStreamerElement.h> // EDM include(s): #include "AthContainers/AuxTypeRegistry.h" @@ -1469,6 +1472,19 @@ namespace xAOD { br->GetName() ); } + // Check for schema evolution: + // If a branch has automatic schema evolution from one class to another, + // then what we get from GetExpectedType will be the on-disk class. + // What we have in memory is given by GetCurrentClass. + if (expectedClass) { + if (TBranchElement* bre = dynamic_cast<TBranchElement*> (br)) { + TClass* newClass = bre->GetCurrentClass(); + if (newClass && newClass != expectedClass) { + expectedClass = newClass; + } + } + } + // If this is a primitive variable, and we're still not sure whether this // is a store for an object or a container, the answer is given... if( ( ! expectedClass ) &&