WARNING: MadAnalysis5 failed to run the commands for task 'analysis1'. Madanalys5 analysis will be skipped.

Bug #1657893 reported by Blake Forland
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MadAnalysis 5
Fix Released
High
Benjamin Fuks

Bug Description

I've been trying simply to get MadGraph and MadAnalysis to work together. I get this error:

"WARNING: MadAnalysis5 failed to run the commands for task 'analysis1'. Madanalys5 analysis will be skipped."

When I simply try to "launch" the tutorial process with Delphes, Pythia8, and MadAnalysis5. I'm not sure what the issue is or what has gone from in the installation to keep them from interfacing. My installation steps where as follows:

Xcode (normal installation)
install Homebrew
install gcc and Python2.7 (via homebrew)
install root6 (via homebrew)
tar -xvf "MG5 tar file"
fastjet (via home-brew)
In mg5_aMC
> install Delphes
> install ExRootAnalysis
> install pythia8
> install MadAnalysis

I've run out of ideas to try. Any help would be much appreciated.

I reran on debug mode, here are the actual errors:

DEBUG: MadAnalysis5 error was:
DEBUG: ------------------------------------------------------------
DEBUG: Traceback (most recent call last):
  File "/Users/bforland/Documents/MG5_aMC_v2_5_2/madgraph/interface/common_run_interface.py", line 2176, in runMA5
    MA5_interpreter.load(MA5_cmds)
  File "/Users/bforland/Documents/MG5_aMC_v2_5_2/HEPTools/madanalysis5/madanalysis5/madanalysis/misc/freeze_environment.py", line 40, in newf
    out = func(self, *args, **opts)
  File "/Users/bforland/Documents/MG5_aMC_v2_5_2/HEPTools/madanalysis5/madanalysis5/madanalysis/interpreter/ma5_interpreter.py", line 178, in load
    Interpreter.load(self,*args,**opts)
TypeError: load() takes exactly 1 argument (2 given)
DEBUG: ------------------------------------------------------------

Blake Forland (bforland)
description: updated
affects: mg5amcnlo → madanalysis5
Revision history for this message
Benjamin Fuks (fuks) wrote : Re: [Bug 1657893] Re: WARNING: MadAnalysis5 failed to run the commands for task 'analysis1'. Madanalys5 analysis will be skipped.

Hi,

Do you mind providing the madanalysis card?

I by the way recall that MadAnalysis5 can only handle delphes files that it has generated itself. How have you generated the delphes file?

Regards,

Benjamin

On 19 Jan 2017, at 22:55 , Olivier Mattelaer <email address hidden> wrote:

> ** Project changed: mg5amcnlo => madanalysis5
>
> --
> You received this bug notification because you are a member of
> MadAnalysisTeam, which is subscribed to MadAnalysis 5.
> https://bugs.launchpad.net/bugs/1657893
>
> Title:
> WARNING: MadAnalysis5 failed to run the commands for task 'analysis1'.
> Madanalys5 analysis will be skipped.
>
> Status in MadAnalysis 5:
> New
>
> Bug description:
> I've been trying simply to get MadGraph and MadAnalysis to work
> together. I get this error:
>
> "WARNING: MadAnalysis5 failed to run the commands for task
> 'analysis1'. Madanalys5 analysis will be skipped."
>
> When I simply try to "launch" the tutorial process with Delphes,
> Pythia8, and MadAnalysis5. I'm not sure what the issue is or what has
> gone from in the installation to keep them from interfacing. My
> installation steps where as follows:
>
> Xcode (normal installation)
> install Homebrew
> install gcc and Python2.7 (via homebrew)
> install root6 (via homebrew)
> tar -xvf "MG5 tar file"
> fastjet (via home-brew)
> In mg5_aMC
>> install Delphes
>> install ExRootAnalysis
>> install pythia8
>> install MadAnalysis
>
> I've run out of ideas to try. Any help would be much appreciated.
>
> I reran on debug mode, here are the actual errors:
>
> DEBUG: MadAnalysis5 error was:
> DEBUG: ------------------------------------------------------------
> DEBUG: Traceback (most recent call last):
> File "/Users/bforland/Documents/MG5_aMC_v2_5_2/madgraph/interface/common_run_interface.py", line 2176, in runMA5
> MA5_interpreter.load(MA5_cmds)
> File "/Users/bforland/Documents/MG5_aMC_v2_5_2/HEPTools/madanalysis5/madanalysis5/madanalysis/misc/freeze_environment.py", line 40, in newf
> out = func(self, *args, **opts)
> File "/Users/bforland/Documents/MG5_aMC_v2_5_2/HEPTools/madanalysis5/madanalysis5/madanalysis/interpreter/ma5_interpreter.py", line 178, in load
> Interpreter.load(self,*args,**opts)
> TypeError: load() takes exactly 1 argument (2 given)
> DEBUG: ------------------------------------------------------------
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/madanalysis5/+bug/1657893/+subscriptions

