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