Message: Re: GDML pointer stripping does not seem to work Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: GDML pointer stripping does not seem to work 

Forum: Persistency
Re: None GDML pointer stripping does not seem to work (Jeremy McCormick)
Re: More Re: GDML pointer stripping does not seem to work (Michael H. Kelsey)
Date: 21 Sep, 2016
From: Gabriele Cosmo <Gabriele Cosmo>

The -default- for the writer is to append pointers to the name of volumes/solids/materials for obvious
reasons of guaranteeing unique entity IDs required by the GDML  parser. Pointers get stripped when
reading if the strip Boolean flag is turned on when reading.
To turn off default extension of names in writing, you should either call:
before writing, or set the flag to false in the call to Write, e.g.:
  parser.Write(WriteFile, WorldPhysVol, false);
in that case, you must be sure your generated entities have unique names!

Cheers, Gabriele

On Tue, 13 Sep 2016 14:19:11 GMT, Michael H. Kelsey wrote:
> On Mon, 12 Sep 2016 23:04:20 GMT, Jeremy McCormick wrote:
> > I want to write a GDML file from the Geant4 runtime without the pointers added to the names, but it does not seem to work.
> > 
> > G4VPhysicalVolume* world = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
> > 
> > G4GDMLParser* parser = new G4GDMLParser();
> > parser->SetAddPointerToName(false);
> > parser->StripNamePointers();
> > parser->Write(fileName, world);
> > 
> > But the names still end up with the pointers in them e.g. ...
> > 
> > <isotope N="180" Z="74" name="W1800x2257000">
> >     <atom unit="g/mole" value="179.947"/>
> > </isotope>
> I have the same problem writing out GDML. I ended up writing a SED
> script to strip all the strings /0x[0-9A-F][0-9A-F]*/.
> StripNamePointers() is supposed to work on _input_, so that your
> geometry inside your G4 app ends up with sensible names.
> I fully agree that this ought to be the default.
>   -- Michael Kelsey

 Add Message Add Message
to: "Re: GDML pointer stripping does not seem to work"

 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 ]