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