e4nu / e4nuanalysiscode

Placeholder for all e4nu analyses
1 stars 2 forks source link

Radiative corrections #127

Closed jtenavidal closed 3 months ago

jtenavidal commented 9 months ago

New plan. Develop framework which deals with :

  1. External radiation
  2. Internal radiation (vertex+vaccumm+brs effects) Outside event generator.

It would be good for it to be a separate package which can be included in the e4nu code implementation easily. This allows future users to run this code as well

jtenavidal commented 9 months ago

First goal: replicate QEL implementation

jtenavidal commented 9 months ago

For pion production: interference between pion photon and electron photon might not be negligible. Box effects. Get delta T magnitude from code. Run radiative corrections code

jtenavidal commented 9 months ago

Also need to quatify number of emited photons close to electron beam from data.

jtenavidal commented 9 months ago

Create app that loops over events, adds weight and modifies outgoing electron energy (and adds photon)

Also run GENIE SAMPLE with radiated flux

jtenavidal commented 9 months ago

The new app is available. Testing:

Compare event record before and after - Stored correctly Compare with Adi's implementation Recreate H plot at 4.32 GeV (and build instructions for it)

jtenavidal commented 8 months ago

How to test with Adi's implementation:

Install it in gvpvm's Tweak code to print out the following

jtenavidal commented 8 months ago

An example of command I am using:

gevgen -p 11 -n 4 -e 4.32 -t 1000010010 -r 1110000100100 --seed 1210931039 --cross-sections /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/Splines/GEM21_11a_00_000/GEM21_11a_00_000_eFreeNucleon_Q2min_08_total_xsec.xml --event-generator-list EM --tune GEM21_11a_00_000 -o e_on_1000010010_4320MeV_0.ghep.root

The setup script I use is in /genie/app/users/jtenavid/Software/genie-v3/setup_GENIE.sh To build the exact version of GENIE I am using, you can do source /genie/app/users/jtenavid/Software/genie-v3/setup_GENIE.sh https://github.com/adishka/Generator.git adi_radcorr /genie/app/users/jtenavid/Software/genie-v3/GeneratorRad/confdir

This should build the same version of GENIE I am using, with the correct configuration directory You will see that MECGenerator.xml has a bug which you have to fix to be able to run events

jtenavidal commented 8 months ago

Fixed implementation. Now available in https://github.com/e4nu/Generator-Rad, jtv_radcorr

Example: gevgen -p 11 -n 40 -e 4.32 -t 1000010010 -r 1110000100100 --seed 1210931039 --cross-sections /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/Splines/G18_10a_00_000/G18_10a_00_000_eNuclei_Q2min_002_total_xsec.xml --event-generator-list EMQEradcorr --tune G18_10a_00_000 -o e_on_1000010010_4320MeV_0.ghep.root

jtenavidal commented 8 months ago

File without rad weights but using Q2 min 0.02. Using radiated flux /genie/app/users/jtenavid/Software/genie-v3/GeneratorRad/e_on_1000010010_4320MeV_NoRadWeigh_FluxRad.ghep.root

jtenavidal commented 8 months ago

Testing "simple" weight calculator. With my code (G18_10a, def Q2min, Decayed Flux)

image

With Adi's calculation

image
jtenavidal commented 7 months ago

Files

jtenavidal commented 7 months ago

Run GENIE + Radiative Adis approach:

python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/G18_10a/AdiRad/ --total-xsec /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/Splines/G18_10a_00_000/G18_10a_00_000_eFreeNucleon_Q2min_08_total_xsec.xml --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-GENIE-config --probe-list 11 --vN-gen-list none --vA-gen-list none --e-ntotevents 10000000 --starting-point 4 --no-ghep-output --gst-output --tune G18_10a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 4GB --subjob-memory 4GB --mainjob-memory 10GB --mainjob-disk 10GB --ebeam-energy 4.325 --git-location https://github.com/e4nu/Generator-Rad --git-branch jtv_radcorr --event-generator-list EMQEradcorr

jtenavidal commented 7 months ago

Run with Radiated Flux

python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/G18_10a/RadCorrFlux/ --total-xsec /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/Splines/G18_10a_00_000/G18_10a_00_000_eFreeNucleon_Q2min_08_total_xsec.xml --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-GENIE-config --probe-list 11 --vN-gen-list none --vA-gen-list none --e-ntotevents 10000000 --starting-point 4 --no-ghep-output --gst-output --tune G18_10a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 4GB --subjob-memory 4GB --mainjob-memory 10GB --mainjob-disk 10GB --git-location https://github.com/e4nu/Generator_Q08.git --event-generator-list EMQE --flux /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/G18_10a/RadCorrFlux/radflux_H_4325MeV.root,hradflux --e-minenergy-fluxrange 3.45 --e-maxenergy-fluxrange 4.325

