Skip to content

Commit

Permalink
Changes to have the possibility to use Fluka
Browse files Browse the repository at this point in the history
  • Loading branch information
chiarazampolli committed Apr 23, 2018
1 parent d68f2c5 commit e3585bf
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 10 deletions.
26 changes: 24 additions & 2 deletions MC/Config.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static Int_t quenchingConfig = 0; // quenching
static Float_t qhatConfig = 1.7; // q-hat
static Bool_t isGeant4 = kFALSE; // geant4 flag
static Bool_t purifyKine = kTRUE; // purifyKine flag
static Bool_t isFluka = kFALSE; // fluka flag

#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
#include "MC/DetectorConfig.C"
Expand Down Expand Up @@ -98,6 +99,7 @@ Config()
printf(">>>>> random seed: %d \n", seedConfig);
printf(">>>>> geant4: %d \n", isGeant4);
printf(">>>>> purifyKine: %d \n", purifyKine);
printf(">>>>> fluka: %d \n", isFluka);
printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");

#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
Expand All @@ -106,8 +108,14 @@ Config()
LoadLibraries();
#endif

/* Check that it is not set both Geant4 and Fluka */
if (isGeant4 && isFluka) {
printf(">>>>> You cannot have in your parameters both Geant4 and Fluka set!: isGeant4 = %d, isFluka = %d \n", (Int_t)isGeant4, (Int_t)isFluka);
abort();
}

/* setup geant3 */
if (!isGeant4) new TGeant3TGeo("C++ Interface to Geant3");
if (!isGeant4 && !isFluka) new TGeant3TGeo("C++ Interface to Geant3");

/* create galice.root */
CreateGAlice();
Expand All @@ -127,6 +135,14 @@ Config()
gROOT->ProcessLine("Geant4Config();");
}

/* configure Fluka if requested */
if (isFluka) {
gSystem->Load("libfluka.so");
new TFluka("C++ Interface to Fluka", 0/*verbositylevel*/);
TFluka* fluka = (TFluka*) gMC;
fluka->SetLowEnergyNeutronTransport(1);
}

/* configure MC generator */
GeneratorConfig(generatorConfig);
GeneratorOptions();
Expand Down Expand Up @@ -347,6 +363,12 @@ ProcessEnvironment()
purifyKine = kTRUE;
if (gSystem->Getenv("CONFIG_PURIFYKINEOFF"))
purifyKine = kFALSE;

// Fluka configuration
isFluka = kFALSE;
if (gSystem->Getenv("CONFIG_FLUKA"))
isFluka = kTRUE;

}

#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
Expand Down Expand Up @@ -379,7 +401,7 @@ LoadLibraries()
gSystem->Load("libDPMJET");
gSystem->Load("libTDPMjet");
}
gSystem->Load("libgeant321");
if (!isFluka) gSystem->Load("libgeant321");

}
#endif
Expand Down
3 changes: 2 additions & 1 deletion MC/Config_LoadLibraries.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Config_LoadLibraries()
gSystem->Load("libDPMJET");
gSystem->Load("libTDPMjet");
}
gSystem->Load("libgeant321");
TString isFluka = gSystem->Getenv("CONFIG_FLUKA");
if (isFluka!="on") gSystem->Load("libgeant321");

}

16 changes: 10 additions & 6 deletions MC/DetectorConfig.C
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ DetectorInit(Int_t tag)
//============================ TPC parameters =====================

AliTPC *TPC = new AliTPCv2("TPC", "Default");
if (isGeant4)
if (isGeant4 || isFluka)
TPC->SetPrimaryIonisation(1);
if( tag == kDetectorPhosOnly)
TPC->DisableStepManager();
Expand Down Expand Up @@ -537,11 +537,15 @@ DetectorInit(Int_t tag)
}

