JeffersonLab / hps-mc

HPS MC toolkit
1 stars 6 forks source link

idm introduction #366

Closed tomeichlersmith closed 1 year ago

tomeichlersmith commented 1 year ago

Just a copy of my MadEvent workspace that is generating iDM events at the HPS beam energy. I think I resolved the issues I was seeing by removing the possibility of the dark photon from coupling with the nucleus - this seemed to be causing interference when the dark photons mass grew smaller (perhaps since it was growing "similar" to the standard photon). I don't know if this is the correct interpretation, but the SIMP MadEvent model also doesn't have a dark photon - nucleus interaction, so I think it is fair to go ahead with this workspace.

Still To Do

I am not planning on including an example of how to use this because I do not understand the full data processing pipeline enough to construct a helpful example (like the simp example). My general proposal is to merge this PR as an "introduction" and then include an iDM example after I've had time to work with it for a while longer generating real simulation samples.

I've been able to verify that this introduction works by using the following job script and job parameter files.

idm_job.py

from hpsmc.generators import MG5

job.description = 'iDM generation'

## Generate tritrig in MG5
mg = MG5(name='idm', event_types=['unweighted'])

## Run the job
job.add([mg])

job.json

{
    "nevents": 10,
    "run_params": "2pt3",
    "Map": 1000.0,
    "mchi": 200.0,
    "dmchi": 40.0,
    "seed": 879483
}

Running

hps-mc-job run idm_job.py job.json -d scratch

And then I see the generated LHE file in scratch ready to be copied out (which hps-mc would do if I provided an output_files parameter to it in the job parameter file).

tomeichlersmith commented 1 year ago

I believe this is a limitation of the MadGraph/MadEvent software itself. I don't think any of us have the time to get familiar enough the MG/ME in order to get around this amount of code duplication unfortunately. While there is almost certainly code duplication across the different MG/ME workspace copies, there are also substantial differences that are hardcoded into the source files when they are written by MG for ME.

This can perhaps be best shown with a simple example.

eichl008@spa-cms017 ~/hps/mc/generators/madgraph5/src> diff {simp,idm}/Source/MODEL/couplings.f
12a13,14
>       LOGICAL UPDATELOOP
>       COMMON /TO_UPDATELOOP/UPDATELOOP
30c32,34
<       LOGICAL READLHA
---
>       LOGICAL READLHA, FIRST
>       DATA FIRST /.TRUE./
>       SAVE FIRST
32a37,38
>       LOGICAL UPDATELOOP
>       COMMON /TO_UPDATELOOP/UPDATELOOP
33a40,52
>       DOUBLE PRECISION GOTHER
> 
>       DOUBLE PRECISION MODEL_SCALE
>       COMMON /MODEL_SCALE/MODEL_SCALE
> 
> 
>       INCLUDE '../maxparticles.inc'
>       INCLUDE '../cuts.inc'
>       INCLUDE '../run.inc'
> 
>       DOUBLE PRECISION ALPHAS
>       EXTERNAL ALPHAS
> 
40a60
> 
57a78,80
>       DOUBLE PRECISION MODEL_SCALE
>       COMMON /MODEL_SCALE/MODEL_SCALE
> 
59c82,83
<       IF (MU_R2.GT.0D0) MU_R = MU_R2
---
>       IF (MU_R2.GT.0D0) MU_R = DSQRT(MU_R2)
>       MODEL_SCALE = DSQRT(MU_R2)
eichl008@spa-cms017 ~/hps/mc/generators/madgraph5/src> diff {simp,idm}/Source/hfill.f
eichl008@spa-cms017 ~/hps/mc/generators/madgraph5/src> 

Without a more intimate knowledge of MG/ME, I don't think we'll be able to deduce which files will change with other models and which ones won't. We'd need to manually go through the almost 3.2k (in MG5) and 8.5k (in MG4) files to check for duplicates.