@@ -25,32 +25,26 @@ class GeneratorPhiResonance : public o2::eventgen::GeneratorPythia8
2525{
2626public :
2727 GeneratorPhiResonance (int resoPDG = 999999 ,
28- int customPhiPDG = 888888 ,
29- float ptMin = 0.0 , float ptMax = 50.0 , float ptMaxPhi = 100.0 ,
28+ float ptMin = 0.0 , float ptMax = 50.0 ,
3029 float yMin = -1.0 , float yMax = 1.0 ,
3130 std ::string pythiaCfgMb = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg" ,
32- int signalInterval = 3 )
33- : GeneratorPythia8 (), mResoPDG (resoPDG ), mCustomPhiPDG ( customPhiPDG ), mPtMin (ptMin ), mPtMaxPhiPhi (ptMax ), mPtMaxPhi ( ptMaxPhi ), mYMin (yMin ), mYMax (yMax ), mSignalInterval (signalInterval )
31+ int signalInterval = 0 )
32+ : GeneratorPythia8 (), mResoPDG (resoPDG ), mPtMin (ptMin ), mPtMaxPhiPhi (ptMax ), mYMin (yMin ), mYMax (yMax ), mSignalInterval (signalInterval )
3433 {
35- // 1. Define Custom Directly Injected Phi (PDG: 888888) with mass, width, and decay to kaons
36- std ::string createCustomPhi = std ::to_string (mCustomPhiPDG ) + ":new = custom_phi custom_phi 3 0 0 1.019461 0.004249 0.980 1.100 0.0" ;
37- std ::string customPhiMayDecay = std ::to_string (mCustomPhiPDG ) + ":mayDecay = on" ;
38- std ::string addPhiDecayKPlusKMinus = std ::to_string (mCustomPhiPDG ) + ":addChannel = 1 0.492 0 321 -321" ;
3934
40- // 2 . Define Custom Signal Resonance (PDG: 999999) decay into standard Phis (333 333)
35+ // 1 . Define Custom Signal Resonance (PDG: 999999) decay into standard Phis (333 333)
4136 std ::string createReso = std ::to_string (mResoPDG ) + ":new = f2_Custom void 5 0 0 2.714 0.012 2.05 3.50 0.0" ;
4237 std ::string resoMayDecay = std ::to_string (mResoPDG ) + ":mayDecay = on" ;
4338 std ::string addResoDecay = std ::to_string (mResoPDG ) + ":addChannel = 1 1.0 0 333 333" ;
4439
4540 // Helper lambda to load custom particle definitions across ALL Pythia engines
4641 auto applyCustomParticles = [& ](Pythia8 ::Pythia & pythiaInst )
4742 {
48- pythiaInst .readString (createCustomPhi );
49- pythiaInst .readString (customPhiMayDecay );
50- pythiaInst .readString (addPhiDecayKPlusKMinus );
5143 pythiaInst .readString (createReso );
5244 pythiaInst .readString (resoMayDecay );
5345 pythiaInst .readString (addResoDecay );
46+ pythiaInst .readString ("333:mayDecay = on" );
47+ pythiaInst .readString ("333:oneChannel = 1 1.0 0 321 -321" );
5448 };
5549
5650 // 1: Apply particle definitions to mPythia, mPythiaGun, and pythiaObjectMinimumBias
@@ -99,15 +93,10 @@ public:
9993 mPythiaGun .event .reset ();
10094
10195 // 3. Inject Signal Gun Particles into mPythiaGun
102- if (mEventCounter % mSignalInterval == 0 )
96+ if (mSignalInterval > 0 && mEventCounter % mSignalInterval == 0 )
10397 {
104- // Resonant signal -> Decays into 333 333 (Standard Phis)
105- injectParticle (mResoPDG , 1 , true);
106- }
107- else
108- {
109- // Directly injected uncorrelated Phi -> Uses Custom PDG 888888
110- injectParticle (mCustomPhiPDG , 2 , false);
98+ // Resonant signal -> Decays into 333 333
99+ injectParticle (mResoPDG , 1 );
111100 }
112101
113102 // 4. Force Decay of injected particles using Pythia's Decayer
@@ -157,7 +146,7 @@ private:
157146 mPythia .event .restorePtrs ();
158147 }
159148
160- void injectParticle (int pdg , int nParticles , bool thermalPt )
149+ void injectParticle (int pdg , int nParticles )
161150 {
162151 const double phiMass = 1.019461 ;
163152
@@ -167,27 +156,15 @@ private:
167156 const double phi = gRandom -> Uniform (0 , TMath ::TwoPi ());
168157
169158 double mass = 0.0 ;
170- if (pdg == mResoPDG )
171- {
172- do
173- {
174- mass = gRandom -> BreitWigner (2.714 , 0.012 );
175- } while (mass <= 2.0 * phiMass || mass < 2.05 || mass > 3.50 );
176- }
177- else
159+
160+ do
178161 {
179- mass = mPythiaGun . particleData . mSel ( 333 ); // Use standard phi mass for directly injected custom phi
180- }
162+ mass = gRandom -> BreitWigner ( 2.714 , 0.012 );
163+ } while ( mass <= 2.0 * phiMass || mass < 2.05 || mass > 3.50 );
181164
182165 double pt ;
183- if (thermalPt )
184- {
185- pt = gRandom -> Uniform (mPtMin , mPtMaxPhiPhi );
186- }
187- else
188- {
189- pt = gRandom -> Uniform (mPtMin , mPtMaxPhi );
190- }
166+
167+ pt = gRandom -> Uniform (mPtMin , mPtMaxPhiPhi );
191168
192169 const double px = pt * std ::cos (phi );
193170 const double py = pt * std ::sin (phi );
@@ -214,16 +191,15 @@ private:
214191
215192 int mEventCounter = 0 ;
216193 int mResoPDG ;
217- int mCustomPhiPDG ;
218194 int mSignalInterval ;
219- float mPtMin , mPtMaxPhiPhi , mPtMaxPhi , mYMin , mYMax ;
195+ float mPtMin , mPtMaxPhiPhi , mYMin , mYMax ;
220196
221197 Pythia8 ::Pythia mPythiaGun ;
222198 Pythia8 ::Pythia pythiaObjectMinimumBias ;
223199};
224200
225201/// Entry point for o2-sim
226- FairGenerator * generatePhiResonanceGun (int resoPDG = 999999 , int customPhiPDG = 888888 , float ptMin = 0.0 , float ptMax = 50.0 , float ptMaxPhi = 100.0 , float yMin = -1.0 , float yMax = 1.0 , std ::string pythiaCfgMb = "" , int signalInterval = 3 )
202+ FairGenerator * generatePhiResonanceGun (int resoPDG = 999999 , float ptMin = 0.0 , float ptMax = 50.0 , float yMin = -1.0 , float yMax = 1.0 , std ::string pythiaCfgMb = "" , int signalInterval = 0 )
227203{
228- return new GeneratorPhiResonance (resoPDG , customPhiPDG , ptMin , ptMax , ptMaxPhi , yMin , yMax , pythiaCfgMb , signalInterval );
204+ return new GeneratorPhiResonance (resoPDG , ptMin , ptMax , yMin , yMax , pythiaCfgMb , signalInterval );
229205}
0 commit comments