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