# Changes between Version 2 and Version 3 of FAQ-General-15

Ignore:
Timestamp:
11/09/18 17:46:56 (6 months ago)
Comment:

--

Unmodified
Added
Removed
Modified
• ## FAQ-General-15

 v2 }}} {{{ import madgraph.various.misc as misc def remove_diag(diag): """force to have two s-channel W decaying into a specific way. Designed for interference studies where decay chain are not allowed This is designed for keeping the following diagram generate p p > j j w- w-, w- > e- ve~ from the following syntax:  p p > j j e- ve~ e- ve~ """ found_w = 0 for vertex in diag['vertices']: #misc.sprint(vertex.nice_string()) if vertex.get('id') == 0: #special final vertex continue if len(vertex['legs'])!=3: continue for i, leg in enumerate(list(vertex['legs'])): #misc.sprint(i, leg) if abs(leg['id']) != 24: continue else: break else: continue # we have a vertex with a W if i == 2: #This means a vertex A B > W or W > A B if leg['number'] > 2: # means that we have W > A B #misc.sprint(vertex.nice_string()) # check that A B are what we want if not all(oleg['state'] for oleg in vertex['legs'][:2]) : # this means not final state continue #misc.sprint([oleg['id'] for oleg in vertex['legs'][:2] ]) if set([oleg['id'] for oleg in vertex['legs'][:2] ]) == set([11,-12]): found_w +=1 else: # this means A W > B if vertex['legs'][-1].get('number') < 3: # T-channel -> continue continue else: #check that they are both final state if not vertex['legs'][-1]['state']: continue if not vertex['legs'][1 if i==0 else 0]['state']: continue other_id = [vertex['legs'][-1].get('id'), vertex['legs'][1 if i==0 else 0]['id']] if set(other_id) == set([11,-12]): found_w += 1 misc.sprint(found_w) if found_w == 2: return True else: return False }}} === running with user_filter