]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TFluka/mgdraw.cxx
b265ba78fb1c6d902896dd36858a03909b5cf154
[u/mrichter/AliRoot.git] / TFluka / mgdraw.cxx
1 #include <Riostream.h>
2 #include "TVirtualMCApplication.h"
3 #include "TVirtualMCStack.h"
4
5 #ifndef WITH_ROOT
6 #include "TFluka.h"
7 #else
8 #include "TFlukaGeo.h"
9 #endif
10
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
16 #ifndef WIN32
17 # define mgdraw mgdraw_
18 #else
19 # define mgdraw MGDRAW
20 #endif
21
22 extern "C" {
23 void mgdraw(Int_t& icode, Int_t& mreg)
24 {
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 //    
34     fluka->SetMreg(mreg);
35     fluka->SetNewreg(mreg);
36     fluka->SetIcode(icode);
37     fluka->SetCaller(4);
38     
39 //    if (verbosityLevel >= 3) {
40 //      cout << endl << " !!! I am in mgdraw - calling Stepping()" << endl;
41 //      cout << endl << " Track Id =" << trackId << endl;
42 //    }
43     if (TRACKR.jtrack == -1)
44     printf("Cerenkov photon: region# %6d icode %6d \n", mreg, icode);
45
46     
47     (TVirtualMCApplication::Instance())->Stepping();
48     fluka->SetTrackIsNew(kFALSE);
49 } // end of mgdraw
50 } // end of extern "C"
51