Message: Re: repeating substructures, split DetectorConstruction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: repeating substructures, split DetectorConstruction 

Forum: Geometry
Re: Question repeating substructures, split DetectorConstruction (Yen-Yung Chang)
Re: None Re: repeating substructures, split DetectorConstruction (michel maire)
Re: Angry Re: repeating substructures, split DetectorConstruction (Yen-Yung Chang)
Date: 04 Feb, 2017
From: Michael H. Kelsey <Michael H. Kelsey>

On Sat, 04 Feb 2017 08:11:02 GMT, Yen-Yung Chang wrote:
> Hi,
> 
> Thanks for the reply :) I am aware of the replica trick. What I'm asking is more like 
> 
> MyDetectorConstruction::Construct(){
> 
> ConstructOuterVeto();
> ConstructInnerVeto();
> ConstructCryostat();
> ConstructDetectorHousing();
> ConstructDetector(G4ThreeVector(0,0,0));
> ConstructDetector(G4ThreeVector(1,0,0));
> ConstructDetector(G4ThreeVector(0,1,0));
> ConstructDetector(G4ThreeVector(1,1,0));
> 
> }
> 
> Now in my code all the outer veto, inner veto, cryostat, detector housing, and
> the detectors (I made up all these items for illustration) are  all written in
> the Construct() function. Each of them has ~1000 lines invoking complex
> geometries and materials. I would like to separate them into different files.
> And ideally I would also like to do the replica trick, e.g. the
> ConstructDetector() here, but with a much more complex construction as one
> unit.I have looked into the hadrontherepy example for the usage of parallel
> world but couldn't make any useful progress. Thank!

Put each one in a separate class. Instantiate those classes in your main Construct() function. For the "ConstructDetector()" which takes placement arguments, have the class provide a "Build()" function which takes that argument.

  -- Mike Kelsey

 Add Message Add Message
to: "Re: repeating substructures, split DetectorConstruction"

 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 ]