3 # define stuprf stuprf_
9 #include "Fdimpar.h" //(DIMPAR) fluka include
11 #include "Fdblprc.h" //(DBLPRC) fluka common
12 #include "Fevtflg.h" //(EVTFLG) fluka common
13 #include "Fpaprop.h" //(PAPROP) fluka common
14 #include "Fstack.h" //(STACK) fluka common
15 #include "Ftrackr.h" //(TRACKR) fluka common
16 #include "Ffinuc.h" //(FINUC) fluka common
21 #include "TVirtualMCStack.h"
22 #include "TVirtualMCApplication.h"
23 #include "TParticle.h"
27 void stuprf(Int_t& /*ij*/, Int_t& /*mreg*/,
28 Double_t& xx, Double_t& yy, Double_t& zz,
29 Int_t& numsec, Int_t& npprmr)
31 //*----------------------------------------------------------------------*
33 //* SeT User PRoperties for Fluka particles *
35 //*----------------------------------------------------------------------*
37 // STACK.lstack = stack pointer
38 // STACK.louse = user flag
39 // TRACKR.llouse = user defined flag for the current particle
40 STACK.louse[STACK.lstack] = TRACKR.llouse;
42 // mkbmx1 = dimension for kwb real spare array in fluka stack in DIMPAR
43 // mkbmx2 = dimension for kwb int. spare array in fluka stack in DIMPAR
44 // STACK.sparek = spare real variables available for k.w.burn
45 // STACK.ispark = spare integer variables available for k.w.burn
46 // TRACKR.spausr = user defined spare variables for the current particle
47 // TRACKR.ispusr = user defined spare flags for the current particle
49 for (ispr = 0; ispr <= mkbmx1 - 1; ispr++) {
50 STACK.sparek[STACK.lstack][ispr] = TRACKR.spausr[ispr];
52 for (ispr = 0; ispr <= mkbmx2 - 1; ispr++) {
53 STACK.ispark[STACK.lstack][ispr] = TRACKR.ispusr[ispr];
56 // Get the pointer to the VMC
57 TFluka* fluka = (TFluka*) gMC;
58 Int_t verbosityLevel = fluka->GetVerbosityLevel();
59 Bool_t debug = (verbosityLevel>=3)?kTRUE:kFALSE;
60 fluka->SetTrackIsNew(kTRUE);
61 // TVirtualMC* fluka = TFluka::GetMC();
62 // Get the stack produced from the generator
63 TVirtualMCStack* cppstack = fluka->GetStack();
65 // EVTFLG.ntrcks = track number
66 // Increment the track number and put it into the last flag
68 // clarify with Alberto
69 if (numsec > npprmr) {
70 // Now call the PushTrack(...)
73 Int_t parent = TRACKR.ispusr[mkbmx2-1];
74 Int_t kpart = FINUC.kpart[numsec-1];
75 if (kpart < -6) return;
77 Int_t pdg = fluka->PDGFromId(kpart);
80 Double_t px = FINUC.plr[numsec-1] * FINUC.cxr[numsec-1];
81 Double_t py = FINUC.plr[numsec-1] * FINUC.cyr[numsec-1];
82 Double_t pz = FINUC.plr[numsec-1] * FINUC.czr[numsec-1];
83 Double_t e = FINUC.tki[numsec-1] + PAPROP.am[FINUC.kpart[numsec-1]+6];
89 Double_t tof = TRACKR.atrack;
90 Double_t polx = FINUC.cxrpol[numsec-1];
91 Double_t poly = FINUC.cyrpol[numsec-1];
92 Double_t polz = FINUC.czrpol[numsec-1];
95 TMCProcess mech = kPHadronic;
97 if (EVTFLG.ldecay == 1) {
99 if (debug) cout << endl << "Decay" << endl;
101 } else if (EVTFLG.ldltry == 1) {
103 if (debug) cout << endl << "Delta Ray" << endl;
105 } else if (EVTFLG.lpairp == 1) {
107 if (debug) cout << endl << "Pair Production" << endl;
109 } else if (EVTFLG.lbrmsp == 1) {
111 if (debug) cout << endl << "Bremsstrahlung" << endl;
116 Double_t weight = FINUC.wei[numsec-1];
120 // Save particle in VMC stack
121 cppstack->PushTrack(done, parent, pdg,
125 mech, ntr, weight, is);
126 if (debug) cout << endl << " !!! stuprf: ntr=" << ntr << "pdg " << pdg << " parent=" << parent << "numsec "
127 << numsec << "npprmr " << npprmr << endl;
129 // Save current track number
130 STACK.ispark[STACK.lstack][mkbmx2-1] = ntr;
131 STACK.ispark[STACK.lstack][mkbmx2-2] = 0;
132 } // end of if (numsec-1 > npprmr)
134 } // end of extern "C"