MadWeight: best permutation

Asked by Juan Pablo Gomez

Dear all, I realize that it is possible to define how to manage the permutations in MadWeight_card.dat
#*************************************************************************
## Permutations ##
#*************************************************************************
Block MW_perm
# TAG VALUE UTILITY
     permutation T # make permutation
     bjet_is_jet T # consider permutation between b-jets and light jets

Also, I could notice that in Source/MadWeight_File/Python/collect_result.py, it is possible to define:
if 0: #put to one in order the select the best permutation only as the weight
                    input=list(self.choose_bestperm())
                elif 0: #put to one in order to select a particular permutation
                 input=list(self.select_perm(1))
                elif 0: #recreate the weights.out from details.out
                    input=list(self.find_from_details())
                else:
                    input=list(self.read_from_output())
But, what I am needing is to know what is the best permutation itself, not the best weight.
Could you please help me with this?
Thanks in advance!!!

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Dear Juan,

Feel free to modify the routine self.choose_bestperm()
in order to return the permutation number associated to the highest weight.

If I'm correct the file details.out (present for each weight computation) should provide details on
which permutation this refer.

Cheers,

Olivier

On Jul 13, 2012, at 10:56 AM, Juan Pablo Gomez wrote:

> New question #203030 on MadGraph5:
> https://answers.launchpad.net/madgraph5/+question/203030
>
> Dear all, I realize that it is possible to define how to manage the permutations in MadWeight_card.dat
> #*************************************************************************
> ## Permutations ##
> #*************************************************************************
> Block MW_perm
> # TAG VALUE UTILITY
> permutation T # make permutation
> bjet_is_jet T # consider permutation between b-jets and light jets
>
> Also, I could notice that in Source/MadWeight_File/Python/collect_result.py, it is possible to define:
> if 0: #put to one in order the select the best permutation only as the weight
> input=list(self.choose_bestperm())
> elif 0: #put to one in order to select a particular permutation
> input=list(self.select_perm(1))
> elif 0: #recreate the weights.out from details.out
> input=list(self.find_from_details())
> else:
> input=list(self.read_from_output())
> But, what I am needing is to know what is the best permutation itself, not the best weight.
> Could you please help me with this?
> Thanks in advance!!!
>
> --
> You received this question notification because you are a member of
> MadTeam, which is an answer contact for MadGraph5.

Revision history for this message
Juan Pablo Gomez (djp) said :
#2

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Juan Pablo Gomez (djp) said :
#3

Thanks a lot Olivier, I am going to follow your advice.
Cheers,

JP

Revision history for this message
Juan Pablo Gomez (djp) said :
#4

Hi Olivier I was looking for the file details.out but I was not able of finding it. Could you please tell me where can I get it?

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#5

Hi Pablo,

Those files are in
SubProcesses/PXXXXXXXXX/RUN_NAME/cards_X/event_Y
where RUN_NAME is usually fermi

Cheers,

Olivier

On Jul 18, 2012, at 9:15 PM, Juan Pablo Gomez wrote:

> Question #203030 on MadGraph5 changed:
> https://answers.launchpad.net/madgraph5/+question/203030
>
> Status: Solved => Open
>
> Juan Pablo Gomez is still having a problem:
> Hi Olivier I was looking for the file details.out but I was not able of
> finding it. Could you please tell me where can I get it?
>
> --
> You received this question notification because you are a member of
> MadTeam, which is an answer contact for MadGraph5.

Revision history for this message
Juan Pablo Gomez (djp) said :
#6

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Juan Pablo Gomez (djp) said :
#7

Thanks a lot Olivier for your help!!!
Cheers,

JP

Revision history for this message
Juan Pablo Gomez (djp) said :
#8

Dear all, I have tried with several decays but I haven't been able to get the file called details.out.

I was reviewing in the path that Olivier told me (SubProcesses/P1_gg_bxe-vexbudx/fermi/card_1) but in this folder there are the following files:
G1.040 G3.040 ajob2 all_iter.dat done.ajob1 done.ajob3 madevent param.dat results.html symfact.dat
G2.040 ajob1 ajob3 dname.mg done.ajob2 input_app.txt madevent.py results.dat seedvalue.inc

I was also reviewing another folder with similar name (SubProcesses/MW_P1_gg_bxe-vexbudx/fermi/card_2/event_0) but the files that I found here are:
param.dat verif.lhco

Do you know what can be happening? is it maybe something that I am forgoting to do?

Thanks in advance,

JP

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#9

Which version of MW did you use?

Cheers,

Olivier

Revision history for this message
Juan Pablo Gomez (djp) said :
#10

