Skip to content

Commit

Permalink
add flat pthat option
Browse files Browse the repository at this point in the history
  • Loading branch information
mverwe committed Jun 21, 2023
1 parent ed2a77c commit 8067041
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 10 additions & 2 deletions include/pythiaEvent.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ private :
std::vector<fastjet::PseudoJet> partons;

public :
pythiaEvent(double pthat = 120., unsigned int tune = 14, double rapMin = -3., double rapMax = 3., bool partonLevel = false, bool vinciaShower = false);
pythiaEvent(double pthat = 120., unsigned int tune = 14, double rapMin = -3., double rapMax = 3., bool partonLevel = false, bool vinciaShower = false, bool flatPtHat = false);
std::vector<fastjet::PseudoJet> createPythiaEvent();

std::vector<fastjet::PseudoJet> getPartonList() const { return partons; }

void getStat() {pythia.stat();}
double getWeight() {return pythia.info.weight();}
double getPtHat() {return pythia.info.pTHat();}

};

pythiaEvent::pythiaEvent(double pthat, unsigned int tune, double rapMin, double rapMax, bool partonLevel, bool vinciaShower) :
pythiaEvent::pythiaEvent(double pthat, unsigned int tune, double rapMin, double rapMax, bool partonLevel, bool vinciaShower, bool flatPtHat) :
pthat_(pthat), tune_(tune), rapMin_(rapMin), rapMax_(rapMax), partonLevel_(partonLevel), vinciaShower_(vinciaShower)
{

Expand All @@ -64,6 +65,13 @@ pythiaEvent::pythiaEvent(double pthat, unsigned int tune, double rapMin, double
pythia.readString("PartonShowers:Model = 2"); //activate the VINCIA parton shower
else
pythia.readString(Form("Tune:pp = %d",tune_));

if(flatPtHat) {
//flat pthard
pythia.readString("PhaseSpace:bias2Selection = on");
pythia.readString("PhaseSpace:bias2SelectionPow = 4.5");
pythia.readString("PhaseSpace:bias2SelectionRef = 15");
}

pythia.init();

Expand Down
9 changes: 7 additions & 2 deletions runCreatePythiaEvents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ int main (int argc, char ** argv)
//---------------------------------------------------------------------------

fout << "# event " << ie << "\n";

//create pythia event
std::vector<fastjet::PseudoJet> particlesSig = pyt.createPythiaEvent();
fout << "weight " << pyt.getWeight() << " pthat " << pyt.getPtHat() << "\n"; //<< " weight " << pow(15./pyt.getPtHat(),4.5)

std::vector<fastjet::PseudoJet> partons = pyt.getPartonList();
for(fastjet::PseudoJet p : partons) {
Expand All @@ -75,10 +76,14 @@ int main (int argc, char ** argv)
fout << p.px() << " " << p.py() << " " << p.pz() << " " << p.m() << " " << pdgid << " " << vtx << "\n";
}
fout << "end\n";

//std::cout << "weight: " << std::scientific << pyt.getWeight() << std::endl;
//std::cout << "pthat: " << std::fixed << pyt.getPtHat() << std::endl;
}

pyt.getStat();



fout.close();

std::cout << "\n Finished generating PYTHIA events" << std::endl;
Expand Down

0 comments on commit 8067041

Please sign in to comment.