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