if (iAD){
//=================== AD parameters ============================

AliAD *AD = new AliADv1("AD", "normal AD");
if( tag == kDetectorPhosOnly)
AD->DisableStepManager();
if (!isFluka){ // does not work for now with Fluka
//=================== AD parameters ============================
AliAD *AD = new AliADv1("AD", "normal AD");
if( tag == kDetectorPhosOnly)
AD->DisableStepManager();
}
else {
Printf("AD is disabled, as we are using Fluka");
}
}

}
Expand Down
8 changes: 8 additions & 0 deletions MC/FlukaConfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# Link here some special Fluka files needed
ln -s $FLUPRO/neuxsc-ind_260.bin neuxsc.bin
ln -s $FLUVMC/input/coreFlukaVmc.inp coreFlukaVmc.inp
ln -s $FLUPRO/random.dat old.seed
ln -s $FLUPRO/fluodt.dat
ln -s $FLUPRO/xnloan.dat
15 changes: 14 additions & 1 deletion MC/dpgsim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ALIDPG_ROOT/DataProc/Common/EnableVDTUponPackageVersion.sh
###################

# set job and simulation variables as :
COMMAND_HELP="./dpgsim.sh --mode <mode> --run <run> --generator <generatorConfig> --energy <energy> --system <system> --detector <detectorConfig> --magnet <magnetConfig> --simulation <simulationConfig> --reconstruction <reconstructionConfig> --uid <uniqueID> --nevents <numberOfEvents> --qa <qaConfig> --aod <aodConfig> --ocdb <ocdbConfig> --hlt <hltConfig> --keepTrackRefsFraction <percentage> --ocdbCustom --purifyKineOff"
COMMAND_HELP="./dpgsim.sh --mode <mode> --run <run> --generator <generatorConfig> --energy <energy> --system <system> --detector <detectorConfig> --magnet <magnetConfig> --simulation <simulationConfig> --reconstruction <reconstructionConfig> --uid <uniqueID> --nevents <numberOfEvents> --qa <qaConfig> --aod <aodConfig> --ocdb <ocdbConfig> --hlt <hltConfig> --keepTrackRefsFraction <percentage> --ocdbCustom --purifyKineOff --fluka --geant4"

function runcommand(){
echo -e "\n"
Expand Down Expand Up @@ -161,6 +161,7 @@ CONFIG_OCDBRUN3=""
CONFIG_PURIFYKINEOFF=""
CONFIG_HLT=""
CONFIG_GEANT4=""
CONFIG_FLUKA=""
CONFIG_FASTB="on"
CONFIG_VDT="on"
CONFIG_MATERIAL=""
Expand Down Expand Up @@ -349,6 +350,9 @@ while [ ! -z "$1" ]; do
elif [ "$option" = "--geant4" ]; then
CONFIG_GEANT4="on"
export CONFIG_GEANT4
elif [ "$option" = "--fluka" ]; then
CONFIG_FLUKA="on"
export CONFIG_FLUKA
elif [ "$option" = "--nofastB" ]; then
CONFIG_FASTB=""
elif [ "$option" = "--novdt" ]; then
Expand Down Expand Up @@ -495,6 +499,13 @@ if [[ $CONFIG_MODE == *"Run3"* ]]; then
fi
fi

### check for Fluka and configure it if needed

if [[ $CONFIG_FLUKA == "on" ]]; then
echo "* Linking files needed for Fluka"
source $ALIDPG_ROOT/MC/FlukaConfig.sh
fi

### check whether we are in OCDB generation job

if [[ $ALIEN_JDL_LPMOCDBJOB == "true" ]]; then
Expand Down Expand Up @@ -720,6 +731,8 @@ echo "No. Events....... $CONFIG_NBKG"
echo "============================================"
echo "Detector......... $CONFIG_DETECTOR"
echo "GEANT4........... $CONFIG_GEANT4"
echo "FLUKA............ $CONFIG_FLUKA"
echo "PurifyKineOff.... $CONFIG_PURIFYKINEOFF"
echo "Fast-B........... $CONFIG_FASTB"
echo "VDT math......... $CONFIG_VDT"
echo "Material Budget.. $CONFIG_MATERIAL"
Expand Down

0 comments on commit e3585bf

Please sign in to comment.