Hi Olivier, the version is MG_ME_V4.5.2
Cheers,

JP

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#11

Ok Sorry my mistake those files are at the following path:

SubProcesses/MW_PXXXXXXXXX/RUN_NAME/cards_X/event_Y

Sorry for that,

Olivier

On Jul 31, 2012, at 9:26 AM, Juan Pablo Gomez wrote:

> Question #203030 on MadGraph5 changed:
> https://answers.launchpad.net/madgraph5/+question/203030
>
> Juan Pablo Gomez gave more information on the question:
> Hi Olivier, the version is MG_ME_V4.5.2
> Cheers,
>
> JP
>
> --
> You received this question notification because you are a member of
> MadTeam, which is an answer contact for MadGraph5.

Revision history for this message
Juan Pablo Gomez (djp) said :
#12

Dear all and dear Olivier, first of all thanks a lot for spend some of your time solving my doubts.
As I mentioned in a last entry, I have been trying to find the details.out file in several ways . The last try that I did was to run the same process in three different ways which I describe here:

1. Using MG_ME_V4.5.2 for the whole process, I mean, for the generation of events as well to use the Matrix Element Method.
2. Using MadGraph5_v1_4_7 for generate the events and MG_ME_V4.5.2 to apply the Matrix Element Method.
3. Using the tool that is obtained with "bzr branch lp:~maddevelopers/madgraph5/madweight" for the whole process.

-In all the cases the process is the same but the sintaxis changes a little bit:

MG_ME_V4.5.2:
pp>(t~>(w->l- vl~)b~)(t>(w+>jj)b) @1 # First Process
QCD=99 # Max QCD couplings
QED=99 # Max QED couplings
end_coup # End the couplings input

MadGraph5_v1_4_7:
generate p p > t t~ QED=99, (t > W+ b, W+ > j j),(t~ > W- b~, W- > l- vl~)

-The run card is the default one but instead of 10000 events only 100.
-The MadWeight Card is also the default but running on a single machine and with following change:
# # first parameter #
     11 mass # Block of the parameter to change
     12 6 # id of the parameter to change
     13 180 # here you can enter the different values:
     13 190 # add a new line with tag 13 to introduce a new value
     13 200 # add a new line with tag 13 to introduce a new value
#
# # second parameter #

However, I didn't get in any of the cases the file details.out.
Finally, I was reviewing the code Source/MadWeight_File/Python/collect_result.py and I realized that in fact, this file is opened from at least one of the methods, as you can see here:
 def choose_bestperm(self):
        """ select the best permutation for the weight"""

        ff=open(os.path.join(self.path,'details.out','r'))
        pat=re.compile(r'''^\s*\d+\s*\|\|\s*\d+\s*\|\|\s*(?P<value>[\de.+-]+)\s*\|\|\s*(?P<error>[\deE.+-]+)\s*$''',re.I)

        max=0
        i=0
        for line in ff:
            if pat.search(line):
                i+=1
                value=float(pat.search(line).group('value'))
                if value>max:
                    max=value
                    error=pat.search(line).group('error')

        return max/i,error/i
So, the question is: do you know if I have to change something in the code in order to have the file details.out?, or if this is not the case, what could you suggest to me?
Thanks in advance,

JP

Revision history for this message
Andres Osorio (osorio-af) said :
#13

Dear Juan Pablo and all,

Just to help out the Mad Developers on this open ticket - so they can close it - please allow to answer partly your question (not as a developer, but as a fellow user):

- At least in the official release of MadWeight -the one you download from the MadGraph site- V2.5.16, the "details.out" file is not created anymore. Looking to previous versions, I managed to see that apparently the last version that was able to produce this file was V2.5.8.

- The fortran code responsible for this type of output is "Source/MadWeight_File/MWP_template/driver.f"

- So in order to get some output that contains "permutation + weight + error" you need to look into a file called "vegas_values.out". This file is generated by the same "drive.f" file. As Olivier pointed out, this type of output is produced on a event by event basis.

- However, I had to slightly modify the code in "Source/MadWeight_File/Python/clean.py", to protect those file from the clean up process, by removing those files from the "protect_all_but( )" method. If you do that, then you will get the output as Olivier pointed out.

So I think this should answer your previous questions.

I know that what you want is to use MadWeight as a possible way to select among physics objects the best combination. My question to the MadWeight experts is if that makes sense? if so, the what is your advice in order to output the permutation and its physics objects assignment?

Many thanks,

Andres

Can you help with this problem?

Provide an answer of your own, or ask Juan Pablo Gomez for more information if necessary.

To post a message you must log in.