12 #include "Pythia8/Pythia.h"
18 #include "TVirtualPad.h"
19 #include "TApplication.h"
24 using namespace Pythia8;
26 int main(
int argc,
char* argv[]) {
29 TApplication theApp(
"hist", &argc, argv);
34 pythia.readString(
"HardQCD:all = on");
35 pythia.readString(
"PhaseSpace:pTHatMin = 20.");
36 pythia.readString(
"Beams:eCM = 14000.");
40 TFile* outFile =
new TFile(
"hist.root",
"RECREATE");
43 TH1F *mult =
new TH1F(
"mult",
"charged multiplicity", 100, -0.5, 799.5);
46 for (
int iEvent = 0; iEvent < 100; ++iEvent) {
47 if (!pythia.next())
continue;
51 for (
int i = 0; i < pythia.event.size(); ++i)
52 if (pythia.event[i].isFinal() && pythia.event[i].isCharged())
56 mult->Fill( nCharged );
64 std::cout <<
"\nDouble click on the histogram window to quit.\n";
65 gPad->WaitPrimitive();