~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to madgraph/core/diagram_generation.py

  • Committer: olivier Mattelaer
  • Date: 2014-06-11 19:47:48 UTC
  • mfrom: (253.1.38 2.1.2)
  • mto: (253.1.70 2.1.2)
  • mto: This revision was merged to the branch mainline in revision 254.
  • Revision ID: olivier.mattelaer@uclouvain.be-20140611194748-nhxx3210gudd1qfw
merge with 2.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
558
558
                part = model.get('particle_dict')[leg.get('id')]
559
559
                try:
560
560
                    value = part.get(charge)
561
 
                except AttributeError, PhysicsObjectError:
562
 
                    value = 0
563
 
                    
 
561
                except (AttributeError, base_objects.PhysicsObject.PhysicsObjectError):
 
562
                    try:
 
563
                        value = getattr(part, charge)
 
564
                    except AttributeError:
 
565
                        value = 0
 
566
                        
564
567
                if (leg.get('id') != part['pdg_code']) != leg['state']:
565
568
                    total -= value
566
569
                else: