2 #include "TVirtualMCApplication.h"
4 #include <TLorentzVector.h>
5 #include "Fdimpar.h" //(DIMPAR) fluka include
6 #include "Ftrackr.h" //(TRACKR) fluka common
7 #include "Femfstk.h" //(EMFSTK) fluka common
9 # define usdraw usdraw_
11 # define usdraw USDRAW
14 void usdraw(Int_t& icode, Int_t& mreg,
15 Double_t& xsco, Double_t& ysco, Double_t& zsco)
17 TFluka *fluka = (TFluka*)gMC;
18 Int_t verbosityLevel = fluka->GetVerbosityLevel();
19 Bool_t debug = (verbosityLevel >= 3)? kTRUE : kFALSE;
21 fluka->SetIcode(icode);
24 for (Int_t npnw = EMFSTK.npstrt-1; npnw <= EMFSTK.npemf-1; npnw++) {
25 if (EMFSTK.iespak[npnw][mkbmx2-1] == TRACKR.ispusr[mkbmx2 - 1] ) {
26 EMFSTK.iespak[npnw][mkbmx2 - 2] = 1;
27 // Save properties at point where particle disappears in case this is only an interruption
29 gMC->TrackMomentum(p);
30 EMFSTK.espark[npnw][0] = xsco; // x
31 EMFSTK.espark[npnw][1] = ysco; // y
32 EMFSTK.espark[npnw][2] = zsco; // z
33 EMFSTK.espark[npnw][3] = gMC->TrackTime(); // t
34 EMFSTK.espark[npnw][4] = p[0]; // px
35 EMFSTK.espark[npnw][5] = p[1]; // py
36 EMFSTK.espark[npnw][6] = p[2]; // pz
37 EMFSTK.espark[npnw][7] = p[3]; // e
38 EMFSTK.espark[npnw][8] = gMC->TrackLength(); // Length
39 } // Track found in stack
40 } // Loop over emf stack
41 } // Electromagnetic process
50 if (debug) printf("USDRAW: Number of track segments:%6d %6d %6d %10.3e\n", TRACKR.ntrack, TRACKR.mtrack, icode, TRACKR.atrack);
52 (TVirtualMCApplication::Instance())->Stepping();
53 fluka->SetTrackIsNew(kFALSE);
56 } // end of extern "C"