Revision history for this message
Blake Forland (bforland) wrote :

Benjamin,

this is the madanalysis5_hardon_card.dat , is that the card you're looking for?

# Uncomment the line below to skip this analysis altogether
# @MG5aMC skip_analysis

@MG5aMC stdout_lvl=INFO

# Recasting functionalities based on Delphes turned off. Please type
# install MadAnalysis5 --update --with_delphes
# in the MG5 interpereter to turn them on.

# Recasting functionalities based on DelphesMA5tune turned off. Please type
# install MadAnalysis5 --update --with_delphesMA5tune
# in the MG5 interpereter to turn them on.

@MG5aMC inputs = *.hepmc, *.hep, *.stdhep, *.lhco, *.fifo

# Reconstruction using FastJet
@MG5aMC reconstruction_name = BasicReco
@MG5aMC reco_output = lhe
# Multiparticle definition
define invisible = 12 14 16 -12 -14 -16
set main.fastsim.package = fastjet
set main.fastsim.algorithm = antikt
set main.fastsim.radius = 0.4
set main.fastsim.ptmin = 5.0
# b-tagging
set main.fastsim.bjet_id.matching_dr = 0.4
set main.fastsim.bjet_id.efficiency = 1.0
set main.fastsim.bjet_id.misid_cjet = 0.0
set main.fastsim.bjet_id.misid_ljet = 0.0
# tau-tagging
set main.fastsim.tau_id.efficiency = 1.0
set main.fastsim.tau_id.misid_ljet = 0.0

# Analysis using the fastjet reco
@MG5aMC analysis_name = analysis2
# Uncomment the next line to bypass this analysis
# @MG5aMC skip_analysis
@MG5aMC set_reconstructions = ['BasicReco']

# plot tunning: dsigma/sigma is plotted.
set main.stacking_method = normalize2one

# object definition
define e = e+ e-
define mu = mu+ mu-
select (j) PT > 20
select (b) PT > 20
select (e) PT > 10
select (mu) PT > 10
select (j) ABSETA < 2.5
select (b) ABSETA < 2.5
select (e) ABSETA < 2.5
select (mu) ABSETA < 2.5
# Basic plots
plot MET 40 0 500
plot THT 40 0 500
# basic properties of the non-b-tagged jets
plot PT(j[1]) 40 0 500 [logY]
plot ETA(j[1]) 40 -10 10 [logY]
plot MT_MET(j[1]) 40 0 500 [logY]
plot PT(j[2]) 40 0 500 [logY]
plot ETA(j[2]) 40 -10 10 [logY]
plot MT_MET(j[2]) 40 0 500 [logY]
# basic properties of the leptons
# basic properties of the photons
# Invariant-mass distributions
plot M(j[1] j[2]) 40 0 500 [logY]
# Angular distance distributions
plot DELTAR(j[1],j[2]) 40 0 10 [logY]

Revision history for this message
Joshua Ellis (jp-ellis) wrote :

The issue comes from the `.load` methods in the `Interpreter` family of classes.

