GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Hades » Pluto » [SOLVED] PVertexFile
Re: PVertexFile [message #13608 is a reply to message #13603] Fri, 15 June 2012 12:45 Go to previous messageGo to previous message
Ingo Froehlich is currently offline  Ingo Froehlich
Messages: 167
Registered: March 2004
Location: IKF - Frankfurt
first-grade participant
From: *x-matter.uni-frankfurt.de
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...


--
Ingo Froehlich
IKF - University of Frankfurt
069-798-47027, FAX: -47024
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] pp->K0s+X with V5.34
Next Topic: Multiple branches in the Pluto-file
Goto Forum:
  


Current Time: Wed Dec 08 04:49:45 CET 2021

Total time taken to generate the page: 0.02269 seconds