Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The GEOM_SCALE identifier in TRestEveEventViewer.h causes wrong scale in visualization #380

Open
girardcarillo opened this issue Feb 17, 2023 · 4 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@girardcarillo
Copy link

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 d2fdc6e (0.1 to 1) and 9f89066 (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 c4db169

@lobis lobis self-assigned this Feb 17, 2023
@lobis lobis added the invalid This doesn't seem right label Feb 17, 2023
@jgalan
Copy link
Member

jgalan commented Feb 21, 2023

I found the following root-forum post that could throw some light

https://root-forum.cern.ch/t/tgeomanager-units/44869/3

@jgalan
Copy link
Member

jgalan commented Feb 21, 2023

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);

@jgalan
Copy link
Member

jgalan commented Feb 21, 2023

@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
Copy link
Member

lobis commented Feb 21, 2023

@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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants