@@ -25,21 +25,29 @@ class GeneratorPhiResonance : public o2::eventgen::GeneratorPythia8
2525{
2626public :
2727 GeneratorPhiResonance (int resoPDG = 999999 ,
28+ int customPhiPDG = 888888 ,
2829 float ptMin = 0.0 , float ptMax = 50.0 , float ptMaxPhi = 100.0 ,
2930 float yMin = -1.0 , float yMax = 1.0 ,
3031 std ::string pythiaCfgMb = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg" ,
3132 int signalInterval = 3 )
32- : GeneratorPythia8 (), mResoPDG (resoPDG ), mPtMin (ptMin ), mPtMaxPhiPhi (ptMax ), mPtMaxPhi (ptMaxPhi ), mYMin (yMin ), mYMax (yMax ), mSignalInterval (signalInterval )
33+ : GeneratorPythia8 (), mResoPDG (resoPDG ), mCustomPhiPDG ( customPhiPDG ), mPtMin (ptMin ), mPtMaxPhiPhi (ptMax ), mPtMaxPhi (ptMaxPhi ), mYMin (yMin ), mYMax (yMax ), mSignalInterval (signalInterval )
3334 {
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" ;
3439
35- // 1 . Define Custom Signal Resonance (PDG: 999999) decay into standard Phis (333 333)
40+ // 2 . Define Custom Signal Resonance (PDG: 999999) decay into standard Phis (333 333)
3641 std ::string createReso = std ::to_string (mResoPDG ) + ":new = f2_Custom void 5 0 0 2.714 0.012 2.05 3.50 0.0" ;
3742 std ::string resoMayDecay = std ::to_string (mResoPDG ) + ":mayDecay = on" ;
3843 std ::string addResoDecay = std ::to_string (mResoPDG ) + ":addChannel = 1 1.0 0 333 333" ;
3944
4045 // Helper lambda to load custom particle definitions across ALL Pythia engines
4146 auto applyCustomParticles = [& ](Pythia8 ::Pythia & pythiaInst )
4247 {
48+ pythiaInst .readString (createCustomPhi );
49+ pythiaInst .readString (customPhiMayDecay );
50+ pythiaInst .readString (addPhiDecayKPlusKMinus );
4351 pythiaInst .readString (createReso );
4452 pythiaInst .readString (resoMayDecay );
4553 pythiaInst .readString (addResoDecay );
@@ -98,8 +106,8 @@ public:
98106 }
99107 else
100108 {
101- // Directly injected uncorrelated Phi
102- injectParticle (333 , 2 , false);
109+ // Directly injected uncorrelated Phi -> Uses Custom PDG 888888
110+ injectParticle (mCustomPhiPDG , 2 , false);
103111 }
104112
105113 // 4. Force Decay of injected particles using Pythia's Decayer
@@ -168,7 +176,7 @@ private:
168176 }
169177 else
170178 {
171- mass = mPythiaGun .particleData .mSel (pdg );
179+ mass = mPythiaGun .particleData .mSel (333 ); // Use standard phi mass for directly injected custom phi
172180 }
173181
174182 double pt ;
@@ -206,6 +214,7 @@ private:
206214
207215 int mEventCounter = 0 ;
208216 int mResoPDG ;
217+ int mCustomPhiPDG ;
209218 int mSignalInterval ;
210219 float mPtMin , mPtMaxPhiPhi , mPtMaxPhi , mYMin , mYMax ;
211220
@@ -214,7 +223,7 @@ private:
214223};
215224
216225/// Entry point for o2-sim
217- FairGenerator * generatePhiResonanceGun (int resoPDG = 999999 , 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 )
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 )
218227{
219- return new GeneratorPhiResonance (resoPDG , ptMin , ptMax , ptMaxPhi , yMin , yMax , pythiaCfgMb , signalInterval );
228+ return new GeneratorPhiResonance (resoPDG , customPhiPDG , ptMin , ptMax , ptMaxPhi , yMin , yMax , pythiaCfgMb , signalInterval );
220229}
0 commit comments