Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
readHits.C
이 파일의 문서화 페이지로 가기
1 // Include files
2 #include "TROOT.h"
3 #include "TFile.h"
4 #include "TSystem.h"
5 #include "TKey.h"
6 //*****************************************************************************
7 // To run this macro in cint do (after replacing the location_of_your_libraries below):
8 // .include $G4INCLUDE
9 // gSystem->Load("<location_of_your_libraries>/libExP01ClassesDict.so");
10 // .L hits.C++
11 // hits();
12 //*****************************************************************************
14 
15 void hits()
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
Definition of the ExP01TrackerHit class.