jtenavidal commented 7 months ago
image

SIMC Way - Adis code

jtenavidal commented 7 months ago

Run with Mono Flux: python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/G18_10a/MonoFlux/ --total-xsec /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/Splines/G18_10a_00_000/G18_10a_00_000_eFreeNucleon_Q2min_08_total_xsec.xml --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-GENIE-config --probe-list 11 --vN-gen-list none --vA-gen-list none --e-ntotevents 10000000 --starting-point 4 --no-ghep-output --gst-output --tune G18_10a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 4GB --subjob-memory 4GB --mainjob-memory 10GB --mainjob-disk 10GB --ebeam-energy 4.325 --git-location https://github.com/e4nu/Generator_Q08.git --event-generator-list EMQE

jtenavidal commented 7 months ago

Run radiative corrections on GENIE FILE:

./process_radweights --input-gst-file /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/G18_10a/MonoFlux/master-routine_validation_01-eScattering/e_on_1000010010_4325MeV_0.sh --output-gst-file e_on_1000010010_4325MeV_H_G18_10a_radiated.gst.root --true-EBeam 4.325 --nevents 1000 --target 1000010010 --rad-model simc

SIMC:

image

SIMPLE:

image
jtenavidal commented 7 months ago

Running test with id: 75617196.0@jobsub02.fnal.gov

jtenavidal commented 7 months ago

To do: Calculate missing E and momenta from gst files

jtenavidal commented 7 months ago

Simple fixed now. Store and print out difference

Why do I get El so different??

ANSWER: It was a flux issue. Need very thin binning

jtenavidal commented 7 months ago

GEM_21a cannot run. After changing some cases, I still get the error

1705077769 FATAL KineLimits : [s] <Jacobian (332)> : *** Can not compute Jacobian for transforming: <{Q2}|E> --> <QELEvGen>
terminate called after throwing an instance of 'genie::exceptions::InteractionException'
  what():  Can not compute Jacobian for transforming: <{Q2}|E> --> <QELEvGen>

Spline issue?

jtenavidal commented 7 months ago

For presentation:

jtenavidal commented 7 months ago
image

When removing weights and rad cuts it reproduces the results. Acceptance issue?

jtenavidal commented 7 months ago

Most events removed due to :

    if ( fabs(delta_e) > DeltaP_CV) { continue; }
    if ( fabs(delta_p) > DeltaP_CV) { continue; }

Leave 138 events

jtenavidal commented 7 months ago
    if ( fabs(YPTarE) > YPTarAcceptance ) { continue; }
    if ( fabs(YPTarP) > YPTarAcceptance ) { continue; }

While the rest is commented:

counter = 9600000

countQEL 20254 countRES 0 countDIS 0

image
jtenavidal commented 7 months ago

When adding YPTar Acc and e and p acceptance:

counter = 9600000

countQEL 696 countRES 0 countDIS 0
image
jtenavidal commented 7 months ago

Only YPTar Acc and electron acceptance:


counter = 9600000

countQEL 5134 countRES 0 countDIS 0
image
jtenavidal commented 7 months ago

counter = 9600000

countQEL 825 countRES 0 countDIS 0

with proton acceptance

image
jtenavidal commented 7 months ago

Are we flipping theta on the acceptance?

jtenavidal commented 7 months ago

Implement code in my analysis

jtenavidal commented 7 months ago

Implementation seems to have some issue. Due to kElectronMap thing

Aborting!

Error in Efid parameter file! Received parameter type -315694640, which is not found. Aborting!

Error in Efid parameter file! Received parameter type -315694640, which is not found. Aborting!

jtenavidal commented 7 months ago

Error due to fiducial

Set correct fiducial to point to

//printf("Reading fiducial cut parameters for 4.4GeV/2250A ...\n");                                                                                           
sprintf(Filename,"%s/FCP_4GeV.par", ParLocation);
fiducial_par = fopen(Filename,"r");
jtenavidal commented 7 months ago

Running Radiative with Electrons and GEM21

python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/RadCorrValidation --total-xsec /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/2024Splines/GEM21_11a_Dipole_Q2_08_eFreeNucleon.xml --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-config-files/e4nu-GENIE-config --probe-list 11 --e-ntotevents 10000000 --flux /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/radflux_H_4325MeV_simple.root,hradflux --e-minenergy-fluxrange 3.4 --e-maxenergy-fluxrange 4.35 --starting-point 4 --no-ghep-output --gst-output --tune GEM21_11a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 3GB --subjob-memory 3GB --mainjob-memory 10GB --mainjob-disk 10GB --git-location https://github.com/e4nu/Generator_Rad_Q2_08.git --submit-jobs --event-generator-list EMQE

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Use job id 7645195.0@jobsub04.fnal.gov to retrieve output =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

