23 #include "ProMCBook.h"
27 #include <EicMCreader.h>
40 if (fileName.EndsWith(
".promc")) {
43 mProMCBook =
new ProMCBook(fileName.Data(),
"r");
52 Fatal(
"Poacher::Poacher()",
"failed to open input ProMC file.");
58 Fatal(
"Poacher::Poacher()",
"ProMC support is not compiled in.");
60 }
else if (fileName.EndsWith(
".eicmc")) {
62 GOOGLE_PROTOBUF_VERIFY_VERSION;
71 Fatal(
"Poacher::Poacher()",
"EicMC support is not compiled in.");
97 ProMCEvent_Particles *pa=eve.mutable_particles();
102 for (
int j=0; j<pa->pdg_id_size(); j++) {
131 Fatal(
"Poacher::Poacher()",
"ProMC support is not compiled in.");
return 0;
136 eicmc::Record record;
141 const eicmc::Record::MonteCarloEvent &mcevent = record.mcevent();
143 for(
int pt=0; pt<mcevent.particles_size(); pt++) {
168 Fatal(
"Poacher::Poacher()",
"EicMC support is not compiled in.");
return 0;
182 return EventProMC::Class()->GetName();
184 return EventEicMC::Class()->GetName();
203 cout <<
"-I EicEventGenerator: Using input file(s) " << fileName << endl;
209 if (fileName.IsNull())
return;
213 if (fileName.EndsWith(
".root"))
242 for(
unsigned ev=0; ev<eventsToSkip; ev++)
270 cout <<
"-W- EicEventGenerator(): event chunk size limit reached!" << endl;
283 cout <<
"-E- EicEventGenerator(): event list exhausted!" << endl;
293 int leadingParticleId = -1;
294 double leadingParticleMomentum;
306 if (leadingParticleId == -1 || vp->
GetP() > leadingParticleMomentum) {
307 leadingParticleId = iq;
308 leadingParticleMomentum = vp->
GetP();
313 if (leadingParticleId == -1 ||
341 if (leadingParticleId != -1 && leadingParticleId != iq)
continue;
371 primGen->
AddTrack(vp->
Id(), pvect[0], pvect[1], pvect[2], pvtx[0], pvtx[1], pvtx[2]);
390 static TBranch *outputEventBranch, *outputMappingBranch;
392 if (!outputEventBranch) {
413 outputEventBranch->GetTree()->Fill();
432 for(
unsigned ih=0; ih<2; ih++) {
433 TH1D *hist = hists[ih];