Merge lp:~maddevelopers/mg5amcnlo/fix_configs into lp:~madteam/mg5amcnlo/trunk

Proposed by Johan Alwall
Status: Merged
Merged at revision: 60
Proposed branch: lp:~maddevelopers/mg5amcnlo/fix_configs
Merge into: lp:~madteam/mg5amcnlo/trunk
Diff against target: 2509 lines (+2374/-33)
3 files modified
madgraph/core/helas_objects.py (+29/-32)
tests/input_files/test_8fs.pkl (+2051/-0)
tests/unit_tests/iolibs/test_export_v4.py (+294/-1)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/fix_configs
Reviewer Review Type Date Requested Status
Olivier Mattelaer Approve
Review via email: mp+44588@code.launchpad.net

Description of the change

- Fixed problem in generation of configs.inc with 8 or more final state particles
- Added the corresponding tests.

To post a comment you must log in.
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Thanks Johan!!

I didn't understand everything but it seems ok.
I suppose this should be release as 0.6.0.1
If you agree then go ahead for the release. (Otherwise I'll do tomorow)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'madgraph/core/helas_objects.py'
--- madgraph/core/helas_objects.py 2010-12-17 01:47:59 +0000
+++ madgraph/core/helas_objects.py 2010-12-23 16:04:09 +0000
@@ -890,7 +890,8 @@
890 """Returns two lists of vertices corresponding to the s- and890 """Returns two lists of vertices corresponding to the s- and
891 t-channels that can be traced from this wavefunction, ordered891 t-channels that can be traced from this wavefunction, ordered
892 from the outermost s-channel and in/down towards the highest892 from the outermost s-channel and in/down towards the highest
893 number initial state leg."""893 number initial state leg. mother_leg corresponds to self but with
894 correct leg number = min(final state mothers)."""
894895
895 schannels = base_objects.VertexList()896 schannels = base_objects.VertexList()
896 tchannels = base_objects.VertexList()897 tchannels = base_objects.VertexList()
@@ -916,15 +917,7 @@
916 # leg of a decay process. Add vertex and continue stepping917 # leg of a decay process. Add vertex and continue stepping
917 # down towards external initial state918 # down towards external initial state
918 legs = base_objects.LegList()919 legs = base_objects.LegList()
919920 mothers = final_mothers + init_mothers
920 if ninitial == 1 or init_mothers[0].get('number_external') == 2 \
921 or init_mothers[0].get('leg_state') == True:
922 # This is an s-channel or a leg on its way towards the
923 # final vertex
924 mothers = final_mothers + init_mothers
925 else:
926 # This is a t-channel leg going up towards leg number 1
927 mothers = init_mothers + final_mothers
928921
929 for mother in mothers:922 for mother in mothers:
930 legs.append(base_objects.Leg({923 legs.append(base_objects.Leg({
@@ -934,19 +927,20 @@
934 'from_group': False927 'from_group': False
935 }))928 }))
936929
937 if ninitial == 1 or init_mothers[0].get('number_external') == 2 \930 if init_mothers[0].get('number_external') == 1 and \
938 or init_mothers[0].get('leg_state') == True:931 not init_mothers[0].get('leg_state') and \
939 # For decay processes or if this is an s-channel leg932 ninitial > 1:
940 # or we are going towards external leg 2, mother leg933 # If this is t-channel going towards external leg 1,
941 # is one of the mothers934 # mother_leg is resulting wf
935 legs.append(mother_leg)
936 else:
937 # For decay processes or if init_mother is an s-channel leg
938 # or we are going towards external leg 2, mother_leg
939 # is one of the mothers (placed next-to-last)
942 legs.insert(-1, mother_leg)940 legs.insert(-1, mother_leg)
943 # Also need to switch direction of the resulting s-channel941 # Need to switch direction of the resulting s-channel
944 legs[-1].set('id', init_mothers[0].get_anti_pdg_code())942 legs[-1].set('id', init_mothers[0].get_anti_pdg_code())
945 else:943
946 # If the mother is going
947 # towards external leg 1, mother leg is resulting wf
948 legs.append(mother_leg)
949
950 # Renumber resulting leg according to minimum leg number944 # Renumber resulting leg according to minimum leg number
951 legs[-1].set('number', min([l.get('number') for l in legs[:-1]]))945 legs[-1].set('number', min([l.get('number') for l in legs[:-1]]))
952946
@@ -954,30 +948,32 @@
954 'id': self.get('interaction_id'),948 'id': self.get('interaction_id'),
955 'legs': legs})949 'legs': legs})
956950
957 # Add s- and t-channels from further down951 # Add s- and t-channels from init_mother
958 new_mother_leg = legs[-1]952 new_mother_leg = legs[-1]
959 if init_mothers[0].get('number_external') == 1:953 if init_mothers[0].get('number_external') == 1 and \
960 # If we are going towards external leg 1, mother of954 not init_mothers[0].get('leg_state') and \
961 # next vertex is legs[0]955 ninitial > 1:
962 new_mother_leg = legs[0]956 # Mother of next vertex is init_mothers[0]
957 # (next-to-last in legs)
958 new_mother_leg = legs[-2]
963959
964 mother_s, tchannels = \960 mother_s, tchannels = \
965 init_mothers[0].get_s_and_t_channels(ninitial,961 init_mothers[0].get_s_and_t_channels(ninitial,
966 new_mother_leg)962 new_mother_leg)
967 schannels.extend(mother_s)
968
969 if ninitial == 1 or init_mothers[0].get('leg_state') == True:963 if ninitial == 1 or init_mothers[0].get('leg_state') == True:
970 # This leg is s-channel964 # This vertex is s-channel
971 schannels.append(vertex)965 schannels.append(vertex)
972 elif init_mothers[0].get('number_external') == 1:966 elif init_mothers[0].get('number_external') == 1:
973 # If we are going towards external leg 1, add to967 # If init_mothers is going towards external leg 1, add
974 # t-channels, at end968 # to t-channels, at end
975 tchannels.append(vertex)969 tchannels.append(vertex)
976 else:970 else:
977 # If we are going towards external leg 2, add to971 # If init_mothers is going towards external leg 2, add to
978 # t-channels, at start972 # t-channels, at start
979 tchannels.insert(0, vertex)973 tchannels.insert(0, vertex)
980974
975 schannels.extend(mother_s)
976
981 elif len(init_mothers) == 2:977 elif len(init_mothers) == 2:
982 # This is a t-channel junction. Start with the leg going978 # This is a t-channel junction. Start with the leg going
983 # towards external particle 1, and then do external979 # towards external particle 1, and then do external
@@ -1019,6 +1015,7 @@
1019 schannels.extend(mother_s)1015 schannels.extend(mother_s)
1020 tchannels.extend(mother_t)1016 tchannels.extend(mother_t)
10211017
1018
1022 return schannels, tchannels1019 return schannels, tchannels
10231020
1024 def get_conjugate_index(self):1021 def get_conjugate_index(self):
10251022
=== added file 'tests/input_files/test_8fs.pkl'
--- tests/input_files/test_8fs.pkl 1970-01-01 00:00:00 +0000
+++ tests/input_files/test_8fs.pkl 2010-12-23 16:04:09 +0000
@@ -0,0 +1,2051 @@
1(lp0
2ccopy_reg
3_reconstructor
4p1
5(cmadgraph.core.helas_objects
6HelasDiagram
7p2
8c__builtin__
9dict
10p3
11(dp4
12S'wavefunctions'
13p5
14g1
15(cmadgraph.core.helas_objects
16HelasWavefunctionList
17p6
18c__builtin__
19list
20p7
21(lp8
22tp9
23Rp10
24sS'amplitudes'
25p11
26g1
27(cmadgraph.core.helas_objects
28HelasAmplitudeList
29p12
30g7
31(lp13
32g1
33(cmadgraph.core.helas_objects
34HelasAmplitude
35p14
36g3
37(dp15
38S'inter_color'
39p16
40g1
41(cmadgraph.core.color_algebra
42ColorString
43p17
44g7
45(lp18
46cmadgraph.core.color_algebra
47T
48p19
49(I1
50I0
51tp20
52Rp21
53atp22
54Rp23
55(dp24
56S'coeff'
57p25
58cfractions
59Fraction
60p26
61(S'1'
62p27
63tp28
64Rp29
65sS'is_imaginary'
66p30
67I00
68sS'Nc_power'
69p31
70I0
71sbsS'coupling'
72p32
73S'GC_1'
74p33
75sS'mothers'
76p34
77g1
78(g6
79g7
80(lp35
81g1
82(cmadgraph.core.helas_objects
83HelasWavefunction
84p36
85g3
86(dp37
87S'number_external'
88p38
89I6
90sS'fermionflow'
91p39
92I1
93sS'coupl_key'
94p40
95(I0
96I0
97tp41
98sS'number'
99p42
100I59
101sS'onshell'
102p43
103I00
104sS'antiparticle'
105p44
106g1
107(cmadgraph.core.base_objects
108Particle
109p45
110g3
111(dp46
112S'texname'
113p47
114S'b'
115p48
116sS'is_part'
117p49
118I01
119sS'name'
120p50
121S'b'
122p51
123sS'self_antipart'
124p52
125I00
126sS'color'
127p53
128I3
129sS'width'
130p54
131S'ZERO'
132p55
133sS'charge'
134p56
135F-0.33333333333333331
136sS'mass'
137p57
138S'MB'
139p58
140sS'antiname'
141p59
142S'b~'
143p60
144sS'line'
145p61
146S'straight'
147p62
148sS'propagating'
149p63
150I01
151sS'spin'
152p64
153I2
154sS'antitexname'
155p65
156g48
157sS'pdg_code'
158p66
159I5
160stp67
161Rp68
162sS'lorentz'
163p69
164S'FFV1'
165p70
166sS'leg_state'
167p71
168I01
169sS'orders'
170p72
171(dp73
172S'QCD'
173p74
174I1
175ssg16
176g1
177(g17
178g7
179(lp75
180g19
181(I2
182I1
183I0
184tp76
185Rp77
186atp78
187Rp79
188(dp80
189g25
190g26
191(g27
192tp81
193Rp82
194sg30
195I00
196sg31
197I0
198sbsg32
199S'GC_5'
200p83
201sS'particle'
202p84
203g1
204(g45
205g3
206(dp85
207g47
208g48
209sg63
210I01
211sg50
212g51
213sg52
214I00
215sg53
216I3
217sg54
218g55
219sg56
220F-0.33333333333333331
221sg57
222g58
223sg59
224g60
225sg61
226g62
227sg49
228I00
229sg64
230I2
231sg65
232g48
233sg66
234I5
235stp86
236Rp87
237sg34
238g1
239(g6
240g7
241(lp88
242g1
243(g36
244g3
245(dp89
246g38
247I6
248sg39
249I1
250sg40
251g41
252sg42
253I45
254sg43
255I00
256sg44
257g68
258sg69
259g70
260sg71
261I01
262sg72
263g73
264sg16
265g79
266sg32
267g83
268sg84
269g87
270sg34
271g1
272(g6
273g7
274(lp90
275g1
276(g36
277g3
278(dp91
279g38
280I6
281sg39
282I1
283sg40
284(I0
285I0
286tp92
287sg42
288I6
289sg43
290I00
291sg44
292g68
293sg69
294S''
295p93
296sg71
297I01
298sg72
299(dp94
300sg16
301Nsg32
302S'none'
303p95
304sg84
305g87
306sg34
307g1
308(g6
309g7
310(lp96
311tp97
312Rp98
313sS'decay'
314p99
315I00
316sS'state'
317p100
318S'incoming'
319p101
320sS'is_part'
321p102
322I00
323sS'pdg_codes'
324p103
325(lp104
326sS'interaction_id'
327p105
328I0
329stp106
330Rp107
331ag1
332(g36
333g3
334(dp108
335g38
336I8
337sg39
338I1
339sg40
340g92
341sg42
342I8
343sg43
344I00
345sg44
346g1
347(g45
348g3
349(dp109
350g47
351S'G'
352p110
353sg49
354I01
355sg50
356S'g'
357p111
358sg52
359I01
360sg53
361I8
362sg54
363g55
364sg56
365F0.0
366sg57
367g55
368sg59
369S'g'
370p112
371sg61
372S'curly'
373p113
374sg63
375I01
376sg64
377I3
378sg65
379g110
380sg66
381I21
382stp114
383Rp115
384sg69
385g93
386sg71
387I01
388sg72
389(dp116
390sg16
391Nsg32
392g95
393sg84
394g115
395sg34
396g1
397(g6
398g7
399(lp117
400tp118
401Rp119
402sg99
403I00
404sg100
405S'final'
406p120
407sg102
408I01
409sg103
410(lp121
411sg105
412I0
413stp122
414Rp123
415atp124
416Rp125
417sg99
418I00
419sg100
420g101
421sg102
422I00
423sg103
424(lp126
425I-5
426aI5
427aI21
428asg105
429I25
430stp127
431Rp128
432ag1
433(g36
434g3
435(dp129
436g38
437I7
438sg39
439I1
440sg40
441g92
442sg42
443I7
444sg43
445I00
446sg44
447g115
448sg69
449g93
450sg71
451I01
452sg72
453(dp130
454sg16
455Nsg32
456g95
457sg84
458g115
459sg34
460g1
461(g6
462g7
463(lp131
464tp132
465Rp133
466sg99
467I00
468sg100
469g120
470sg102
471I01
472sg103
473(lp134
474sg105
475I0
476stp135
477Rp136
478atp137
479Rp138
480sg99
481I00
482sg100
483g101
484sg102
485I00
486sg103
487(lp139
488I-5
489aI5
490aI21
491asg105
492I25
493stp140
494Rp141
495ag1
496(g36
497g3
498(dp142
499g38
500I5
501sg39
502I1
503sg40
504g92
505sg42
506I5
507sg43
508I00
509sg44
510g87
511sg69
512g93
513sg71
514I01
515sg72
516(dp143
517sg16
518Nsg32
519g95
520sg84
521g68
522sg34
523g1
524(g6
525g7
526(lp144
527tp145
528Rp146
529sg99
530I00
531sg100
532S'outgoing'
533p147
534sg102
535I01
536sg103
537(lp148
538sg105
539I0
540stp149
541Rp150
542ag1
543(g36
544g3
545(dp151
546g38
547I1
548sg39
549I1
550sg40
551(I0
552I0
553tp152
554sg42
555I129
556sg43
557I00
558sg44
559g1
560(g45
561g3
562(dp153
563g47
564S'A'
565p154
566sg49
567I01
568sg50
569S'a'
570p155
571sg52
572I01
573sg53
574I1
575sg54
576g55
577sg56
578F0.0
579sg57
580g55
581sg59
582S'a'
583p156
584sg61
585S'wavy'
586p157
587sg63
588I01
589sg64
590I3
591sg65
592g154
593sg66
594I22
595stp158
596Rp159
597sg69
598g70
599sg71
600I01
601sg72
602(dp160
603S'QED'
604p161
605I1
606ssg16
607g1
608(g17
609g7
610(lp162
611g19
612(I1
613I0
614tp163
615Rp164
616atp165
617Rp166
618(dp167
619g25
620g26
621(g27
622tp168
623Rp169
624sg30
625I00
626sg31
627I0
628sbsg32
629g33
630sg84
631g159
632sg34
633g1
634(g6
635g7
636(lp170
637g1
638(g36
639g3
640(dp171
641g38
642I1
643sg39
644I1
645sg40
646(I0
647I0
648tp172
649sg42
650I71
651sg43
652I00
653sg44
654g1
655(g45
656g3
657(dp173
658g47
659S'd'
660p174
661sg49
662I01
663sg50
664S'd'
665p175
666sg52
667I00
668sg53
669I3
670sg54
671g55
672sg56
673F-0.33333333333333331
674sg57
675g55
676sg59
677S'd~'
678p176
679sg61
680g62
681sg63
682I01
683sg64
684I2
685sg65
686g174
687sg66
688I1
689stp177
690Rp178
691sg69
692S'FFV2'
693p179
694sg71
695I01
696sg72
697(dp180
698g161
699I1
700ssg16
701g1
702(g17
703g7
704(lp181
705g19
706(I1
707I0
708tp182
709Rp183
710atp184
711Rp185
712(dp186
713g25
714g26
715(g27
716tp187
717Rp188
718sg30
719I00
720sg31
721I0
722sbsg32
723S'GC_11'
724p189
725sg84
726g1
727(g45
728g3
729(dp190
730g47
731g174
732sg63
733I01
734sg50
735g175
736sg52
737I00
738sg53
739I3
740sg54
741g55
742sg56
743F-0.33333333333333331
744sg57
745g55
746sg59
747g176
748sg61
749g62
750sg49
751I00
752sg64
753I2
754sg65
755g174
756sg66
757I1
758stp191
759Rp192
760sg34
761g1
762(g6
763g7
764(lp193
765g1
766(g36
767g3
768(dp194
769g38
770I1
771sg39
772I1
773sg40
774(I0
775I0
776tp195
777sg42
778I9
779sg43
780I00
781sg44
782g1
783(g45
784g3
785(dp196
786g47
787S'u'
788p197
789sg49
790I01
791sg50
792S'u'
793p198
794sg52
795I00
796sg53
797I3
798sg54
799g55
800sg56
801F0.66666666666666663
802sg57
803g55
804sg59
805S'u~'
806p199
807sg61
808g62
809sg63
810I01
811sg64
812I2
813sg65
814g197
815sg66
816I2
817stp200
818Rp201
819sg69
820g70
821sg71
822I01
823sg72
824g73
825sg16
826g1
827(g17
828g7
829(lp202
830g19
831(I2
832I1
833I0
834tp203
835Rp204
836atp205
837Rp206
838(dp207
839g25
840g26
841(g27
842tp208
843Rp209
844sg30
845I00
846sg31
847I0
848sbsg32
849g83
850sg84
851g1
852(g45
853g3
854(dp210
855g47
856g197
857sg63
858I01
859sg50
860g198
861sg52
862I00
863sg53
864I3
865sg54
866g55
867sg56
868F0.66666666666666663
869sg57
870g55
871sg59
872g199
873sg61
874g62
875sg49
876I00
877sg64
878I2
879sg65
880g197
881sg66
882I2
883stp211
884Rp212
885sg34
886g1
887(g6
888g7
889(lp213
890g1
891(g36
892g3
893(dp214
894g38
895I1
896sg39
897I1
898sg40
899g92
900sg42
901I1
902sg43
903I00
904sg44
905g201
906sg69
907g93
908sg71
909I00
910sg72
911(dp215
912sg16
913Nsg32
914g95
915sg84
916g212
917sg34
918g1
919(g6
920g7
921(lp216
922tp217
923Rp218
924sg99
925I00
926sg100
927g101
928sg102
929I01
930sg103
931(lp219
932sg105
933I0
934stp220
935Rp221
936ag1
937(g36
938g3
939(dp222
940g38
941I2
942sg39
943I1
944sg40
945g92
946sg42
947I2
948sg43
949I00
950sg44
951g115
952sg69
953g93
954sg71
955I00
956sg72
957(dp223
958sg16
959Nsg32
960g95
961sg84
962g115
963sg34
964g1
965(g6
966g7
967(lp224
968tp225
969Rp226
970sg99
971I00
972sg100
973S'initial'
974p227
975sg102
976I01
977sg103
978(lp228
979sg105
980I0
981stp229
982Rp230
983atp231
984Rp232
985sg99
986I00
987sg100
988g101
989sg102
990I00
991sg103
992(lp233
993I-2
994aI2
995aI21
996asg105
997I36
998stp234
999Rp235
1000ag1
1001(g36
1002g3
1003(dp236
1004g38
1005I4
1006sg39
1007I1
1008sg40
1009g92
1010sg42
1011I4
1012sg43
1013I00
1014sg44
1015g1
1016(g45
1017g3
1018(dp237
1019g47
1020S'W+'
1021p238
1022sg63
1023I01
1024sg50
1025S'w+'
1026p239
1027sg52
1028I00
1029sg53
1030I1
1031sg54
1032S'WW'
1033p240
1034sg56
1035F1.0
1036sg57
1037S'MW'
1038p241
1039sg59
1040S'w-'
1041p242
1042sg61
1043g157
1044sg49
1045I00
1046sg64
1047I3
1048sg65
1049g238
1050sg66
1051I24
1052stp243
1053Rp244
1054sg69
1055g93
1056sg71
1057I01
1058sg72
1059(dp245
1060sg16
1061Nsg32
1062g95
1063sg84
1064g1
1065(g45
1066g3
1067(dp246
1068g47
1069g238
1070sg49
1071I01
1072sg50
1073g239
1074sg52
1075I00
1076sg53
1077I1
1078sg54
1079g240
1080sg56
1081F1.0
1082sg57
1083g241
1084sg59
1085g242
1086sg61
1087g157
1088sg63
1089I01
1090sg64
1091I3
1092sg65
1093g238
1094sg66
1095I24
1096stp247
1097Rp248
1098sg34
1099g1
1100(g6
1101g7
1102(lp249
1103tp250
1104Rp251
1105sg99
1106I00
1107sg100
1108g120
1109sg102
1110I01
1111sg103
1112(lp252
1113sg105
1114I0
1115stp253
1116Rp254
1117atp255
1118Rp256
1119sg99
1120I00
1121sg100
1122g101
1123sg102
1124I00
1125sg103
1126(lp257
1127I-2
1128aI1
1129aI24
1130asg105
1131I33
1132stp258
1133Rp259
1134ag1
1135(g36
1136g3
1137(dp260
1138g38
1139I3
1140sg39
1141I1
1142sg40
1143g92
1144sg42
1145I3
1146sg43
1147I00
1148sg44
1149g192
1150sg69
1151g93
1152sg71
1153I01
1154sg72
1155(dp261
1156sg16
1157Nsg32
1158g95
1159sg84
1160g178
1161sg34
1162g1
1163(g6
1164g7
1165(lp262
1166tp263
1167Rp264
1168sg99
1169I00
1170sg100
1171g147
1172sg102
1173I01
1174sg103
1175(lp265
1176sg105
1177I0
1178stp266
1179Rp267
1180atp268
1181Rp269
1182sg99
1183I00
1184sg100
1185S'intermediate'
1186p270
1187sg102
1188I01
1189sg103
1190(lp271
1191I-1
1192aI1
1193aI22
1194asg105
1195I14
1196stp272
1197Rp273
1198atp274
1199Rp275
1200sg40
1201(I0
1202I0
1203tp276
1204sg42
1205I547
1206sg103
1207(lp277
1208I-5
1209aI5
1210aI22
1211asg69
1212g70
1213sg105
1214I16
1215sS'color_indices'
1216p278
1217(lp279
1218I0
1219aI0
1220aI0
1221aI0
1222aI0
1223aI0
1224asg72
1225g160
1226sS'fermionfactor'
1227p280
1228I-1
1229stp281
1230Rp282
1231atp283
1232Rp284
1233sg42
1234I324
1235stp285
1236Rp286
1237ag1
1238(g2
1239g3
1240(dp287
1241g5
1242g1
1243(g6
1244g7
1245(lp288
1246tp289
1247Rp290
1248sg11
1249g1
1250(g12
1251g7
1252(lp291
1253g1
1254(g14
1255g3
1256(dp292
1257g16
1258g79
1259sg32
1260g83
1261sg34
1262g1
1263(g6
1264g7
1265(lp293
1266g107
1267ag1
1268(g36
1269g3
1270(dp294
1271g38
1272I2
1273sg39
1274I1
1275sg40
1276g41
1277sg42
1278I179
1279sg43
1280I00
1281sg44
1282g87
1283sg69
1284g70
1285sg71
1286I00
1287sg72
1288g73
1289sg16
1290g79
1291sg32
1292g83
1293sg84
1294g68
1295sg34
1296g1
1297(g6
1298g7
1299(lp295
1300g150
1301ag1
1302(g36
1303g3
1304(dp296
1305g38
1306I2
1307sg39
1308I1
1309sg40
1310(I0
1311I0
1312tp297
1313sg42
1314I178
1315sg43
1316I00
1317sg44
1318g115
1319sg69
1320S'VVV1'
1321p298
1322sg71
1323I00
1324sg72
1325(dp299
1326g74
1327I1
1328ssg16
1329g1
1330(g17
1331g7
1332(lp300
1333cmadgraph.core.color_algebra
1334f
1335p301
1336(I0
1337I1
1338I2
1339tp302
1340Rp303
1341atp304
1342Rp305
1343(dp306
1344g25
1345g26
1346(g27
1347tp307
1348Rp308
1349sg30
1350I00
1351sg31
1352I0
1353sbsg32
1354S'GC_4'
1355p309
1356sg84
1357g115
1358sg34
1359g1
1360(g6
1361g7
1362(lp310
1363g230
1364ag123
1365atp311
1366Rp312
1367sg99
1368I00
1369sg100
1370g270
1371sg102
1372I01
1373sg103
1374(lp313
1375I21
1376aI21
1377aI21
1378asg105
1379I2
1380stp314
1381Rp315
1382atp316
1383Rp317
1384sg99
1385I00
1386sg100
1387g147
1388sg102
1389I01
1390sg103
1391(lp318
1392I-5
1393aI5
1394aI21
1395asg105
1396I25
1397stp319
1398Rp320
1399ag1
1400(g36
1401g3
1402(dp321
1403g38
1404I1
1405sg39
1406I1
1407sg40
1408(I0
1409I0
1410tp322
1411sg42
1412I239
1413sg43
1414I00
1415sg44
1416g115
1417sg69
1418g70
1419sg71
1420I00
1421sg72
1422g73
1423sg16
1424g1
1425(g17
1426g7
1427(lp323
1428g19
1429(I2
1430I1
1431I0
1432tp324
1433Rp325
1434atp326
1435Rp327
1436(dp328
1437g25
1438g26
1439(g27
1440tp329
1441Rp330
1442sg30
1443I00
1444sg31
1445I0
1446sbsg32
1447g83
1448sg84
1449g115
1450sg34
1451g1
1452(g6
1453g7
1454(lp331
1455g1
1456(g36
1457g3
1458(dp332
1459g38
1460I1
1461sg39
1462I1
1463sg40
1464g322
1465sg42
1466I206
1467sg43
1468I00
1469sg44
1470g178
1471sg69
1472g70
1473sg71
1474I00
1475sg72
1476g73
1477sg16
1478g327
1479sg32
1480g83
1481sg84
1482g192
1483sg34
1484g1
1485(g6
1486g7
1487(lp333
1488g1
1489(g36
1490g3
1491(dp334
1492g38
1493I1
1494sg39
1495I1
1496sg40
1497g172
1498sg42
1499I201
1500sg43
1501I00
1502sg44
1503g178
1504sg69
1505g179
1506sg71
1507I00
1508sg72
1509g180
1510sg16
1511g185
1512sg32
1513g189
1514sg84
1515g192
1516sg34
1517g1
1518(g6
1519g7
1520(lp335
1521g221
1522ag254
1523atp336
1524Rp337
1525sg99
1526I00
1527sg100
1528g101
1529sg102
1530I00
1531sg103
1532(lp338
1533I-2
1534aI1
1535aI24
1536asg105
1537I33
1538stp339
1539Rp340
1540ag136
1541atp341
1542Rp342
1543sg99
1544I00
1545sg100
1546g101
1547sg102
1548I00
1549sg103
1550(lp343
1551I-1
1552aI1
1553aI21
1554asg105
1555I23
1556stp344
1557Rp345
1558ag267
1559atp346
1560Rp347
1561sg99
1562I00
1563sg100
1564g270
1565sg102
1566I01
1567sg103
1568(lp348
1569I-1
1570aI1
1571aI21
1572asg105
1573I23
1574stp349
1575Rp350
1576atp351
1577Rp352
1578sg40
1579g41
1580sg42
1581I1573
1582sg103
1583(lp353
1584I-5
1585aI5
1586aI21
1587asg69
1588g70
1589sg105
1590I25
1591sg278
1592(lp354
1593I0
1594aI0
1595aI0
1596aI0
1597aI0
1598aI0
1599asg72
1600g73
1601sg280
1602I-1
1603stp355
1604Rp356
1605atp357
1606Rp358
1607sg42
1608I955
1609stp359
1610Rp360
1611ag1
1612(g2
1613g3
1614(dp361
1615g5
1616g1
1617(g6
1618g7
1619(lp362
1620tp363
1621Rp364
1622sg11
1623g1
1624(g12
1625g7
1626(lp365
1627g1
1628(g14
1629g3
1630(dp366
1631g16
1632g305
1633sg32
1634g309
1635sg34
1636g1
1637(g6
1638g7
1639(lp367
1640g1
1641(g36
1642g3
1643(dp368
1644g38
1645I5
1646sg39
1647I1
1648sg40
1649g297
1650sg42
1651I21
1652sg43
1653I00
1654sg44
1655g115
1656sg69
1657g298
1658sg71
1659I01
1660sg72
1661g299
1662sg16
1663g305
1664sg32
1665g309
1666sg84
1667g115
1668sg34
1669g1
1670(g6
1671g7
1672(lp369
1673g1
1674(g36
1675g3
1676(dp370
1677g38
1678I5
1679sg39
1680I1
1681sg40
1682g41
1683sg42
1684I18
1685sg43
1686I00
1687sg44
1688g115
1689sg69
1690g70
1691sg71
1692I01
1693sg72
1694g73
1695sg16
1696g79
1697sg32
1698g83
1699sg84
1700g115
1701sg34
1702g1
1703(g6
1704g7
1705(lp371
1706g107
1707ag150
1708atp372
1709Rp373
1710sg99
1711I00
1712sg100
1713g270
1714sg102
1715I01
1716sg103
1717(lp374
1718I-5
1719aI5
1720aI21
1721asg105
1722I25
1723stp375
1724Rp376
1725ag123
1726atp377
1727Rp378
1728sg99
1729I00
1730sg100
1731g270
1732sg102
1733I01
1734sg103
1735(lp379
1736I21
1737aI21
1738aI21
1739asg105
1740I2
1741stp380
1742Rp381
1743ag136
1744ag1
1745(g36
1746g3
1747(dp382
1748g38
1749I1
1750sg39
1751I1
1752sg40
1753g322
1754sg42
1755I298
1756sg43
1757I00
1758sg44
1759g115
1760sg69
1761g70
1762sg71
1763I01
1764sg72
1765g73
1766sg16
1767g327
1768sg32
1769g83
1770sg84
1771g115
1772sg34
1773g1
1774(g6
1775g7
1776(lp383
1777g1
1778(g36
1779g3
1780(dp384
1781g38
1782I1
1783sg39
1784I1
1785sg40
1786g322
1787sg42
1788I290
1789sg43
1790I00
1791sg44
1792g178
1793sg69
1794g70
1795sg71
1796I01
1797sg72
1798g73
1799sg16
1800g327
1801sg32
1802g83
1803sg84
1804g192
1805sg34
1806g1
1807(g6
1808g7
1809(lp385
1810g340
1811ag230
1812atp386
1813Rp387
1814sg99
1815I00
1816sg100
1817g101
1818sg102
1819I00
1820sg103
1821(lp388
1822I-1
1823aI1
1824aI21
1825asg105
1826I23
1827stp389
1828Rp390
1829ag267
1830atp391
1831Rp392
1832sg99
1833I00
1834sg100
1835g270
1836sg102
1837I01
1838sg103
1839(lp393
1840I-1
1841aI1
1842aI21
1843asg105
1844I23
1845stp394
1846Rp395
1847atp396
1848Rp397
1849sg40
1850g297
1851sg42
1852I1880
1853sg103
1854(lp398
1855I21
1856aI21
1857aI21
1858asg69
1859g298
1860sg105
1861I2
1862sg278
1863(lp399
1864I0
1865aI0
1866aI0
1867aI0
1868aI0
1869aI0
1870asg72
1871g299
1872sg280
1873I-1
1874stp400
1875Rp401
1876atp402
1877Rp403
1878sg42
1879I1124
1880stp404
1881Rp405
1882ag1
1883(g2
1884g3
1885(dp406
1886g5
1887g1
1888(g6
1889g7
1890(lp407
1891tp408
1892Rp409
1893sg11
1894g1
1895(g12
1896g7
1897(lp410
1898g1
1899(g14
1900g3
1901(dp411
1902g16
1903g327
1904sg32
1905g83
1906sg34
1907g1
1908(g6
1909g7
1910(lp412
1911g1
1912(g36
1913g3
1914(dp413
1915g38
1916I1
1917sg39
1918I1
1919sg40
1920g322
1921sg42
1922I238
1923sg43
1924I00
1925sg44
1926g178
1927sg69
1928g70
1929sg71
1930I00
1931sg72
1932g73
1933sg16
1934g327
1935sg32
1936g83
1937sg84
1938g192
1939sg34
1940g1
1941(g6
1942g7
1943(lp414
1944g345
1945ag123
1946atp415
1947Rp416
1948sg99
1949I00
1950sg100
1951g101
1952sg102
1953I00
1954sg103
1955(lp417
1956I-1
1957aI1
1958aI21
1959asg105
1960I23
1961stp418
1962Rp419
1963ag267
1964ag1
1965(g36
1966g3
1967(dp420
1968g38
1969I2
1970sg39
1971I1
1972sg40
1973g297
1974sg42
1975I292
1976sg43
1977I00
1978sg44
1979g115
1980sg69
1981g298
1982sg71
1983I00
1984sg72
1985g299
1986sg16
1987g305
1988sg32
1989g309
1990sg84
1991g115
1992sg34
1993g1
1994(g6
1995g7
1996(lp421
1997g230
1998ag376
1999atp422
2000Rp423
2001sg99
2002I00
2003sg100
2004g270
2005sg102
2006I01
2007sg103
2008(lp424
2009I21
2010aI21
2011aI21
2012asg105
2013I2
2014stp425
2015Rp426
2016atp427
2017Rp428
2018sg40
2019g322
2020sg42
2021I1910
2022sg103
2023(lp429
2024I-1
2025aI1
2026aI21
2027asg69
2028g70
2029sg105
2030I23
2031sg278
2032(lp430
2033I0
2034aI0
2035aI0
2036aI0
2037aI0
2038aI0
2039asg72
2040g73
2041sg280
2042I-1
2043stp431
2044Rp432
2045atp433
2046Rp434
2047sg42
2048I1140
2049stp435
2050Rp436
2051a.
0\ No newline at end of file2052\ No newline at end of file
12053
=== modified file 'tests/unit_tests/iolibs/test_export_v4.py'
--- tests/unit_tests/iolibs/test_export_v4.py 2010-12-17 01:47:59 +0000
+++ tests/unit_tests/iolibs/test_export_v4.py 2010-12-23 16:04:09 +0000
@@ -19,6 +19,10 @@
19import copy19import copy
20import fractions20import fractions
21import os 21import os
22import sys
23
24root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0]
25sys.path.append(os.path.join(root_path, os.path.pardir, os.path.pardir))
2226
23import tests.unit_tests as unittest27import tests.unit_tests as unittest
2428
@@ -26,6 +30,7 @@
26import madgraph.iolibs.export_v4 as export_v430import madgraph.iolibs.export_v4 as export_v4
27import madgraph.iolibs.file_writers as writers31import madgraph.iolibs.file_writers as writers
28import madgraph.iolibs.helas_call_writers as helas_call_writers32import madgraph.iolibs.helas_call_writers as helas_call_writers
33import madgraph.iolibs.save_load_object as save_load_object
29import madgraph.core.base_objects as base_objects34import madgraph.core.base_objects as base_objects
30import madgraph.core.helas_objects as helas_objects35import madgraph.core.helas_objects as helas_objects
31import madgraph.core.diagram_generation as diagram_generation36import madgraph.core.diagram_generation as diagram_generation
@@ -36,6 +41,9 @@
36import tests.unit_tests.iolibs.test_helas_call_writers as \41import tests.unit_tests.iolibs.test_helas_call_writers as \
37 test_helas_call_writers42 test_helas_call_writers
3843
44_file_path = os.path.dirname(os.path.realpath(__file__))
45_input_file_path = os.path.join(_file_path, os.path.pardir, os.path.pardir,
46 'input_files')
39#===============================================================================47#===============================================================================
40# IOImportV4Test48# IOImportV4Test
41#===============================================================================49#===============================================================================
@@ -4466,7 +4474,7 @@
4466 self.assertEqual(result[i], goal_string[i])4474 self.assertEqual(result[i], goal_string[i])
44674475
4468 def test_configs_ug_ttxz(self):4476 def test_configs_ug_ttxz(self):
4469 """Test config.inc which previously failed.4477 """Test configs.inc which previously failed.
4470 """4478 """
44714479
4472 mypartlist = base_objects.ParticleList()4480 mypartlist = base_objects.ParticleList()
@@ -4800,6 +4808,247 @@
4800 POW(-3,10) = 14808 POW(-3,10) = 1
4801""")4809""")
4802 4810
4811 def test_configs_long_decay(self):
4812 """Test configs.inc which previously failed.
4813 """
4814
4815 mypartlist = base_objects.ParticleList()
4816 myinterlist = base_objects.InteractionList()
4817
4818 # b and t quarks
4819 mypartlist.append(base_objects.Particle({'name':'b',
4820 'antiname':'b~',
4821 'spin':2,
4822 'color':3,
4823 'mass':'zero',
4824 'width':'zero',
4825 'texname':'b',
4826 'antitexname':'\bar b',
4827 'line':'straight',
4828 'charge':-1. / 3.,
4829 'pdg_code':5,
4830 'propagating':True,
4831 'is_part':True,
4832 'self_antipart':False}))
4833 b = mypartlist[len(mypartlist) - 1]
4834 antib = copy.copy(b)
4835 antib.set('is_part', False)
4836
4837 mypartlist.append(base_objects.Particle({'name':'t',
4838 'antiname':'t~',
4839 'spin':2,
4840 'color':3,
4841 'mass':'MT',
4842 'width':'WT',
4843 'texname':'y',
4844 'antitexname':'\bar t',
4845 'line':'straight',
4846 'charge':2. / 3.,
4847 'pdg_code':6,
4848 'propagating':True,
4849 'is_part':True,
4850 'self_antipart':False}))
4851 t = mypartlist[len(mypartlist) - 1]
4852 antit = copy.copy(t)
4853 antit.set('is_part', False)
4854
4855 # A w
4856 mypartlist.append(base_objects.Particle({'name':'w+',
4857 'antiname':'w+',
4858 'spin':3,
4859 'mass':'wmass',
4860 'width':'wwidth',
4861 'texname':'\gamma',
4862 'antitexname':'\gamma',
4863 'line':'wavy',
4864 'charge':1.,
4865 'pdg_code':24,
4866 'propagating':True,
4867 'is_part':True,
4868 'self_antipart':True}))
4869 wplus = mypartlist[len(mypartlist) - 1]
4870 wminus = copy.copy(wplus)
4871 wplus.set('is_part', False)
4872
4873 # A gluon
4874 mypartlist.append(base_objects.Particle({'name': 'g',
4875 'antiname': 'g',
4876 'spin': 3,
4877 'color': 8,
4878 'charge': 0.00,
4879 'mass': 'ZERO',
4880 'width': 'ZERO',
4881 'pdg_code': 21,
4882 'texname': '_',
4883 'antitexname': '_',
4884 'line': 'curly',
4885 'propagating': True,
4886 'is_part': True,
4887 'self_antipart': True}))
4888
4889 g = mypartlist[len(mypartlist) - 1]
4890
4891 # t b w couplings
4892 myinterlist.append(base_objects.Interaction({
4893 'id': 1,
4894 'particles': base_objects.ParticleList(\
4895 [t, \
4896 antib, \
4897 wminus]),
4898 'color': [color.ColorString([color.T(0, 1)])],
4899 'lorentz':['L1'],
4900 'couplings':{(0,0):'GC_23'},
4901 'orders':{'QED':1}}))
4902
4903 myinterlist.append(base_objects.Interaction({
4904 'id': 2,
4905 'particles': base_objects.ParticleList(\
4906 [antit, \
4907 b, \
4908 wplus]),
4909 'color': [color.ColorString([color.T(0, 1)])],
4910 'lorentz':['L1'],
4911 'couplings':{(0,0):'GC_23'},
4912 'orders':{'QED':1}}))
4913
4914 # Gluon couplings to quarks
4915 myinterlist.append(base_objects.Interaction({
4916 'id': 3,
4917 'particles': base_objects.ParticleList(\
4918 [antib, \
4919 b, \
4920 g]),
4921 'color': [color.ColorString([color.T(2, 1, 0)])],
4922 'lorentz':[''],
4923 'couplings':{(0, 0):'GG'},
4924 'orders':{'QCD':1}}))
4925
4926 myinterlist.append(base_objects.Interaction({
4927 'id': 4,
4928 'particles': base_objects.ParticleList(\
4929 [antit, \
4930 t, \
4931 g]),
4932 'color': [color.ColorString([color.T(2, 1, 0)])],
4933 'lorentz':[''],
4934 'couplings':{(0, 0):'GG'},
4935 'orders':{'QCD':1}}))
4936
4937 mymodel = base_objects.Model()
4938 mymodel.set('particles', mypartlist)
4939 mymodel.set('interactions', myinterlist)
4940
4941 myleglist = base_objects.LegList()
4942
4943 myleglist.append(base_objects.Leg({'id':6,
4944 'state':False}))
4945 myleglist.append(base_objects.Leg({'id':21}))
4946 myleglist.append(base_objects.Leg({'id':5}))
4947 myleglist.append(base_objects.Leg({'id':24}))
4948 myleglist.append(base_objects.Leg({'id':21}))
4949
4950 myproc = base_objects.Process({'legs':myleglist,
4951 'model':mymodel})
4952 myamplitude = diagram_generation.Amplitude({'process': myproc})
4953
4954 me = helas_objects.HelasMatrixElement(myamplitude,
4955 gen_color=False)
4956
4957 myfortranmodel = helas_call_writers.FortranHelasCallWriter(mymodel)
4958 writer = writers.FortranWriter(self.give_pos('test'))
4959
4960 # Test configs file
4961 nconfig, s_and_t_channels = export_v4.write_configs_file(writer,
4962 me,
4963 myfortranmodel)
4964 writer.close()
4965
4966 self.assertFileContains('test',
4967"""C Diagram 1, Amplitude 1
4968 DATA MAPCONFIG(1)/1/
4969 DATA (IFOREST(I,-1,1),I=1,2)/3,2/
4970 DATA SPROP(-1,1)/5/
4971 DATA (IFOREST(I,-2,1),I=1,2)/4,-1/
4972 DATA SPROP(-2,1)/6/
4973 DATA (IFOREST(I,-3,1),I=1,2)/5,-2/
4974 DATA SPROP(-3,1)/6/
4975C Diagram 2, Amplitude 2
4976 DATA MAPCONFIG(2)/2/
4977 DATA (IFOREST(I,-1,2),I=1,2)/3,2/
4978 DATA SPROP(-1,2)/5/
4979 DATA (IFOREST(I,-2,2),I=1,2)/5,-1/
4980 DATA SPROP(-2,2)/5/
4981 DATA (IFOREST(I,-3,2),I=1,2)/4,-2/
4982 DATA SPROP(-3,2)/6/
4983C Diagram 3, Amplitude 3
4984 DATA MAPCONFIG(3)/3/
4985 DATA (IFOREST(I,-1,3),I=1,2)/4,3/
4986 DATA SPROP(-1,3)/6/
4987 DATA (IFOREST(I,-2,3),I=1,2)/-1,2/
4988 DATA SPROP(-2,3)/6/
4989 DATA (IFOREST(I,-3,3),I=1,2)/5,-2/
4990 DATA SPROP(-3,3)/6/
4991C Diagram 4, Amplitude 4
4992 DATA MAPCONFIG(4)/4/
4993 DATA (IFOREST(I,-1,4),I=1,2)/4,3/
4994 DATA SPROP(-1,4)/6/
4995 DATA (IFOREST(I,-2,4),I=1,2)/5,-1/
4996 DATA SPROP(-2,4)/6/
4997 DATA (IFOREST(I,-3,4),I=1,2)/-2,2/
4998 DATA SPROP(-3,4)/6/
4999C Diagram 5, Amplitude 5
5000 DATA MAPCONFIG(5)/5/
5001 DATA (IFOREST(I,-1,5),I=1,2)/5,3/
5002 DATA SPROP(-1,5)/5/
5003 DATA (IFOREST(I,-2,5),I=1,2)/-1,2/
5004 DATA SPROP(-2,5)/5/
5005 DATA (IFOREST(I,-3,5),I=1,2)/4,-2/
5006 DATA SPROP(-3,5)/6/
5007C Diagram 6, Amplitude 6
5008 DATA MAPCONFIG(6)/6/
5009 DATA (IFOREST(I,-1,6),I=1,2)/5,3/
5010 DATA SPROP(-1,6)/5/
5011 DATA (IFOREST(I,-2,6),I=1,2)/4,-1/
5012 DATA SPROP(-2,6)/6/
5013 DATA (IFOREST(I,-3,6),I=1,2)/-2,2/
5014 DATA SPROP(-3,6)/6/
5015C Number of configs
5016 DATA MAPCONFIG(0)/6/
5017""")
5018
5019 def test_configs_8fs(self):
5020 """Test configs.inc for 8fs process which previously failed.
5021 """
5022
5023 diagrams = save_load_object.load_from_file(\
5024 os.path.join(_input_file_path,
5025 'test_8fs.pkl'))
5026
5027 goal_schannels = [[[8, 6, -1], [7, -1, -2], [-2, 5, -3],
5028 [-3, 3, -4], [4, -4, -5]],
5029 [],
5030 [[6, 5, -1], [8, -1, -2], [7, -2, -3], [-3, 3, -4]],
5031 [[6, 5, -1]]]
5032 goal_tchannels = [[[1, -5, -6]],
5033 [[1, 4, -1], [-1, 7, -2], [-2, 3, -3],
5034 [-3, 6, -4], [-4, 5, -5], [-5, 8, -6]],
5035 [[1, 4, -5], [-5, -4, -6]],
5036 [[1, 4, -2], [-2, 7, -3], [-3, 8, -4],
5037 [-4, 3, -5], [-5, -1, -6]]]
5038
5039
5040 for (idiag, diagram) in enumerate(diagrams):
5041
5042 schannels, tchannels = diagram.get('amplitudes')[0].\
5043 get_s_and_t_channels(2)
5044
5045 self.assertEqual([[l.get('number') for l in v.get('legs')] for v \
5046 in schannels],
5047 goal_schannels[idiag])
5048 self.assertEqual([[l.get('number') for l in v.get('legs')] for v \
5049 in tchannels],
5050 goal_tchannels[idiag])
5051
4803class AlohaFortranWriterTest(unittest.TestCase):5052class AlohaFortranWriterTest(unittest.TestCase):
4804 """ A basic test to see if the Aloha Fortran Writter is working """5053 """ A basic test to see if the Aloha Fortran Writter is working """
4805 5054
@@ -4851,3 +5100,47 @@
4851 for i in range(len(split_sol)):5100 for i in range(len(split_sol)):
4852 self.assertEqual(split_sol[i]+'\n', textfile.readline())5101 self.assertEqual(split_sol[i]+'\n', textfile.readline())
48535102
5103if __name__ == '__main__':
5104 """Write out pkl file with helas diagram for test_configs_8fs
5105 """
5106
5107 import models.import_ufo
5108 mymodel = models.import_ufo.import_model('sm')
5109
5110 myleglist = base_objects.LegList()
5111
5112 myleglist.append(base_objects.Leg({'id':2,
5113 'state':False}))
5114 myleglist.append(base_objects.Leg({'id':21,
5115 'state':False}))
5116 myleglist.append(base_objects.Leg({'id':1}))
5117 myleglist.append(base_objects.Leg({'id':24}))
5118 myleglist.append(base_objects.Leg({'id':5}))
5119 myleglist.append(base_objects.Leg({'id':-5}))
5120 myleglist.append(base_objects.Leg({'id':21}))
5121 myleglist.append(base_objects.Leg({'id':21}))
5122
5123 myproc = base_objects.Process({'legs':myleglist,
5124 'model':mymodel})
5125 myamplitude = diagram_generation.Amplitude({'process': myproc})
5126
5127 me = helas_objects.HelasMatrixElement(myamplitude,
5128 gen_color=False)
5129
5130 import madgraph.iolibs.drawing_eps as draw
5131 filename = os.path.join('diagrams_' + \
5132 myamplitude.get('process').shell_string() + ".eps")
5133 plot = draw.MultiEpsDiagramDrawer(myamplitude.get('diagrams'),
5134 filename,
5135 model=mymodel,
5136 amplitude='',
5137 legend=myamplitude.get('process').input_string())
5138
5139 plot.draw()
5140
5141
5142
5143 me = save_load_object.save_to_file(\
5144 os.path.join(_input_file_path, 'test_8fs.pkl'),
5145 [me.get('diagrams')[323], me.get('diagrams')[954],
5146 me.get('diagrams')[1123], me.get('diagrams')[1139]])

Subscribers

People subscribed via source and target branches