Potential issue in GATERootToCastor

Hello everyone,

I played around with castor’s utility for conversion of ROOT data from GATE and noticed that the conversion fails, if you only have one crystal layer and do not explicitly attach the crystals to layer0 in GATE.

This can be validated by performing the “benchPET” from the official GATE repository (https://github.com/OpenGATE/Gate/blob/develop/benchmarks/benchPET)

By default, two layers are attached (see camera.mac):

/gate/systems/cylindricalPET/layer0/attach LSO

/gate/systems/cylindricalPET/layer1/attach BGO

Commenting out both lines from above results in layer IDs equal to “-1” (default value?).

This may be the case if you do not explicitly state that you have only one layer.

A simple workaround for “castor-GATERootToCastor” could be testing the values for meaningful ranges, e.g. values layerID>= 0, or even simpler just checking that the castorID1 and castorID2 are < nCrystalsTot and otherwise at least trigger a warning.



Hello Moritz,

Thank you for the feedback and suggestion and sorry for the delayed answer. There is a patch on the way so we will fix this soon.