Skip to content

Commit

Permalink
Attempt to produce pyxsec.root file for Pythia8 runs, not successful yet
Browse files Browse the repository at this point in the history
  • Loading branch information
preghenella committed Nov 15, 2016
1 parent 9160196 commit 8124089
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions MC/sim.C
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ void sim()
}

WriteXsection()
{
if (WriteXsection_Pythia6()) return;
if (WriteXsection_Pythia8()) return;
}

Bool_t
WriteXsection_Pythia6()
{

TPythia6 *pythia = TPythia6::Instance();
if (!pythia) return;
if (!pythia) return kFALSE;
pythia->Pystat(1);
Double_t xsection = pythia->GetPARI(1);
if (xsection < 1.e-30) return kFALSE;
UInt_t ntrials = pythia->GetMSTI(5);
TFile *file = new TFile("pyxsec.root","recreate");
TTree *tree = new TTree("Xsection","Pythia cross section");
Expand All @@ -62,7 +70,29 @@ WriteXsection()
tree->Fill();
tree->Write();
file->Close();
cout << "Pythia cross section: " << xsection
cout << "Pythia6 cross section: " << xsection
<< ", number of trials: " << ntrials << endl;
return kTRUE;
}

Bool_t
WriteXsection_Pythia8()
{

AliPythia8 *pythia = AliPythia8::Instance();
if (!pythia) return kFALSE;
pythia->Pystat(1);
Double_t xsection = pythia->GetXSection();
if (xsection < 1.e-30) return kFALSE;
UInt_t ntrials = 0; // fix me please!
TFile *file = new TFile("pyxsec.root","recreate");
TTree *tree = new TTree("Xsection","Pythia cross section");
TBranch *branch = tree->Branch("xsection", &xsection, "X/D");
TBranch *branch = tree->Branch("ntrials" , &ntrials , "X/i");
tree->Fill();
tree->Write();
file->Close();
cout << "Pythia8 cross section: " << xsection
<< ", number of trials: " << ntrials << endl;
return kTRUE;
}

0 comments on commit 8124089

Please sign in to comment.