Problem with MA5v1.5

Asked by hprager

Hello,

I'm trying to use MA5 in recasting mode with the analysis atlas_1605_03814 but it is only implemented in MA5v1.5 and I don't manage to make it work properly. I tried to install it both by hand and through MG5v2.5.2 and in both cases I manage to install PAD and PADForMA5tune without getting any error message, but when I try to do the recasting using the following commands

./bin/ma5 -R
set main.recast=on
set main.recast.card_path = myCard,dat
import myfile.hepmc as myRun
set myRun.xsection = 6.4035
submit myRun

I systematically get this error

Traceback (most recent call last):
  File "./bin/ma5", line 70, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 394, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 299, in MainSession
    interpreter.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/interpreter.py", line 283, in do_submit
    self.cmd_submit.do(self.split_arg(line),self.history)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 86, in do
    return self.do_submit(args,history)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 237, in do_submit
    if not self.submit(filename,history):
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 528, in submit
    self.submit(dirname+'_DelphesRun',[])
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 430, in submit
    if not jobber.CopyLHEAnalysis():
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/IOinterface/job_writer.py", line 327, in CopyLHEAnalysis
    self.CreateDelphesCard()
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/IOinterface/job_writer.py", line 291, in CreateDelphesCard
    self.CopyDelphesCard(input,output,cfg,theFile)
UnboundLocalError: local variable 'theFile' referenced before assignment

I also tried to do the recasting using MA5v1.4 and it worked for ATLAS_1604_07773 but not for atlas_1605_03814 which is not implemented in that version. I even tried to add atlas_1605_03814 to MA5v1.4 using the newAnalyzer.py script and adding the .ccp, .h and .info files to MA5_v1.4/PAD/Build/SampleAnalyzer/User/Analyzer and then compiling the PAD again doing

source setup.sh
make clean
make

I didn't get any error during the compilation but when I tried to do the recasting I got this error message

MA5-ERROR: Recasting card: invalid analysis (not present in the PAD and in the PADForMA5tune): atlas_1605_03814
MA5-ERROR: Invalid recasting card
MA5-ERROR: job submission aborted.

Finally I also tried to install the v1.5 PAD in MA5v1.4 by replacing the install_pad.* files in the madanalysis/install directory but it didn't work either, I got this other error message:

Traceback (most recent call last):
  File "./bin/ma5", line 70, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/core/launcher.py", line 324, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/core/launcher.py", line 237, in MainSession
    interpreter.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/interpreter.py", line 282, in do_submit
    self.cmd_submit.do(self.split_arg(line),self.history)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/cmd_submit.py", line 86, in do
    return self.do_submit(args,history)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/cmd_submit.py", line 237, in do_submit
    if not self.submit(filename,history):
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/cmd_submit.py", line 613, in submit
    if not self.main.recasting.SavePADOutput(PADdir,dirname,myanalyses,myset.name):
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/configuration/recast_configuration.py", line 531, in SavePADOutput
    shutil.move(PADdir+'/Output/PADevents.list/PADevents.list.saf',dirname+'/Output/'+setname+'.saf')
  File "/usr/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/usr/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/PAD/Output/PADevents.list/PADevents.list.saf'

Could you please help me to solve this problem?

Best,
Hugo

Question information

Language:
English Edit question
Status:
Solved
For:
MadAnalysis 5 Edit question
Assignee:
No assignee Edit question
Solved by:
hprager
Solved:
Last query:
Last reply:
Revision history for this message
Benjamin Fuks (fuks) said :
#1

Dear Hugo,

This is a known bug that is actually fixed in v1.6beta. In the meantime, it is sufficient to open the file madanalysis/IOinterface/job_writer.py, find line 285 that reads
> if cfg.pileup.startswith('/'):

and initialize theFile before this line as in:
> theFile = ""
> if cfg.pileup.startswith('/'):

Cheers,

Benjamin

On 25 Jan 2017, at 17:07 , hprager <email address hidden> wrote:

