~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to tests/unit_tests/core/test_helas_objects.py

merge with lp:~maddevelopers/madgraph5/use_me_tags_for_decay_chains

Show diffs side-by-side

added added

removed removed

Lines of Context:
3188
3188
            self.assert_(wf.get_with_flow('state') != old_wf.get_with_flow('state'))
3189
3189
        
3190
3190
 
 
3191
    def test_decay_chain_different_pdgs(self):
 
3192
        """Test decay chain with identical particles with different PDG
 
3193
        With the new IdentifyMETag, processes with identical s-channel particles
 
3194
        but different PDG code are not combined, to ensure that the particles
 
3195
        are correctly included in the event file.
 
3196
        """
 
3197
 
 
3198
        mypartlist = base_objects.ParticleList()
 
3199
        myinterlist = base_objects.InteractionList()
 
3200
 
 
3201
        # A electron and positron
 
3202
        mypartlist.append(base_objects.Particle({'name':'e-',
 
3203
                      'antiname':'e+',
 
3204
                      'spin':2,
 
3205
                      'color':1,
 
3206
                      'mass':'zero',
 
3207
                      'width':'zero',
 
3208
                      'texname':'e^-',
 
3209
                      'antitexname':'e^+',
 
3210
                      'line':'straight',
 
3211
                      'charge':-1.,
 
3212
                      'pdg_code':11,
 
3213
                      'propagating':True,
 
3214
                      'is_part':True,
 
3215
                      'self_antipart':False}))
 
3216
        eminus = mypartlist[len(mypartlist) - 1]
 
3217
        eplus = copy.copy(eminus)
 
3218
        eplus.set('is_part', False)
 
3219
 
 
3220
        # A E slepton and its antiparticle
 
3221
        mypartlist.append(base_objects.Particle({'name':'sl2-',
 
3222
                      'antiname':'sl2+',
 
3223
                      'spin':1,
 
3224
                      'color':1,
 
3225
                      'mass':'Msl2',
 
3226
                      'width':'Wsl2',
 
3227
                      'texname':'\tilde e^-',
 
3228
                      'antitexname':'\tilde e^+',
 
3229
                      'line':'dashed',
 
3230
                      'charge':1.,
 
3231
                      'pdg_code':1000011,
 
3232
                      'propagating':True,
 
3233
                      'is_part':True,
 
3234
                      'self_antipart':False}))
 
3235
        seminus = mypartlist[len(mypartlist) - 1]
 
3236
        seplus = copy.copy(seminus)
 
3237
        seplus.set('is_part', False)
 
3238
 
 
3239
        # A E' slepton and its antiparticle
 
3240
        mypartlist.append(base_objects.Particle({'name':'sl4-',
 
3241
                      'antiname':'sl4+',
 
3242
                      'spin':1,
 
3243
                      'color':1,
 
3244
                      'mass':'Msl2',
 
3245
                      'width':'Wsl2',
 
3246
                      'texname':'\tilde mu^-',
 
3247
                      'antitexname':'\tilde mu^+',
 
3248
                      'line':'dashed',
 
3249
                      'charge':1.,
 
3250
                      'pdg_code':1000013,
 
3251
                      'propagating':True,
 
3252
                      'is_part':True,
 
3253
                      'self_antipart':False}))
 
3254
        sepminus = mypartlist[len(mypartlist) - 1]
 
3255
        sepplus = copy.copy(sepminus)
 
3256
        sepplus.set('is_part', False)
 
3257
 
 
3258
        # A neutralino
 
3259
        mypartlist.append(base_objects.Particle({'name':'n1',
 
3260
                      'antiname':'n1',
 
3261
                      'spin':2,
 
3262
                      'color':1,
 
3263
                      'mass':'Mneu1',
 
3264
                      'width':'Wneu1',
 
3265
                      'texname':'\chi_0^1',
 
3266
                      'antitexname':'\chi_0^1',
 
3267
                      'line':'straight',
 
3268
                      'charge':0.,
 
3269
                      'pdg_code':1000022,
 
3270
                      'propagating':True,
 
3271
                      'is_part':True,
 
3272
                      'self_antipart':True}))
 
3273
        n1 = mypartlist[len(mypartlist) - 1]
 
3274
 
 
3275
        # A photon
 
3276
        mypartlist.append(base_objects.Particle({'name':'a',
 
3277
                      'antiname':'a',
 
3278
                      'spin':3,
 
3279
                      'color':1,
 
3280
                      'mass':'zero',
 
3281
                      'width':'zero',
 
3282
                      'texname':'\gamma',
 
3283
                      'antitexname':'\gamma',
 
3284
                      'line':'wavy',
 
3285
                      'charge':0.,
 
3286
                      'pdg_code':22,
 
3287
                      'propagating':True,
 
3288
                      'is_part':True,
 
3289
                      'self_antipart':True}))
 
3290
        a = mypartlist[len(mypartlist) - 1]
 
3291
 
 
3292
        # Coupling of n1 to e and se
 
3293
        myinterlist.append(base_objects.Interaction({
 
3294
                      'id': 103,
 
3295
                      'particles': base_objects.ParticleList(\
 
3296
                                            [n1, \
 
3297
                                             eminus, \
 
3298
                                             seplus]),
 
3299
                      'color': [],
 
3300
                      'lorentz':[''],
 
3301
                      'couplings':{(0, 0):'MGVX350'},
 
3302
                      'orders':{'QED':1}}))
 
3303
 
 
3304
        myinterlist.append(base_objects.Interaction({
 
3305
                      'id': 104,
 
3306
                      'particles': base_objects.ParticleList(\
 
3307
                                            [eplus, \
 
3308
                                             n1, \
 
3309
                                             seminus]),
 
3310
                      'color': [],
 
3311
                      'lorentz':[''],
 
3312
                      'couplings':{(0, 0):'MGVX494'},
 
3313
                      'orders':{'QED':1}}))
 
