A problem : Different Castor (castorGATERootToCastor) results with same GATE geometry architectures

Dear Castor users,
I am a beginner using GATE and Castor. Recently I found an interesting situation when i used castor-GATERootToCastor to reconstruct the GATE results, it seemed that Castor unitID probably did not match to every GATE geometry definition. (More detail in attachment PDF file)
In GATE simulation there are many ways to establish geometry architecture. i could start planting the rsector at any axis , and after repeating units, and rotating the angle to define the first rsector location. But i received the different results from two GATE seemed same geometry simulation when i used converted inputfile from castor-GATERootToCastor. I checked and found that the detector unitID are different in GATE geometry, so castor-GATERootToCastor should not directly use the ID form GATE, or it is better to verify these ID were quite correctly good in castor -GATERootToCastor.
I wrote two GATE mac files in attachments with different start-rsector planting, if you are interested in the comparison of GATE results , you can check and do some simulation.(PS: before runnig the mac files , please reset GATEMeterials.db path in your PC).

regards,

leision_Y.mac (8.06 KB)

leision_X.mac (8.06 KB)

CheckCastor_GATEGeometry.pdf (590 KB)

Dear Xiaozhuang,

Thank you very much for exposing this issue and for your detailed file. The differences in reconstructions originated from an incorrect line in the conversion code, leading to an erroneous reading of the number of crystals when the first rsector is located on the Y-axis, and from the different possible ordering IDs in GATE, as you mentioned. I attached to this mail an update of the code with a fix which should solve this issue. Please tell me if you encounter any other troubles.

Kind regards,

Thibaut

castor_v2.0.2.zip (3.68 MB)