aboutsummaryrefslogtreecommitdiffstats
path: root/src/G4BeamTestEventAction.cxx
diff options
context:
space:
mode:
authorshivesh <s.p.mandalia@qmul.ac.uk>2018-11-20 17:26:02 +0000
committershivesh <s.p.mandalia@qmul.ac.uk>2018-11-20 17:26:02 +0000
commitd0533d03d0c85f2f993f1793a6b9ea2af3391207 (patch)
tree682c2fefe2d113319f21c07bded00fed5245e19b /src/G4BeamTestEventAction.cxx
parent738c2f88939a041fbc8b6b9cfa3c547b86bc6e42 (diff)
downloadG4BeamTest-d0533d03d0c85f2f993f1793a6b9ea2af3391207.tar.gz
G4BeamTest-d0533d03d0c85f2f993f1793a6b9ea2af3391207.zip
Tue 20 Nov 17:26:02 GMT 2018
Diffstat (limited to 'src/G4BeamTestEventAction.cxx')
-rw-r--r--src/G4BeamTestEventAction.cxx91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/G4BeamTestEventAction.cxx b/src/G4BeamTestEventAction.cxx
new file mode 100644
index 0000000..176991d
--- /dev/null
+++ b/src/G4BeamTestEventAction.cxx
@@ -0,0 +1,91 @@
+#include "G4Event.hh"
+
+#include "G4HCofThisEvent.hh"
+#include "G4VHitsCollection.hh"
+#include "G4SDManager.hh"
+#include "G4ios.hh"
+#include "G4VDigitizerModule.hh"
+#include "G4DigiManager.hh"
+#include "G4Event.hh"
+#include "G4RunManager.hh"
+
+#include "G4BeamTestSiSD.h"
+#include "G4BeamTestSiHit.h"
+#include "G4BeamTestEventAction.h"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+G4BeamTestEventAction::G4BeamTestEventAction()
+ : G4UserEventAction(),
+
+ SiCollID(0)
+{
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+G4BeamTestEventAction::~G4BeamTestEventAction()
+{}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void G4BeamTestEventAction::BeginOfEventAction(const G4Event* event )
+{
+
+
+ G4SDManager * SDman = G4SDManager::GetSDMpointer();
+ if(SiCollID<0)
+ {
+ G4String colNam;
+ SiCollID = SDman->GetCollectionID(colNam="G4BeamTestSiSDCollection");
+
+ }
+
+
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+void G4BeamTestEventAction::EndOfEventAction(const G4Event* event)
+{
+
+ G4cout << ">>> Summary of Event " << event->GetEventID() << G4endl;
+
+ if(SiCollID<0) return;
+
+ G4HCofThisEvent* HCE = event->GetHCofThisEvent();
+ G4BeamTestSiHitsCollection* SiHC = 0;
+
+ if(HCE)
+ {
+ SiHC = (G4BeamTestSiHitsCollection*)(HCE->GetHC(SiCollID));
+
+ }
+
+
+
+
+ if(SiHC)
+ {
+ int n_hit = SiHC->entries();
+ G4cout << G4endl;
+ G4cout << "Si hits " <<
+ "--------------------------------------------------------------"
+ << G4endl;
+ G4cout << n_hit << " hits are stored in G4BeamTestSiHitsCollection."
+ << G4endl;
+ /* G4cout << "List of hits in tracker" << G4endl; */
+ for(int i=0;i<n_hit;i++)
+ {
+ /* (*SiHC)[i]->Print(); */
+ (*SiHC)[i]->Dataout();
+ }
+
+ // G4cout << "sid + " << SiCollID << G4endl;
+
+ }
+
+}
+
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+