The GEOM_SCALE identifier in TRestEveEventViewer.h causes wrong scale in visualization
Hi everyone,
I'm raising this issue because I recently had some problem with the EVE event viewer. This issue is related with this thread.
In short: there is a scaling factor, GEOM_SCALE defined here source/framework/core/inc/TRestEveEventViewer.h, which is set to 0.1.
It scales the visualization of your geometry. One of the consequences is that the primary event coordinates appear to be "closer" to the geometry detector than it actually is. So for example, if you simulated some cosmic and then visualize with EVE, they will artificially appear as generated in the middle of your detector. Of course this is just about the visualization and does not affect the simulation process.
Some people already had this problem in the past, as here. This scaling factor had already been modified in commits d2fdc6e5 (0.1 to 1) and 9f890664 (back to 1).
For the moment I manually modified theTRestEveEventViewer.h file to set GEOM_SCALE to 1 in my install. But this will probably mess with something else..
Should this parameter be modified? Following @lobis and @jgalan, this should be linked to Root versions and gdml files.
Root version: 6.26/10 Rest version: v2.3.15 commit c4db1698
I found the following root-forum post that could throw some light
https://root-forum.cern.ch/t/tgeomanager-units/44869/3
And also the following
https://root-forum.cern.ch/t/unit-inconsistency-with-tgeomanager-and-gdml-tgeo-geometries/44519/4
Perhaps the default units on one ROOT system installation and other systems are different and that's why @lobis gets different behaviour?
Perhaps adding the following lines before importing the GDML could solve the problem.
TGeoManager::LockDefaultUnits(kFALSE);
TGeoManager::SetDefaultUnits(TGeoManager::EDefaultUnits::kRootUnits);
@lobis it could also happen that the file was written back with an old ROOT version, the translation will be then already truncated inside TGeoManager, and even if it is open with a recent ROOT version, the problem will be already there.
Just make sure you generate a fresh file. I believe the right value is GEOM_SCALE=1. Thus in a new PR we could just remove GEOM_SCALE completely. We could add a CMake flag that requires a minimum ROOT version 6.26
@lobis it could also happen that the file was written back with an old ROOT version, the translation will be then already truncated inside
TGeoManager, and even if it is open with a recent ROOT version, the problem will be already there.Just make sure you generate a fresh file. I believe the right value is
GEOM_SCALE=1. Thus in a new PR we could just removeGEOM_SCALEcompletely. We could add a CMake flag that requires a minimum ROOT version 6.26
I tried in my fresh installation with a just-generated simulation file and the visualization works ok with the scale set to 0.1 (as described in https://rest-forum.unizar.es/t/the-primary-origin-of-the-generated-particles-are-not-located-at-the-expected-position/571/13)