Skip to content

Commit ccb9ff3

Browse files
authored
Adjustments for new STARlight version (#2173)
* Adjustments for new STARlight version * Kstar decay
1 parent b8289dc commit ccb9ff3

File tree

4 files changed

+48
-35
lines changed

4 files changed

+48
-35
lines changed

MC/config/PWGUD/external/generator/DecayTablesEvtGen/OPENCHARM.DEC

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,12 @@ Decay phi
4242
1.0 K+ K- VSS; #[Reconstructed PDG2011]
4343
Enddecay
4444

45+
Decay K*0
46+
1.0 K+ pi- VSS;
47+
Enddecay
48+
49+
Decay anti-K*0
50+
1.0 K- pi+ VSS;
51+
Enddecay
52+
4553
End

MC/config/PWGUD/external/generator/GeneratorStarlight.C

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ class GeneratorStarlight_class : public Generator
7777
bool Init() override
7878
{
7979
Generator::Init();
80-
80+
8181
float beam1energy = TMath::Sqrt(Double_t(projZ)/projA*targA/targZ)*eCM/2;
8282
float beam2energy = TMath::Sqrt(Double_t(projA)/projZ*targZ/targA)*eCM/2;
8383
float gamma1 = beam1energy/0.938272;
8484
float gamma2 = beam2energy/0.938272;
8585
float rapMax = 4.1 + 0.5*(TMath::ACosH(gamma2)-TMath::ACosH(gamma1));
8686
float dy = 0.01;
87-
87+
8888
const struct SLConfig {
8989
const char* name;
9090
int prod_mode;
@@ -166,14 +166,14 @@ class GeneratorStarlight_class : public Generator
166166
break;
167167
}
168168
}
169-
169+
170170
if (idx == -1) {
171171
std::cout << "STARLIGHT process "<< mSelectedConfiguration <<" is not supported" << std::endl;
172172
return false;
173173
}
174-
174+
175175
mPdgMother = slConfig[idx].pdg_mother;
176-
mDecayEvtGen = slConfig[idx].decay_EvtGen;
176+
mDecayEvtGen = slConfig[idx].decay_EvtGen;
177177

178178
unsigned int random_seed = generateRandomSeed();
179179

@@ -211,6 +211,8 @@ class GeneratorStarlight_class : public Generator
211211
if(slConfig[idx].prod_mode == 5 || slConfig[idx].prod_mode == 6 || slConfig[idx].prod_mode == 7){
212212
setParameter("MIN_GAMMA_ENERGY = 1000.0");
213213
setParameter("MAX_GAMMA_ENERGY = 600000.0");
214+
setParameter("KEEP_PHI = 1");
215+
setParameter("KEEP_KSTAR = 1");
214216
}
215217

216218
TString extraPars(mExtraParams);
@@ -221,18 +223,18 @@ class GeneratorStarlight_class : public Generator
221223
if (not mInputParameters.init()) {
222224
std::cout << "InitStarLight parameter initialization has failed" << std::endl;
223225
return false;
224-
}
225-
226+
}
227+
226228
mStarLight = new starlight;
227229
mStarLight->setInputParameters(&mInputParameters);
228230
mRandomGenerator.SetSeed(mInputParameters.randomSeed());
229-
mStarLight->setRandomGenerator(&mRandomGenerator);
230-
return mStarLight->init();
231-
231+
mStarLight->setRandomGenerator(&mRandomGenerator);
232+
return mStarLight->init();
233+
232234
};
233-
234-
bool generateEvent() override {
235-
235+
236+
bool generateEvent() override {
237+
236238
if (!mStarLight) {
237239
std::cout <<"GenerateEvent: StarLight class/object not properly constructed"<<std::endl;
238240
return false;
@@ -246,15 +248,15 @@ class GeneratorStarlight_class : public Generator
246248
mEvent = mStarLight->produceEvent();
247249
// boost event to the experiment CM frame
248250
mEvent.boost(0.5*(TMath::ACosH(mInputParameters.beam1LorentzGamma()) - TMath::ACosH(mInputParameters.beam2LorentzGamma())));
249-
250-
return true;
251-
251+
252+
return true;
253+
252254
};
253255

254256
// at importParticles we add particles to the output particle vector
255257
// according to the selected configuration
256258
bool importParticles() override
257-
{
259+
{
258260
int nVtx(0);
259261
float vtx(0), vty(0), vtz(0), vtt(0);
260262
const std::vector<vector3>* slVtx;
@@ -327,9 +329,9 @@ class GeneratorStarlight_class : public Generator
327329
//particle.Print();
328330
mParticles.push_back(particle);
329331
o2::mcutils::MCGenHelper::encodeParticleStatusAndTracking(mParticles.back(), true);
330-
}
332+
}
331333
}
332-
return true;
334+
return true;
333335
}
334336

335337
protected:
@@ -340,7 +342,7 @@ class GeneratorStarlight_class : public Generator
340342
int targZ=82;
341343

342344
private:
343-
starlight *mStarLight = 0x0;
345+
starlight *mStarLight = 0x0;
344346
inputParameters mInputParameters; // simulation input information.
345347
randomGenerator mRandomGenerator; // STARLIGHT's own random generator
346348
upcXEvent mEvent; // object holding STARlight simulated event.
@@ -350,12 +352,12 @@ class GeneratorStarlight_class : public Generator
350352
int mPdgMother = -1;
351353
bool mDecayEvtGen = 0;
352354

