Skip to content

Commit

Permalink
Modifications required by Root6
Browse files Browse the repository at this point in the history
  • Loading branch information
hristov authored and hristov committed Feb 10, 2017
1 parent 6e75ce5 commit 40360ce
Show file tree
Hide file tree
Showing 29 changed files with 301 additions and 266 deletions.
34 changes: 6 additions & 28 deletions test/vmctest/gun/commonConfig.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,12 @@ const char * pprTrigConfName[] = {
"p-p","Pb-Pb"
};

enum ConfigVersion_t {
kConfigV0, // default configuration
kConfigV1 // configuration for LHC 2010 production
};

// Options
static AliMagF::BMap_t smag = AliMagF::k5kG;
static PprTrigConf_t strig = kDefaultPPTrig; // default PP trigger configuration
static TString comment;

// Functions
void LoadPythia();

void commonConfig(ConfigVersion_t configVersion = kConfigV0)
void commonConfig(Bool_t isConfig2010 = kFALSE)
{
cout << "Running commonConfig.C ... " << endl;

Expand All @@ -38,12 +30,6 @@ void commonConfig(ConfigVersion_t configVersion = kConfigV0)
AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);


//=======================================================================
// Load Pythia libraries
//=======================================================================

LoadPythia();

//=======================================================================
// ALICE steering object (AliRunLoader)
//=======================================================================
Expand Down Expand Up @@ -202,7 +188,7 @@ void commonConfig(ConfigVersion_t configVersion = kConfigV0)
//=================== TRD parameters ============================

AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
if ( configVersion == kConfigV1 ) {
if ( isConfig2010 ) {
AliTRDgeometry *geoTRD = TRD->GetGeometry();
// Partial geometry: modules at 0,1,7,8,9,16,17
// starting at 3h in positive direction
Expand Down Expand Up @@ -236,9 +222,9 @@ void commonConfig(ConfigVersion_t configVersion = kConfigV0)

if (iPHOS)
{
if ( configVersion == kConfigV0 )
if ( !isConfig2010 )
AliPHOS *PHOS = new AliPHOSv1("PHOS", "Run1");
else if ( configVersion == kConfigV1 )
else
AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
}

Expand All @@ -258,9 +244,9 @@ void commonConfig(ConfigVersion_t configVersion = kConfigV0)
if (iEMCAL)
{
//=================== EMCAL parameters ============================
if ( configVersion == kConfigV0 )
if ( !isConfig2010 )
AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
else if ( configVersion == kConfigV1 )
else
AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_FIRSTYEARV1");
}

Expand All @@ -281,11 +267,3 @@ void commonConfig(ConfigVersion_t configVersion = kConfigV0)
cout << "Running commonConfig.C finished ... " << endl;
}

void LoadPythia()
{
// Load Pythia related libraries
gSystem->Load("liblhapdf"); // Parton density functions
gSystem->Load("libEGPythia6"); // TGenerator interface
gSystem->Load("libpythia6"); // Pythia
gSystem->Load("libAliPythia6"); // ALICE specific implementations
}
8 changes: 0 additions & 8 deletions test/vmctest/gun/g3Config.C
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,15 @@ void Config()

// AliRoot setup
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");
commonConfig();

// Load Geant3 + Geant3 VMC libraries
//
#if defined(__CINT__)
gSystem->Load("libgeant321");
#endif

// Create TGeant3
//
new TGeant3TGeo("C++ Interface to Geant3");

// AliRoot event generator
// (it has to be created after MC, as it may use decayer via VMC)
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");
genExtFileConfig();

cout << "Running g3Config.C finished ... " << endl;
Expand Down
17 changes: 7 additions & 10 deletions test/vmctest/gun/g4Config.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ void Config()

// AliRoot setup
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");
commonConfig();

// TPC primary ionization
Expand All @@ -26,14 +25,13 @@ void Config()

// Load Geant4 + Geant4 VMC libraries
//
std::string g4libmacro("$G4VMCINSTALL/share/examples/macro/g4libs.C");
if (gClassTable->GetID("TGeant4") == -1) {
// Load Geant4 libraries
if (!gInterpreter->IsLoaded(g4libmacro.c_str())) {
gROOT->LoadMacro(g4libmacro.c_str());
gInterpreter->ProcessLine("g4libs()");
}
}
// if (gClassTable->GetID("TGeant4") == -1) {
// // Load Geant4 libraries
// if (!gInterpreter->IsLoaded(g4libmacro.c_str())) {
// gROOT->LoadMacro(g4libmacro.c_str());
// gInterpreter->ProcessLine("g4libs()");
// }
// }

// Create Geant4 VMC
//
Expand Down Expand Up @@ -157,7 +155,6 @@ G4ProcessTable::Insert : arguments are 0 pointer
// AliRoot event generator
// (it has to be created after MC, as it may use decayer via VMC)
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");
genExtFileConfig();

cout << "Running g4Config.C finished ... " << endl;
Expand Down
29 changes: 1 addition & 28 deletions test/vmctest/gun/gen.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,8 @@
//
// By I. Hrivnacova, IPN Orsay

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
#include <TH1F.h>
#include <TStopwatch.h>
#include <TDatime.h>
#include <TRandom.h>
#include <TDatabasePDG.h>
#include <TParticle.h>
#include <TArrayI.h>

#include "AliGenerator.h"
#include "AliPDG.h"
#include "AliRunLoader.h"
#include "AliRun.h"
#include "AliStack.h"
#include "AliHeader.h"
#include "PYTHIA6/AliGenPythia.h"
#include "PYTHIA6/AliPythia.h"
#endif

void gen(Int_t nev = 1, char* filename = "galice.root")
void gen(Int_t nev = 1)
{
// Load libraries
// gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT");
gSystem->Load("liblhapdf"); // Parton density functions
gSystem->Load("libEGPythia6"); // TGenerator interface
gSystem->Load("libpythia6"); // Pythia
gSystem->Load("libAliPythia6"); // ALICE specific implementations

AliPDG::AddParticlesToPdgDataBase();
TDatabasePDG::Instance();
Expand All @@ -55,7 +29,6 @@ void gen(Int_t nev = 1, char* filename = "galice.root")
AliHeader* header = rl->GetHeader();

// Create and Initialize Generator
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genGunConfig.C");
AliGenerator* gener = genGunConfig();

// Go to galice.root
Expand Down
19 changes: 0 additions & 19 deletions test/vmctest/gun/genConfig.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,9 @@

void Config()
{
cout << "Running genConfig.C ... " << endl;

// AliRoot setup
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");
commonConfig(kFALSE);

// Load Geant3 + Geant3 VMC libraries
//
#if defined(__CINT__)
gSystem->Load("libgeant321");
#endif

// Create TGeant3
//
new TGeant3TGeo("C++ Interface to Geant3");

// AliRoot event generator
// (it has to be created after MC, as it may use decayer via VMC)
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genGunConfig.C");
genGunConfig();

cout << "Running genConfig.C finished ... " << endl;
}
19 changes: 19 additions & 0 deletions test/vmctest/gun/rungen.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Int_t n = 100; // This makes n "visible" to the compiled macro
void rungen(Int_t nev, const char* configMacro) {
// Load libraries
gSystem->Load("liblhapdf"); // Parton density functions
gSystem->Load("libEGPythia6"); // TGenerator interface
gSystem->Load("libpythia6"); // Pythia
gSystem->Load("libAliPythia6"); // ALICE specific implementations


// Load configuration macros

gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genGunConfig.C");
gROOT->LoadMacro(configMacro);

n = nev; // Use the requested number of events
// Execute gen.C
gROOT->Macro("gen.C(n)");
}
2 changes: 1 addition & 1 deletion test/vmctest/gun/rungen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GENCONFIG="$ALICE_ROOT/test/vmctest/gun/genConfig.C"
OUTDIR=gen

rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
aliroot -b -q gen.C\($NEVENTS,\""$GENCONFIG"\"\) 2>&1 | tee gen.log
aliroot -b -q rungen.C\($NEVENTS,\""$GENCONFIG"\"\) 2>&1 | tee gen.log
rm -fr $OUTDIR
mkdir $OUTDIR
mv galice.root Kinematics*.root gen.log $OUTDIR
Expand Down
2 changes: 1 addition & 1 deletion test/vmctest/gun/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

if [ "$RUNG4" = "1" ]; then
rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
aliroot -b -q sim.C\($NEVENTS,\""$G4CONFIG"\"\) 2>&1 | tee sim.log
aliroot -b -q simG4.C\($NEVENTS,\""$G4CONFIG"\"\) 2>&1 | tee sim.log
aliroot -b -q rec.C 2>&1 | tee rec.log
aliroot -b -q ${ALICE_ROOT}/STEER/macros/CheckESD.C 2>&1 | tee check.log
rm -fr $G4OUTDIR
Expand Down
18 changes: 17 additions & 1 deletion test/vmctest/gun/sim.C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,23 @@
// Macro for running simulation in test/vmctest/gun.
// From test/gun.

void sim(Int_t nev=1, const TString& config) {
void sim(Int_t nev, const char * config) {
// Load Geant3 + Geant3 VMC libraries
//
gSystem->Load("liblhapdf"); // Parton density functions
gSystem->Load("libEGPythia6"); // TGenerator interface
gSystem->Load("libpythia6"); // Pythia
gSystem->Load("libAliPythia6"); // ALICE specific implementations
gSystem->Load("libgeant321");

// AliRoot setup
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");

// AliRoot event generator
// (it has to be created after MC, as it may use decayer via VMC)
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");

AliSimulation simulator(config);
simulator.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO ACORDE");
Expand Down
40 changes: 40 additions & 0 deletions test/vmctest/gun/simG4.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// $Id$
//
// Macro for running simulation in test/vmctest/gun.
// From test/gun.

void simG4(Int_t nev, const char * config) {
// Load Geant3 + Geant3 VMC libraries
//
gSystem->Load("liblhapdf"); // Parton density functions
gSystem->Load("libEGPythia6"); // TGenerator interface
gSystem->Load("libpythia6"); // Pythia
gSystem->Load("libAliPythia6"); // ALICE specific implementations

gROOT->Macro("$G4VMCINSTALL/share/examples/macro/g4libs.C");
// AliRoot setup
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");

// AliRoot event generator
// (it has to be created after MC, as it may use decayer via VMC)
//
gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");

AliSimulation simulator(config);
simulator.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO ACORDE");
simulator.SetMakeDigitsFromHits("ITS TPC");
simulator.SetWriteRawData("ALL","raw.root",kTRUE);

simulator.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
simulator.SetSpecificStorage("GRP/GRP/Data",
Form("local://%s",gSystem->pwd()));

simulator.SetRunHLT("default"); // In case we do not have ancored production

TStopwatch timer;
timer.Start();
simulator.Run(nev);
timer.Stop();
timer.Print();
}
Loading

0 comments on commit 40360ce

Please sign in to comment.