Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,12 @@ Decay phi
1.0 K+ K- VSS; #[Reconstructed PDG2011]
Enddecay

Decay K*0
1.0 K+ pi- VSS;
Enddecay

Decay anti-K*0
1.0 K- pi+ VSS;
Enddecay

End
48 changes: 25 additions & 23 deletions MC/config/PWGUD/external/generator/GeneratorStarlight.C
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ class GeneratorStarlight_class : public Generator
bool Init() override
{
Generator::Init();

float beam1energy = TMath::Sqrt(Double_t(projZ)/projA*targA/targZ)*eCM/2;
float beam2energy = TMath::Sqrt(Double_t(projA)/projZ*targZ/targA)*eCM/2;
float gamma1 = beam1energy/0.938272;
float gamma2 = beam2energy/0.938272;
float rapMax = 4.1 + 0.5*(TMath::ACosH(gamma2)-TMath::ACosH(gamma1));
float dy = 0.01;

const struct SLConfig {
const char* name;
int prod_mode;
Expand Down Expand Up @@ -166,14 +166,14 @@ class GeneratorStarlight_class : public Generator
break;
}
}

if (idx == -1) {
std::cout << "STARLIGHT process "<< mSelectedConfiguration <<" is not supported" << std::endl;
return false;
}

mPdgMother = slConfig[idx].pdg_mother;
mDecayEvtGen = slConfig[idx].decay_EvtGen;
mDecayEvtGen = slConfig[idx].decay_EvtGen;

unsigned int random_seed = generateRandomSeed();

Expand Down Expand Up @@ -211,6 +211,8 @@ class GeneratorStarlight_class : public Generator
if(slConfig[idx].prod_mode == 5 || slConfig[idx].prod_mode == 6 || slConfig[idx].prod_mode == 7){
setParameter("MIN_GAMMA_ENERGY = 1000.0");
setParameter("MAX_GAMMA_ENERGY = 600000.0");
setParameter("KEEP_PHI = 1");
setParameter("KEEP_KSTAR = 1");
}

TString extraPars(mExtraParams);
Expand All @@ -221,18 +223,18 @@ class GeneratorStarlight_class : public Generator
if (not mInputParameters.init()) {
std::cout << "InitStarLight parameter initialization has failed" << std::endl;
return false;
}
}

mStarLight = new starlight;
mStarLight->setInputParameters(&mInputParameters);
mRandomGenerator.SetSeed(mInputParameters.randomSeed());
mStarLight->setRandomGenerator(&mRandomGenerator);
return mStarLight->init();
mStarLight->setRandomGenerator(&mRandomGenerator);
return mStarLight->init();

};
bool generateEvent() override {

bool generateEvent() override {

if (!mStarLight) {
std::cout <<"GenerateEvent: StarLight class/object not properly constructed"<<std::endl;
return false;
Expand All @@ -246,15 +248,15 @@ class GeneratorStarlight_class : public Generator
mEvent = mStarLight->produceEvent();
// boost event to the experiment CM frame
mEvent.boost(0.5*(TMath::ACosH(mInputParameters.beam1LorentzGamma()) - TMath::ACosH(mInputParameters.beam2LorentzGamma())));
return true;

return true;

};

// at importParticles we add particles to the output particle vector
// according to the selected configuration
bool importParticles() override
{
{
int nVtx(0);
float vtx(0), vty(0), vtz(0), vtt(0);
const std::vector<vector3>* slVtx;
Expand Down Expand Up @@ -327,9 +329,9 @@ class GeneratorStarlight_class : public Generator
//particle.Print();
mParticles.push_back(particle);
o2::mcutils::MCGenHelper::encodeParticleStatusAndTracking(mParticles.back(), true);
}
}
}
return true;
return true;
}

protected:
Expand All @@ -340,7 +342,7 @@ class GeneratorStarlight_class : public Generator
int targZ=82;

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


};

} // namespace eventgen
} // namespace o2


