Why does reweighting take a long time?

Asked by Yue Xu on 2019-11-06

Dear MadGraph group,

I'm using the reweighting technique in MG5 version2.6.6 with an external model which contains a heavy higgs ( hh ). I found it takes me a long time to run reweighting.

For example:
the processes are:
import model SMwithHeavyScalarDim4Dim6_NoDecay_UFO
generate p p > z hh, z > l- l+, hh > j j j j
add process p p > z hh, z > j j, hh > e- e+ j j
add process p p > z hh, z > j j, hh > mu- mu+ j j
add process p p > w- hh, w- > j j, hh > e- e+ j j
add process p p > w- hh, w- > j j, hh > mu- mu+ j j
add process p p > w+ hh, w+ > j j, hh > e- e+ j j
add process p p > w+ hh, w+ > j j, hh > mu- mu+ j j

if I don't use reweighting, it takes me less than 2 minutes to get a sample with 10k events. But if I use reweighting with a set of parameters "fw" and "fww" that influence the coupling between heavy higgs and vector boson and the decay width of heavy higgs, it takes me about 30 minutes.

The model is here:
https://github.com/xuyue1231/MG5-heavy-Higgs/tree/master/SMwithHeavyScalarDim4Dim6_NoDecay_UFO

the process and reweigt_card are here:
https://github.com/xuyue1231/MG5-heavy-Higgs/tree/master/LHC_HH_2lep

Why does reweighting take such a long time?
How can I reduce the reweighting time ?

Best,
Yue

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Yue Xu
Solved:
2019-11-06
Last query:
2019-11-06
Last reply:
2019-11-06

Hi,

Most of this time is likely linked to the creation/compilation of the matrix-element needed for the re-weighting. You can technically save such compuations and/or reuse it if you do multiple re-weighting in a row.

Cheers,

Olivier

> On 6 Nov 2019, at 08:53, Yue Xu <email address hidden> wrote:
>
> New question #685648 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/685648
>
> Dear MadGraph group,
>
> I'm using the reweighting technique in MG5 version2.6.6 with an external model which contains a heavy higgs ( hh ). I found it takes me a long time to run reweighting.
>
> For example:
> the processes are:
> import model SMwithHeavyScalarDim4Dim6_NoDecay_UFO
> generate p p > z hh, z > l- l+, hh > j j j j
> add process p p > z hh, z > j j, hh > e- e+ j j
> add process p p > z hh, z > j j, hh > mu- mu+ j j
> add process p p > w- hh, w- > j j, hh > e- e+ j j
> add process p p > w- hh, w- > j j, hh > mu- mu+ j j
> add process p p > w+ hh, w+ > j j, hh > e- e+ j j
> add process p p > w+ hh, w+ > j j, hh > mu- mu+ j j
>
> if I don't use reweighting, it takes me less than 2 minutes to get a sample with 10k events. But if I use reweighting with a set of parameters "fw" and "fww" that influence the coupling between heavy higgs and vector boson and the decay width of heavy higgs, it takes me about 30 minutes.
>
> The model is here:
> https://github.com/xuyue1231/MG5-heavy-Higgs/tree/master/SMwithHeavyScalarDim4Dim6_NoDecay_UFO
>
> the process and reweigt_card are here:
> https://github.com/xuyue1231/MG5-heavy-Higgs/tree/master/LHC_HH_2lep
>
> Why does reweighting take such a long time?
> How can I reduce the reweighting time ?
>
> Best,
> Yue
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Yue Xu (yuexu) said : #2

Hi,
If I do a multiple reweighting, such as:

launch --rwgt_name=fwM300fww4600
 set DIM6COEFF 3 -300
 set DIM6COEFF 4 4600
 set DECAY 254 auto
launch --rwgt_name=fwM300fwwM4600
 set DIM6COEFF 3 -300
 set DIM6COEFF 4 -4600
 set DECAY 254 auto

It takes the same time as one reweighting.

But if I just want to do one reweighting, such as:
launch --rwgt_name=fwM300fww4600
 set DIM6COEFF 3 -300
 set DIM6COEFF 4 4600
 set DECAY 254 auto

Does it have some way to reduce the reweighting time?

Cheers,
Yue

So this prooves that most of the time is taken in creating/compiling the matrix-element needed for the re-weighting. if you plan to do multiple times re-weighting for this process then you can save the directory such that next time you do not have to redo that step.
But otherwise no you can not speed it up.

Cheers,

Olivier

> On 6 Nov 2019, at 09:15, Yue Xu <email address hidden> wrote:
>
> Question #685648 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/685648
>
> Status: Answered => Open
>
> Yue Xu is still having a problem:
> Hi,
> If I do a multiple reweighting, such as:
>
> launch --rwgt_name=fwM300fww4600
> set DIM6COEFF 3 -300
> set DIM6COEFF 4 4600
> set DECAY 254 auto
> launch --rwgt_name=fwM300fwwM4600
> set DIM6COEFF 3 -300
> set DIM6COEFF 4 -4600
> set DECAY 254 auto
>
> It takes the same time as one reweighting.
>
> But if I just want to do one reweighting, such as:
> launch --rwgt_name=fwM300fww4600
> set DIM6COEFF 3 -300
> set DIM6COEFF 4 4600
> set DECAY 254 auto
>
> Does it have some way to reduce the reweighting time?
>
> Cheers,
> Yue
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Yue Xu (yuexu) said : #4

Thanks a lot! Now I know the reason.

Cheers,
Yue