JeffersonLab / remoll

Simulations for the MOLLER Experiment at Jefferson Lab, http://moller.jlab.org
http://jeffersonlab.github.io/remoll/
11 stars 55 forks source link

Unexpected cutoff in ev.beamp with elastic generator #591

Open rahmans1 opened 1 year ago

rahmans1 commented 1 year ago

Issue Unable to reproduce historical ev.beamp pattern.

Environment:
eic-shell 3.0-stable container

gcc-10.2.1 root-6.22.08 geant4-10.7.1

Input Macro

/remoll/setgeofile geometry/mollerMother.gdml
/remoll/physlist/register QGSP_BERT_HP
/remoll/physlist/parallel/enable
/remoll/parallel/setfile geometry/mollerParallel.gdml
/run/numberOfThreads 5
/run/initialize
/remoll/addfield map_directory/subcoil_2_3_3mm_full.txt
/remoll/addfield map_directory/V2U.1a.50cm.parallel.txt
/remoll/field/scale map_directory/subcoil_2_3_3mm_full.txt 1.0
/remoll/field/scale map_directory/V2U.1a.50cm.parallel.txt 1.0
/remoll/target/mother LH2
/remoll/target/volume LH2
/remoll/evgen/set elastic
/remoll/oldras false
/remoll/beam_x0 0.0 mm
/remoll/beamene 11 GeV
/remoll/beamcurr 85 microampere
/remoll/SD/disable_all
/remoll/SD/enable 28
/remoll/SD/detect lowenergyneutral 28
/remoll/SD/detect secondaries 28
/remoll/SD/detect boundaryhits 28
/remoll/filename remollout_oldrasfalse.root
/run/beamOn 2000

Steps to reproduce

git clone https://github.com/JeffersonLab/remoll cd remoll git checkout develop cmake -DCMAKE_BUILD_TYPE=Release -S . -B build cmake --build build -j 8 ./build/remoll macros/test.mac

SameScriptDevelopEvBeamp

git clone https://github.com/JeffersonLab/remoll cd remoll git checkout feature-trigscint cmake -DCMAKE_BUILD_TYPE=Release -S . -B build cmake --build build -j 8 ./build/remoll macros/test.mac

RakithaBranchEvBeamP

rahmans1 commented 1 year ago

Insights:

Compared commit history of elastic generator between develop and feature-trigscint branch

Commit 1476a58 and 79127a9 are not present in feature-trigscint but present in develop.

Checked out head 79127a9 which dates back to October 2021. It still shows cutoff.

RolledBack

Checked out head 0a716d6 (precedes 79127a9) and still see same cutoff.

Head

rahmans1 commented 1 year ago

Tracking develop commit history, we see that the large merge commit which demonstrated continuous energy spectrum was ccda46f. It stops working at next merge commit fe3209d. Both from May 2021.

ccda46f: ccda46f-May2021 ccda46f-rate-May2021

fe3209d: fe3209d-May2021 fe3209d-rate-May2021

There is very little difference in the source code between the two merge commits

diff -r ccda46f/src fe3209d/src:
Only in ccda46f/src: remollGen12CElastic.cc
Only in fe3209d/src: remollGenC12.cc
diff -r ccda46f/src/remollPrimaryGeneratorAction.cc fe3209d/src/remollPrimaryGeneratorAction.cc
30c30
< #include "remollGen12CElastic.hh"
---
> #include "remollGenC12.hh"
60c60,62
<     fEvGenMap["carbon"] = new remollGen12CElastic();
---
>     fEvGenMap["elasticC12"] = new remollGenC12(0);
>     fEvGenMap["quasielasticC12"] = new remollGenC12(1);
>     fEvGenMap["inelasticC12"] = new remollGenC12(2);
diff -r ccda46f/include fe3209d/include
Only in ccda46f/include: remollGen12CElastic.hh
Only in fe3209d/include: remollGenC12.hh

Cannot identify why this would effect the elastic ep generator at all.

rahmans1 commented 1 year ago

Some bizarre behavior. In develop, the proportion of events sampled in the three energy loss regions seem to reflect the right proportions (40%, 20%, 40%) BeamEnergyDifferenceSlug

However, for those events with evidx=2, the eloss sampled always returns ~11 GeV. So, beamE= 11GeV-eloss ~0 and this is roughly what's stored in ev.beamp. The relevant lines of code that does this is line 124-133, line148-152 and line 169-180 in remollGenpElastic.cc. EnergyLossSampled

Interestingly, for commit head ccda46b, we do see a spread in energy loss region 2 (evidx=2): ElossSamplingccda

rakithab commented 1 year ago

@rahmans1 I think we fixed this issue right?

rahmans1 commented 1 year ago

@rahmans1 I think we fixed this issue right?

The intermediate solution was to explicitly set the parameters with messenger commands. So, in that sense, it's solved. But we didn't get to putting in guardrails so that people don't accidentally think built in defaults are set properly.