Skip to content

Commit

Permalink
Restore option to generate weighted events in AliGenPythiaPlus and ad…
Browse files Browse the repository at this point in the history
…d setting for AliPythia8
  • Loading branch information
mfasDa authored and chiarazampolli committed Apr 7, 2021
1 parent ee1868f commit a048450
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PYTHIA6/AliPythia6/AliGenPythiaPlus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ AliGenPythiaPlus::AliGenPythiaPlus():
fNev(0),
fFlavorSelect(0),
fXsection(0.),
fWeightPower(0.),
fPtHardMin(0.),
fPtHardMax(1.e4),
fYHardMin(-1.e10),
Expand Down Expand Up @@ -172,6 +173,7 @@ AliGenPythiaPlus::AliGenPythiaPlus(AliPythiaBase* pythia)
fNev(0),
fFlavorSelect(0),
fXsection(0.),
fWeightPower(0.),
fPtHardMin(0.),
fPtHardMax(1.e4),
fYHardMin(-1.e10),
Expand Down Expand Up @@ -369,7 +371,8 @@ void AliGenPythiaPlus::Init()
//
fParentWeight=1./Float_t(fNpart);
//

if (fWeightPower != 0)
fPythia->SetWeightPower(fWeightPower);

fPythia->SetPtHardRange(fPtHardMin, fPtHardMax);
fPythia->SetYHardRange(fYHardMin, fYHardMax);
Expand Down
3 changes: 3 additions & 0 deletions PYTHIA6/AliPythia6/AliGenPythiaPlus.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class AliGenPythiaPlus : public AliGenMC
virtual void SetProcess(Process_t proc = kPyCharm) {fProcess = proc;}
// Select structure function
virtual void SetStrucFunc(StrucFunc_t func = kCTEQ5L) {fStrucFunc = func;}
// Rewieght pt, hard spectrum with pT/p0^n, set power n
virtual void SetWeightPower(Float_t power = 0.) { fWeightPower = power; }
// Select pt of hard scattering
virtual void SetPtHard(Float_t ptmin = 0, Float_t ptmax = 1.e10)
{fPtHardMin = ptmin; fPtHardMax = ptmax; }
Expand Down Expand Up @@ -290,6 +292,7 @@ class AliGenPythiaPlus : public AliGenMC
Int_t fNev; //Number of events
Int_t fFlavorSelect; //Heavy Flavor Selection
Float_t fXsection; //Cross-section
Float_t fWeightPower; //power for cross section weights; 0 means no reweighting
Float_t fPtHardMin; //lower pT-hard cut
Float_t fPtHardMax; //higher pT-hard cut
Float_t fYHardMin; //lower y-hard cut
Expand Down
5 changes: 5 additions & 0 deletions PYTHIA6/AliPythia6/AliPythiaBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class AliPythiaBase : public AliRndm
virtual Int_t GetParticles(TClonesArray */*particles*/){return -1;}
virtual void PrintStatistics() {;}
virtual void EventListing() {;}
/**
* @brief Use weighted cross sections
* @param pow Weight power
*/
virtual void SetWeightPower(Double_t pow) {;}
// Treat protons as inside nuclei
virtual void SetNuclei(Int_t /*a1*/, Int_t /*a2*/) {;}
// Print particle properties
Expand Down
4 changes: 4 additions & 0 deletions PYTHIA8/AliPythia8/AliPythia8.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,10 @@ void AliPythia8::SetYHardRange(Float_t /*ymin*/, Float_t /*ymax*/)

}

void AliPythia8::SetWeightPower(Double_t pow){
ReadString("PhaseSpace:bias2Selection = on");
ReadString(Form("PhaseSpace:bias2SelectionPow = %13.3f", pow));
}

void AliPythia8::SetFragmentation(Int_t flag)
{
Expand Down
5 changes: 5 additions & 0 deletions PYTHIA8/AliPythia8/AliPythia8.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class AliPythia8 :public AliTPythia8, public AliPythiaBase
virtual Int_t GetParticles(TClonesArray *particles) {return ImportParticles(particles, "All");}
// Treat protons as inside nuclei
virtual void SetNuclei(Int_t a1, Int_t a2);
/**
* @brief Use weighted cross sections
* @param pow Weight power
*/
virtual void SetWeightPower(Double_t pow);
// Print particle properties
virtual void PrintParticles();
// Reset the decay table
Expand Down

0 comments on commit a048450

Please sign in to comment.