Message: UI Crashing Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question UI Crashing 

Forum: Particles
Date: 23 Feb, 2011
From: Sarah Bender <Sarah Bender>


I'm new to Geant and I'm trying to model a HPGe gamma ray detector. I'm having problems with the UI that's generating my particles. The problem only occurs for certain isotopes, for instance Cs-137 and Ce-144. Many other isotopes run without issue. My code generates particles, but then an exception happens and the code terminates. The visualization window appears for a few seconds, runs some particles, then disappears and comes back and runs more particles. It repeats this cycle about 6 times before it terminates the run. Has anyone experienced problems like this? I'm using version 4.9.3.

Any advice would be greatly appreciated. Thank you, Sarah

int main(int argc,char** argv)
	G4Timer timer;

  // random engine
  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);

  // Construct the default run manager
  G4RunManager* runManager = new G4RunManager;

  // Creation of the analysis manager
  // exrdmAnalysisManager* analysis = exrdmAnalysisManager::getInstance();

  // set mandatory initialization classes

  DetectorConstruction* CSS = new DetectorConstruction;
  exrdmPhysicsList* exrdmPhysicsList1=new exrdmPhysicsList();

  // Initialize G4 kernel
  // do this at run time so the geometry/physics can be changed

  // set mandatory user action class
  runManager->SetUserAction(new exrdmPrimaryGeneratorAction);
  //runManager->SetUserAction(new exrdmRunAction);
  //runManager->SetUserAction(new exrdmEventAction);
  //runManager->SetUserAction(new exrdmSteppingAction);

  G4UIsession* session=0;

  if (argc==1)   // Define UI session for interactive mode.
#ifdef G4UI_USE_XM
      session = new G4UIXm(argc,argv);
#ifdef G4UI_USE_TCSH
      session = new G4UIterminal(new G4UItcsh);      
      session = new G4UIterminal();

#ifdef G4VIS_USE
  // visualization manager
	G4VisManager* visManager = new G4VisExecutive;
	visManager -> Initialize();

  // get the pointer to the User Interface manager 
    G4UImanager* UI = G4UImanager::GetUIpointer();
	UI->ApplyCommand("/vis/open OGLSWin32");
	UI->ApplyCommand("/vis/viewer/set/viewpointThetaPhi 45 0"); //rotate the detector visualization
	// UI->ApplyCommand("/vis/viewer/set/background white");
	// UI->ApplyCommand("/vis/viewer/flush");

	UI->ApplyCommand("/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true");
	UI->ApplyCommand("/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 4");

	G4String command = "/control/execute ";
	G4String fileName = argv[1];
	G4int i;

		InputReader reader;

			Isotope isotope=reader.getIsotope();
			G4double Strength=isotope.getDoubleStrength();

			G4cout<<"running  " << isotope.getName() << " "<<(isotope.getStrength()) <<" "<< isotope.getIsotopeText()<< G4endl;
			G4cout << Strength << G4endl;
			for ( i = 0;  i<Strength;i++){



		G4cout<<"Real time passed: "<< timer.GetUserElapsed() << G4endl;

  // job termination
// #ifdef G4VIS_USE
//  delete visManager;
// #endif
//  delete analysis;
   delete runManager;

  return 0;

 Add Message Add Message
to: "UI Crashing"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]