Interface TGeo -> FLUKA (A. Gheata)
[u/mrichter/AliRoot.git] / TFluka / mgdraw.cxx
CommitLineData
fa3d1cc7 1#include <Riostream.h>
8fd1d27e 2#include "TVirtualMCApplication.h"
b1b2005d 3#include "TVirtualMCStack.h"
fa3d1cc7 4#include "TFluka.h"
b1b2005d 5// Fluka include
6#include "Fdimpar.h" //(DIMPAR) fluka include
7#include "Fdblprc.h" //(DBLPRC) fluka common
8#include "Ftrackr.h" //(TRACKR) fluka common
9
fa3d1cc7 10#ifndef WIN32
11# define mgdraw mgdraw_
12#else
13# define mgdraw MGDRAW
14#endif
15
16extern "C" {
17void mgdraw(Int_t& icode, Int_t& mreg)
18{
b1b2005d 19 TFluka* fluka = (TFluka*) gMC;
20 Int_t verbosityLevel = fluka->GetVerbosityLevel();
21//
22// Make sure that stack has currrent track Id
23 Int_t trackId = TRACKR.ispusr[mkbmx2-1];
24 TVirtualMCStack* cppstack = fluka->GetStack();
25 cppstack->SetCurrentTrack(trackId);
26//
27//
55d6cb0f 28 fluka->SetMreg(mreg);
29 fluka->SetNewreg(mreg);
b1b2005d 30 fluka->SetIcode(icode);
a1f42b9c 31 fluka->SetCaller(4);
32
c31c3638 33 if (verbosityLevel >= 3) {
34 cout << endl << " !!! I am in mgdraw - calling Stepping()" << endl;
35 cout << endl << " Track Id =" << trackId << endl;
36 }
8fd1d27e 37
55d6cb0f 38 (TVirtualMCApplication::Instance())->Stepping();
39
fa3d1cc7 40} // end of mgdraw
41} // end of extern "C"
42