Not being able to export number of events into command script

Asked by Yannick Burkard

Dear users,

I am trying to generate 100'000 gg > H events by directly executing an .sh script, in which I directly define the directory to such process and number of events. For that I execute in the terminal `./makeEvents.sh gg_to_H 100000`, where makeEvents.sh contains the following lines:

````

process_directory = $1
nevents = $2
export process_directory
export nevents
./bin/mg5_aMC $simulation_commands
````

and the simmulation_commands refers to an .sh file (simmulation_commands.sh) with the following lines:

````
launch $directory_name
shower=Pythia8
detector=Delphes
analysis=ExRoot
0
set nevents $nevents
0
````

the $directory_name is perfectly recognized in this script, whereas the $nevents is not; I obtain the following error:

````
WARNING: Invalid input: Expected number and not '$nevents'
````

It seems like $nevents is not being recognized as an integer. Does anyone know what is the solution to this? Any help would be appreciated!

Question information

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

Sorry I'm not a bash expert in order to identify what the issue is.

But what surprise me is how directory_name is even defined since you do not define it anywhere.
I guess if you follow the same setup for both parameter you should get the same behavior.

Cheers,

Olivier

Revision history for this message
Yannick Burkard (yburkard) said :
#2

I'm sorry, I meant to write 'directory_name' instead of 'process_directory' in the very first and third code lines above. So basically this string passes without an issue, but not the number $nevents.

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

But if they are set in the same way, it should behaves in the same way...
Are you sure that you have not setup one variable directly at your shell level or something like that?

Sorry but I'm not sure how to help

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Yannick Burkard for more information if necessary.

To post a message you must log in.