Message: Re: Problem in Ion definition Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Problem in Ion definition 

Forum: Particles
Re: Question Problem in Ion definition (Adrien MATTA)
Re: Idea Re: Problem in Ion definition (Vladimir Ivanchenko)
Date: 21 Jan, 2009
From: Adrien MATTA <Adrien MATTA>

Dear Vladimir,

Thank you for your quick answer. Things are going clearer.

At first my guess was that when the GetIon method is called, G4 instantiated a new Ion (if does not exist at this time) that's inherite all process form the GenericIon class and then you can edited freely his decay table. You confirmed that it does not work this way? NB: I was working this way on G4-09-01-patch-03 and it was working, so I would like to know if there is some problem if I go back to this G4 release.

I tried what you suggest:

- the first way work pretty well and I get inspiration from example you mentionned. Unfortunnetly, G4 don't have the channel that interrest me.

- So I tried the second way, and define a new particle, using G4ParticleDefinition method. At this point particle is instantiate without problem. But then, I use G4NuclearDecayChannel method to create a new decay channel, and here I have again the segmentation violation at exactly the same point, because one of the decay product is 8He, and the method called the GetIon method and crash when the BuildDEDXTable method is called.

Note that GetIon method is called successfully in my PrimaryGeneratorAction. So maybe I'm not calling my personnal method at the right time, here it is just after Initialisation in my main programm. I tried to move it but doesn't change anything.

Here my main program if it's help:

int main(int argc,char** argv) {

  //my Verbose output class
  G4VSteppingVerbose::SetInstance(new SteppingVerbose);   

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

  //set mandatory initialization classes
  DetectorConstruction* detector  = new DetectorConstruction();

  PhysicsList* physics   = new PhysicsList();
  PrimaryGeneratorAction* primary = new PrimaryGeneratorAction(detector);

  //Initialize Geant4 kernel
  physics->MyOwnConstruction();//<- in this method is called GetIon.
		G4String reactionfileName = argv[1];
		G4String detectorfileName = argv[2];

		////////////////////// Reading Reaction ///////////////////////

		/////////////////// Reading Configuration /////////////////////
		MUST2Array* myArray = new MUST2Array(detector->GetWorldLogic());
		Target* myTarget    = new Target(detector->GetWorldLogic())    ;
		ReadConfiguration(detectorfileName,myArray,myTarget)           ;

  /////////////////// Starting the Root Output //////////////////
  G4String prefix("Trees/mySimul");
  ROOTOutput* root = new ROOTOutput(prefix,myArray);

  EventAction* event_action = new EventAction();


  //get the pointer to the User Interface manager 
  G4UImanager* UI = G4UImanager::GetUIpointer();  

  if (/*argc!=1*/false) {   	// Batch mode 
    G4String command = "/control/execute ";
    G4String fileName = argv[1];

  else {          	// Define UI terminal for interactive mode

#ifdef G4VIS_USE
    G4VisManager* visManager = new G4VisExecutive;

    G4UIsession* session = 0;
#ifdef G4UI_USE_TCSH
    session = new G4UIterminal(new G4UItcsh);      
    session = new G4UIterminal();
    UI->ApplyCommand( "/control/execute vis.mac");                      
    delete session;

#ifdef G4VIS_USE
    delete visManager;

 //job termination
 delete runManager;
 delete root;
 return 0;


 Add Message Add Message
to: "Re: Problem in Ion definition"

 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 ]