353-
355+
354356
};
355-
357+
356358
} // namespace eventgen
357359
} // namespace o2
358-
360+
359361

360362
FairGenerator*
361363
GeneratorStarlight(std::string configuration = "empty",float energyCM = 5020, int beam1Z = 82, int beam1A = 208, int beam2Z = 82, int beam2A = 208, std::string extrapars = "",std::string dpmjetconf = "")

MC/config/PWGUD/external/generator/GeneratorStarlightToEvtGen.C

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FairGenerator*
1818
gen->AddPdg(-15,1);
1919
}
2020
else if(configuration.find("kDpmjet") != std::string::npos){
21-
gen->SetSizePdg(11);
21+
gen->SetSizePdg(14);
2222
gen->AddPdg( 411,0);
2323
gen->AddPdg(-411,1);
2424
gen->AddPdg( 421,2);
@@ -30,6 +30,9 @@ FairGenerator*
3030
gen->AddPdg( 4122,8);
3131
gen->AddPdg(-4122,9);
3232
gen->AddPdg( 333,10);
33+
gen->AddPdg(-333,11);
34+
gen->AddPdg( 313,12);
35+
gen->AddPdg(-313,13);
3336
}
3437
else{
3538
gen->SetPolarization(1); //Transversal
@@ -38,7 +41,7 @@ FairGenerator*
3841
gen->AddPdg(100443,1);
3942
gen->AddPdg(223,2);
4043
}
41-
44+
4245
TString pathO2 = gSystem->ExpandPathName("$O2DPG_MC_CONFIG_ROOT/MC/config/PWGUD/external/generator/DecayTablesEvtGen");
4346
if (configuration.find("Psi2sToMuPi") != std::string::npos) gen->SetDecayTable(Form("%s/PSI2S.MUMUPIPI.DEC",pathO2.Data()));
4447
else if (configuration.find("Psi2sToElPi") != std::string::npos) gen->SetDecayTable(Form("%s/PSI2S.EEPIPI.DEC",pathO2.Data()));
@@ -53,6 +56,6 @@ FairGenerator*
5356
else if (configuration.find("Jpsi4Prong") != std::string::npos) gen->SetDecayTable(Form("%s/JPSI.4PRONG.DEC",pathO2.Data()));
5457
else if (configuration.find("Jpsi6Prong") != std::string::npos) gen->SetDecayTable(Form("%s/JPSI.6PRONG.DEC",pathO2.Data()));
5558
else if (configuration.find("Dpmjet") != std::string::npos) gen->SetDecayTable(Form("%s/OPENCHARM.DEC",pathO2.Data()));
56-
59+
5760
return gen;
5861
}

MC/config/PWGUD/trigger/triggerDpmjetParticle.C

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ o2::eventgen::Trigger triggerDzero(double rapidityMin = -1., double rapidityMax
1414
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
1515
return kTRUE;
1616
}
17-
return kFALSE;
17+
return kFALSE;
1818
};
1919
}
2020

@@ -45,10 +45,10 @@ o2::eventgen::Trigger triggerDstar(double rapidityMin = -1., double rapidityMax
4545
o2::eventgen::Trigger triggerPhi(double rapidityMin = -1., double rapidityMax = -1.)
4646
{
4747
return [rapidityMin, rapidityMax](const std::vector<TParticle>& particles) -> bool {
48-
for (std::vector<TParticle>::size_type i = 0; i != (particles.size()-1); i++) {
49-
if ((particles[i].GetPdgCode() == 321 && particles[i+1].GetPdgCode() == -321) || (particles[i].GetPdgCode() == -321 && particles[i+1].GetPdgCode() == 321))
50-
if ((particles[i].Eta() > rapidityMin) && (particles[i].Eta() < rapidityMax) && (particles[i+1].Eta() > rapidityMin) && (particles[i+1].Eta() < rapidityMax))
51-
return kTRUE;
48+
for (const auto& particle : particles) {
49+
if (TMath::Abs(particle.GetPdgCode()) == 333)
50+
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
51+
return kTRUE;
5252
}
5353
return kFALSE;
5454
};
@@ -57,10 +57,10 @@ o2::eventgen::Trigger triggerPhi(double rapidityMin = -1., double rapidityMax =
5757
o2::eventgen::Trigger triggerKstar(double rapidityMin = -1., double rapidityMax = -1.)
5858
{
5959
return [rapidityMin, rapidityMax](const std::vector<TParticle>& particles) -> bool {
60-
for (std::vector<TParticle>::size_type i = 0; i != (particles.size()-1); i++) {
61-
if ((particles[i].GetPdgCode() == 321 && particles[i+1].GetPdgCode() == -211) || (particles[i].GetPdgCode() == -211 && particles[i+1].GetPdgCode() == 321))
62-
if ((particles[i].Eta() > rapidityMin) && (particles[i].Eta() < rapidityMax) && (particles[i+1].Eta() > rapidityMin) && (particles[i+1].Eta() < rapidityMax))
63-
return kTRUE;
60+
for (const auto& particle : particles) {
61+
if (TMath::Abs(particle.GetPdgCode()) == 313)
62+
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
63+
return kTRUE;
6464
}
6565
return kFALSE;
6666
};

0 commit comments

Comments
 (0)