1 #include "Pythia8/Pythia.h"
2 #include "Pythia8Plugins/HepMC2.h"
16 pythiaengine.readString(
"Beams:eCM = 200.");
17 pythiaengine.readString(
"SoftQCD:nonDiffractive = on");
18 pythiaengine.readString(
"SoftQCD:singleDiffractive = on");
19 pythiaengine.readString(
"SoftQCD:doubleDiffractive = on");
20 pythiaengine.readString(
"PhaseSpace:pTHatMin = 0");
21 pythiaengine.readString(
"Random::setSeed = on");
22 pythiaengine.readString(
"Random::seed =0");
26 string tfilename = filename+
"_analysis.root";
27 TFile *outFile =
new TFile(tfilename.c_str(),
"RECREATE");
28 TTree *photonTree =
new TTree(
"photonTree",
"phat phirn tree");
29 photonTree->SetAutoSave(300);
30 vector<float> photon_pT;
31 photonTree->Branch(
"photon_pT",&photon_pT);
32 TTree *nophotonTree =
new TTree(
"nophotonTree",
"phat phirn tree");
33 unsigned noPhotonEvents=0;
34 nophotonTree->Branch(
"nNoPhoton",&noPhotonEvents);
36 for (
int iEvent = 0; iEvent <
nEvents; ++iEvent)
38 if (!pythiaengine.next()){
39 cout<<
"pythia.next() failed"<<
"\n";
44 for(
unsigned ipart=0; ipart!=pythiaengine.event.size(); ipart++){
45 if(pythiaengine.event[ipart].id()==22&&pythiaengine.event[ipart].isFinal()&&pythiaengine.event[ipart].pT()>5
46 &&TMath::Abs(pythiaengine.event[ipart].eta()))photon_pT.push_back(pythiaengine.event[ipart].pT());
48 if (photon_pT.size()>0)photonTree->Fill();
65 int main(
int argc,
char const *argv[] )
67 string fileOut =
string(argv[1]);
68 bool signalOnly=
false;
69 if(argv[2][0]==
'1'||argv[2][0]==
't')signalOnly=
true;
70 long nEvents =strtol(argv[2],NULL,10);
72 cout<<
"All done"<<endl;