3314
 
 
3315
        myinterlist.append(base_objects.Interaction({
 
3316
                      'id': 105,
 
3317
                      'particles': base_objects.ParticleList(\
 
3318
                                            [n1, \
 
3319
                                             eminus, \
 
3320
                                             sepplus]),
 
3321
                      'color': [],
 
3322
                      'lorentz':[''],
 
3323
                      'couplings':{(0, 0):'MGVX350'},
 
3324
                      'orders':{'QED':1}}))
 
3325
 
 
3326
        myinterlist.append(base_objects.Interaction({
 
3327
                      'id': 106,
 
3328
                      'particles': base_objects.ParticleList(\
 
3329
                                            [eplus, \
 
3330
                                             n1, \
 
3331
                                             sepminus]),
 
3332
                      'color': [],
 
3333
                      'lorentz':[''],
 
3334
                      'couplings':{(0, 0):'MGVX494'},
 
3335
                      'orders':{'QED':1}}))
 
3336
 
 
3337
        # Coupling of e to gamma
 
3338
        myinterlist.append(base_objects.Interaction({
 
3339
                      'id': 7,
 
3340
                      'particles': base_objects.ParticleList(\
 
3341
                                            [eminus, \
 
3342
                                             eplus, \
 
3343
                                             a]),
 
3344
                      'color': [],
 
3345
                      'lorentz':[''],
 
3346
                      'couplings':{(0, 0):'MGVX12'},
 
3347
                      'orders':{'QED':1}}))
 
3348
 
 
3349
        # Coupling of sl2 to gamma
 
3350
        myinterlist.append(base_objects.Interaction({
 
3351
                      'id': 8,
 
3352
                      'particles': base_objects.ParticleList(\
 
3353
                                            [a, \
 
3354
                                             seplus, \
 
3355
                                             seminus]),
 
3356
                      'color': [],
 
3357
                      'lorentz':[''],
 
3358
                      'couplings':{(0, 0):'MGVX56'},
 
3359
                      'orders':{'QED':1}}))
 
3360
 
 
3361
        myinterlist.append(base_objects.Interaction({
 
3362
                      'id': 9,
 
3363
                      'particles': base_objects.ParticleList(\
 
3364
                                            [a, \
 
3365
                                             sepplus, \
 
3366
                                             sepminus]),
 
3367
                      'color': [],
 
3368
                      'lorentz':[''],
 
3369
                      'couplings':{(0, 0):'MGVX56'},
 
3370
                      'orders':{'QED':1}}))
 
3371
 
 
3372
        mymodel = base_objects.Model()
 
3373
        mymodel.set('particles', mypartlist)
 
3374
        mymodel.set('interactions', myinterlist)
 
3375
 
 
3376
        myleglist = base_objects.MultiLegList()
 
3377
 
 
3378
        myleglist.append(base_objects.MultiLeg({'ids':[11],
 
3379
                                         'state':False}))
 
3380
        myleglist.append(base_objects.MultiLeg({'ids':[-11],
 
3381
                                         'state':False}))
 
3382
        myleglist.append(base_objects.MultiLeg({'ids':[1000011,1000013],
 
3383
                                         'state':True}))
 
3384
        myleglist.append(base_objects.MultiLeg({'ids':[-1000011,-1000013],
 
3385
                                         'state':True}))
 
3386
 
 
3387
        mycoreproc = base_objects.ProcessDefinition({'legs':myleglist,
 
3388
                                       'model':mymodel})
 
3389
 
 
3390
        myleglist = base_objects.MultiLegList()
 
3391
 
 
3392
        myleglist.append(base_objects.MultiLeg({'ids':[1000011,1000013],
 
3393
                                         'state':False}))
 
3394
        myleglist.append(base_objects.MultiLeg({'ids':[11],
 
3395
                                         'state':True}))
 
3396
        myleglist.append(base_objects.MultiLeg({'ids':[1000022],
 
3397
                                         'state':True}))
 
3398
 
 
3399
        mydecay1 = base_objects.ProcessDefinition({'legs':myleglist,
 
3400
                                         'model':mymodel})
 
3401
 
 
3402
        myleglist = base_objects.MultiLegList()
 
3403
 
 
3404
        myleglist.append(base_objects.MultiLeg({'ids':[-1000011,-1000013],
 
3405
                                         'state':False}))
 
3406
        myleglist.append(base_objects.MultiLeg({'ids':[-11],
 
3407
                                         'state':True}))
 
3408
        myleglist.append(base_objects.MultiLeg({'ids':[1000022],
 
3409
                                         'state':True}))
 
3410
 
 
3411
 
 
3412
        mydecay2 = base_objects.ProcessDefinition({'legs':myleglist,
 
3413
                                         'model':mymodel})
 
3414
 
 
3415
        mycoreproc.set('decay_chains', base_objects.ProcessDefinitionList([\
 
3416
            mydecay1,mydecay2]))
 
3417
 
 
3418
        myamplitude = diagram_generation.DecayChainAmplitude(mycoreproc)
 
3419
 
 
3420
        matrix_element = helas_objects.HelasDecayChainProcess(myamplitude)
 
3421
 
 
3422
        matrix_elements = matrix_element.combine_decay_chain_processes()
 
3423
        
 
3424
        self.assertEqual(len(matrix_elements), 4)
 
3425
 
 
3426
 
3191
3427
    def test_equal_decay_chains(self):
3192
3428
        """Test the functions for checking equal decay chains
3193
3429
        """