9 //______________________________________________________________________
15 /**************************************************************************/
17 const TString VSDEvent::sVSDHeaderName("VSDheader");
19 VSDEvent::VSDEvent() :
20 EventBase("VSDEvent"),
21 fRun(0), fEvent(0), fUrl(),
23 fDirectory(0), fCreator(0), fSelector(0)
26 VSDEvent::VSDEvent(Int_t run, Int_t evt, const TString& url) :
27 EventBase("VSDEvent"),
28 fRun(run), fEvent(evt), fUrl(url),
30 fDirectory(0), fCreator(0), fSelector(0)
33 VSDEvent::VSDEvent(const TString& url) :
34 EventBase("VSDEvent"),
35 fRun(0), fEvent(0), fUrl(url),
37 fDirectory(0), fCreator(0), fSelector(0)
40 /**************************************************************************/
42 VSDEvent* VSDEvent::OpenDirectory(const TString& dir_name)
44 static const Exc_t eH("VSDEvent::OpenDirectory ");
46 TDirectory* dir = dynamic_cast<TDirectory*>(gDirectory->Get(dir_name));
48 throw(eH + "direcotry '" + dir_name + "' not found.");
49 return OpenDirectory(dir);
52 VSDEvent* VSDEvent::OpenDirectory(TDirectory* dir)
54 static const Exc_t eH("VSDEvent::OpenDirectory ");
56 VSDEvent* evt = dynamic_cast<VSDEvent*>(dir->Get(sVSDHeaderName));
58 throw(eH + "VSD header '" + sVSDHeaderName + "' not found.");
59 evt->fDirectory = dir;
63 /**************************************************************************/
64 /**************************************************************************/
66 void VSDEvent::SetDirectory(TDirectory* dir)
69 fDirectory->RecursiveRemove(this);
72 fDirectory->Append(this);
75 TDirectory* VSDEvent::MakeDirectory(const Text_t* name, const Text_t* title)
77 TDirectory* dir = new TDirectory(name, title);
82 /**************************************************************************/
84 void VSDEvent::Print(Option_t* ) const
86 printf("%s: '%s', '%s'\n", IsA()->GetName(), GetName(), GetTitle());
87 printf(" run=%d, event=%d, url='%s'\n", fRun, fEvent, fUrl.Data());
89 printf(" directory: '%s', '%s'\n", fDirectory->GetName(), fDirectory->GetTitle());
92 /**************************************************************************/
93 /**************************************************************************/
94 /**************************************************************************/
95 /**************************************************************************/
99 void EvTree::Browse(TBrowser* b)
101 // fFolder.Browse(b); // This adds all elements to top-level.