1 | | === Plugin idea |
2 | | |
3 | | === init file: |
| 1 | === Structure |
| 2 | |
| 3 | The idea of the plugin idea is to allow some modification of the code behavior without the need to modify the internal code. |
| 4 | Allowing an easy support of many modification in the future release of MG5aMC. |
| 5 | So far three type of modification are supported by this module: |
| 6 | 1. New output type (for LO processes) |
| 7 | 2. New cluster type |
| 8 | 3. Modification of the interface (new command/modification of the command) |
| 9 | |
| 10 | The plugin is a directory to placed inside the PLUGIN directory of MG5aMC. |
| 11 | It should at least have one file named "!__init!__.py" which should contains some minimal information (see below). |
| 12 | This file should link to other python file if needed. |
| 13 | |
| 14 | |
| 15 | === !__init!__.py file: |
| 16 | |
| 17 | The minimal information that need to be present in that file is: |
51 | | |
52 | | import helloworld as helloworld |
53 | | |
54 | | |
55 | | ## Does it define a new interface (will be avaible with ./bin/mg5_aMC --mode=maddm |
| 65 | # example: import maddm_interface as maddm_interface # local file |
| 66 | # import madgraph.various.cluster as cluster #MG5 distribution file |
| 67 | # Three types of functionality are allowed in a plugin |
| 68 | # 1. new output mode |
| 69 | # 2. new cluster support |
| 70 | # 3. new interface |
| 71 | |
| 72 | # 1. Define new output mode |
| 73 | # example: new_output = {'myformat': MYCLASS} |
| 74 | # madgraph will then allow the command "output myformat PATH" |
| 75 | # MYCLASS should inherated of the class madgraph.iolibs.export_v4.VirtualExporter |
| 76 | new_output = {} |
| 77 | |
| 78 | # 2. Define new way to handle the cluster. |
| 79 | # example new_cluster = {'mycluster': MYCLUSTERCLASS} |
| 80 | # allow "set cluster_type mycluster" in madgraph |
| 81 | # MYCLUSTERCLASS should inherated from madgraph.various.cluster.Cluster |
| 82 | new_cluster = {} |
| 83 | |
| 84 | |
| 85 | # 3. Define a new interface (allow to add/modify MG5 command) |
| 86 | # This can be activated via ./bin/mg5_aMC --mode=PLUGINNAME |
58 | | |
59 | | ## Does it define a new output mode. Need to be define |
60 | | new_output = {} |
61 | | |
62 | | ## The test/code have been validated up to this version |
63 | | latest_validated_version = '2.3.4' |
| 90 | |
| 91 | |
| 92 | ########################## CONTROL VARIABLE #################################### |
| 93 | __author__ = 'Mattelaer Olivier' |
| 94 | __email__ = 'o.p.c.mattelaer@durham.ac.uk' |
| 95 | __version__ = (1,0,0) |
| 96 | minimal_mg5amcnlo_version = (2,5,0) |
| 97 | maximal_mg5amcnlo_version = (1000,1000,1000) |
| 98 | latest_validated_version = (2,5,0) |