Geant4  10.02.p03
readHits.C File Reference
#include "TROOT.h"
#include "TFile.h"
#include "TSystem.h"
#include "TKey.h"
#include "include/ExP01TrackerHit.hh"
Include dependency graph for readHits.C:

Go to the source code of this file.

Functions

void hits ()
 

Function Documentation

◆ hits()

void hits ( )

Definition at line 15 of file readHits.C.

16 {
17  TFile fo("hits.root");
18 
19  std::vector<ExP01TrackerHit*>* hits;
20  fo.GetListOfKeys()->Print();
21 
22  TIter next(fo.GetListOfKeys());
23  TKey *key;
24  double tot_en;
25  while ((key=(TKey*)next()))
26  {
27  fo.GetObject(key->GetName(), hits);
28 
29  tot_en = 0;
30  cout << "Collection: " << key->GetName() << endl;
31  cout << "Number of hits: " << hits->size() << endl;
32  for (int i=0;i!=hits->size();i++)
33  {
34  (*hits)[i]->Print();
35  }
36  }
37 }
void hits()
Definition: readHits.C:15
Here is the caller graph for this function: