Example #1
0
void	GSMS::EventAction::BeginOfEventAction(const G4Event*	evt) {
	G4int	evtNb = evt->GetEventID();
//	std::cerr << "Event: " << evtNb << std::endl;

	G4SDManager*	sdman = G4SDManager::GetSDMpointer();
	colID = sdman->GetCollectionID("crystal/eDep");

//	std::cerr << "Coll ID: " << colID << std::endl;
}
Example #2
0
void BIEventAction::BeginOfEventAction(const G4Event *)
{
   if (fHitsCollectionID == -1) {
      G4SDManager *manager = G4SDManager::GetSDMpointer();
      if(fForGrid){
         fHitsCollectionID = manager->GetCollectionID("Small/SmallHitsCollection");
         if (fHitsCollectionID == -1) {
            G4cout << "Small/SmallHitsCollection not found" << G4endl;
            exit(0);
         }
      }
      else {
         fHitsCollectionID = manager->GetCollectionID("Common/CommonHitsCollection");
         if (fHitsCollectionID == -1) {
            G4cout << "Common/CommonHitsCollection not found" << G4endl;
            exit(0);
         }
      }
   }
}