how can i use scan command for CM energy for ebeam1 and ebeam2?

Asked by abdul quddus

>set ebeam1 scan:[250,300,350,400,500,550,600,650,700,750,800,850,900,950,1000,1050,1200,1250,1300,1350,1400,1450,1500]
scan:[250,300,350,400,500,550,600,650,700,750,800,850,900,950,1000,1050,1200,1250,1300,1350,1400,1450,1500] can not be mapped to a float
Do you want to edit a card (press enter to bypass editing)?
/------------------------------------------------------------\
| 1. param : param_card.dat |
| 2. run : run_card.dat |
| 3. pythia8 : pythia8_card.dat |
| 4. delphes : delphes_card.dat |
\------------------------------------------------------------/
 you can also
   - enter the path to a valid card or banner.
   - use the 'set' command to modify a parameter directly.
     The set option works only for param_card and run_card.
     Type 'help set' for more information on this command.
   - call an external program (ASperGE/MadWidth/...).
     Type 'help' for the list of available command
 [0, done, 1, param, 2, run, 3, pythia8, 4, enter path, ... ]
>

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

The scan command is only possible for benchmark scan. But the following FAQ shows you one way to have the same effect
FAQ #2186: “How to script MG5 run?”.

Revision history for this message
abdul quddus (kakakhail) said :
#2

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Sagar Modak (sagarmodakiisc) said :
#3

I am also having the same problem. Abdul can you please tell me how did you perform scan for ebeam1 and ebeam2? I am also getting the same error.

Revision history for this message
abdul quddus (kakakhail) said :
#4

Hi Sagar, hope you are doing well. As the question concerns, there is no
scan command for energy i.e. ebeam1 and ebeam2. You can change it for
different values of energy by script file.
First you have to make a script file of all madgraph commands and set your
ebeam1 and ebeam2 and run. After this you can change it again in script
file. I am sharing my script file with you.

On Wed, 9 Aug 2023, 12:51 am Sagar Modak, <
<email address hidden>> wrote:

> Your question #705764 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/705764
>
> Sagar Modak posted a new comment:
> I am also having the same problem. Abdul can you please tell me how did
> you perform scan for ebeam1 and ebeam2? I am also getting the same
> error.
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
abdul quddus (kakakhail) said :
#5

On Wed, 9 Aug 2023, 12:59 am Abdul Quddus, <email address hidden>
wrote:

> Hi Sagar, hope you are doing well. As the question concerns, there is no
> scan command for energy i.e. ebeam1 and ebeam2. You can change it for
> different values of energy by script file.
> First you have to make a script file of all madgraph commands and set your
> ebeam1 and ebeam2 and run. After this you can change it again in script
> file. I am sharing my script file with you.
>
> On Wed, 9 Aug 2023, 12:51 am Sagar Modak, <
> <email address hidden>> wrote:
>
>> Your question #705764 on MadGraph5_aMC@NLO changed:
>> https://answers.launchpad.net/mg5amcnlo/+question/705764
>>
>> Sagar Modak posted a new comment:
>> I am also having the same problem. Abdul can you please tell me how did
>> you perform scan for ebeam1 and ebeam2? I am also getting the same
>> error.
>>
>> --
>> You received this question notification because you asked the question.
>>
>

Revision history for this message
Sagar Modak (sagarmodakiisc) said :
#6

This is my script file:

clear all
generate e+ e- > a a
output eptoaa1
launch eptoaa1
set ebeam1 scan: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 900, 950, 1000]
set ebeam2 scan: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 900, 950, 1000]

But this also gives the same error.

Revision history for this message
abdul quddus (kakakhail) said :
#7

This command can not work because scan command can not be used for ebeams.
You should use ebeam1 =50 ebeam2=50 and run it. Then again change it to
next energy value. This is the only way to scan different ebeams.

On Wed, 9 Aug 2023, 1:05 am Sagar Modak, <
<email address hidden>> wrote:

> Your question #705764 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/705764
>
> Sagar Modak posted a new comment:
> This is my script file:
>
> clear all
> generate e+ e- > a a
> output eptoaa1
> launch eptoaa1
> set ebeam1 scan: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550,
> 600, 650, 700, 750, 800, 900, 950, 1000]
> set ebeam2 scan: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550,
> 600, 650, 700, 750, 800, 900, 950, 1000]
>
>
> But this also gives the same error.
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
abdul quddus (kakakhail) said :
#8

