Message: Re: Change detector setup (refractive index of the grease) between runs. Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Change detector setup (refractive index of the grease) between runs. 

Forum: Event and Track Management
Re: Question Change detector setup (refractive index of the grease) between runs. (Bogdan Sikach)
Re: Idea Re: Change detector setup (refractive index of the grease) between runs. (Michael H. Kelsey)
Re: Feedback Re: Change detector setup (refractive index of the grease) between runs. (Bogdan Sikach)
Date: Mar 27, 07:13
From: Michael H. Kelsey <Michael H. Kelsey>

Bogdan Sikach writes:
> I already succeeded with the approach which resembles your suggestion.
> 
> I added public methods in my `DetectorConstruction` and `RunAction`
> classes.
> 
> But there is a difference between where I call `ReinitializeGeometry`
> funtion. I do it in `main()`:
> 
> <code>
>     //here is main() function
> 
>     ...
> 
>     G4RunManager* runManager = new G4RunManager();
> 
>           DetectorConstruction* detector = new DetectorConstruction();
>           runManager->SetUserInitialization( detector );
> 
>           runManager->SetUserInitialization( new PhysicsList() );
> 
>           runManager->SetUserAction( new PrimaryGeneratorAction() );
> 
>           RunAction* runAction           = new RunAction();
>           runManager->SetUserAction( runAction );
> 
>           EventAction* eventAction = new EventAction();
>           runManager->SetUserAction( eventAction );
> 
>           runManager->Initialize()
> 
>     ...
> 
>           G4String pathToDataDir = "/home/lrdprdx/BINP/g4work/LightCollection/data/reflectivity";
>           for( G4int i = 0; i < 100; i++ )
>           {
>               detector->SetReflectivity( G4double(i) / 100.);
>               runAction->SetFileName( pathToDataDir + "/ref" + std::to_string(i) );
>   //
>               runManager->ReinitializeGeometry();
>               runManager->BeamOn( cs::nEvents );
> 
>           }
> </code>
> 
> I am wondering if it is OK too.

Oh, sure.  It doesn't really matter where the call happens, as long as it's
before the next BeamOn.  My own simulation framework make extensive use of
macro commands, so I tend to put this programmatic stuff close together.
What you've done, with a fully code-driven job, is fine.

      -- Mike

 Add Message Add Message
to: "Re: Change detector setup (refractive index of the grease) between runs."

 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 ]