Package madgraph :: Package various :: Module banner
[hide private]
[frames] | no frames]

Source Code for Module madgraph.various.banner

  1  ################################################################################ 
  2  # 
  3  # Copyright (c) 2011 The MadGraph Development team and Contributors 
  4  # 
  5  # This file is a part of the MadGraph 5 project, an application which  
  6  # automatically generates Feynman diagrams and matrix elements for arbitrary 
  7  # high-energy processes in the Standard Model and beyond. 
  8  # 
  9  # It is subject to the MadGraph license which should accompany this  
 10  # distribution. 
 11  # 
 12  # For more information, please visit: http://madgraph.phys.ucl.ac.be 
 13  # 
 14  ################################################################################ 
 15  """A File for splitting""" 
 16   
 17  import sys 
 18  import re 
 19  import os 
 20   
 21  pjoin = os.path.join 
 22   
 23  try: 
 24      import madgraph.various.misc as misc 
 25      from madgraph import MG5DIR 
 26      MADEVENT = False 
 27  except: 
 28      MADEVENT = True 
 29      MEDIR = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0] 
 30      MEDIR = os.path.split(MEDIR)[0] 
 31   
 32   
 33   
 34  #dict 
179   
180   
181   
182   
183   
184 -def split_banner(banner_path, me_dir, proc_card=True):
185 """a simple way to split a banner""" 186 187 banner = Banner(banner_path) 188 banner.split(me_dir, proc_card)
189
190 -def recover_banner(results_object, level):
191 """as input we receive a gen_crossxhtml.AllResults object. 192 This define the current banner and load it 193 """ 194 try: 195 run = results_object.current['run_name'] 196 tag = results_object.current['tag'] 197 except: 198 return Banner() 199 path = results_object.path 200 banner_path = pjoin(path,'Events',run,'%s_%s_banner.txt' % (run, tag)) 201 202 if not os.path.exists(banner_path): 203 # security if the banner was remove (or program canceled before created it) 204 return Banner() 205 206 banner = Banner(banner_path) 207 208 209 210 if level == 'pythia': 211 if 'mgpythiacard' in banner: 212 del banner['mgpythiacard'] 213 if level in ['pythia','pgs','delphes']: 214 for tag in ['mgpgscard', 'mgdelphescard', 'mgdelphestrigger']: 215 if tag in banner: 216 del banner[tag] 217 return banner
218