File indexing completed on 2025-02-23 09:22:37
0001
0002 #include "TROOT.h"
0003 #include "TFile.h"
0004 #include "TSystem.h"
0005 #include "TKey.h"
0006
0007
0008
0009
0010
0011
0012
0013 #include "include/ExP01TrackerHit.hh"
0014
0015 void hits()
0016 {
0017 TFile fo("hits.root");
0018
0019 std::vector<ExP01TrackerHit*>* hits;
0020 fo.GetListOfKeys()->Print();
0021
0022 TIter next(fo.GetListOfKeys());
0023 TKey *key;
0024 double tot_en;
0025 while ((key=(TKey*)next()))
0026 {
0027 fo.GetObject(key->GetName(), hits);
0028
0029 tot_en = 0;
0030 cout << "Collection: " << key->GetName() << endl;
0031 cout << "Number of hits: " << hits->size() << endl;
0032 for (int i=0;i!=hits->size();i++)
0033 {
0034 (*hits)[i]->Print();
0035 }
0036 }
0037 }