Clean-up. (E. Futo)
[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;
fbf08100 26// Int_t verbosityLevel = fluka->GetVerbosityLevel();
b1b2005d 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
fbf08100 39// if (verbosityLevel >= 3) {
40// cout << endl << " !!! I am in mgdraw - calling Stepping()" << endl;
41// cout << endl << " Track Id =" << trackId << endl;
42// }
cad96957 43 if (TRACKR.jtrack == -1)
44 printf("Cerenkov photon: region# %6d icode %6d \n", mreg, icode);
8fd1d27e 45
cad96957 46
55d6cb0f 47 (TVirtualMCApplication::Instance())->Stepping();
fbf08100 48 fluka->SetTrackIsNew(kFALSE);
fa3d1cc7 49} // end of mgdraw
50} // end of extern "C"
51