]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TFluka/bxdraw.cxx
Set values to zero in constructor. Added print function.
[u/mrichter/AliRoot.git] / TFluka / bxdraw.cxx
1 #include <Riostream.h>
2
3 #ifndef WITH_ROOT
4 #include "TFluka.h"
5 #else
6 #include "TFlukaGeo.h"
7 #endif
8
9 #include "Fdimpar.h"  //(DIMPAR) fluka include
10 #include "Ftrackr.h"  //(TRACKR) fluka common
11 #ifndef WIN32
12 # define bxdraw bxdraw_
13 #else
14 # define bxdraw BXDRAW
15 #endif
16 extern "C" {
17 void bxdraw(Int_t& icode, Int_t& mreg, Int_t& newreg,
18             Double_t& xsco, Double_t& ysco, Double_t& zsco)
19 {
20     TFluka* fluka = (TFluka*) gMC;
21     
22     fluka->SetIcode(icode);
23     fluka->SetNewreg(newreg);
24     fluka->SetXsco(xsco);
25     fluka->SetYsco(ysco);
26     fluka->SetZsco(zsco);
27     Int_t verbosityLevel = fluka->GetVerbosityLevel();
28     Bool_t debug = (verbosityLevel>=3)?kTRUE:kFALSE;
29 //
30 // Double step for boundary crossing
31 //
32     fluka->SetTrackIsNew(kFALSE); // has to be called BEFORE Stepping()
33     if (debug) printf("bxdraw (ex) \n");
34     fluka->SetTrackIsExiting();
35     fluka->SetCaller(12);
36     fluka->SetMreg(mreg);
37     (TVirtualMCApplication::Instance())->Stepping(); 
38
39     if (debug) printf("bxdraw (en) \n");
40     fluka->SetCaller(11);
41     fluka->SetTrackIsEntering();
42     if (fluka->GetDummyBoundary() == 1) fluka->SetDummyBoundary(2);
43     fluka->SetMreg(newreg);
44     (TVirtualMCApplication::Instance())->Stepping();
45
46 } // end of bxdraw
47 } // end of extern "C"
48