35def StarlightBaseCfg(flags, name="Starlight_i", safety=1., **kwargs):
36 """
37 The main Starlight configuration fragment that sets up the Starlight_i algorithm
38 and returns a CA instance.
39 By default Starlight is set to Pb+Pb collisions.
40 """
41
42
43 kwargs.setdefault("lheOutput", False)
44
45
46
47 kwargs.setdefault("maxevents", _get_nevents(flags, safety))
48
49
50
51 gamma = 208*flags.Beam.Energy/GeV / (207.9766359 * 0.931494)
52
53
54 base_init = [
55 "beam1Z 82", "beam1A 208",
56 "beam2Z 82", "beam2A 208",
57 f"beam1Gamma {int(gamma)}",
58 f"beam2Gamma {int(gamma)}",
59 "maxW -1",
60 "minW -1",
61 "nmbWBins 400",
62 "maxRapidity 3.",
63 "nmbRapidityBins 300",
64 "accCutPt 0",
65 "accCutEta 0",
66
67 f"nmbEventsTot {kwargs["maxevents"] if kwargs["lheOutput"] else 1}",
68 "interferenceEnabled 0",
69 "interferenceStrength 1.",
70 "coherentProduction 1",
71 "incoherentFactor 1.",
72 "maxPtInterference 0.24",
73 "nmbPtBinsInterference 120",
74 "xsecMethod 0",
75 "nThreads 1",
76 "pythFullRec 0"
77 ]
78
79
80 user_init = kwargs.pop("Initialize", None)
81 kwargs["Initialize"] = GeneratorSettingsLayer(
82 source="base_initialize",
83 values=tuple(base_init),
84 precedence=GeneratorSettingsPrecedence.BASE,
85 report_context="Starlight.Initialize",
86 )
87
88
89 ca = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Generator))
90 ca.addEventAlgo(
91 CompFactory.Starlight_i(name, **kwargs)
92 )
93
94
95 if user_init:
96 ca.merge(StarlightInitializeCfg(
97 flags,
98 source="user_initialize",
99 values=user_init,
100 precedence=GeneratorSettingsPrecedence.USER,
101 name=name,
102 ))
103
104
105 from GeneratorConfig.GeneratorInfoSvcConfig import GeneratorInfoSvcCfg
106 ca.merge(GeneratorInfoSvcCfg(flags, Generators=["Starlight"]), sequenceName=EvgenSequence.Generator.value)
107
108 return ca
109
110