jtenavidal commented 7 months ago

Running mono flux with GEM21

python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/RadValidationMono --total-xsec /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/2024Splines/GEM21_11a_Dipole_Q2_08_eFreeNucleon.xml --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-config-files/e4nu-GENIE-config --probe-list 11 --vN-gen-list none --vA-gen-list none --e-ntotevents 10000000 --starting-point 4 --no-ghep-output --gst-output --tune GEM21_11a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 4GB --subjob-memory 4GB --mainjob-memory 10GB --mainjob-disk 10GB --ebeam-energy 4.325 --git-location https://github.com/e4nu/Generator_Q08.git --event-generator-list EMQE

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Use job id 75983260.0@jobsub02.fnal.gov to retrieve output =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

jtenavidal commented 7 months ago

Rerun with Adi's implementation

mkdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/RadCorrAdi ; python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/RadCorrAdi --total-xsec /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/2024Splines/G18_10a_Dipole_master_eFreeNucleon.xml --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-config-files/e4nu-GENIE-config --probe-list 11 --vN-gen-list none --vA-gen-list none --e-ntotevents 10000000 --starting-point 4 --no-ghep-output --gst-output --tune G18_10a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 4GB --subjob-memory 4GB --mainjob-memory 10GB --mainjob-disk 10GB --ebeam-energy 4.325 --git-location https://github.com/e4nu/Generator-Rad --git-branch jtv_radcorr_simple --event-generator-list EMQEradcorr --store-comitinfo --submit-jobs

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Use job id 75983300.0@jobsub02.fnal.gov to retrieve output =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

jtenavidal commented 6 months ago

Rad flux in Use job id 7827947.0@jobsub04.fnal.gov to retrieve output =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

jtenavidal commented 6 months ago
image
jtenavidal commented 6 months ago

We only need to account for phi and (1-hard) We already deal with electron radiation correctly so no need to reweigh it back?

jtenavidal commented 6 months ago

Simple correction running ehre: Use job id 7828732.0@jobsub04.fnal.gov to retrieve output

jtenavidal commented 6 months ago

RUN SAMPLE WITHOUT Q2 cut!!

Seems off now

jtenavidal commented 6 months ago

empty ? /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/2024Generation/GEM21_11c_Dipole_LFG_Q1_01_1GeV_eCarbon.gst.root

jtenavidal commented 6 months ago

Run sample with G18_10a and Radiative correction for all! processes

jtenavidal commented 6 months ago

To run the scripts: ./e4nuanalysis --conf-file ConfFiles/mc_conf/clas6mc_1panalysis_eH_4325MeV.txt

Error 1:

Error in Efid parameter file!
^CReceived parameter type 1903146416, which is not found.
Aborting!
jtenavidal commented 6 months ago

Something is off with the input files. Evcorr seems ok Probbly outgoing proton momentum is off? Rerun previous code w/o acceptance and see if I also see shift there

jtenavidal commented 6 months ago

Also other files now break. WHY??

jtenavidal commented 6 months ago

Unradiated:

For Kirill analysis:

jtenavidal commented 6 months ago

For pion acceptances https://web.mit.edu/~schmidta/www/e2a_maps/

jtenavidal commented 6 months ago

Phi acceptance remove it Only use theta acceptance For rad plot. Then use the same for proton. Same for proton Then set min Q2 for genie to be 0.8. (Use Q2 about 2 for the paper). 1.8 GeV2.

jtenavidal commented 5 months ago

Running spline at 1.8 GeV2 Q2 cut python eAScatteringGridSubmitter.py --jobs-topdir /pnfs/genie/scratch/users/jtenavid/GENIE_e4nu_Generations/2024Generation/Spline18/ --config-dir /pnfs/genie/persistent/users/jtenavid/e4nu_files/e4nu-config-files/e4nu-GENIE-config --probe-list 11 --stopping-point 4 --no-ghep-output --gst-output --tune GEM21_11a_00_000 --e-tgt-list 1000010010 --store-comitinfo --subjob-disk 4GB --subjob-memory 4GB --mainjob-memory 10GB --mainjob-disk 10GB --git-location https://github.com/e4nu/Generator-Q208.git --git-branch Q2-1_8GeV --submit-jobs

8889287.0@jobsub04.fnal.gov

jtenavidal commented 5 months ago

image Compute for each case Can I see 2D plot with tail?