> New question #446984 on MadAnalysis 5:
> https://answers.launchpad.net/madanalysis5/+question/446984
>
> Hello,
>
> I'm trying to use MA5 in recasting mode with the analysis atlas_1605_03814 but it is only implemented in MA5v1.5 and I don't manage to make it work properly. I tried to install it both by hand and through MG5v2.5.2 and in both cases I manage to install PAD and PADForMA5tune without getting any error message, but when I try to do the recasting using the following commands
>
> ./bin/ma5 -R
> set main.recast=on
> set main.recast.card_path = myCard,dat
> import myfile.hepmc as myRun
> set myRun.xsection = 6.4035
> submit myRun
>
> I systematically get this error
>
> Traceback (most recent call last):
> File "./bin/ma5", line 70, in <module>
> madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 394, in LaunchMA5
> repeat = MainSession(mode,arglist,ma5dir,version,date)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 299, in MainSession
> interpreter.cmdloop()
> File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
> stop = self.onecmd(line)
> File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
> return func(arg)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/interpreter.py", line 283, in do_submit
> self.cmd_submit.do(self.split_arg(line),self.history)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 86, in do
> return self.do_submit(args,history)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 237, in do_submit
> if not self.submit(filename,history):
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 528, in submit
> self.submit(dirname+'_DelphesRun',[])
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 430, in submit
> if not jobber.CopyLHEAnalysis():
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/IOinterface/job_writer.py", line 327, in CopyLHEAnalysis
> self.CreateDelphesCard()
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/IOinterface/job_writer.py", line 291, in CreateDelphesCard
> self.CopyDelphesCard(input,output,cfg,theFile)
> UnboundLocalError: local variable 'theFile' referenced before assignment
>
> I also tried to do the recasting using MA5v1.4 and it worked for ATLAS_1604_07773 but not for atlas_1605_03814 which is not implemented in that version. I even tried to add atlas_1605_03814 to MA5v1.4 using the newAnalyzer.py script and adding the .ccp, .h and .info files to MA5_v1.4/PAD/Build/SampleAnalyzer/User/Analyzer and then compiling the PAD again doing
>
> source setup.sh
> make clean
> make
>
> I didn't get any error during the compilation but when I tried to do the recasting I got this error message
>
> MA5-ERROR: Recasting card: invalid analysis (not present in the PAD and in the PADForMA5tune): atlas_1605_03814
> MA5-ERROR: Invalid recasting card
> MA5-ERROR: job submission aborted.
>
> Finally I also tried to install the v1.5 PAD in MA5v1.4 by replacing the install_pad.* files in the madanalysis/install directory but it didn't work either, I got this other error message:
>
> Traceback (most recent call last):
> File "./bin/ma5", line 70, in <module>
> madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/core/launcher.py", line 324, in LaunchMA5
> repeat = MainSession(mode,arglist,ma5dir,version,date)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/core/launcher.py", line 237, in MainSession
> interpreter.cmdloop()
> File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
> stop = self.onecmd(line)
> File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
> return func(arg)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/interpreter.py", line 282, in do_submit
> self.cmd_submit.do(self.split_arg(line),self.history)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/cmd_submit.py", line 86, in do
> return self.do_submit(args,history)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/cmd_submit.py", line 237, in do_submit
> if not self.submit(filename,history):
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/interpreter/cmd_submit.py", line 613, in submit
> if not self.main.recasting.SavePADOutput(PADdir,dirname,myanalyses,myset.name):
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/madanalysis/configuration/recast_configuration.py", line 531, in SavePADOutput
> shutil.move(PADdir+'/Output/PADevents.list/PADevents.list.saf',dirname+'/Output/'+setname+'.saf')
> File "/usr/lib/python2.7/shutil.py", line 302, in move
> copy2(src, real_dst)
> File "/usr/lib/python2.7/shutil.py", line 130, in copy2
> copyfile(src, dst)
> File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
> with open(src, 'rb') as fsrc:
> IOError: [Errno 2] No such file or directory: '/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/InstallMA_script/madanalysis5/PAD/Output/PADevents.list/PADevents.list.saf'
>
> Could you please help me to solve this problem?
>
> Best,
> Hugo
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
hprager (prager-hugo) said :
#2

Dear Benjamin,

I did a brand new installation of MA5v1.5 and modified the job_writer.py as you suggested before installing PAD and PADForMA5tune and compiling the code and I then tried to do my recasting but once again I got the same error message

Traceback (most recent call last):
  File "./bin/ma5", line 70, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 394, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 299, in MainSession
    interpreter.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/interpreter.py", line 283, in do_submit
    self.cmd_submit.do(self.split_arg(line),self.history)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 86, in do
    return self.do_submit(args,history)
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 237, in do_submit
    if not self.submit(filename,history):
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 613, in submit
    if not self.main.recasting.SavePADOutput(PADdir,dirname,myanalyses,myset.name):
  File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/configuration/recast_configuration.py", line 535, in SavePADOutput
    shutil.move(PADdir+'/Output/PADevents.list/PADevents.list.saf',dirname+'/Output/'+setname+'.saf')
  File "/usr/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/usr/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/PAD/Output/PADevents.list/PADevents.list.saf'

I've also tried to use v1.6beta but I got the same error message during the recasting. Is there any other file apart from job_writer.py that I should modify in order to fix this problem?

Best,
Hugo

Revision history for this message
Benjamin Fuks (fuks) said :
#3

Hi Hugo,

