Hi,
I am dealing with ntuples that contain a shower object that has changed a bit over time. The newer versions of the object contain additional data-members corresponding to a more sophisticated energy reconstruction. While running with a version of the code associated with the newer version of my shower object, I’d like to detect if the actual object read in from disk is from an older version so I can take different action. This is what I’ve tried, perhaps it will be more clear:
Version_t ver = ntpShower->Class()->GetClassVersion();
if(ver <=7){
result=(ntpShower->ph.gev);
}
else {
result=ntpShower->shwph.linCCgev;
}
ntpShower is a pointer to my shower object. The code above doesn’t work, the variable “ver” always corresponds to the newer class version. That is, the version associated with the code in memory rather than the obect stored in the ntuple. Is it possible to successfully test for the class version of objects on disk? I’m afraid I’ve wandered into an area of ROOT that I know very little about.
Mike Kordosky