Use set ebeam1 = 50 , set ebeam2 =50

On Wed, 9 Aug 2023, 1:09 am Abdul Quddus, <email address hidden>
wrote:

> This command can not work because scan command can not be used for ebeams.
> You should use ebeam1 =50 ebeam2=50 and run it. Then again change it to
> next energy value. This is the only way to scan different ebeams.
>
>
> On Wed, 9 Aug 2023, 1:05 am Sagar Modak, <
> <email address hidden>> wrote:
>
>> Your question #705764 on MadGraph5_aMC@NLO changed:
>> https://answers.launchpad.net/mg5amcnlo/+question/705764
>>
>> Sagar Modak posted a new comment:
>> This is my script file:
>>
>> clear all
>> generate e+ e- > a a
>> output eptoaa1
>> launch eptoaa1
>> set ebeam1 scan: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550,
>> 600, 650, 700, 750, 800, 900, 950, 1000]
>> set ebeam2 scan: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550,
>> 600, 650, 700, 750, 800, 900, 950, 1000]
>>
>>
>> But this also gives the same error.
>>
>> --
>> You received this question notification because you asked the question.
>>
>

Revision history for this message
Sagar Modak (sagarmodakiisc) said :
#9

I understand. But I have to make a plot of the cross section vs the centre of mass energy. If scan does not work for ebeam1 and ebeam2, then how can I do that? If you please help, I will be grateful. Thanks in advance.

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

Please check the linked FAQ it does have all the information that you do need (also to create a file with the input needed for a plot of the cross-section)

Revision history for this message
abdul quddus (kakakhail) said :
#11

Running the file as I have explained, will make directory for every run.
You have to collect the cross-section from every run directory and put it
in a script file of .dat or .txt. In the first column you have to write
energy values and corresponding cross-section values in second column. You
will get plot by running this script file of data in root or other plotting
software your are using.

On Wed, 9 Aug 2023, 1:15 am Sagar Modak, <
<email address hidden>> wrote:

> Your question #705764 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/705764
>
> Sagar Modak posted a new comment:
> I understand. But I have to make a plot of the cross section vs the
> centre of mass energy. If scan does not work for ebeam1 and ebeam2, then
> how can I do that? If you please help, I will be grateful. Thanks in
> advance.
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Sagar Modak (sagarmodakiisc) said :
#12

Thanks Olivier for your response. I tried with the command mentioned in the FAQ:

  launch MYDIRECTORY -i
       print_results --path=./cross_section_top.txt --format=short

which produces the value of the cross-section inside a text file. But when I change the value of the cmenergy, the file is re-written and the information from the previous run is gone. Is there any workaround for this?
Thanks in advance.

Revision history for this message
Sagar Modak (sagarmodakiisc) said :
#13

So Abdul, that means, I have to manually do it after every run? Editing the script file and also putting all the cross-section and cmenergy values in a txt file?

When we change any parameter in param_card using scan command, after running the script file, we get a txt file with the changing parameter values and the cross sections in the file. So do you mean nothing like that happens here?

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

By running this command (here with version 2.9.16):

generate e+ e- > a a
output eptoaa1
launch eptoaa1
set ebeam 50
launch eptoaa1
set ebeam 100
launch eptoaa1 -i
print_results --path=./cross_section_top.txt --format=short

then the file is:
# run_name tag cross error Nb_event cross_after_matching nb_event_after matching
run_01 tag_1 50.261 0.027908 10000
run_02 tag_1 13.987 0.0062273 10000

Cheers,

Olivier

Revision history for this message
abdul quddus (kakakhail) said :
#15

Exactly. For param_card the scan command only works. It does not work for
run_card. You have to edit script file manually for every run and collect
data in txt file.

On Wed, 9 Aug 2023, 1:35 am Sagar Modak, <
<email address hidden>> wrote:

> Your question #705764 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/705764
>
> Sagar Modak posted a new comment:
> So Abdul, that means, I have to manually do it after every run? Editing
> the script file and also putting all the cross-section and cmenergy
> values in a txt file?
>
> When we change any parameter in param_card using scan command, after
> running the script file, we get a txt file with the changing parameter
> values and the cross sections in the file. So do you mean nothing like
> that happens here?
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Sagar Modak (sagarmodakiisc) said :
#16

Thank you Olivier. That really helped. Also thanks to Abdul for your time and attention.