Dear Michael,
just for testing I have created a small script for generating the vertex events as follows:
TFile *f = new TFile("Vertex.root", "RECREATE");
TNtuple *ntuple = new TNtuple("vertex", "Vertex data", "vx:vy:vz");
PReaction my_reaction;
my_reaction.Do("vz = sampleFlat() * 400 - 200;");
my_reaction.Do("loop: vx = sampleFlat() * 20 - 10; vy = sampleFlat() * 20 - 10; ");
my_reaction.Do("if ((vx*vx + vy*vy) > 100); goto loop");
my_reaction.Output(ntuple);
cout << my_reaction.Loop(10000) << " vertex events created" << endl;
f->cd();
ntuple->Write();
f->Close();
At least running a part of your script:
PReaction my_reaction("_P1 = 2.2","g","p","p eta [g g]","delme",1,0,1,0);
//Construct the vertex container:
PVertexFile *vertex = new PVertexFile();
vertex->OpenFile("Vertex.root");
//add to prologue action
my_reaction.AddPrologueBulk(vertex);
// my_reaction.Print(); //The "Print()" statement is optional
my_reaction.Loop(10000);
seems to work for me...