#include <Riostream.h>
#include "TFluka.h"
+#include "TFlukaCodes.h"
+#include "TFlukaMCGeometry.h"
#include "Fdimpar.h" //(DIMPAR) fluka include
#include "Ftrackr.h" //(TRACKR) fluka common
+#include "Fltclcm.h" //(LTCLCM) fluka common
#ifndef WIN32
# define bxdraw bxdraw_
#else
Double_t& xsco, Double_t& ysco, Double_t& zsco)
{
TFluka* fluka = (TFluka*) gMC;
-
- fluka->SetIcode(icode);
- fluka->SetNewreg(newreg);
+ Int_t oldlttc = LTCLCM.mlatm1;
+ Int_t newlttc = LTCLCM.newlat;
+ fluka->SetIcode((FlukaProcessCode_t)icode);
+ fluka->SetNewreg(newreg,newlttc);
fluka->SetXsco(xsco);
fluka->SetYsco(ysco);
fluka->SetZsco(zsco);
// Double step for boundary crossing
//
fluka->SetTrackIsNew(kFALSE); // has to be called BEFORE Stepping()
- if (debug) printf("bxdraw (ex) \n");
- fluka->SetTrackIsExiting();
- fluka->SetCaller(12);
- fluka->SetMreg(mreg);
- (TVirtualMCApplication::Instance())->Stepping();
-
- if (debug) printf("bxdraw (en) \n");
- fluka->SetCaller(11);
- fluka->SetTrackIsEntering();
- if (fluka->GetDummyBoundary() == 1) fluka->SetDummyBoundary(2);
- fluka->SetMreg(newreg);
- (TVirtualMCApplication::Instance())->Stepping();
+ if (mreg != fluka->GetDummyRegion()) {
+ if (debug) printf("bxdraw (ex) \n");
+ fluka->SetTrackIsExiting();
+ fluka->SetCaller(kBXExiting);
+ fluka->SetMreg(mreg,oldlttc);
+ (TVirtualMCApplication::Instance())->Stepping();
+ }
+ if (newreg != fluka->GetDummyRegion()) {
+ if (debug) printf("bxdraw (en) \n");
+ fluka->SetCaller(kBXEntering);
+ fluka->SetTrackIsEntering();
+ if (fluka->GetDummyBoundary() == 1) fluka->SetDummyBoundary(2);
+ fluka->SetMreg(newreg,newlttc);
+ (TVirtualMCApplication::Instance())->Stepping();
+ }
} // end of bxdraw
} // end of extern "C"
#include "TVirtualMCApplication.h"
#include "TFluka.h"
+#include "TFlukaCodes.h"
#ifndef WIN32
# define eedraw eedraw_
extern "C" {
void eedraw(Int_t& icode)
{
- ((TFluka*) gMC)->SetCaller(2);
- ((TFluka*) gMC)->SetIcode(icode);
+ ((TFluka*) gMC)->SetCaller(kEEDRAW);
+ ((TFluka*) gMC)->SetIcode((FlukaProcessCode_t) icode);
} // end of eedraw
} // end of extern "C"
#include "TFlukaCerenkov.h"
#include "TFluka.h"
+#include "TFlukaCodes.h"
#include "Fdimpar.h" //(DIMPAR) fluka include
#include "Ftrackr.h" //(TRACKR) fluka common
+#include "Fltclcm.h" //(LTCLCM) fluka common
+#include "Fpaprop.h" //(PAPROP) fluka common
#ifndef WIN32
# define endraw endraw_
#else
void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t& ysco, Double_t& zsco)
{
TFluka* fluka = (TFluka*) gMC;
+ // nothing to do if particle in dummy region
+ if (mreg == fluka->GetDummyRegion()) return;
Int_t verbosityLevel = fluka->GetVerbosityLevel();
Bool_t debug = (verbosityLevel >= 3)? kTRUE : kFALSE;
- fluka->SetCaller(3);
+ Int_t mlttc = LTCLCM.mlatm1;
+ fluka->SetCaller(kENDRAW);
fluka->SetRull(rull);
fluka->SetXsco(xsco);
fluka->SetYsco(ysco);
fluka->SetZsco(zsco);
- fluka->SetMreg(mreg);
+ fluka->SetMreg(mreg, mlttc);
Float_t edep = rull;
- if (icode == 11) {
+ if (icode == kKASKADinelarecoil) {
if (debug) cout << " For icode=" << icode << " Stepping is NOT called" << endl;
return;
}
+
if (TRACKR.jtrack == -1) {
// Handle quantum efficiency the G3 way
if (debug) printf("endraw: Cerenkov photon depositing energy: %d %e\n", mreg, rull);
TGeoMaterial* material = (gGeoManager->GetCurrentVolume())->GetMaterial();
- // Int_t nmat = material->GetIndex();
TFlukaCerenkov* cerenkov = dynamic_cast<TFlukaCerenkov*> (material->GetCerenkovProperties());
if (cerenkov) {
Double_t eff = (cerenkov->GetQuantumEfficiency(rull));
}
}
}
- if (debug) printf("endraw: Depositing energy for : %d %e icode: %d \n", TRACKR.ispusr[mkbmx2-1], rull, icode);
- if (icode != 21 && icode != 22) {
- fluka->SetIcode(icode);
+ if (icode != kEMFSCOstopping1 && icode != kEMFSCOstopping2) {
+ fluka->SetIcode((FlukaProcessCode_t)icode);
fluka->SetRull(edep);
(TVirtualMCApplication::Instance())->Stepping();
} else {
//
- // for icode 21,22 the particle has fallen below thresshold
+ // For icode 21,22 the particle has fallen below thresshold.
// This has to be signalled to the StepManager()
//
fluka->SetRull(edep);
- fluka->SetIcode(20);
+ fluka->SetIcode((FlukaProcessCode_t) icode);
(TVirtualMCApplication::Instance())->Stepping();
fluka->SetTrackIsNew(kFALSE);
- fluka->SetIcode(icode);
+ fluka->SetIcode((FlukaProcessCode_t)icode);
fluka->SetRull(0.);
(TVirtualMCApplication::Instance())->Stepping();
}
#include "TVirtualMCStack.h"
#include "TFluka.h"
-
+#include "TFlukaCodes.h"
// Fluka include
#include "Fdimpar.h" //(DIMPAR) fluka include
#include "Fdblprc.h" //(DBLPRC) fluka common
#include "Ftrackr.h" //(TRACKR) fluka common
#include "Fopphst.h" //(OPPHST) fluka common
#include "Fflkstk.h" //(FLKSTK) fluka common
+#include "Fltclcm.h" //(LTCLCM) fluka common
+#include "Fpaprop.h" //(PAPROP) fluka common
#ifndef WIN32
# define mgdraw mgdraw_
void mgdraw(Int_t& icode, Int_t& mreg)
{
TFluka* fluka = (TFluka*) gMC;
+ if (mreg == fluka->GetDummyRegion()) return;
Int_t verbosityLevel = fluka->GetVerbosityLevel();
//
// Make sure that stack has currrent track Id
cppstack->SetCurrentTrack(trackId);
//
//
- fluka->SetMreg(mreg);
- fluka->SetNewreg(mreg);
- fluka->SetIcode(icode);
- fluka->SetCaller(4);
+ Int_t mlttc = LTCLCM.mlatm1;
+ fluka->SetMreg(mreg, mlttc);
+ fluka->SetNewreg(mreg, mlttc);
+ fluka->SetIcode((FlukaProcessCode_t) icode);
+ fluka->SetCaller(kMGDRAW);
if (!TRACKR.ispusr[mkbmx2 - 2]) {
//
// Single step
- if (TRACKR.jtrack == -1 && trackId == 109340) {
- cout << endl << " !!! I am in mgdraw - calling Stepping(): " << icode << endl;
- cout << endl << " Track Id = " << trackId << " region = " << mreg << endl;
- printf("Stepsize %13.5e \n", fluka->TrackStep());
+ if (verbosityLevel >= 3) {
+ cout << endl << "mgdraw: energy deposition for:" << trackId << endl;
}
-
-
-
-
(TVirtualMCApplication::Instance())->Stepping();
fluka->SetTrackIsNew(kFALSE);
} else {
// Tracking is being resumed after secondary tracking
//
if (verbosityLevel >= 3) {
- cout << endl << " !!! I am in mgdraw - resuming Stepping(): " << trackId << endl;
+ cout << endl << "mgdraw: resuming Stepping(): " << trackId << endl;
}
-
+
fluka->SetTrackIsNew(kTRUE);
- fluka->SetCaller(40);
+ fluka->SetCaller(kMGResumedTrack);
(TVirtualMCApplication::Instance())->Stepping();
// Reset flag and stored values
}
fluka->SetTrackIsNew(kFALSE);
- fluka->SetCaller(4);
+ fluka->SetCaller(kMGDRAW);
(TVirtualMCApplication::Instance())->Stepping();
}
-
-
} // end of mgdraw
} // end of extern "C"
#include "TVirtualMCApplication.h"
#include "TFluka.h"
+#include "TFlukaCodes.h"
#ifndef WIN32
# define sodraw sodraw_
extern "C" {
void sodraw()
{
- ((TFluka*) gMC)->SetCaller(5);
- ((TFluka*) gMC)->SetIcode(0);
+ ((TFluka*) gMC)->SetCaller(kSODRAW);
+ ((TFluka*) gMC)->SetIcode((FlukaProcessCode_t)0);
} // end of sodraw
} // end of extern "C"
//Virtual MC
#include "TFluka.h"
+#include "TFlukaCodes.h"
#include "TVirtualMCStack.h"
#include "TVirtualMCApplication.h"
#include "TParticle.h"
//* SeT User PRoperties for Emf particles *
//* *
//*----------------------------------------------------------------------*
- static Double_t emassmev = PAPROP.am[9] * 1000.;
+// Get the pointer to the VMC
+ TFluka* fluka = (TFluka*) gMC;
+ static Double_t emassmev = PAPROP.am[kFLUKAelectron + 6] * 1000.;
Int_t lbhabh = 0;
if (EVTFLG.ldltry == 1) {
if (EMFSTK.ichemf[EMFSTK.npemf-1] * EMFSTK.ichemf[EMFSTK.npemf-2] < 0) lbhabh = 1;
}
-
+
// mkbmx1 = dimension for kwb real spare array in fluka stack in DIMPAR
// mkbmx2 = dimension for kwb int. spare array in fluka stack in DIMPAR
// EMFSTK.espark = spare real variables available for
Int_t npnw, ispr;
for (npnw = EMFSTK.npstrt-1; npnw <= EMFSTK.npemf-1; npnw++) {
-
- for (ispr = 0; ispr <= mkbmx1-1; ispr++)
- EMFSTK.espark[npnw][ispr] = TRACKR.spausr[ispr];
+
+ for (ispr = 0; ispr <= mkbmx1-1; ispr++)
+ EMFSTK.espark[npnw][ispr] = TRACKR.spausr[ispr];
+
+ for (ispr = 0; ispr <= mkbmx2-1; ispr++)
+ EMFSTK.iespak[npnw][ispr] = TRACKR.ispusr[ispr];
- for (ispr = 0; ispr <= mkbmx2-1; ispr++)
- EMFSTK.iespak[npnw][ispr] = TRACKR.ispusr[ispr];
-
- EMFSTK.louemf[npnw] = TRACKR.llouse;
+ EMFSTK.louemf[npnw] = TRACKR.llouse;
}
-// Get the pointer to the VMC
- TFluka* fluka = (TFluka*) gMC;
+
Int_t verbosityLevel = fluka->GetVerbosityLevel();
Bool_t debug = (verbosityLevel>=3)?kTRUE:kFALSE;
fluka->SetTrackIsNew(kTRUE);
for (kp = EMFSTK.npstrt - 1; kp <= EMFSTK.npemf - 1; kp++) {
// Ckeck transport cut first
- Int_t ireg = EMFSTK.iremf[kp];
- Double_t cut = (TMath::Abs(EMFSTK.ichemf[kp]) == 1) ? EMFRGN.elethr[ireg-1] : EMFRGN.phothr[ireg-1];
+ Int_t ireg = EMFSTK.iremf[kp];
+ Double_t cut = (TMath::Abs(EMFSTK.ichemf[kp]) == 1) ? EMFRGN.elethr[ireg-1] : EMFRGN.phothr[ireg-1];
Double_t e = EMFSTK.etemf[kp];
if ((e < cut)
continue;
}
-//* save the parent track number and reset it at each loop
+// Save the parent track number and reset it at each loop
Int_t done = 0;
Int_t parent = TRACKR.ispusr[mkbmx2-1];
Int_t flukaid = 0;
// Identify particle type
- if (EMFSTK.ichemf[kp] == -1) flukaid = 3;
- else if (EMFSTK.ichemf[kp] == 0) flukaid = 7;
- else if (EMFSTK.ichemf[kp] == 1) flukaid = 4;
+ if (EMFSTK.ichemf[kp] == -1) flukaid = kFLUKAelectron;
+ else if (EMFSTK.ichemf[kp] == 0) flukaid = kFLUKAphoton;
+ else if (EMFSTK.ichemf[kp] == 1) flukaid = kFLUKApositron;
- e *= emvgev;
+ e *= emvgev;
Int_t pdg = fluka->PDGFromId(flukaid);
Double_t p = sqrt(e * e - PAPROP.am[flukaid+6] * PAPROP.am[flukaid+6]);
Double_t px = p * EMFSTK.uemf[kp];
#include <Riostream.h>
#include "TVirtualMCApplication.h"
#include "TFluka.h"
+#include "TFlukaCodes.h"
#include <TLorentzVector.h>
#include "Fdimpar.h" //(DIMPAR) fluka include
#include "Ftrackr.h" //(TRACKR) fluka common
+#include "Fltclcm.h" //(LTCLCM) fluka common
#include "Femfstk.h" //(EMFSTK) fluka common
#ifndef WIN32
# define usdraw usdraw_
Double_t& xsco, Double_t& ysco, Double_t& zsco)
{
TFluka *fluka = (TFluka*)gMC;
+ // nothing to do if particle inside dummy region
+ if (mreg == fluka->GetDummyRegion()) return;
Int_t verbosityLevel = fluka->GetVerbosityLevel();
Bool_t debug = (verbosityLevel >= 3)? kTRUE : kFALSE;
- fluka->SetCaller(6);
- fluka->SetIcode(icode);
+ fluka->SetCaller(kUSDRAW);
+ fluka->SetIcode((FlukaProcessCode_t) icode);
- if (icode/100 == 2) {
+ if (icode/100 == kEMFSCO) {
for (Int_t npnw = EMFSTK.npstrt-1; npnw <= EMFSTK.npemf-1; npnw++) {
if (EMFSTK.iespak[npnw][mkbmx2-1] == TRACKR.ispusr[mkbmx2 - 1] ) {
EMFSTK.iespak[npnw][mkbmx2 - 2] = 1;
- fluka->SetMreg(mreg);
+ Int_t mlttc = LTCLCM.mlatm1;
+ fluka->SetMreg(mreg, mlttc);
fluka->SetXsco(xsco);
fluka->SetYsco(ysco);
fluka->SetZsco(zsco);