Message: Re: How to import GDML file to Geant4? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How to import GDML file to Geant4? 

Forum: Geometry
Re: Question How to import GDML file to Geant4? (Kyuwon Jung)
Date: Oct 12, 01:59
From: John Apostolakis <John Apostolakis>

Hi Kyuwon,

I think that I can help.

The missing method is one that we introduced with 10.0 for Multi-threading. It is needed to initialise key objects (Sensitive Detectors and Field Manager(s), which must be created for each thread.

I suggest that you reorganise your code and move to the method ConstructionSDandField() all your code that creates sensitive detectors and the code which initialises the propagation in field - i.e. that instantiates your field class (if any) and creates a Chord Finder, and registers it with the field manager.

We have created several examples of a ConstructionSDandField method in the Geant4 examples - B2a shows how to use it for a uniform field with the ‘global field’ messenger and B5 shows how to create one with a field class.   If you have a different type of field then there is further information how to configure it in the Application Guide.  If you are stuck, please write again.

Best regards,
John
===================================================
John Apostolakis,  EP Department, CERN
SFT (SoFTware for Experiments) Group
Office: Building 32/ room R-003 (ground floor),  Mail: J27210
Email:  john.apostolakis@cern.ch<mailto:john.apostolakis@cern.ch>       Office Tel:  +41-22-767-7239
------------------------------------------------------------------------------------------

On 12 Oct 2018, at 07:48, Kyuwon Jung <jungkw92@naver.com<mailto:jungkw92@naver.com>> wrote:


*** Discussion title: Geometry

Dear, All experts.

I am trying to import GDML file to Geant4, so I wrote down the coding
like,

#include "DetectorConstruction.hh"

#include "G4Tubs.hh"
#include "G4Box.hh"
#include "G4VSolid.hh"

#include "G4LogicalVolume.hh"
#include "G4NistManager.hh"

#include "G4PVPlacement.hh"
#include "G4PvReplica.hh"

#include "G4VisAttributes.hh"

#include "SensitiveDetector.hh"
#include "G4SDManager.hh"

#include "G4GDMLParser.hh"

DetectorConstruction::DetectorConstruction() :
   G4VUserDetectorConstruction() {
}

DetectorConstruction::~DetectorConstruction() {
}

G4VPhysicalVolume* DetectorConstruction::Construct() {
  G4GDMLParser parser;
  parser.Read( "Test_Model_Geant4.gdml" );

  return parser.GetworldVolume();
}

Then ran make command, the error message

"undefined reference to 'DetectorConstruction::ConstructionSDandField()'
collect2: error: ld returned 1 exit status" popped up.

I have no idea which point is wrong, and how I should modify the coding.

Please, help and teach me,

Kyuwon Jung.

-------------------------------------------------------------
Visit this GEANT4 at hypernews.slac.stanford.edu<http://hypernews.slac.stanford.edu> message (to reply or unsubscribe) at:
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1598.html


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

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Ok: Re: How to import GDML file to Geant4?   (Kyuwon Jung - Oct 14, 22:21) new
 Add Message Add Message
to: "Re: How to import GDML file to Geant4?"

 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 ]