FairGenerator*
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 = "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FairGenerator*
gen->AddPdg(-15,1);
}
else if(configuration.find("kDpmjet") != std::string::npos){
gen->SetSizePdg(11);
gen->SetSizePdg(14);
gen->AddPdg( 411,0);
gen->AddPdg(-411,1);
gen->AddPdg( 421,2);
Expand All @@ -30,6 +30,9 @@ FairGenerator*
gen->AddPdg( 4122,8);
gen->AddPdg(-4122,9);
gen->AddPdg( 333,10);
gen->AddPdg(-333,11);
gen->AddPdg( 313,12);
gen->AddPdg(-313,13);
}
else{
gen->SetPolarization(1); //Transversal
Expand All @@ -38,7 +41,7 @@ FairGenerator*
gen->AddPdg(100443,1);
gen->AddPdg(223,2);
}

TString pathO2 = gSystem->ExpandPathName("$O2DPG_MC_CONFIG_ROOT/MC/config/PWGUD/external/generator/DecayTablesEvtGen");
if (configuration.find("Psi2sToMuPi") != std::string::npos) gen->SetDecayTable(Form("%s/PSI2S.MUMUPIPI.DEC",pathO2.Data()));
else if (configuration.find("Psi2sToElPi") != std::string::npos) gen->SetDecayTable(Form("%s/PSI2S.EEPIPI.DEC",pathO2.Data()));
Expand All @@ -53,6 +56,6 @@ FairGenerator*
else if (configuration.find("Jpsi4Prong") != std::string::npos) gen->SetDecayTable(Form("%s/JPSI.4PRONG.DEC",pathO2.Data()));
else if (configuration.find("Jpsi6Prong") != std::string::npos) gen->SetDecayTable(Form("%s/JPSI.6PRONG.DEC",pathO2.Data()));
else if (configuration.find("Dpmjet") != std::string::npos) gen->SetDecayTable(Form("%s/OPENCHARM.DEC",pathO2.Data()));

return gen;
}
18 changes: 9 additions & 9 deletions MC/config/PWGUD/trigger/triggerDpmjetParticle.C
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ o2::eventgen::Trigger triggerDzero(double rapidityMin = -1., double rapidityMax
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
return kTRUE;
}
return kFALSE;
return kFALSE;
};
}

Expand Down Expand Up @@ -45,10 +45,10 @@ o2::eventgen::Trigger triggerDstar(double rapidityMin = -1., double rapidityMax
o2::eventgen::Trigger triggerPhi(double rapidityMin = -1., double rapidityMax = -1.)
{
return [rapidityMin, rapidityMax](const std::vector<TParticle>& particles) -> bool {
for (std::vector<TParticle>::size_type i = 0; i != (particles.size()-1); i++) {
if ((particles[i].GetPdgCode() == 321 && particles[i+1].GetPdgCode() == -321) || (particles[i].GetPdgCode() == -321 && particles[i+1].GetPdgCode() == 321))
if ((particles[i].Eta() > rapidityMin) && (particles[i].Eta() < rapidityMax) && (particles[i+1].Eta() > rapidityMin) && (particles[i+1].Eta() < rapidityMax))
return kTRUE;
for (const auto& particle : particles) {
if (TMath::Abs(particle.GetPdgCode()) == 333)
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
return kTRUE;
}
return kFALSE;
};
Expand All @@ -57,10 +57,10 @@ o2::eventgen::Trigger triggerPhi(double rapidityMin = -1., double rapidityMax =
o2::eventgen::Trigger triggerKstar(double rapidityMin = -1., double rapidityMax = -1.)
{
return [rapidityMin, rapidityMax](const std::vector<TParticle>& particles) -> bool {
for (std::vector<TParticle>::size_type i = 0; i != (particles.size()-1); i++) {
if ((particles[i].GetPdgCode() == 321 && particles[i+1].GetPdgCode() == -211) || (particles[i].GetPdgCode() == -211 && particles[i+1].GetPdgCode() == 321))
if ((particles[i].Eta() > rapidityMin) && (particles[i].Eta() < rapidityMax) && (particles[i+1].Eta() > rapidityMin) && (particles[i+1].Eta() < rapidityMax))
return kTRUE;
for (const auto& particle : particles) {
if (TMath::Abs(particle.GetPdgCode()) == 313)
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
return kTRUE;
}
return kFALSE;
};
Expand Down