ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimROOTAnalSci.cc
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 05/2008
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 //////////////////////////////////////////////////////////////////
10 /// \class ActarSimROOTAnalSci
11 /// The ACTAR Scintillator detectorpart of the ROOT Analysis
12 /////////////////////////////////////////////////////////////////
13 
14 #include "ActarSimROOTAnalSci.hh"
15 #include "ActarSimSciHit.hh"
16 #include "ActarSimSciGeantHit.hh"
17 
18 #include "G4ios.hh"
19 #include "G4RunManager.hh"
20 #include "G4SDManager.hh"
21 #include "G4Event.hh"
22 #include "G4Run.hh"
23 #include "G4Track.hh"
24 #include "G4ClassificationOfNewTrack.hh"
25 #include "G4TrackStatus.hh"
26 #include "G4Step.hh"
27 #include "G4Types.hh"
28 
29 //#include "G4PhysicalConstants.hh"
30 //#include "G4SystemOfUnits.hh"
31 
32 #include "TROOT.h"
33 //#include "TApplication.h"
34 //#include "TSystem.h"
35 //#include "TH1.h"
36 //#include "TH2.h"
37 //#include "TPad.h"
38 //#include "TCanvas.h"
39 #include "TTree.h"
40 #include "TFile.h"
41 #include "TClonesArray.h"
42 
43 //////////////////////////////////////////////////////////////////
44 /// Constructor
46 
47  //The simulation file
49  simFile->cd();
50 
51  //The tree
53 
54  //TODO->Implement SimHits/Hits duality as R3B...
55 
56  //The clones array of Sci Hits
57  sciHitCA = new TClonesArray("ActarSimSciHit",2);
58 
59  sciHitsBranch = eventTree->Branch("sciHits",&sciHitCA);
60 }
61 
62 //////////////////////////////////////////////////////////////////
63 /// Destructor. Makes nothing
65 }
66 
67 //////////////////////////////////////////////////////////////////
68 /// Actions to perform in the scintillator anal when generating the primaries
69 void ActarSimROOTAnalSci::GeneratePrimaries(const G4Event *anEvent){
70  if(anEvent){;} // to quiet the compiler
71 }
72 
73 //////////////////////////////////////////////////////////////////
74 /// Actions to perform in the scintillator anal at the begining of the run
75 void ActarSimROOTAnalSci::BeginOfRunAction(const G4Run *aRun) {
76  if (aRun){;} /* keep the compiler "quiet" */
77 
78  //Storing the runID
79  SetTheRunID(aRun->GetRunID());
80 
81  char newDirName[255];
82  sprintf(newDirName,"%s%i","Histos",aRun->GetRunID());
83  simFile->cd(newDirName);
84 
85  dirName = new char[255];
86 
87  sprintf(dirName,"%s","sci");
88  gDirectory->mkdir(dirName,dirName);
89  gDirectory->cd(dirName);
90 
91  simFile->cd();
92 }
93 
94 //////////////////////////////////////////////////////////////////
95 /// Actions to perform in the scintillator anal at the begining of the event
96 void ActarSimROOTAnalSci::BeginOfEventAction(const G4Event *anEvent) {
97  SetTheEventID(anEvent->GetEventID());
98 }
99 
100 //////////////////////////////////////////////////////////////////
101 /// Actions to perform in the scintillator anal at the beginning of the run
102 void ActarSimROOTAnalSci::EndOfEventAction(const G4Event *anEvent) {
103  FillingHits(anEvent);
104 }
105 
106 //////////////////////////////////////////////////////////////////
107 /// Actions to perform in the scintillator detector analysis after each step
108 void ActarSimROOTAnalSci::UserSteppingAction(const G4Step *aStep){
109  if(aStep){;} // to quiet the compiler
110 }
111 
112 //////////////////////////////////////////////////////////////////
113 /// Defining the ActarSimSciHits from the ActarSimSciGeantHits
114 void ActarSimROOTAnalSci::FillingHits(const G4Event *anEvent) {
115 
116  //Hit Container ID for ActarSimSciGeantHit
117  G4int hitsCollectionID =
118  G4SDManager::GetSDMpointer()->GetCollectionID("SciCollection");
119 
120  G4HCofThisEvent* HCofEvent = anEvent->GetHCofThisEvent();
121 
122  ActarSimSciGeantHitsCollection* hitsCollection =
123  (ActarSimSciGeantHitsCollection*) HCofEvent->GetHC(hitsCollectionID);
124 
125  //Number of R3BCalGeantHit (or steps) in the hitsCollection
126  G4int NbHits = hitsCollection->entries();
127  G4int NbHitsWithSomeEnergy = NbHits;
128  //G4cout << " NbHits: " << NbHits << G4endl;
129 
130  //We accept edep=0 GeantHits, we have to remove them
131  //from the total number of GeantHits accepted for creating a real CrystalHit
132  for (G4int i=0;i<NbHits;i++)
133  if((*hitsCollection)[i]->GetEdep()==0.)
134  NbHitsWithSomeEnergy--;
135  //G4cout << " NbHitsWithSomeEnergy: " << NbHitsWithSomeEnergy << G4endl;
136 
137  G4int NbCrystalsWithHit=NbHitsWithSomeEnergy;
138  G4String* nameWithSomeEnergy;
139  G4int* detIDWithSomeEnergy;
140  detIDWithSomeEnergy = new G4int[NbHitsWithSomeEnergy];
141  nameWithSomeEnergy = new G4String[NbHitsWithSomeEnergy];
142 
143  //keep the crystal identifiers of the GeantHits with some energy
144  G4int hitsWithEnergyCounter=0;
145  for (G4int i=0;i<NbHits;i++) {
146  if((*hitsCollection)[i]->GetEdep()>0.){
147  nameWithSomeEnergy[hitsWithEnergyCounter] = (*hitsCollection)[i]->GetDetName();
148  detIDWithSomeEnergy[hitsWithEnergyCounter] = (*hitsCollection)[i]->GetDetID();
149  //G4cout << "with some energy: name:" << nameWithSomeEnergy[hitsWithEnergyCounter]
150  // << " detID:"<<detIDWithSomeEnergy[hitsWithEnergyCounter] << G4endl;
151  hitsWithEnergyCounter++;
152  }
153  }
154 
155  //if(hitsWithEnergyCounter != NbHitsWithSomeEnergy) {
156  // G4cout << "ERROR in ActarSimROOTAnalSci::FillingHits(): hitsWithEnergyCounter!=NbHitsWithSomeEnergy" << G4endl;
157  // G4cout << " hitsWithEnergyCounter = " << hitsWithEnergyCounter << " while NbHitsWithSomeEnergy = " << NbHitsWithSomeEnergy << G4endl;
158  //}
159 
160  //We ask for the number of crystals with signal and
161  //this loop calculates them from the number of ActarSimSciGeantHits with energy
162  for (G4int i=0;i<NbHitsWithSomeEnergy;i++) {
163  for(G4int j=0;j<i;j++){
164  if(nameWithSomeEnergy[i] == nameWithSomeEnergy[j] && detIDWithSomeEnergy[i] == detIDWithSomeEnergy[j]){
165  NbCrystalsWithHit--;
166  break; //break stops the second for() sentence as soon as one repetition is found
167  }
168  }
169  }
170  //G4cout << " NbCrystalsWithHit: " << NbCrystalsWithHit << G4endl;
171 
172  G4String* nameWithHit;
173  G4int* detIDWithHit;
174  detIDWithHit = new G4int[NbCrystalsWithHit];
175  nameWithHit = new G4String[NbCrystalsWithHit];
176  hitsWithEnergyCounter=0;
177 
178  //keep the crystal identifiers of the final crystalHits
179  G4int hitsCounter=0;
180  for (G4int i=0;i<NbHits;i++) {
181  if ((*hitsCollection)[i]->GetEdep()>0.) {
182  if(hitsCounter==0) { //the first geantHit with energy always creates a newHit
183  nameWithHit[hitsCounter] = (*hitsCollection)[i]->GetDetName();
184  detIDWithHit[hitsCounter] = (*hitsCollection)[i]->GetDetID();
185  //G4cout << "with hit: name:" << nameWithHit[hitsCounter]
186  // << " detID:"<<detIDWithHit[hitsCounter] << G4endl;
187  hitsCounter++;
188  }
189  else {
190  for (G4int j=0;j<hitsCounter;j++) {
191  if ( (*hitsCollection)[i]->GetDetName() == nameWithHit[j] &&
192  (*hitsCollection)[i]->GetDetID() == detIDWithHit[j] ) {
193  break; //break stops the second for() sentence as soon as one repetition is found
194  }
195  if(j==hitsCounter-1){ //when the previous if was never true, there is no repetition
196  nameWithHit[hitsCounter] = (*hitsCollection)[i]->GetDetName();
197  detIDWithHit[hitsCounter] = (*hitsCollection)[i]->GetDetID();
198  //G4cout << "with hit: name:" << nameWithHit[hitsCounter]
199  // << " detID:"<<detIDWithHit[hitsCounter] << G4endl;
200  hitsCounter++;
201  }
202  }
203  }
204  }
205  }
206  //DELETE ME AFTER THE PRELIMINARY TESTS!
207  //if(hitsCounter != NbCrystalsWithHit) {
208  // G4cout << "ERROR in R3BROOTAnalCal::FillingHits(): hitsCounter!=NbCrystalsWithHit" << G4endl;
209  // G4cout << " hitsCounter = " << hitsCounter << " while NbCrystalsWithHit = " << NbCrystalsWithHit << G4endl;
210  //}
211 
212  //Let us create as many R3BCalCrystalHit as NbCrystalsWithHit
213  //TODO->Recover here the simhit/hit duality if needed!!
214  //if(((ActarSimROOTAnalysis*)gActarSimROOTAnalysis)->GetUseCrystalHitSim()==0){
215  theSciHit = new ActarSimSciHit*[NbCrystalsWithHit];
216  for (G4int i=0;i<NbCrystalsWithHit;i++)
217  theSciHit[i] = new ActarSimSciHit();
218  //}
219  //else{ //In case that the simulated hits were used!
220  // theSciHit = new ActarSimSciHit*[NbCrystalsWithHit];
221  // for (G4int i=0;i<NbCrystalsWithHit;i++)
222  // theSciHit[i] = new ActarSimSciHitSim();
223  //}
224 
225  //Clear the ClonesArray before filling it
226  sciHitCA->Clear();
227 
228  G4bool counted = 0;
229  hitsCounter = 0; //now this variable is going to count the added GeantHits
230  G4String* name;
231  G4int* detID;
232  detID = new G4int[NbCrystalsWithHit];
233  name = new G4String[NbCrystalsWithHit];
234 
235  G4bool shouldThisBeStored = 0;
236  //Filling the ActarSimSciHit from the R3BCalGeantHit (or step)
237  for (G4int i=0;i<NbHits;i++) {
238  //do not accept GeantHits with edep=0
239  //if there is no other GeantHit with edep>0 in the same crystal!
240  shouldThisBeStored=0;
241  counted =0;
242  //G4cout << "ADDING THE HITS. GeantHit with name:" << (*hitsCollection)[i]->GetDetName()
243  // << " detID:"<< (*hitsCollection)[i]->GetDetID() << " edep:"<< (*hitsCollection)[i]->GetEdep() <<" under consideration"<< G4endl;
244  for (G4int j=0;j<NbCrystalsWithHit;j++) {
245  if( (*hitsCollection)[i]->GetDetName() == nameWithHit[j] &&
246  (*hitsCollection)[i]->GetDetID() == detIDWithHit[j] ) {
247  shouldThisBeStored=1;
248  break; //break stops the for() sentence as soon as one "energetic" partner is found
249  }
250  }
251  if(!shouldThisBeStored) continue; //so, continue with next, if there is no "energetic partner"
252  if(hitsCounter==0){ //only for the first geantHit accepted for storage
253  name[hitsCounter] = (*hitsCollection)[i]->GetDetName();
254  detID[hitsCounter] = (*hitsCollection)[i]->GetDetID();
255  AddCalCrystalHit(theSciHit[hitsCounter],(*hitsCollection)[i],0);
256  //G4cout << "ADD hit: name:" << name[hitsCounter]
257  // << " detID:"<<detID[hitsCounter] << " with code 0 (initial)" << G4endl;
258  hitsCounter++;
259  }
260  else { // from the second in advance, compare if a R3BCalCrystalHit
261  // in the same volume already exists
262  for (G4int j=0;j<hitsCounter;j++) {
263  if( (*hitsCollection)[i]->GetDetName() == name[j] &&
264  (*hitsCollection)[i]->GetDetID() == detID[j] ){ //identical Hit already present
265  AddCalCrystalHit(theSciHit[j],(*hitsCollection)[i],1);
266  //G4cout << "ADD hit: name:" << name[j]
267  // << " detID:"<< detID[j] << " with code 1" << G4endl;
268  counted = 1;
269  break; // stops the for() loop; the info is written in the first identical Hit
270  }
271  }
272  if(counted==0) { //No identical Hit present.
273  name[hitsCounter] = (*hitsCollection)[i]->GetDetName();
274  detID[hitsCounter] = (*hitsCollection)[i]->GetDetID();
275  AddCalCrystalHit(theSciHit[hitsCounter],(*hitsCollection)[i],0);
276  //G4cout << "ADD hit: name:" << name[hitsCounter]
277  // << " detID:"<<detID[hitsCounter] << " with code 0" << G4endl;
278  hitsCounter++;
279  }
280  }
281  }
282 
283  //BORRAME
284  //G4cout << G4endl <<"************************ END OF DEBUGGING *****************************************" << G4endl;
285  //G4cout <<"************************************************************************************" << G4endl;
286 
287  //at the end, fill the ClonesArray
288  //TODO-> Recover here the simhit/hit duality if needed!!
289  //if(((ActarSimROOTAnalysis*)gActarSimROOTAnalysis)->GetUseCrystalHitSim()==0){
290  for (G4int i=0;i<NbCrystalsWithHit;i++)
291  new((*sciHitCA)[i])ActarSimSciHit(*theSciHit[i]);
292  //}
293  //else{ //In case that the simulated hits were used!
294  // ActarSimSciHitSim* testSim;
295  // for (G4int i=0;i<NbCrystalsWithHit;i++) {
296  // testSim = (ActarSimSciHitSim*) (theSciHit[i]);
297  // new((*sciHitCA)[i])ActarSimSciHitSim(*testSim);
298  // }
299  //}
300 
301  // all branches at the same time!
302  //G4cout << " #@BITCOUNT "<< crystalHitsBranch->Fill() << G4endl;
303  //G4cout << " #@BITCOUNT "<< theR3BTree->Fill() << G4endl;
304 
305  delete [] detIDWithSomeEnergy;
306  delete [] nameWithSomeEnergy;
307  delete [] detIDWithHit;
308  delete [] nameWithHit;
309  delete [] detID;
310  delete [] name;
311  for (G4int i=0;i<NbCrystalsWithHit;i++) delete theSciHit[i];
312  delete [] theSciHit;
313 }
314 
315 //////////////////////////////////////////////////////////////////
316 /// Function to move the information from the ActarSimSciGeantHit (a step hit)
317 /// to ActarSimSciHit (an event hit) for the Darmstadt-Heidelberg Crystall Ball.
318 /// Two modes are possible:
319 /// - mode == 0 : creation; the ActarSimSciHit is void and is
320 /// filled by the data from the ActarSimSciGeantHit
321 /// - mode == 1 : addition; the ActarSimSciHit was already created
322 /// by other ActarSimSciGeantHit and some data members are updated
324  ActarSimSciGeantHit* gHit,
325  G4int mode) {
326 
327  if(mode == 0) { //creation
328  if( gHit->GetDetName() == "sciPhys" ) cHit->SetType(1);
329  else G4cout << "ERROR in R3BROOTAnalCal::AddCalCrystalHit()." << G4endl
330  << "Unknown Detector Name: "<< gHit->GetDetName() << G4endl << G4endl;
331 
332  cHit->SetCopy(gHit->GetDetID());
333 
334  cHit->SetEnergy(gHit->GetEdep()/ CLHEP::MeV);
335  cHit->SetTime(gHit->GetToF() / CLHEP::ns);
336 
337  cHit->SetEventID(GetTheEventID());
338  cHit->SetRunID(GetTheRunID());
339 
340  cHit->SetParticleID(gHit->GetParticleID());
341  cHit->SetParticleCharge(gHit->GetParticleCharge());
342  cHit->SetParticleMass(gHit->GetParticleMass());
343 
344  //TODO-> Recover here the simhit/hit duality if needed!!
345  /*
346  if(((ActarSimROOTAnalysis*)gActarSimROOTAnalysis)->GetUseCrystalHitSim()!=0){
347  if( fabs(gHit->GetLocalPos().z())> 120 )
348  ((ActarSimSciHitSim*)cHit)->SetEnergyPerZone(24,gHit->GetEdep()/ MeV);
349  else {
350  G4int bin = (G4int)((gHit->GetLocalPos().z()/10) + 12);
351  ((ActarSimSciHitSim*)cHit)->SetEnergyPerZone( bin,
352  gHit->GetEdep()/ MeV);
353  //G4cout << G4endl << "Initial posZ:" << gHit->GetLocalPos().z() << " bin " << bin
354  // << " E:" << ((ActarSimSciHitSim*)cHit)->GetEnergyPerZone( bin ) << G4endl << G4endl;
355  }
356  ((ActarSimSciHitSim*)cHit)->SetNbOfSteps(1);
357  ((ActarSimSciHitSim*)cHit)->SetTimeFirstStep(gHit->GetToF() / ns);
358  ((ActarSimSciHitSim*)cHit)->SetTimeLastStep(gHit->GetToF() / ns);
359  ((ActarSimSciHitSim*)cHit)->SetNbOfPrimaries(GetPrimNbOfParticles());
360  ((ActarSimSciHitSim*)cHit)->SetEnergyPrimary(GetPrimEnergy() / MeV);
361  ((ActarSimSciHitSim*)cHit)->SetThetaPrimary(GetPrimTheta() / rad);
362  ((ActarSimSciHitSim*)cHit)->SetPhiPrimary(GetPrimPhi() / rad);
363  if(gHit->GetProcessName()=="phot") ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(1);
364  else if(gHit->GetProcessName()=="compt") ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(2);
365  else if(gHit->GetProcessName()=="conv") ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(3);
366  else if(gHit->GetProcessName()=="msc") ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(4);
367  else if(gHit->GetProcessName()=="eBrem") ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(5);
368  else if(gHit->GetProcessName()=="Transportation") ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(6);
369  else ((ActarSimSciHitSim*)cHit)->SetFirstInteractionType(0);
370  ((ActarSimSciHitSim*)cHit)->SetFirstInteractionX(gHit->GetLocalPos().x());
371  ((ActarSimSciHitSim*)cHit)->SetFirstInteractionY(gHit->GetLocalPos().y());
372  ((ActarSimSciHitSim*)cHit)->SetFirstInteractionZ(gHit->GetLocalPos().z());
373  }
374  */
375  }
376  else if(mode==1){ //addition
377  cHit->SetEnergy(cHit->GetEnergy() + gHit->GetEdep()/ CLHEP::MeV);
378  if(gHit->GetToF()<cHit->GetTime()) cHit->SetTime(gHit->GetToF()/ CLHEP::ns);
379 
380  //TODO-> Recover here the simhit/hit duality if needed!!
381  /*
382  if(((ActarSimROOTAnalysis*)gActarSimROOTAnalysis)->GetUseCrystalHitSim()!=0){
383  if( fabs(gHit->GetLocalPos().z())> 120 )
384  ((R3BCalCrystalHitSim*)cHit)->SetEnergyPerZone(24,
385  ((R3BCalCrystalHitSim*)cHit)->GetEnergyPerZone(24)+gHit->GetEdep()/ MeV);
386  else {
387  G4int bin = (G4int)((gHit->GetLocalPos().z()/10) + 12);
388  ((R3BCalCrystalHitSim*)cHit)->SetEnergyPerZone( bin,
389  ((R3BCalCrystalHitSim*)cHit)->GetEnergyPerZone(bin)+gHit->GetEdep()/ MeV);
390  //G4cout << G4endl << "Adding posZ:" << gHit->GetLocalPos().z() << " bin " << bin << " E:"
391  // << ((R3BCalCrystalHitSim*)cHit)->GetEnergyPerZone( bin ) << G4endl << G4endl;
392  }
393  ((R3BCalCrystalHitSim*)cHit)->SetNbOfSteps(((R3BCalCrystalHitSim*)cHit)->GetNbOfSteps()+1);
394  if(gHit->GetToF()<((R3BCalCrystalHitSim*)cHit)->GetTime()){
395  ((R3BCalCrystalHitSim*)cHit)->SetTime(gHit->GetToF()/ ns);
396  ((R3BCalCrystalHitSim*)cHit)->SetTimeFirstStep(gHit->GetToF() / ns);
397  if(gHit->GetProcessName()=="phot") ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(1);
398  else if(gHit->GetProcessName()=="compt") ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(2);
399  else if(gHit->GetProcessName()=="conv") ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(3);
400  else if(gHit->GetProcessName()=="msc") ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(4);
401  else if(gHit->GetProcessName()=="eBrem") ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(5);
402  else if(gHit->GetProcessName()=="Transportation") ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(6);
403  else ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionType(0);
404  ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionX(gHit->GetLocalPos().x());
405  ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionY(gHit->GetLocalPos().y());
406  ((R3BCalCrystalHitSim*)cHit)->SetFirstInteractionZ(gHit->GetLocalPos().z());
407  }
408  else if(gHit->GetToF()>((R3BCalCrystalHitSim*)cHit)->GetTimeLastStep())
409  ((R3BCalCrystalHitSim*)cHit)->SetTimeLastStep(gHit->GetToF());
410  }
411  */
412  }
413 }
void SetTheRunID(G4int id)
ActarSimROOTAnalSci()
Constructor.
Double_t GetTime()
G4THitsCollection< ActarSimSciGeantHit > ActarSimSciGeantHitsCollection
void SetEnergy(Double_t ed)
~ActarSimROOTAnalSci()
Destructor. Makes nothing.
void SetCopy(UInt_t co)
void EndOfEventAction(const G4Event *)
Actions to perform in the scintillator anal at the beginning of the run.
void UserSteppingAction(const G4Step *)
Actions to perform in the scintillator detector analysis after each step.
void SetParticleID(UInt_t pdgID)
void SetType(UInt_t ty)
void BeginOfRunAction(const G4Run *)
Actions to perform in the scintillator anal at the begining of the run.
TBranch * sciHitsBranch
Local branch for scintillators.
void BeginOfEventAction(const G4Event *)
Actions to perform in the scintillator anal at the begining of the event.
void FillingHits(const G4Event *anEvent)
Defining the ActarSimSciHits from the ActarSimSciGeantHits.
void SetTime(Double_t ti)
void SetParticleCharge(Double_t pdgCharge)
void SetParticleMass(Double_t pdgMass)
ActarSimROOTAnalysis * gActarSimROOTAnalysis
Global pointer to this soliton.
TClonesArray * sciHitCA
ClonesArray of the hits in the scintillators.
TTree * eventTree
Local pointer to the event tree.
void GeneratePrimaries(const G4Event *)
Actions to perform in the scintillator anal when generating the primaries.
void SetEventID(UInt_t ev)
void SetRunID(UInt_t run)
ActarSimSciHit ** theSciHit
Pointer to the hits in the scintillators.
void AddCalCrystalHit(ActarSimSciHit *, ActarSimSciGeantHit *, G4int)
TFile * simFile
Local pointer to simFile.
Double_t GetEnergy()
void SetTheEventID(G4int id)