//Virutal MC
#include "TFluka.h"
#include "TVirtualMCStack.h"
+#include "TVirtualMCApplication.h"
#include "TParticle.h"
#include "TVector3.h"
# define soevsv SOEVSV
#endif
-
extern "C" {
//
// Prototypes for FLUKA functions
// 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);
/* 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;
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