Message: Re: problem while SetUserInitialazaion Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: problem while SetUserInitialazaion 

Forum: Run Management
Re: None problem while SetUserInitialazaion (varun bahal)
Re: None Re: problem while SetUserInitialazaion (Tevfik Kaplanoglu)
Re: Note Re: problem while SetUserInitialazaion (varun bahal)
Date: 29 Aug, 2016
From: Tevfik Kaplanoglu <Tevfik Kaplanoglu>

Dear Varun,

In your code you this line :
_
__ SetUserAction( new actioninitialization);_

is a wrong code. because, in actioninitilization, you initialize actions
like runaction, step, track, etc. actions.

The code below will help you as an example action ini. the runaction and
primarygenerator actions are user classes.

//// The header file ://
//
//#ifndef ActionInitialization_h//
//#define ActionInitialization_h 1//
//
//#include "G4VUserActionInitialization.hh"//
//
//class ActionInitialization : public G4VUserActionInitialization//
//{//
//    public://
//        ActionInitialization();//
//        virtual ~ActionInitialization();//
//
//        virtual void Build() const;//
//        virtual void BuildForMaster() const;//
//
//    private://
//
//
//};//
//
//#endif/

 //// The source file ://
//
//#include "ActionInitialization.hh"//
//#include "PrimaryGeneratorAction.hh"//
//#include "RunAction.hh"//
//
//
//ActionInitialization::ActionInitialization()//
// : G4VUserActionInitialization()//
//{}//
//
//
//ActionInitialization::~ActionInitialization()//
//{}//
//
//void ActionInitialization::BuildForMaster() const//
//{//
//
//    RunAction* runAction//
//            = new RunAction();//
//    SetUserAction(runAction);//
//
//
//  }//
//
//void ActionInitialization::Build() const//
//{//
//
//    // Generator//
//    PrimaryGeneratorAction* generatorAction//
//            = new PrimaryGeneratorAction();//
//    SetUserAction(generatorAction);//
//
//}/


Also, do not forget calling action inis from main code.


/    // User action initialization//
//    ActionInitialization* Actions = new ActionInitialization();//
//    runManager->SetUserInitialization(Actions);//
/

Tevfik.


On 29-08-2016 05:26, varun bahal wrote:
> *** Discussion title: Run Management
>
> Hi Tevfik,
>
> Thanks for the reply.
>
> I have spend quite a good amount of time understanding basic examples.
>
> In my view, compiler not understanding the G4 libraries might not be the
> right reason. I have used three user intitialization classes in the main
> program. i do no get error for other two ( detectorconstruction and
> physicslist) classes.
>
> I have already used source command to set root and geant data variables.
>
> I this application i have tried to use exampleB1 as a reference.
>
> Can you suggest something more specific ?
>
> Thanks Varun
>
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/runmanage/413/1/1.html 
>
>



 [ MIME part of type text/html without a name stripped ]

 Add Message Add Message
to: "Re: problem while SetUserInitialazaion"

 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 ]