-
Notifications
You must be signed in to change notification settings - Fork 483
Fix: apply global density scaling factor in MaterialManager::getDensity #14546
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
Conversation
|
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
|
Hi @alcaliva, Actually local density factors are more appropriate since it avoid scaling densities outside the ITS. Of course, this still does not explain why it seems not to work. |
Hi Andreas, |
|
Hi Alberto, |
Hi Andreas, with the current implementation, the variable "auto densityFactor = getDensity(modname)" contains the (unscaled) density of a given module. I see that this gets scaled by the variable "Float_t dens". Where is this latter variable set to the globalDensityFactor? I do not see it. |
|
Hi Alberto, which contains comma separated pairs of modules and density factors The way I understand it, mDensityMap contains actually scaling factors. If this was not the case one would multiply densities with densities. ->Where is this latter variable set to the globalDensityFactor? I do not see it. The global density factor is the default of the getDensity function, in case the module is not in th mDensityMap list. |
|
I've added a print statement in Material I get: |
|
Error while checking build/O2/fullCI_slc9 for 4c00039 at 2025-07-29 07:46: Full log here. |
Hi Andreas, ok, mDensityMap contains scaling factors and not densities. The actual density is contained in the variable "Float_t dens". If I want to increase the material density by a factor of 2, I would set globalDensityFactor=2.0. -> The global density factor is the default of the getDensity function, in case the module is not in th mDensityMap list what if the module is instead found inside the list (like the ITS), where is it's density scaled by globalDensityFactor? |
|
In this case the module is found, i.e. and getDensity gives back o2-sim-serial -n 100 -g pythia8pp --configKeyValues "SimMaterialParams.localDensityFactor=ITS:2.,TPC:3." -m ITS TPC In Material(...), density factor for TPC is 3.000 for density 2.700 In Material(...), density factor for ITS is 2.000 for density 2.330 |
|
I think you should replace i.e. remove the "f" o2-sim-serial -n 100 -g pythia8pp --configKeyValues "SimMaterialParams.globalDensityFactor=2.f" -m ITS |
|
I've run a simulation where I changed the material by a large factor and still no change is seen in the efficiency. The script is here |
|
I don't know how the JDL is interpreted, however, locally I have to use to make this work. |
|
Thanks! I will try that too and let you know |
|
I'm not sure it will work. All jobs execute the following for simulation: The config option related to the scaling is not contained. It seems that the setting of the SIM_OPTIONS variable in the JDL is ignored. This is also the reason that it does not crash with the wrong syntax. |
|
... but the aliprod jobs use yet another syntax: |
|
I'm trying with export ALIEN_JDL_O2SIM_OPTIONS="--configKeyValues SimCutParams.globalDensityFactor=2.0" and export ALIEN_JDL_O2SIM_OPTIONS="--configKeyValues SimCutParams.globalDensityFactor=0.2" |
|
as I wrote before, locally I use I just wanted to point out that in the production job JDLs I found 2 variations of this setting, and I believe that they are not correct. |
|
ok, I submitted another couple of jobs with SimMaterialParams.globalDensityFactor |
|
I think the arguments passed to o2dpg_sim_workflow.py are in ANCHOR_SIM_OPTIONS |
|
Hi, As far as I can see, the only option to use from the JDL is I.e. the format to you in the JDL is e.g. |
|
I think the explanation for the problem is the following.Before March '25 globalDensityFactor existed in SimCutParams and SimMaterialParamsHowever, MaterialManager only uses the one from SimMaterialParams.Hence, it was possible to use SimCutParams.globalDensityFactor without having o2-sim crashing, but it had no effect. This setting was used in aliprod. Now globalDensityFactor has been removed from SimCutParams. Note: the correct parameter is in any case SimMaterialParams.localDensityFactor=ITS:1.05and this existed always only in SimMaterialParams |
|
Hi. Back from vacation. Let me try to make a point on the situation from my point of view. I suspect that the current problem might be a combination of multiple things (use of deprecated keys, parse errors of float literals such as 2.f in strings, and wrong configuration of DPL MC jobs). I remember that we discussed the material budget in older productions before, for instance here: https://its.cern.ch/jira/browse/O2-5700. The suggestion then was already to use key In order to set this parameter in an O2DPG anchored MC job, one should say This is the only environment variable available. Please note that this env variable configures O2DPG MC ... and not directly Using the deprecated key @alcaliva : Could you let me know if this is already good enough or if your PR is still needed? I will try to improve the situation with the float literals. For now, please don't append |
Hi @sawenzel, I opened this PR to start the discussion. Apparently the current implementation of the function is correct and I was wrong. Maybe, as suggested by @amorsch, we could rename some variables to avoid confusion, but this PR can actually be closed. |
Pull request was closed
|
Closing this PR |
Hi,
I believe that the existing function is not scaling the material density by the global factor.
I also added a warning and changed the return value if the density map is not found.
@amorsch