GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Problem with Root geometrys from CAD
Problem with Root geometrys from CAD [message #10633] Thu, 06 May 2010 11:14 Go to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi all

I was trying to create a geometry for proto60 emc prototype using the CadConverter. The created geometry looks correct but I get some problems in the Geant4 simulation.

To find the source of the problem I reduced the geometry to a single crystal. The shape of the crystal is a Trapezoid (can be described by a TGeoTrap). It has two parallel endfaces and two sides which are orthogonal to the endfaces and each other.

The CadConverter creates these shapes as TGeoArb8.

I modified the code of PndEmc slightly to read the Root file and parse the volume name etc, similar to the code for the forward endcap part.

I tested the geometries by generating photons in front of the crystal with random position in x and y. Also a small angle to the z-axis is generated.

When I run the simulation I observed three problems, affecting primary and secondary particles alike. It is likely that these problems have the same cause.

The first problem I get is that a particle seems to get "stuck" at the surface of a Crystal, the particle is transported into and out of the crystalvolume indefinetly:
*** Particle reached max step number (10000). ***

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 88,   Parent ID = 81
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
10002    -11.6    -22.2      990     0.703        0        0      1.07 CrystalType6a Transportation
10003    -11.6    -22.2      990     0.703        0        0      1.07        cave Transportation
10004    -11.6    -22.2      990     0.703        0        0      1.07 CrystalType6a Transportation
10005    -11.6    -22.2      990     0.703        0        0      1.07        cave Transportation


This can also be seen in the event display: The track of this particle ends at the surface of the crystal.

A second problem can be seen in the eventdisplay, where a particle would clearly enter the volume, but have no reactions inside the volume. This could, for example, lead to a 100 MeV photon crossing 10cm of PWO without any reaction.

Problem three can be seen when one plots the position of EmcPoints for a singe crystal. One would expect to find them all inside the crystalvolume, but I observed quite a lot of points with a position outside of the volume.

I have tried to narrow the problem down. I checked that the center of the volume in the cad file is at the geometrical center of the shape. The dimensions of the created TGeoArb8 are correct. The vertices of the endfaces are specified in the correct clockwise order.

The positioning of the volume makes a difference: If I place the crystal on the z-axis I observe no problems. Only if the crystal is not on that axis (as is the case for the proto60) I get the problems mentioned above.

I tried to create a root geometry by hand to reproduce these errors, but all handmade geometries worked for me. This could be a hint that the problem is connected to the cad converter.

On the other hand the error I get from Geant 4 is the same as the one mentioned by Dmitry in his post ( http://forum.gsi.de/index.php?t=rview&th=2816 ).

I also tried using geant3 and I had no problems there.


I have no ideas what else I could try to solve that problem, so any help would be welcome.
If you want to have a look at some of the files (code, rootfiles, cadfiles ...) just tell me what you need.

Thanks very much

Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10642 is a reply to message #10633] Thu, 06 May 2010 14:43 Go to previous messageGo to next message
Dima Melnychuk is currently offline  Dima Melnychuk
Messages: 213
Registered: April 2004
Location: National Centre for Nucle...
first-grade participant
From: *fuw.edu.pl
Hi Christian,

Could you provide the root file with converted geometry.
I see that in your directory in development branch /pandaroot/development/hammann/ there are some modification in PndEmc.cxx but there is no emc_proto60.root file itself, I suppose that it is converted file.
And in pandaroot/development/hammann/geometry I see the file proto60_new2_type6.dat, what if the difference with the root version?

And could you add the macro to run simulation (I suppose modified version of sim_emc.C)

I think you can add those file somewhere to you development branch as well.

And I think on some stage it does make sense to merge your modifications with the trunc. And it's better to do it sooner than later.

Best regards,
Dima
Re: Problem with Root geometrys from CAD [message #10643 is a reply to message #10642] Thu, 06 May 2010 14:50 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Hi Christian,

can you send in addition the STEP files you have converted?

Cheers,

Tobias
Re: Problem with Root geometrys from CAD [message #10645 is a reply to message #10642] Thu, 06 May 2010 15:21 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi Dima

The root file is also in the svn, it is called single_cad_crystal2_emc_proto60.root.

For comparison there is the file
single_cad_crystal2_no_pos_emc_proto60.root
where the crystal is on the z-axis and it works for me.

I attached the macro I use.

Regards
Christian

P.S.: I wanted to merge the changes as soon it works.


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10646 is a reply to message #10643] Thu, 06 May 2010 15:24 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi Tobias

here are the step files I converted:

single_crystal2_pos.stp not working
single_crystal2_no_pos.stp working.

Regards
Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10653 is a reply to message #10646] Fri, 07 May 2010 09:38 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Dear Christian,

can you send me the materials.dat file as well?

Thanks.

Tobias
Re: Problem with Root geometrys from CAD [message #10654 is a reply to message #10653] Fri, 07 May 2010 10:56 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi Tobias

sure here you go.

Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10656 is a reply to message #10654] Fri, 07 May 2010 12:53 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Dear Christian,

are your modifications of the EMC code already in the SVN? I try to run the macro but the geometry is not loaded correctly.

Cheers,

Tobias
Re: Problem with Root geometrys from CAD [message #10658 is a reply to message #10656] Fri, 07 May 2010 13:10 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi Tobias

The changes are not in the trunk, but only in my development branch at
https://subversion.gsi.de/trac/fairroot/browser/pandaroot/development/ha mmann

It should be enough to get the changes in the emc folder and to the media_pnd.geo file.

Regards
Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10660 is a reply to message #10656] Fri, 07 May 2010 14:35 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi

I probably forgot to mention that I don't use the output of the cadconverter directly, but extract the volume and save that as a new file. Here's the macro I use for that.

Regards
Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10676 is a reply to message #10633] Mon, 17 May 2010 16:39 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi again,

I was wondering if somebody has had an idea concerning my problem, or has at least been able to reproduce it.

I still have no idea what exactly goes wrong here. I don't think I will be able to solve this problem myself, since I don't have a good understanding of the inner workings of the CadConverter or Geant/VMC.

Thanks for the help

Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Re: Problem with Root geometrys from CAD [message #10677 is a reply to message #10676] Mon, 17 May 2010 16:59 Go to previous messageGo to next message
Dima Melnychuk is currently offline  Dima Melnychuk
Messages: 213
Registered: April 2004
Location: National Centre for Nucle...
first-grade participant
From: *fuw.edu.pl
Hi Christian,

I could reproduce your problem, at least huge amount of warnings with

*** Particle reached max step number (10000). ***

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 88,   Parent ID = 81
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
10002    -11.6    -22.2      990     0.703        0        0      1.07 CrystalType6a Transportation
10003    -11.6    -22.2      990     0.703        0        0      1.07        cave Transportation
10004    -11.6    -22.2      990     0.703        0        0      1.07 CrystalType6a Transportation
10005    -11.6    -22.2      990     0.703        0        0      1.07        cave Transportation


And I have a suspicion what could case it but I could not check it so far due to technical difficulties. So I suspect that problem is due to the representation of crystal geometry with TGeoArb8 and I would guess that replacement with TGeoTrap could help. The conversion between two shapes is straightforward (you can find it in PndEmcStructure.cxx), however I understand why the CadConvertor provides TGeoArb8.

I tried to convert the geometry from the root file you provided, but simulation results in error which I do not understand. So in my opinion it would make sense to try to obtain the geometry with TGeoTrap directly from the CadConvertor, but at the moment I have no idea how.

My suspicion is based on the fact that such a warning appears also for the backward endcap geometry where TGeoArb8 are used and not for barrel geometry with TGeoTrap.

That's all I can say at the moment.

Best regards,

Dima
Re: Problem with Root geometrys from CAD [message #10678 is a reply to message #10677] Mon, 17 May 2010 17:25 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Hello,
I remember in the old good times we had some problems with g4 and TGeoArb8, and for this reason I have asked to convert the forward endcap from TGeoArb8 to TGeoTrap... I remember something, but not exactly what was the problem. This has came in a "very" old evo meeting.
Maybe Ola remembers...
Re: Problem with Root geometrys from CAD [message #10681 is a reply to message #10678] Tue, 18 May 2010 09:10 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Dear Christian,

I have tried to run your code from the development branch. Unfortunately it did not run, but at the moment my Linux-PC is out of order and I cannot tell you, what the exact problem was.

If you want to use Trap instead of Arb8 you have to modify CxlInfoPart.cc. There is a method called IsArb8(). Just write a line "return false;" in front of the rest of the code.

After recompiling you have no Arb8 anymore but the crystal should be recognized as a trap.

Hope it works.

Cheers,

Tobias
Re: Problem with Root geometrys from CAD [message #10684 is a reply to message #10681] Tue, 18 May 2010 11:27 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Dear Tobias,

I just tried to use the CadConverter to create TGeoTraps, by disabling the TGeoArb8 like you discribed. Unfortunately it did not work, the TGeoTrap is not correct. For expample the length of the crystal is only 10 cm instead of 20 cm.

Cheers
Christian
Re: Problem with Root geometrys from CAD [message #10685 is a reply to message #10684] Tue, 18 May 2010 11:31 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Hi Christian,

is only the length wrong or are other parameters not correct, too?

If only the length is wrong I would suggest to use the geometry you have created and test if the Trap has the same problem like the Arb8. If not I can try to fix the length problem

Cheers,

Tobias
Re: Problem with Root geometrys from CAD [message #10691 is a reply to message #10685] Tue, 18 May 2010 16:47 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi Tobias

For the TGeoTrap the shape of the endfaces is correct. The relative position of the endfaces is not, but this positioning depends on the length of the crystal, so it could still be only the length.

I checked for the errors for the TGeoTrap-Geometry and unfortunately I get also errors for this shape. There is probably a small difference:
For the TGeoArb8 the errors occurred mostly on the side faces of the crystal, for the TGeoTrap it is mostly on the endfaces.
(I have not seen any error on the sideface of the crystal, but I haven't looked at that many events to exclude that.)

Regards
Christian
Re: Problem with Root geometrys from CAD [message #10702 is a reply to message #10633] Wed, 19 May 2010 15:28 Go to previous messageGo to next message
Dima Melnychuk is currently offline  Dima Melnychuk
Messages: 213
Registered: April 2004
Location: National Centre for Nucle...
first-grade participant
From: *fuw.edu.pl
Hi Christian,

I have just observed that with changing geometry navigation in /gconfig/g4Config.C from "geomRoot" to "geomRootToGeant4", i.e. from ROOT navigation to native Geant4 navigation the warning

*** Particle reached max step number (10000). ***

disappeared with simulation with single_cad_crystal2_emc_proto60.root geometry.

I do not know it it is a solution and how it affects the other two problems you reported, but at least it's some progress.

Best regards,

Dima
Re: Problem with Root geometrys from CAD [message #10703 is a reply to message #10702] Wed, 19 May 2010 16:39 Go to previous messageGo to next message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi Dima

I also get no errors for the RootToGeant4 navigation.
Unfortunately I then have a problem getting the detectorid.
The RootToGeant4 navigation changes the volume name slightly and also does not preserve the copy number of the volume.
I use the copy number to determine the detectorid because the name of the volume is, in my case, not unique.

I could maybe solve these problems, but I would prefer to stick with the standard Root navigation.

Regards
Christian
Re: Problem with Root geometrys from CAD [message #10908 is a reply to message #10633] Fri, 06 August 2010 13:45 Go to previous message
Christian Hammann is currently offline  Christian Hammann
Messages: 24
Registered: July 2009
Location: Bonn
continuous participant

From: *cb.uni-bonn.de
Hi all

I have still have not been able to find a solution for this problem. However as it seems to be working with geant3 I have commited the code for the proto60 to svn, rev. 9625, along with a geometry for the proto60. At the moment only the crystals are included, no alveoles etc.

The geometry uses geometry version 18, mapperversion 10, module 7.

Regards

Christian


Christian Hammann
Universität Bonn
Helmholz-Institut für Strahlen und Kernphysik
Nußallee 14-16
53115 Bonn
Tel: +49 228 733895
Fax: +49 228 732505
Previous Topic: Problem installing External package
Next Topic: daily doxygen - genfit missing
Goto Forum:
  


Current Time: Sun Nov 10 17:00:05 CET 2024

Total time taken to generate the page: 0.00817 seconds