Same hep output of Pythia for same run?

Asked by Jory Sonneveld

When I run pythia on an existing run generated by madgraph on the parton level using

echo 'pythia run_name --mullticore --nb_core=2 -f' | python madgraph_dir/process/bin/madevent

I will obtain files for pythia like
tag_1_pythia_events.hep.gz
tag_2_pythia_events.hep.gz
and so on.

When I then pass these files to Delphes and check the final LHCO output, they seem to be the same except for some jets that appear to be b-tagged which before were not. This makes me question the randomness of pythia when run on the same parton level results. How is the random seed of pythia generated when it is called by Madevent? Could this be the source of my exact same pythia files?

I assume a single parton level event file does not mean pythia should produce the same output each time again - am I correct?

I am using an MSSM model with all decays set to zero and masses to 10^5 except for a few particles. I seem to have no such problems (i.e. exact same results) when generating pythia using

python madgraph_dir/process/bin/generate_events run_name --last-step=pythia --multicore --nb_core=2 -f

. The reason I want to use madevent instead is that for generate_events the parton level is generated again.

Thank you in advance,
Jory

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi Jory,

Currently, the seed pass to pythia is the same as the one used for the madgraph generation.
(i.e. this is read from the banner of the events file)

If you want to change this behavior:
I suggest that you follow the instruction given in the following document:
http://milonga.physics.metu.edu.tr/hep-ex/miniguide.pdf
(page 38) suggesting to use timestamp instead.

and edit the related code:
pythia-pgs/src/ME2pythia.f
(line 148)

Cheers,

Olivier

On Jan 28, 2013, at 10:25 AM, Jory Sonneveld <email address hidden> wrote:

> New question #220360 on MadGraph5:
> https://answers.launchpad.net/madgraph5/+question/220360
>
> When I run pythia on an existing run generated by madgraph on the parton level using
>
> echo 'pythia run_name --mullticore --nb_core=2 -f' | python madgraph_dir/process/bin/madevent
>
> I will obtain files for pythia like
> tag_1_pythia_events.hep.gz
> tag_2_pythia_events.hep.gz
> and so on.
>
> When I then pass these files to Delphes and check the final LHCO output, they seem to be the same except for some jets that appear to be b-tagged which before were not. This makes me question the randomness of pythia when run on the same parton level results. How is the random seed of pythia generated when it is called by Madevent? Could this be the source of my exact same pythia files?
>
> I assume a single parton level event file does not mean pythia should produce the same output each time again - am I correct?
>
> I am using an MSSM model with all decays set to zero and masses to 10^5 except for a few particles. I seem to have no such problems (i.e. exact same results) when generating pythia using
>
> python madgraph_dir/process/bin/generate_events run_name --last-step=pythia --multicore --nb_core=2 -f
>
> . The reason I want to use madevent instead is that for generate_events the parton level is generated again.
>
> Thank you in advance,
> Jory
>
> --
> You received this question notification because you are a member of
> MadTeam, which is an answer contact for MadGraph5.

Revision history for this message
Jory Sonneveld (jory) said :
#2

Thanks Olivier, I think this solved my problem. I now obtain output that I expect.

My pythia logs (e.g. tag_1_pythia.log) also now show that the random seed has changed:
mrpy(1) changed from 19780503 to 12224900

I changed the code of ME2pythia.f for this using the miniguide above; see code below. I am not very good at fortran and it took me some time to get this, so if someone happens to notice an error in the code below please let me know.

----------------------------------------------------

C...Random seed with timestamp parameters
        character*8 ctime,ctemp,ctempf, date
        character arg*18
        integer iint,jint

------- some more definitions -------

c...Read the <init> block information

C
C GET THE TIME STAMP 'ctime' OF THE MACHINE (8 CHAR WITH DOTS)
C
       call date_and_time(date, ctime)

 C
 C THE FOLLOWING CODE WILL CONVERT THE TIME-STAMP TO A..
 C ..8 DIGITS NUMBER.
 C
        jint=0
        ctemp = ' '
        do iint = 1,8 ! Remove dots from ‘ctime’.
        if(ctime(iint:iint).ne.'.')then
                jint=jint+1
                ctemp(jint:jint) = ctime(iint:iint)
        endif ! ctime(iint:iint)<>'.'
        enddo ! iint-loop.
        ctempf(1:8) = ctemp(1:6)//'00' ! Fillup to 8 char.
        arg(1:18) = 'mrpy(1)='//ctempf(1:8)
        write(lnhout,*) 'Initializing PYR w/time seed:',arg(1:18)
        call PYGIVE(arg(1:18)) ! Random sequences seed.

  C...Loop until finds line beginning with "<init>" or "<init ".
    100 READ(LNHIN,STRFMT,END=130,ERR=130) STRING
  C...Pick out random number seed and use for PYR initialization
        IF(INDEX(STRING,'iseed').NE.0)THEN
           READ(STRING,*) iseed
           IF(iseed.gt.0) THEN
  C WRITE(LNHOUT,*) 'Initializing PYR with random seed ',iseed
  C MRPY(1) = iseed
              MRPY(2) = 0
           ENDIF
        ENDIF
        IBEG=0
    110 IBEG=IBEG+1

----------------------------------

Revision history for this message
Jory Sonneveld (jory) said :
#3

Thanks Olivier Mattelaer, that solved my question.