I just updated the madgraph installation yesterday night which should now install v1.6bet instead of v1.5. The bug of yesterday should not be there anymore.

Your new problem seems actually unrelated to the previous one. Do you mind sharing a small event file (possibly on google drive) allowing me to reproduce the issue. I also need the list of commands you typed (and the analysis card of course). Thanks in advance.

Cheers,

Benjamin

On 26 Jan 2017, at 12:44 , hprager <email address hidden> wrote:

> Question #446984 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/446984
>
> Status: Answered => Open
>
> hprager is still having a problem:
> Dear Benjamin,
>
> I did a brand new installation of MA5v1.5 and modified the job_writer.py
> as you suggested before installing PAD and PADForMA5tune and compiling
> the code and I then tried to do my recasting but once again I got the
> same error message
>
> Traceback (most recent call last):
> File "./bin/ma5", line 70, in <module>
> madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 394, in LaunchMA5
> repeat = MainSession(mode,arglist,ma5dir,version,date)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/core/launcher.py", line 299, in MainSession
> interpreter.cmdloop()
> File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
> stop = self.onecmd(line)
> File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
> return func(arg)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/interpreter.py", line 283, in do_submit
> self.cmd_submit.do(self.split_arg(line),self.history)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 86, in do
> return self.do_submit(args,history)
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 237, in do_submit
> if not self.submit(filename,history):
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/interpreter/cmd_submit.py", line 613, in submit
> if not self.main.recasting.SavePADOutput(PADdir,dirname,myanalyses,myset.name):
> File "/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/madanalysis/configuration/recast_configuration.py", line 535, in SavePADOutput
> shutil.move(PADdir+'/Output/PADevents.list/PADevents.list.saf',dirname+'/Output/'+setname+'.saf')
> File "/usr/lib/python2.7/shutil.py", line 302, in move
> copy2(src, real_dst)
> File "/usr/lib/python2.7/shutil.py", line 130, in copy2
> copyfile(src, dst)
> File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
> with open(src, 'rb') as fsrc:
> IOError: [Errno 2] No such file or directory: '/home/hprager/PhD/Softwares/MG5_aMC_v2_5_2/madanalysis5_1.5/PAD/Output/PADevents.list/PADevents.list.saf'
>
> I've also tried to use v1.6beta but I got the same error message during
> the recasting. Is there any other file apart from job_writer.py that I
> should modify in order to fix this problem?
>
> Best,
> Hugo
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
hprager (prager-hugo) said :
#4

Hi Benjamin,

You can download here all the information you need to reproduce the issue: https://mega.nz/#!AJYwyQDY!XITwoQyygq1OPAafI8s_Whg24b3N4vGnDj3oMoQfEq4

Please tell me if you need anything else.

Best,
Hugo

Revision history for this message
Benjamin Fuks (fuks) said :
#5

Hi Hugo,

This was a small bug introduced in v1.6beta that I have just fixed. Apologies for this.

Regards,

Benjamin

On 26 Jan 2017, at 15:08 , hprager <email address hidden> wrote:

> Question #446984 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/446984
>
> Status: Answered => Open
>
> hprager is still having a problem:
> Hi Benjamin,
>
> You can download here all the information you need to reproduce the
> issue:
> https://mega.nz/#!AJYwyQDY!XITwoQyygq1OPAafI8s_Whg24b3N4vGnDj3oMoQfEq4
>
> Please tell me if you need anything else.
>
> Best,
> Hugo
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
hprager (prager-hugo) said :
#6

Dear Benjamin,

Thank you for fixing the bug, MA5v1.6beta is now running without giving me the same error than before. Yet I still don't manage to use the analysis atlas_1605_03814 for a recasting. When I try using it I get the following message:

MA5: Checking the recasting card...
MA5-ERROR: Recasting card: invalid analysis (not present in the PAD and in the PADForMA5tune): atlas_1605_03814
MA5-ERROR: Invalid recasting card
MA5-ERROR: job submission aborted.

It seems that atlas_1605_03814 is not recognised by MA5, despite the fact that I can see it in the PAD/Build/SampleAnalyzer/User/Analyzer/analysisList.h file

#include "SampleAnalyzer/User/Analyzer/atlas_1605_03814.h"
[...]
  manager.Add("atlas_1605_03814",new atlas_1605_03814);

and that the atlas_1605_03814.cpp, atlas_1605_03814.h and atlas_1605_03814.info are also in the Analyzer folder.
Is there something special I need to do in order to be able to use it?

Best,
Hugo

Revision history for this message
hprager (prager-hugo) said :
#7

Sorry I just realized I was using the previous version of MA in my simulation, everything is working fine with the last version I installed through MadGraph, thank you very much for your help!

Best,
Hugo