aboutsummaryrefslogtreecommitdiffstats
path: root/src/G4BeamTestEventAction.cxx
diff options
context:
space:
mode:
authorshivesh <s.p.mandalia@qmul.ac.uk>2019-08-22 01:37:19 +0100
committershivesh <s.p.mandalia@qmul.ac.uk>2019-08-22 01:37:19 +0100
commite3079fb2367c26f767be41e6c313d960c517bbcd (patch)
tree509f081184a4179894ab8370ea06425d46729e9a /src/G4BeamTestEventAction.cxx
parentba4dd395d1f163983f7102ff9a6c513cfe17912e (diff)
downloadG4BeamTest-e3079fb2367c26f767be41e6c313d960c517bbcd.tar.gz
G4BeamTest-e3079fb2367c26f767be41e6c313d960c517bbcd.zip
Thu 22 Aug 01:37:19 BST 2019
Diffstat (limited to 'src/G4BeamTestEventAction.cxx')
-rw-r--r--src/G4BeamTestEventAction.cxx56
1 files changed, 25 insertions, 31 deletions
diff --git a/src/G4BeamTestEventAction.cxx b/src/G4BeamTestEventAction.cxx
index 53402c9..bf6b09b 100644
--- a/src/G4BeamTestEventAction.cxx
+++ b/src/G4BeamTestEventAction.cxx
@@ -9,6 +9,7 @@
#include "G4Event.hh"
#include "G4RunManager.hh"
+#include "G4Interface.h"
#include "G4BeamTestSiSD.h"
#include "G4BeamTestSiHit.h"
#include "G4BeamTestEventAction.h"
@@ -16,10 +17,11 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4BeamTestEventAction::G4BeamTestEventAction()
: G4UserEventAction(),
-
- SiCollID(0)
+
+ SiCollID(0),
+ SC4CollID(0)
{
-}
+}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -29,75 +31,67 @@ G4BeamTestEventAction::~G4BeamTestEventAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4BeamTestEventAction::BeginOfEventAction(const G4Event* event )
-{
-
-
+{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
SDman->ListTree();
- if(SiCollID<0)
- {
- G4String colNam;
- SiCollID = SDman->GetCollectionID(colNam="G4BeamTestSiSDCollection");
-
- }
-
-
+ if(SiCollID<0) SiCollID = SDman->GetCollectionID("ice_SD_");
+ if(SC4CollID<0) SC4CollID = SDman->GetCollectionID("sc4_SD_");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4BeamTestEventAction::EndOfEventAction(const G4Event* event)
-{
+{
G4cout << ">>> Summary of Event " << event->GetEventID() << G4endl;
// testnew << ">>> Summary of Event " << event->GetEventID() << G4endl;
G4cout << SiCollID << G4endl;
+ G4cout << SC4CollID << G4endl;
if(SiCollID<0) return;
+ if(SC4CollID<0) return;
G4HCofThisEvent* HCE = event->GetHCofThisEvent();
G4BeamTestSiHitsCollection* SiHC = 0;
+ G4BeamTestSiHitsCollection* SC4HC = 0;
- if(HCE)
- {
- SiHC = (G4BeamTestSiHitsCollection*)(HCE->GetHC(SiCollID));
-
- }
-
+ G4cout << "# collections = " << HCE->GetNumberOfCollections() << G4endl;
+ if(HCE) {
+ SiHC = (G4BeamTestSiHitsCollection*)(HCE->GetHC(SiCollID));
+ SC4HC = (G4BeamTestSiHitsCollection*)(HCE->GetHC(1));
+ }
- if(SiHC)
+ if(SiHC && SC4HC)
{
+ // SC4 veto
+ int sc4_hit = SC4HC->entries();
+ if (sc4_hit < 1) return;
+
int n_hit = SiHC->entries();
- // testnew << std::flush;
G4cout << G4endl;
// G4cout << "Si hits " <<
// "--------------------------------------------------------------"
// << G4endl;
- G4cout << n_hit << " hits are stored in G4BeamTestSiHitsCollection."
+ G4cout << n_hit << " hits are stored in ice_SD_"
<< G4endl;
/* G4cout << "List of hits in tracker" << G4endl; */
- // testnew << G4endl;
- // testnew << "Si hits " <<
// "--------------------------------------------------------------"
- testnew << n_hit << " hits are stored in G4BeamTestSiHitsCollection."
+ testnew << n_hit << " hits are stored in ice_SD_"
<< G4endl;
- /* testnew << "List of hits in tracker" << G4endl; */
for(int i=0;i<n_hit;i++)
{
/* (*SiHC)[i]->Print(); */
(*SiHC)[i]->Dataout();
}
-
// G4cout << "sid + " << SiCollID << G4endl;
// testnew << "sid + " << SiCollID << G4endl;
testnew << std::flush;
- }
+ }
}
-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......