]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TFluka/mgdraw.cxx
Add Cerenkov photons to TVirtualMCStack.
[u/mrichter/AliRoot.git] / TFluka / mgdraw.cxx
1 #include <Riostream.h>
2 #include "TVirtualMCApplication.h"
3 #include "TVirtualMCStack.h"
4
5 #include "TFluka.h"
6
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 #include "Fopphst.h"  //(OPPHST) fluka common
12
13 #ifndef WIN32
14 # define mgdraw mgdraw_
15 #else
16 # define mgdraw MGDRAW
17 #endif
18
19 extern "C" {
20 void mgdraw(Int_t& icode, Int_t& mreg)
21 {
22     TFluka* fluka =  (TFluka*) gMC;
23 //    Int_t verbosityLevel = fluka->GetVerbosityLevel();
24 //
25 //  Make sure that stack has currrent track Id
26     Int_t trackId = -1;
27     TVirtualMCStack* cppstack = fluka->GetStack();
28     
29     if (TRACKR.jtrack == -1) {
30         trackId = OPPHST.LOUOPP[OPPHST.LSTOPP - 1];
31
32     } else {
33         trackId = TRACKR.ispusr[mkbmx2-1];
34     }
35     
36     cppstack->SetCurrentTrack(trackId);
37 //
38 //    
39     fluka->SetMreg(mreg);
40     fluka->SetNewreg(mreg);
41     fluka->SetIcode(icode);
42     fluka->SetCaller(4);
43     
44 //    if (verbosityLevel >= 3) {
45 //      cout << endl << " !!! I am in mgdraw - calling Stepping()" << endl;
46 //      cout << endl << " Track Id =" << trackId << endl;
47 //    }
48     
49     
50     (TVirtualMCApplication::Instance())->Stepping();
51     fluka->SetTrackIsNew(kFALSE);
52 } // end of mgdraw
53 } // end of extern "C"
54