@@ -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,15 @@ 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 );
98+ // Resonant signal -> Decays into 333 333
99+ injectParticle (mResoPDG , 1 );
106100 }
107- else
101+ else if ( mSignalInterval <= 0 )
108102 {
109- // Directly injected uncorrelated Phi -> Uses Custom PDG 888888
110- injectParticle (mCustomPhiPDG , 2 , false );
103+ // Continuous signal -> Decays into 333 333
104+ injectParticle (mResoPDG , 1 );
111105 }
112106
113107 // 4. Force Decay of injected particles using Pythia's Decayer
@@ -157,7 +151,7 @@ private:
157151 mPythia .event .restorePtrs ();
158152 }
159153
160- void injectParticle (int pdg , int nParticles , bool thermalPt )
154+ void injectParticle (int pdg , int nParticles )
161155 {
162156 const double phiMass = 1.019461 ;
163157
@@ -167,27 +161,15 @@ private:
167161 const double phi = gRandom -> Uniform (0 , TMath ::TwoPi ());
168162
169163 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
164+
165+ do
178166 {
179- mass = mPythiaGun . particleData . mSel ( 333 ); // Use standard phi mass for directly injected custom phi
180- }
167+ mass = gRandom -> BreitWigner ( 2.714 , 0.012 );
168+ } while ( mass <= 2.0 * phiMass || mass < 2.05 || mass > 3.50 );
181169
182170 double pt ;
183- if (thermalPt )
184- {
185- pt = gRandom -> Uniform (mPtMin , mPtMaxPhiPhi );
186- }
187- else
188- {
189- pt = gRandom -> Uniform (mPtMin , mPtMaxPhi );
190- }
171+
172+ pt = gRandom -> Uniform (mPtMin , mPtMaxPhiPhi );
191173
192174 const double px = pt * std ::cos (phi );
193175 const double py = pt * std ::sin (phi );
@@ -214,16 +196,15 @@ private:
214196
215197 int mEventCounter = 0 ;
216198 int mResoPDG ;
217- int mCustomPhiPDG ;
218199 int mSignalInterval ;
219- float mPtMin , mPtMaxPhiPhi , mPtMaxPhi , mYMin , mYMax ;
200+ float mPtMin , mPtMaxPhiPhi , mYMin , mYMax ;
220201
221202 Pythia8 ::Pythia mPythiaGun ;
222203 Pythia8 ::Pythia pythiaObjectMinimumBias ;
223204};
224205
225206/// 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 )
207+ 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 )
227208{
228- return new GeneratorPhiResonance (resoPDG , customPhiPDG , ptMin , ptMax , ptMaxPhi , yMin , yMax , pythiaCfgMb , signalInterval );
209+ return new GeneratorPhiResonance (resoPDG , ptMin , ptMax , yMin , yMax , pythiaCfgMb , signalInterval );
229210}
0 commit comments