From 45dc600a196e6af031350de55d6a99933b34940f Mon Sep 17 00:00:00 2001 From: morsch Date: Fri, 31 Jan 2003 14:03:07 +0000 Subject: [PATCH] Calls to FinishPrimary, PostTrack and PreTrack added. --- TFluka/source.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TFluka/source.cxx b/TFluka/source.cxx index 7c0038d9dc2..7b29e4b0cf2 100644 --- a/TFluka/source.cxx +++ b/TFluka/source.cxx @@ -17,6 +17,7 @@ //Virutal MC #include "TFluka.h" #include "TVirtualMCStack.h" +#include "TVirtualMCApplication.h" #include "TParticle.h" #include "TVector3.h" @@ -37,7 +38,6 @@ # define soevsv SOEVSV #endif - extern "C" { // // Prototypes for FLUKA functions @@ -101,6 +101,10 @@ extern "C" { // Get the stack produced from the generator TVirtualMCStack* cppstack = fluka->GetStack(); //Get next particle + if (STACK.lstack != 1) { + TVirtualMCApplication::Instance()->PostTrack(); + TVirtualMCApplication::Instance()->FinishPrimary(); + } Int_t itrack = -1; TParticle* particle = cppstack->GetNextTrack(itrack); @@ -144,6 +148,7 @@ extern "C" { /* Lstack is the stack counter: of course any time source is called it * must be =0 */ + STACK.lstack++; cout << "\t* Storing particle parameters in the stack, lstack = " << STACK.lstack << endl; @@ -270,7 +275,7 @@ extern "C" { cout << "\t* EPISOR.lsouit = " << (EPISOR.lsouit?'T':'F') << endl; cout << "\t* " << STACK.lstack << " particles in the event" << endl; - + TVirtualMCApplication::Instance()->PreTrack(); #ifdef METHODDEBUG cout << "<== source(" << nomore << ")" << endl; #endif -- 2.31.1