5 # define stuprf stuprf_
11 #include "Fdimpar.h" //(DIMPAR) fluka include
13 #include "Fdblprc.h" //(DBLPRC) fluka common
14 #include "Fevtflg.h" //(EVTFLG) fluka common
15 #include "Fpaprop.h" //(PAPROP) fluka common
16 #include "Fstack.h" //(STACK) fluka common
17 #include "Ftrackr.h" //(TRACKR) fluka common
18 #include "Ffinuc.h" //(FINUC) fluka common
24 #include "TFlukaGeo.h"
27 #include "TVirtualMCStack.h"
28 #include "TVirtualMCApplication.h"
29 #include "TParticle.h"
33 void stuprf(Int_t& /*ij*/, Int_t& /*mreg*/,
34 Double_t& xx, Double_t& yy, Double_t& zz,
35 Int_t& numsec, Int_t& npprmr)
37 //*----------------------------------------------------------------------*
39 //* SeT User PRoperties for Fluka particles *
41 //*----------------------------------------------------------------------*
43 // STACK.lstack = stack pointer
44 // STACK.louse = user flag
45 // TRACKR.llouse = user defined flag for the current particle
46 STACK.louse[STACK.lstack] = TRACKR.llouse;
48 // mkbmx1 = dimension for kwb real spare array in fluka stack in DIMPAR
49 // mkbmx2 = dimension for kwb int. spare array in fluka stack in DIMPAR
50 // STACK.sparek = spare real variables available for k.w.burn
51 // STACK.ispark = spare integer variables available for k.w.burn
52 // TRACKR.spausr = user defined spare variables for the current particle
53 // TRACKR.ispusr = user defined spare flags for the current particle
55 for (ispr = 0; ispr <= mkbmx1 - 1; ispr++) {
56 STACK.sparek[STACK.lstack][ispr] = TRACKR.spausr[ispr];
58 for (ispr = 0; ispr <= mkbmx2 - 1; ispr++) {
59 STACK.ispark[STACK.lstack][ispr] = TRACKR.ispusr[ispr];
62 // Get the pointer to the VMC
63 TFluka* fluka = (TFluka*) gMC;
64 Int_t verbosityLevel = fluka->GetVerbosityLevel();
65 Bool_t debug = (verbosityLevel>=3)?kTRUE:kFALSE;
66 fluka->SetTrackIsNew(kTRUE);
67 // TVirtualMC* fluka = TFluka::GetMC();
68 // Get the stack produced from the generator
69 TVirtualMCStack* cppstack = fluka->GetStack();
71 // EVTFLG.ntrcks = track number
72 // Increment the track number and put it into the last flag
74 // clarify with Alberto
75 if (numsec > npprmr) {
76 // Now call the PushTrack(...)
79 Int_t parent = TRACKR.ispusr[mkbmx2-1];
81 Int_t pdg = fluka->PDGFromId(FINUC.kpart[numsec-1]);
82 Double_t px = FINUC.plr[numsec-1] * FINUC.cxr[numsec-1];
83 Double_t pz = FINUC.plr[numsec-1] * FINUC.cyr[numsec-1];
84 Double_t py = FINUC.plr[numsec-1] * FINUC.czr[numsec-1];
85 Double_t e = FINUC.tki[numsec-1] + PAPROP.am[FINUC.kpart[numsec-1]+6];
90 Double_t tof = TRACKR.atrack;
91 Double_t polx = FINUC.cxrpol[numsec-1];
92 Double_t poly = FINUC.cyrpol[numsec-1];
93 Double_t polz = FINUC.czrpol[numsec-1];
96 TMCProcess mech = kPHadronic;
98 if (EVTFLG.ldecay == 1) {
100 if (debug) cout << endl << "Decay" << endl;
102 } else if (EVTFLG.ldltry == 1) {
104 if (debug) cout << endl << "Delta Ray" << endl;
106 } else if (EVTFLG.lpairp == 1) {
108 if (debug) cout << endl << "Pair Production" << endl;
110 } else if (EVTFLG.lbrmsp == 1) {
112 if (debug) cout << endl << "Bremsstrahlung" << endl;
117 Double_t weight = FINUC.wei[numsec-1];
121 // Save particle in VMC stack
122 cppstack->PushTrack(done, parent, pdg,
126 mech, ntr, weight, is);
127 if (debug) cout << endl << " !!! stuprf: ntr=" << ntr << "pdg " << pdg << " parent=" << parent << "numsec "
128 << numsec << "npprmr " << npprmr << endl;
130 // Save current track number
131 STACK.ispark[STACK.lstack][mkbmx2-1] = ntr;
132 } // end of if (numsec-1 > npprmr)
134 } // end of extern "C"