f67e2651 |
1 | //////////////////////////////////////////////////////// |
2 | // Macro to attach and open an IceCube event file |
3 | // for interactive investigation. |
4 | // |
5 | // To run this macro, just do |
6 | // |
7 | // root> .x open.cc |
8 | // |
9 | //--- NvE 18-jun-2004 Utrecht University |
10 | ///////////////////////////////////////////// |
11 | { |
12 | gSystem->Load("ralice"); |
13 | gSystem->Load("icepack"); |
14 | |
15 | // Access to the input data |
16 | TFile* f=new TFile("events.root"); |
17 | TTree* data=(TTree*)f->Get("T"); |
18 | |
19 | // Provide overview of Tree contents |
20 | cout << endl; |
21 | data->Print(); |
22 | |
23 | // Define a pointer for an event |
24 | IceEvent* evt=0; |
25 | |
26 | // Branch in the tree for the event input |
27 | data->SetBranchAddress("IceEvent",&evt); |
28 | |
29 | cout << endl; |
30 | cout << " *READ* nentries : " << data->GetEntries() << endl; |
31 | cout << endl; |
32 | |
33 | cout << " Use data->GetEntry(i) to load the i-th entry." << endl; |
34 | cout << " The event object is called evt " << endl; |
35 | cout << endl; |
36 | } |