Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:37

0001 // Include files
0002 #include "TROOT.h"
0003 #include "TFile.h"
0004 #include "TSystem.h"
0005 #include "TKey.h"
0006 //*****************************************************************************
0007 // To run this macro in cint do (after replacing the location_of_your_libraries below):
0008 // .include  $G4INCLUDE
0009 // gSystem->Load("<location_of_your_libraries>/libExP01ClassesDict.so");
0010 // .L hits.C++
0011 // hits();
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 }