-
Notifications
You must be signed in to change notification settings - Fork 5
WIP: Beam remnants #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jstupak
wants to merge
22
commits into
jstupak:master
Choose a base branch
from
cwaits:beamRemnants
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ee1bcd1
changing envirnment handling
jstupak 30d04ba
bugfix
jstupak 6b2cf77
work on environment handling
jstupak 93b2fc3
bugfix
jstupak e2ca11d
bugfix
jstupak 0094e48
adding exmple amdgraph script for testing
jstupak bed2c7b
adding delphes script to generateEvents.sh
jstupak 9970339
cleaning up/debugging analysis script
jstupak c530034
bugfix
jstupak 4ab971a
bugfix
jstupak 9dd21a2
analyzeDelphes.py
jstupak 284b105
adding anther environment var
jstupak 2c8fae6
bug fixes
jstupak e0056b9
adding gitignore
jstupak 714a332
bugfix
jstupak 7f860f1
bugfix
jstupak ce5d76f
Update README.md
jstupak 6f30043
adding script for re-running analysis
jstupak 9edc104
fixed W status code bug
e4bf299
fixed bug so that hists are filled for correct particle species, adde…
8dcd7a6
took out print statements from debugging
10ca993
added cutflow histogram
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Prerequisites | ||
| *.d | ||
|
|
||
| # Compiled Object files | ||
| *.slo | ||
| *.lo | ||
| *.o | ||
| *.obj | ||
|
|
||
| # Precompiled Headers | ||
| *.gch | ||
| *.pch | ||
|
|
||
| # Compiled Dynamic libraries | ||
| *.so | ||
| *.dylib | ||
| *.dll | ||
|
|
||
| # Fortran module files | ||
| *.mod | ||
| *.smod | ||
|
|
||
| # Compiled Static libraries | ||
| *.lai | ||
| *.la | ||
| *.a | ||
| *.lib | ||
|
|
||
| # Executables | ||
| *.exe | ||
| *.out | ||
| *.app | ||
|
|
||
| # Other | ||
| *~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,227 @@ | ||
| #! /usr/bin/env python3 | ||
| from __future__ import absolute_import | ||
| from __future__ import print_function | ||
| import time | ||
| start = time.time() | ||
|
|
||
| ################################################################################ | ||
| # | ||
| # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors | ||
| # | ||
| # This file is a part of the MadGraph5_aMC@NLO project, an application which | ||
| # automatically generates Feynman diagrams and matrix elements for arbitrary | ||
| # high-energy processes in the Standard Model and beyond. | ||
| # | ||
| # It is subject to the MadGraph5_aMC@NLO license which should accompany this | ||
| # distribution. | ||
| # | ||
| # For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch | ||
| # | ||
| ################################################################################ | ||
| """This is the main executable, a simple frontend to set up the PYTHONPATH | ||
| and call immediately the command line interface scripts""" | ||
|
|
||
| import sys | ||
| if sys.version_info[1] < 7: | ||
| if sys.version_info[0] == 2: | ||
| sys.exit("MadGraph5_aMC@NLO works only with python 2.7 or python 3.7 (and later).\n"+\ | ||
| " You are currently using Python2.%s. Please use a more recent version of Python." % sys.version_info[1]) | ||
| if sys.version_info[0] == 3: | ||
| sys.exit("MadGraph5_aMC@NLO works only with python 2.7 or python 3.7 (and later).\n"+\ | ||
| " You are currently using Python 3.%i. So please upgrade your version of Python." % sys.version_info[1] +\ | ||
| " If you have python2.7 installed you need to run the code as\n"+\ | ||
| " python27 ./bin/mg5_aMC \n") | ||
|
|
||
| try: | ||
| import six | ||
| except ImportError: | ||
| message = 'madgraph requires the six module. The easiest way to install it is to run "pip%s install six --user"\n' % (sys.version_info[0] if sys.version_info[0]==3 else '') | ||
| message += 'in case of problem with pip, you can download the file at https://pypi.org/project/six/ . It has a single python file that you just need to put inside a directory of your $PYTHONPATH environment variable.' | ||
| sys.exit(message) | ||
|
|
||
| import os | ||
| import optparse | ||
|
|
||
| # Get the parent directory (mg root) of the script real path (bin) | ||
| # and add it to the current PYTHONPATH | ||
|
|
||
| root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0] | ||
| sys.path.insert(0, root_path) | ||
|
|
||
|
|
||
| # Write out nice usage message if called with -h or --help | ||
| usage = "usage: %prog [options] [FILE] " | ||
| parser = optparse.OptionParser(usage=usage) | ||
| parser.add_option("-l", "--logging", default='INFO', | ||
| help="logging level (DEBUG|INFO|WARNING|ERROR|CRITICAL) [%default]") | ||
| parser.add_option("-f", "--file", default='', | ||
| help="Use script file FILE") | ||
| parser.add_option("-d", "--mgme_dir", default='', dest = 'mgme_dir', | ||
| help="Use MG_ME directory MGME_DIR") | ||
| parser.add_option("","--web", action="store_true", default=False, dest='web', \ | ||
| help='force to be in secure mode') | ||
| parser.add_option("","--debug", action="store_true", default=False, dest='debug', \ | ||
| help='force to launch debug mode') | ||
| parser.add_option("-m", "--mode", dest="plugin", | ||
| help="Define some additional command provide by a PLUGIN") | ||
| parser.add_option("-s", "--nocaffeinate", action="store_false", default=True, dest='nosleep', | ||
| help='For mac user, forbids to use caffeinate when running with a script') | ||
| (options, args) = parser.parse_args() | ||
| if len(args) == 0: | ||
| args = '' | ||
|
|
||
| import subprocess | ||
|
|
||
| # Check if optimize mode is (and should be) activated | ||
| if __debug__ and not options.debug and \ | ||
| (not os.path.exists(os.path.join(root_path, 'bin','create_release.py')) or options.web): | ||
| os.system('%s -O -W ignore::DeprecationWarning %s' % (sys.executable, ' '.join(sys.argv))) | ||
| sys.exit() | ||
|
|
||
| import logging | ||
| import logging.config | ||
| import madgraph.interface.coloring_logging | ||
|
|
||
| if sys.version_info[0] ==2: | ||
| logging.warning("\033[91mpython2 support will be removed in last quarter 2021. If you use python2 due to issue with Python3, please report them on https://bugs.launchpad.net/mg5amcnlo\033[0m") | ||
|
|
||
|
|
||
| if ' ' in os.getcwd(): | ||
| logging.warning("\033[91mPath does contains spaces. We advise that you change your current path to avoid to have space in the path.\033[0m") | ||
|
|
||
| try: | ||
| import readline | ||
| except ImportError: | ||
| try: | ||
| import pyreadline as readline | ||
| except: | ||
| print( "For tab completion and history, install module readline.") | ||
| else: | ||
| import rlcompleter | ||
|
|
||
| if 'r261:67515' in sys.version and 'GCC 4.2.1 (Apple Inc. build 5646)' in sys.version: | ||
| readline.parse_and_bind("bind ^I rl_complete") | ||
| readline.__doc__ = 'libedit' | ||
|
|
||
| elif hasattr(readline, '__doc__'): | ||
| if 'libedit' not in readline.__doc__: | ||
| readline.parse_and_bind("tab: complete") | ||
| else: | ||
| readline.parse_and_bind("bind ^I rl_complete") | ||
| else: | ||
| readline.__doc__ = 'GNU' | ||
| readline.parse_and_bind("tab: complete") | ||
|
|
||
| # charge history file | ||
| try: | ||
| history_file = os.path.join(os.environ['HOME'], '.mg5', 'mg5history') | ||
| readline.read_history_file(history_file) | ||
| except: | ||
| pass | ||
|
|
||
| try: | ||
| import psyco | ||
| psyco.full() | ||
| except: | ||
| pass | ||
|
|
||
| if __debug__: | ||
| print( 'Running MG5 in debug mode') | ||
|
|
||
| # Set logging level according to the logging level given by options | ||
| #logging.basicConfig(level=vars(logging)[options.logging]) | ||
| try: | ||
| if __debug__ and options.logging == 'INFO': | ||
| options.logging = 'DEBUG' | ||
| if options.logging.isdigit(): | ||
| level = int(options.logging) | ||
| else: | ||
| level = eval('logging.' + options.logging) | ||
|
|
||
| logging.config.fileConfig(os.path.join(root_path, 'madgraph', 'interface', '.mg5_logging.conf')) | ||
| logging.root.setLevel(level) | ||
| logging.getLogger('madgraph').setLevel(level) | ||
| logging.getLogger('madevent').setLevel(level) | ||
| except: | ||
| pass | ||
|
|
||
| import madgraph.interface.master_interface as interface | ||
|
|
||
| if __debug__ and time.time() - start > 0.5: | ||
| print(( 'WARNING: loading of madgraph too slow!!!', time.time() - start)) | ||
|
|
||
| try: | ||
| import madgraph.various.misc as misc | ||
| misc.EasterEgg('loading') | ||
| except: | ||
| pass | ||
|
|
||
|
|
||
| if options.plugin: | ||
| if not os.path.exists(os.path.join(root_path, 'PLUGIN', options.plugin)): | ||
| print( "ERROR: %s is not present in the PLUGIN directory. Please install it first") | ||
| __import__('PLUGIN.%s' % options.plugin) | ||
| plugin = sys.modules['PLUGIN.%s' % options.plugin] | ||
| if not plugin.new_interface: | ||
| logging.warning("Plugin: %s do not define dedicated interface and should be used without the --mode options" % options.plugin) | ||
| sys.exit() | ||
| import madgraph.various.misc as misc | ||
| if not misc.is_plugin_supported(plugin): | ||
| sys.exit() | ||
| cmd_line = plugin.new_interface(mgme_dir = options.mgme_dir) | ||
| cmd_line.plugin=options.plugin | ||
| elif options.web: | ||
| cmd_line = interface.MasterCmdWeb() | ||
| else: | ||
| cmd_line = interface.MasterCmd(mgme_dir = options.mgme_dir) | ||
|
|
||
|
|
||
|
|
||
| # Call the cmd interface main loop | ||
| try: | ||
| if options.file or args: | ||
| if sys.platform == "darwin" and options.nosleep: | ||
| logging.getLogger('madgraph').warning("launching caffeinate to prevent idle sleep when MG5aMC is running. Run './bin/mg5_aMC -s' to prevent this.") | ||
| pid = os.getpid() | ||
| subprocess.Popen(['caffeinate', '-i', '-w', str(pid)]) | ||
| # They are an input file | ||
| if args: | ||
| input_file = os.path.realpath(args[0]) | ||
| else: | ||
| input_file = os.path.realpath(options.file) | ||
| if options.web: | ||
| cmd_line.debug_output = os.path.join(os.path.dirname(input_file),'generation.log') | ||
| cmd_line.use_rawinput = False | ||
| cmd_line.haspiping = False | ||
| cmd_line.run_cmd('import ' + input_file) | ||
| cmd_line.run_cmd('quit') | ||
| else: | ||
| cmd_line.use_rawinput = False | ||
| cmd_line.haspiping = False | ||
| cmd_line.run_cmd('import ' + input_file) | ||
| cmd_line.run_cmd('quit') | ||
| else: | ||
| # Interactive mode | ||
| if options.web: | ||
| if 'MADGRAPH_DATA' not in os.environ: | ||
| os.environ['MADGRAPH_DATA'] = root_path | ||
| os.environ['MADGRAPH_BASE'] = os.path.join(root_path,'input') | ||
| os.environ['REMOTE_USER'] = 'webmode' | ||
| cmd_line.cmdloop() | ||
| else: | ||
| cmd_line.cmdloop() | ||
| except KeyboardInterrupt: | ||
| print('writting history and quit on KeyboardInterrupt') | ||
| pass | ||
|
|
||
| try: | ||
| cmd_line.exec_cmd('quit all', printcmd=False) | ||
| readline.set_history_length(100) | ||
| if not os.path.exists(os.path.join(os.environ['HOME'], '.mg5')): | ||
| os.mkdir(os.path.join(os.environ['HOME'], '.mg5')) | ||
| readline.write_history_file(history_file) | ||
| except Exception as error: | ||
| pass | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,9 @@ | ||
| # aQGC | ||
| # aQGC | ||
|
|
||
| How to run: | ||
|
|
||
| ``` | ||
| lsetup "root 6.20.06-x86_64-centos7-gcc8-opt" | ||
| git clone -b cleanUp https://github.com/jstupak/aQGC.git | ||
| ./aQGC/test.sh | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want to commit this file. You should be able to
git rmit