Selector to generate Monte Carlo events with Pythia8.
#define ProofPythia_cxx
#include <TFormula.h>
ProofPythia::ProofPythia()
{
fHist = 0;
fPt = 0;
fEta = 0;
fPythia = 0;
fP = 0;
}
ProofPythia::~ProofPythia()
{
}
{
Info(
"Begin",
"starting a simple exercise with process option: %s", option.
Data());
}
void ProofPythia::SlaveBegin(
TTree * )
{
fTot =
new TH1F(
"histo1",
"total multiplicity", 25, 0.5, 2500.5);
fHist =
new TH1F(
"histo2",
"charged multiplicity", 20, 0.5, 500.5);
fPt =
new TH1F(
"histo3",
"particles pT", 100, 0., 10);
fEta =
new TH1F(
"histo4",
"particles Eta", 100, -10., 10);
fTot->SetFillColor(kBlue);
fOutput->Add(fTot);
fOutput->Add(fHist);
fOutput->Add(fPt);
fOutput->Add(fEta);
fPythia->SetName("pythia8");
fPythia->ReadConfigFile("pythia8/main03.cmnd");
fPythia->Initialize( 2212, 2212, 14000.);
}
{
fPythia->GenerateEvent();
if (entry < 2)
fPythia->EventListing();
fPythia->ImportParticles(fP, "All");
Int_t nTot = fPythia->GetN();
fPythia->ImportParticles(fP, "All");
Int_t np = fP->GetEntriesFast();
for (
Int_t ip = 0; ip < np; ip++) {
if (ist != 1) continue;
if (charge == 0.) continue;
nCharged++;
if (pt > 0.) fPt->Fill(pt);
if ((eta > -10) && (eta < 10)) fEta->Fill(eta);
}
fTot->Fill(nTot);
}
void ProofPythia::SlaveTerminate()
{
}
void ProofPythia::Terminate()
{
TCanvas *c1 =
new TCanvas(
"c1",
"Proof ProofPythia canvas",200,10,700,700);
if ((fTot = dynamic_cast<TH1F *>(fOutput->FindObject("histo1")))) {
}
if ((fHist = dynamic_cast<TH1F *>(fOutput->FindObject("histo2")))) {
}
if ((fPt = dynamic_cast<TH1F *>(fOutput->FindObject("histo3")))) {
}
if ((fEta = dynamic_cast<TH1F *>(fOutput->FindObject("histo4")))) {
}
}
- Author
- Gerardo Ganis (gerar.nosp@m.do.g.nosp@m.anis@.nosp@m.cern.nosp@m..ch)
Definition in file ProofPythia.C.