Changes between Version 7 and Version 8 of Plugin


Ignore:
Timestamp:
Jun 20, 2016, 2:56:18 PM (8 years ago)
Author:
Olivier Mattelaer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Plugin

    v7 v8  
    6565# example: import maddm_interface as maddm_interface # local file
    6666#          import madgraph.various.cluster as cluster #MG5 distribution file
     67
     68import helloworld as helloworld # local file
     69
    6770# Three types of functionality are allowed in a plugin
    6871#   1. new output mode
     
    8689#    This can be activated via ./bin/mg5_aMC --mode=PLUGINNAME
    8790## Put None if no dedicated command are required
    88 import helloworld as helloworld # local file
    8991new_interface = helloworld.NewInterface
    9092 
     
    123125}}}
    124126
     127For a real physics code using that functionality, you can check maddm.
     128
    125129=== Example 2: New Exporter
    126130
     
    128132{{{
    129133## import the required files
    130 
    131 import output as output
    132 
    133 ## Define a typical error for the plugin
    134 class EVTDECONS_Error(Exception): pass
    135 
    136 ## Does it define a new interface (will be avaible with ./bin/mg5_aMC --mode=maddm
    137 ## Put None if no dedicated command are required
    138 new_interface = False
    139  
    140 ## Does it define a new output mode. Need to be define
     134# example: import maddm_interface as maddm_interface # local file
     135#          import madgraph.various.cluster as cluster #MG5 distribution file
     136
     137import output as output #local file
     138
     139# Three types of functionality are allowed in a plugin
     140#   1. new output mode
     141#   2. new cluster support
     142#   3. new interface
     143
     144# 1. Define new output mode
     145#    example: new_output = {'myformat': MYCLASS}
     146#    madgraph will then allow the command "output myformat PATH"
     147#    MYCLASS should inherated of the class madgraph.iolibs.export_v4.VirtualExporter
    141148new_output = {'madweight2': output.My_MW_Exporter,
    142149              'standalone_lib': output.MY_CPP_Standalone}
    143150
    144 ## The test/code have been validated up to this version
    145 latest_validated_version = '2.5.0'
    146 minimal_version_required = '2.5.0'
    147 maximal_version_required = None
    148 }}}
    149 
     151# 2. Define new way to handle the cluster.
     152#    example new_cluster = {'mycluster': MYCLUSTERCLASS}
     153#    allow "set cluster_type mycluster" in madgraph
     154#    MYCLUSTERCLASS should inherated from madgraph.various.cluster.Cluster
     155new_cluster = {}
     156
     157
     158# 3. Define a new interface (allow to add/modify MG5 command)
     159#    This can be activated via ./bin/mg5_aMC --mode=PLUGINNAME
     160## Put None if no dedicated command are required
     161new_interface = None
     162 
     163 
     164########################## CONTROL VARIABLE ####################################
     165__author__ = 'Mattelaer Olivier'
     166__email__ = 'o.p.c.mattelaer@durham.ac.uk'
     167__version__ = (1,0,0)
     168minimal_mg5amcnlo_version = (2,5,0)
     169maximal_mg5amcnlo_version = (1000,1000,1000)
     170latest_validated_version = (2,5,0)
     171}}}
    150172
    151173output.py file