Dear Philippe,
I think our is a fairly standard way to use root in a reconstruction program
I paste here the 2 classes where root is involved:
[code]#ifndef _BX_ROOT_EVENT_H
#define _BX_ROOT_EVENT_H
#include <TROOT.h>
#include <TObject.h>
class bx_root_event: public TObject {
public:
bx_root_event ();
virtual ~bx_root_event ();
// all variables clean up
void clear ();
ClassDef (bx_root_event, 1)
private:
};
#endif
[/code]
and this is the other
[code]#ifndef _BX_WRITER_H
#define _BX_WRITER_H
#include “TFile.h”
#include “TTree.h”
#include “bx_base_module.hh”
#include “bx_rec_general.hh”
#include “bx_root_event.hh”
// base class for root event filler
class bx_base_root_event_filler {
public:
bx_base_root_event_filler () {}
virtual ~bx_base_root_event_filler () {}
virtual void fill (bx_root_event*) = 0;
};
// one implemetation of a root event filler
class bx_root_event_filler : public bx_base_root_event_filler {
public:
bx_root_event_filler (const bx_reco_event* p) : p_reco_event§ {}
virtual ~bx_root_event_filler () {}
// fill root event
virtual void fill (bx_root_event*);
private:
inline const bx_reco_event& reco () const { return *p_reco_event; }
const bx_reco_event *p_reco_event;
};
class bx_event_writer: public bx_base_module {
public:
bx_event_writer ();
virtual ~bx_event_writer () {}
virtual void begin ();
virtual bx_reco_event* doit (bx_reco_event *ev);
virtual void end ();
private:
TFile *p_root_file;
TTree *p_root_tree;
bx_root_event *p_root_event;
};
[/code]
as you see, there is really nothing special in it.
I suspect that whenever one uses a root object, this somehow initializes a the TROOT singleton that plays the trick.
We could call ->ProcessLine(".exception") on this one if we could get a pointer to it. I just gave a look at the TROOT reference page but could not find a static method that returns a TROOT*
Any idea?
thanks again, bye
Davide
P.S.: uhm, it’s 8.30 pm here in Italy, my stomach really wants me to leave. I’ll check replies again tomorrow hopefully. have a nice evening.