/* $Id$ */
+//
+// Realisation of the TVirtualMC interface for the FLUKA code
+// (See official web side http://www.fluka.org/).
+//
+// This implementation makes use of the TGeo geometry modeller.
+// User configuration is via automatic generation of FLUKA input cards.
+//
+// Authors:
+// A. Fasso
+// E. Futo
+// A. Gheata
+// A. Morsch
+//
+
#include <Riostream.h>
//#include "AliModule.h"
TFluka::TFluka()
:TVirtualMC(),
fVerbosityLevel(0),
- sInputFileName("")
+ fInputFileName("")
{
//
// Default constructor
TFluka::TFluka(const char *title, Int_t verbosity, Bool_t isRootGeometrySupported)
:TVirtualMC("TFluka",title, isRootGeometrySupported),
fVerbosityLevel(verbosity),
- sInputFileName(""),
+ fInputFileName(""),
fTrackIsEntering(0),
fTrackIsExiting(0),
fTrackIsNew(0)
// TFluka control methods
//______________________________________________________________________________
void TFluka::Init() {
-
+//
+// Geometry initialisation
+//
if (fVerbosityLevel >=3) cout << "==> TFluka::Init() called." << endl;
if (!gGeoManager) new TGeoManager("geom", "FLUKA geometry");
//______________________________________________________________________________
void TFluka::BuildPhysics() {
+//
+// Prepare FLUKA input files and call FLUKA physics initialisation
+//
+
if (fVerbosityLevel >=3)
cout << "==> TFluka::BuildPhysics() called." << endl;
- InitPhysics(); // prepare input file with the current physics settings
+// Prepare input file with the current physics settings
+ InitPhysics();
cout << "\t* InitPhysics() - Prepare input file was called" << endl;
if (fVerbosityLevel >=2)
GLOBAL.lfdrtr = true;
if (fVerbosityLevel >=2)
- cout << "\t* Opening file " << sInputFileName << endl;
- const char* fname = sInputFileName;
+ cout << "\t* Opening file " << fInputFileName << endl;
+ const char* fname = fInputFileName;
fluka_openinp(lunin, PASSCHARA(fname));
if (fVerbosityLevel >=2)
flukam(1);
if (fVerbosityLevel >=2)
- cout << "\t* Closing file " << sInputFileName << endl;
+ cout << "\t* Closing file " << fInputFileName << endl;
fluka_closeinp(lunin);
FinishGeometry();
//______________________________________________________________________________
void TFluka::ProcessEvent() {
+//
+// Process one event
+//
if (fVerbosityLevel >=3)
cout << "==> TFluka::ProcessEvent() called." << endl;
fApplication->GeneratePrimaries();
#else
void TFluka::ProcessRun(Int_t nevent) {
#endif
+//
+// Run steering
+//
+
if (fVerbosityLevel >=3)
cout << "==> TFluka::ProcessRun(" << nevent << ") called."
<< endl;
if (fVerbosityLevel >=3)
cout << "<== TFluka::ProcessRun(" << nevent << ") called."
<< endl;
+
+ #if ROOT_VERSION_CODE >= 262150
return kTRUE;
+ #endif
}
//_____________________________________________________________________________
void TFluka::SetProcess(const char* flagName, Int_t flagValue, Int_t imat)
{
+// Set process user flag for material imat
+//
strcpy(&fProcessFlag[fNbOfProc][0],flagName);
fProcessValue[fNbOfProc] = flagValue;
fProcessMaterial[fNbOfProc] = imat;
//______________________________________________________________________________
void TFluka::SetProcess(const char* flagName, Int_t flagValue)
{
+// Set process user flag
+//
+
Int_t i;
if (fNbOfProc < 100) {
for (i=0; i<fNbOfProc; i++) {
//______________________________________________________________________________
void TFluka::SetCut(const char* cutName, Double_t cutValue, Int_t imed)
{
+// Set user cut value for material imed
+//
strcpy(&fCutFlag[fNbOfCut][0],cutName);
fCutValue[fNbOfCut] = cutValue;
fCutMaterial[fNbOfCut] = imed;
//______________________________________________________________________________
void TFluka::SetCut(const char* cutName, Double_t cutValue)
{
+// Set user cut value
+//
Int_t i;
if (fNbOfCut < 100) {
for (i=0; i<fNbOfCut; i++) {
//______________________________________________________________________________
void TFluka::InitPhysics()
{
+//
+// Physics initialisation with preparation of FLUKA input cards
+//
printf("=>InitPhysics\n");
Int_t i, j, k;
Double_t fCut;
//______________________________________________________________________________
Bool_t TFluka::IsTrackExiting() const
{
+// True if track is exiting volume
+//
Int_t caller = GetCaller();
if (caller == 12) // bxdraw exiting
return 1;
//______________________________________________________________________________
Int_t TFluka::NSecondaries() const
+
+{
// Number of secondary particles generated in the current step
// FINUC.np = number of secondaries except light and heavy ions
// FHEAVY.npheav = number of secondaries for light and heavy secondary ions
-{
Int_t caller = GetCaller();
if (caller == 6) // valid only after usdraw
return FINUC.np + FHEAVY.npheav;
void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
TLorentzVector& position, TLorentzVector& momentum)
{
+// Copy particles from secondary stack to vmc stack
+//
+
Int_t caller = GetCaller();
if (caller == 6) { // valid only after usdraw
if (isec >= 0 && isec < FINUC.np) {
//______________________________________________________________________________
TMCProcess TFluka::ProdProcess(Int_t) const
+
+{
// Name of the process that has produced the secondary particles
// in the current step
-{
const TMCProcess kIpNoProc = kPNoProcess;
const TMCProcess kIpPDecay = kPDecay;
const TMCProcess kIpPPair = kPPair;