To be more specific, the MA5Interpreter (http://bazaar.launchpad.net/~ma5/madanalysis5/madanalysis-development/view/head:/madanalysis/interpreter/ma5_interpreter.py) has:

    class MA5Interpreter(Interpreter):
        # [...]
        def load(self, *args, **opts):
            Interpreter.load(self, *args, **opts)

The `Interpreter` class itself does not implement the `load` method; however, it does inherit it from `InterpreterBase` (http://bazaar.launchpad.net/~ma5/madanalysis5/madanalysis-development/view/head:/madanalysis/interpreter/interpreter_base.py):

    class InterpreterBase(cmd.Cmd):
        # [...]
        def load(self):
            ok = True
            while ok:
                line = ScriptStack.Next()
                if line=='':
                    ok=False
                else:
                    self.logger.info("ma5>"+line)
                    line = self.precmd(line)
                    stop = self.onecmd(line)
                    stop = self.postcmd(stop, line)
                    if stop==True: #Restart
                        ok=False
            return True

The issue is that while MA5Interpreter is designed to handled arguments (and MadGraph makes use of this to pass commands over); MA5Interpreter simply passes on the commands to the Interpreter which is then unable to handle the errors.

---------

As a side note, if the intent is to call the parent function in MA5Interpreter, then it should probably be:

    class MA5Interpreter(Interpreter):
        # [...]
        def load(self, *args, **opts):
            super(MA5Interpreter, self).load(*args, **opts)

Revision history for this message
Benjamin Fuks (fuks) wrote :
Download full text (4.2 KiB)

Hi Joshua,

This came from the fact that we changed the way the interpreter class was working but forgot to update it at this place of the code. This has been fixed since then. It is in principle sufficient to reinstall ma5 from mg5 to have it working.

Cheers,

Benjamin

> On 28 Feb 2017, at 09:26 , Joshua Ellis <email address hidden> wrote:
>
> The issue comes from the `.load` methods in the `Interpreter` family of
> classes.
>
> To be more specific, the MA5Interpreter
> (http://bazaar.launchpad.net/~ma5/madanalysis5/madanalysis-
> development/view/head:/madanalysis/interpreter/ma5_interpreter.py) has:
>
> class MA5Interpreter(Interpreter):
> # [...]
> def load(self, *args, **opts):
> Interpreter.load(self, *args, **opts)
>
> The `Interpreter` class itself does not implement the `load` method;
> however, it does inherit it from `InterpreterBase`
> (http://bazaar.launchpad.net/~ma5/madanalysis5/madanalysis-
> development/view/head:/madanalysis/interpreter/interpreter_base.py):
>
> class InterpreterBase(cmd.Cmd):
> # [...]
> def load(self):
> ok = True
> while ok:
> line = ScriptStack.Next()
> if line=='':
> ok=False
> else:
> self.logger.info("ma5>"+line)
> line = self.precmd(line)
> stop = self.onecmd(line)
> stop = self.postcmd(stop, line)
> if stop==True: #Restart
> ok=False
> return True
>
> The issue is that while MA5Interpreter is designed to handled arguments
> (and MadGraph makes use of this to pass commands over); MA5Interpreter
> simply passes on the commands to the Interpreter which is then unable to
> handle the errors.
>
>
> ---------
>
> As a side note, if the intent is to call the parent function in
> MA5Interpreter, then it should probably be:
>
> class MA5Interpreter(Interpreter):
> # [...]
> def load(self, *args, **opts):
> super(MA5Interpreter, self).load(*args, **opts)
>
> --
> You received this bug notification because you are a member of
> MadAnalysisTeam, which is subscribed to MadAnalysis 5.
> https://bugs.launchpad.net/bugs/1657893
>
> Title:
> WARNING: MadAnalysis5 failed to run the commands for task 'analysis1'.
> Madanalys5 analysis will be skipped.
>
> Status in MadAnalysis 5:
> New
>
> Bug description:
> I've been trying simply to get MadGraph and MadAnalysis to work
> together. I get this error:
>
> "WARNING: MadAnalysis5 failed to run the commands for task
> 'analysis1'. Madanalys5 analysis will be skipped."
>
> When I simply try to "launch" the tutorial process with Delphes,
> Pythia8, and MadAnalysis5. I'm not sure what the issue is or what has
> gone from in the installation to keep them from interfacing. My
> installation steps where as follows:
>
> Xcode (normal installation)
> install Homebrew
> install gcc and Python2.7 (via homebrew)
> install root6 (via homebrew)
> tar -xvf "MG5 tar file"
> fastjet (via home-brew)
> In mg5_aMC
>> install Delphes
>> install ExRootAnalysis
>> in...

Read more...

Changed in madanalysis5:
status: New → Confirmed
status: Confirmed → Fix Committed
importance: Undecided → High
assignee: nobody → Benjamin Fuks (fuks)
milestone: none → v1.6
Benjamin Fuks (fuks)
Changed in madanalysis5:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.