GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Fairroot » General Discussion » Geometry input in ROOT (TGeo) format
Reading from TGeoManager does not work [message #13597 is a reply to message #13488] Tue, 12 June 2012 18:42 Go to previous messageGo to previous message
Volker Friese is currently offline  Volker Friese
Messages: 365
Registered: April 2004
Location: GSI CBM
first-grade participant
From: *gsi.de
After trying for a while, I concluded that while reading from a TGeoVolume saved in a ROOT file works, reading from a TGeoManager object in the file does not.

There are some straightforward bugs in FairModule::ConstructRootGeometry().

Line 257
n=v1->GetNode(0);

Since v1 is the volume to be copied (the node below the top node), this sets the node n to its first daughter, i.e. the second node level. Consequently, the wrong transformation matrix is applied when adding v1 to the cave.

Line 259
delete NewGeo;

This immediately leads to a segmentation fault, since the newly created volume v1 is deleted when deleting the new TGeoManager (MakeCopyVolume adds it to the volume list of the latter).

However, even after correcting that, I did not manage to read in from TGeoManager in a file. I would be interested if anybody did succeed. I personally dislike the must to define all media in one file (media.geo), which quickly gets unreadable. It seems to me, though, that copying objects (volumes, media, materials etc.) from one TGeoManager to another is not foreseen in the ROOT geometry concept - all copy constructors and assignment operators are protected, and there is a lot of usage of the gGeoManager pointer and automatic registration of objects to it.

So I resolved to writing out a TGeoVolume with the detector geometry in it. This works, but one has to take care:
  • Below the top node (volume), there must be a single volume containing the entire (sub-)detector. This can be a virtual (keep-in) volume or a real one. But only the first daughter of the top volume is considered.
  • If a medium is assigned whose material name does not correspond to a medium in the TGeoManager (i.e., present in media.geo), the method FairModule::AssignMediumAtImport will create a new medium with the same (material) name but empty properties and assign this to the respective volume. This leads (in my case) to a crash in the transport. It is hard to notice that since there is only a FairLogger output on debug level.



 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Questions on HIts in detector and MCPoint
Next Topic: step length for VMC
Goto Forum:
  


Current Time: Thu Apr 18 14:58:28 CEST 2024

Total time taken to generate the page: 0.01073 seconds