Hello,
I am trying to read back in ROOT an object that I have previously created and saved in a file. The header file from the object is below
[code]#ifndef RTCALIB_HH
#define RTCALIB_HH
#include “TNamed.h”
#include
#include
using namespace std;
class T0Result;
class AthIndex;
class RTCalib : public TNamed {
public:
RTCalib();
virtual ~RTCalib();
T0Result& getT0Fit(const AthIndex& index);
T0Result& getT0Fit(const string& index);
double driftTime(const AthIndex& index, double rawdt);
double radius(const AthIndex& index, double rawdt);
T0Result* getT0FitUnSafe(const AthIndex& index);
T0Result* getT0FitUnSafe(const string& index);
private:
map<string,T0Result*> _t0res;
ClassDef(RTCalib,1) // container and calculator of the RT calibrations
};
#endif
[/code]
My program basically writes this object to a file by doing the following:
TFile* f = TFile::Open("tmp.root", "recreate");
calib->Write();
f->Close();
After that, I try to read back the object in a root session interactively:
[code]$ root tmp.root
-
*
-
W E L C O M E to R O O T *
-
*
- Version 4.03/02 14 March 2005 *
-
*
- You are welcome to visit our Web site *
-
http://root.cern.ch *
-
*
FreeType Engine v2.1.3 used to render TrueType fonts.
Compiled for linuxdeb with thread support.
CINT/ROOT C/C++ Interpreter version 5.15.159, Nov 14 2004
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0]
Attaching file tmp.root as _file0…
root [1] .ls
TFile** tmp.root
TFile* tmp.root
KEY: RTCalib calib;1 RT Calibrations
KEY: TH1F caldrt;1 caldrt
root [2] calib
Error: Incorrect referencing of $calib FILE:(tmpfile) LINE:1
(class RTCalib*)0x8cdaeb8
*** Interpreter error recovered ***
[/code]
I have no idea what this error means: could you help me understanding what is wrong?
I can post more information from my code if what I have given isn’t enough
Thanks
Pierre-François Giraud