fBirkC2 = 9.6e-6/(1.032 * 1.032);
}
+
//____________________________________________________________________________
void AliEMCAL::DefineMediumParameters()
{
fBirkC1 = 0.013/dP;
fBirkC2 = 9.6e-6/(dP * dP);
- DefineMediumParameters(); // Feb 20, 2007
+ // Call just in case of Geant3; What to do in case of Geant4 ?
+ // if(gMC->InheritsFrom("TGeant3")) DefineMediumParameters(); // Feb 20, 2007
+ // Just do the same but in Init() function
+ // DefineMediumParameters();
}
+
+//____________________________________________________________________________
+void AliEMCAL::Init()
+{
+ // Call just in case of Geant3; What to do in case of Geant4 ?
+ // if(gMC->InheritsFrom("TGeant3")) DefineMediumParameters(); // Feb 20, 2007
+ // Just do the same
+ DefineMediumParameters();
+}
+
//____________________________________________________________________________
void AliEMCAL::Digits2Raw() {
}
virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
virtual void CreateMaterials() ;
+ virtual void Init() ;
virtual void Digits2Raw();
virtual void FinishRun() {}
AliMaterial(++matId,"W" ,aW ,zW ,dW ,radW ,absW ); AliMedium(kW ,"W" , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
AliMaterial(++matId,"Al" ,aAl ,zAl ,dAl ,radAl ,absAl ); AliMedium(kAl ,"Al" , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
AliMaterial(++matId,"Ar" ,aAr ,zAr ,dAr ,radAr ,absAr ); AliMedium(kAr ,"Ar" , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
-
- InitProperties();
}//void AliHMPID::CreateMaterials()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Arguments: none
// Returns: none
AliDebug(1,"Start v2 HMPID.");
+ InitProperties();
AliDebug(1,"Stop v2 HMPID.");
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void AliHMPIDv3::DefineOpticalProperties()
{
+ AliDebug(1,"");
+
// Optical properties definition.
const Int_t kNbins=30; //number of photon energy points
Float_t emin=5.5,emax=8.5; //Photon energy range,[eV]
AliModule *detector;
AliInfo("Optical properties definition");
while((detector = dynamic_cast<AliModule*>(next()))) {
+ // Initialise detector geometry
+ if(gAlice->IsRootGeometry()) detector->CreateMaterials();
// Initialise detector optical properties
detector->DefineOpticalProperties();
}
AliModule *detector;
while((detector = dynamic_cast<AliModule*>(next()))) {
stw.Start();
- // Initialise detector geometry
- if(gAlice->IsRootGeometry()) detector->CreateMaterials();
detector->Init();
AliInfo(Form("%10s R:%.2fs C:%.2fs",
detector->GetName(),stw.RealTime(),stw.CpuTime()));
void AliMC::PreTrack()
{
// Actions before the track's transport
+
TObjArray &dets = *gAlice->Modules();
AliModule *module;
for(Int_t i=0; i<=gAlice->GetNdets(); i++)
if((module = dynamic_cast<AliModule*>(dets[i])))
module->PreTrack();
-
}
//_______________________________________________________________________
void AliMC::PostTrack()
{
// Posts tracks for each module
+
TObjArray &dets = *gAlice->Modules();
AliModule *module;
//
// Called at the end of each primary track
//
+
AliRunLoader *runloader=AliRunLoader::Instance();
// static Int_t count=0;
// const Int_t times=10;
//
// Called at the end of the event.
//
-
- //
if(AliSimulation::Instance()->Lego()) AliSimulation::Instance()->Lego()->FinishEvent();
fTmpTrackReferences.Clear();
}
+//_______________________________________________________________________
void AliMC::RemapTrackReferencesIDs(Int_t *map)
{
//
fTmpTrackReferences.Compress();
}
+//_______________________________________________________________________
void AliMC::FixParticleDecaytime()
{
//
fTmpTreeTR->Branch("TrackReferences", "TClonesArray", &pRef, 4000);
}
+//_______________________________________________________________________
void AliMC::ReorderAndExpandTreeTR()
{
//
= new(fParticles[fLoadPoint++])
TParticle(pdg, is, parent, -1, kFirstDaughter, kLastDaughter,
px, py, pz, e, vx, vy, vz, tof);
-
+
particle->SetPolarisation(polx, poly, polz);
particle->SetWeight(weight);
particle->SetUniqueID(mech);
particle->SetBit(kDaughtersBit);
// Add the particle to the stack
-
fParticleMap.AddAtAndExpand(particle, fNtrack);//CHECK!!
if(parent>=0) {
TParticle* particle = Particle(i);
- if (!particle->TestBit(kDoneBit))
+ if (!particle->TestBit(kDoneBit)) {
+ fCurrentTrack = particle;
return particle;
+ }
else
return 0;
}
"\n=======================================================================\n\n");
}
+//_____________________________________________________________________________
+void AliStack::SetCurrentTrack(Int_t track)
+{
+ fCurrent = track;
+ if (fCurrent < fNprimary) fCurrentTrack = Particle(track);
+}
+
+
+//_____________________________________________________________________________
//
// protected methods
//
return isStable;
}
+//_____________________________________________________________________________
Bool_t AliStack::IsPhysicalPrimary(Int_t index)
{
//
inline void AliStack::SetNtrack(Int_t ntrack)
{ fNtrack = ntrack; }
-inline void AliStack::SetCurrentTrack(Int_t track)
-{ fCurrent = track; }
-
inline Int_t AliStack::GetNtrack() const
{ return fNtrack; }
// AliRun with this g4Config.C
//
// aliroot
-// root [0] gAlice->Init("g4Config.C");
-// root [1] gAlice->Run();
+// root [0] AliSimulation sim("$ALICE_ROOT/macros/g4Config.C");
+// root [1] .... customize your simulation setting here
+// root [1] sim.Run(10);
//
// You can also start from a mini GUI - g4menu.C.
// See description in this macro.
// AliRoot setup
//
- gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon.C");
- ConfigCommon();
+ gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon1.C");
+ ConfigCommon1();
// Load Geant4 + Geant4 VMC libraries
//
// Create Geant4 VMC
//
TGeant4 *geant4 = 0;
- if (!gMC) {
+ if ( ! gMC ) {
TG4RunConfiguration* runConfiguration
= new TG4RunConfiguration("geomRoot",
- "emStandard+optical",
- "specialCuts+specialControls+stackPopper",
+ "QGSP_BERT_EMV+optical",
+ "specialCuts+stackPopper+stepLimiter",
true);
// = new TG4RunConfiguration("geomRootToGeant4",
// "emStandard+optical",
-// "specialCuts+specialControls+stackPopper",
+// "specialCuts+specialControls+stackPopper+stepLimiter",
// true);
geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
cout << "Geant4 has been created." << endl;
- } else {
+ }
+ else {
cout << "Monte Carlo has been already created." << endl;
}
-
- //
- // Set External decayer
- TVirtualMCDecayer *decayer = new AliDecayerPythia();
-
- decayer->SetForceDecay(kAll);
- decayer->Init();
- gMC->SetExternalDecayer(decayer);
-
- //=======================================================================
- // ************* STEERING parameters FOR ALICE SIMULATION **************
- // --- Specify event type to be tracked through the ALICE setup
- // --- All positions are in cm, angles in degrees, and P and E in GeV
- gMC->SetProcess("DCAY",1);
- gMC->SetProcess("PAIR",1);
- gMC->SetProcess("COMP",1);
- gMC->SetProcess("PHOT",1);
- gMC->SetProcess("PFIS",0);
- gMC->SetProcess("DRAY",0);
- gMC->SetProcess("ANNI",1);
- gMC->SetProcess("BREM",1);
- gMC->SetProcess("MUNU",1);
- gMC->SetProcess("CKOV",1);
- gMC->SetProcess("HADR",1);
- gMC->SetProcess("LOSS",2);
- gMC->SetProcess("MULS",1);
- //gMC->SetProcess("RAYL",1);
+ // Customization of Geant4 VMC
+ //
- Float_t cut = 1.e-3; // 1MeV cut by default
- Float_t tofmax = 1.e10;
+ geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm");
+ geant4->ProcessGeantCommand("/mcVerbose/all 1");
- gMC->SetCut("CUTGAM", cut);
- gMC->SetCut("CUTELE", cut);
- gMC->SetCut("CUTNEU", cut);
- gMC->SetCut("CUTHAD", cut);
- gMC->SetCut("CUTMUO", cut);
- gMC->SetCut("BCUTE", cut);
- gMC->SetCut("BCUTM", cut);
- gMC->SetCut("DCUTE", cut);
- gMC->SetCut("DCUTM", cut);
- gMC->SetCut("PPCUTM", cut);
- gMC->SetCut("TOFMAX", tofmax);
+ // Uncomment this line to get a detail info from each step
+ //geant4->ProcessGeantCommand("/tracking/verbose 1");
+
+ // More info from the physics list
+ // the verbosity level is passed to all contained physics lists and their
+ // physics builders
+ //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
+
+ // More info from optical processes
+ //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");
+
+ // More info from geometry building
+ //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
- // Set apply cuts
- geant4->ProcessGeantCommand("/run/particle/applyCuts");
- // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");
- geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
- geant4->ProcessGeantCommand("/mcDet/volNameSeparator !");
- geant4->ProcessGeantCommand("/mcControl/g3Defaults");
- geant4->ProcessGeantCommand("/mcPhysics/setStackPopperSelection e+ e- pi+ pi- kaon+ kaon- gamma");
- // geant4->ProcessGeantCommand("/tracking/verbose 1");
+ // More info from setting geometry properties (in materials and surfaces)
+ // for optical physics
+ //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
+
+ // More info about regions construction
+ // and conversion of VMC cuts in cuts in range per regions
+ //geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
+
+ // Suppress verbose info from tracks which reached maximum number of steps
+ // (default value is 30000)
+ geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
+
+ // AliRoot event generator
+ // (it has to be created after MC, as it may use decayer via VMC)
+ //
+ gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon2.C");
+ ConfigCommon2();
cout << "Running g4Config.C finished ... " << endl;
}
--- /dev/null
+// $Id: g4ConfigCommon.C 30849 2009-02-01 11:42:22Z fca $
+//
+// AliRoot Configuration for running aliroot with Monte Carlo.
+// ConfigCommon1() includes the common setting for all MCs
+// which has to be called before MC is instantiated.
+// Called from g4Config.C
+//
+// By I. Hrivnacova, IPN Orsay
+
+// Options
+static AliMagF::BMap_t smag = AliMagF::k5kG;
+static TString comment;
+
+// Functions
+void LoadPythia();
+
+void ConfigCommon1(Bool_t setRootGeometry = kTRUE)
+{
+ cout << "Running ConfigCommon1.C ... " << endl;
+
+ //=======================================================================
+ // Load Pythia libraries
+ //=======================================================================
+
+ LoadPythia();
+
+ //=======================================================================
+ // ALICE steering object (AliRunLoader)
+ //=======================================================================
+
+ // Set Root geometry file
+ if ( setRootGeometry ) {
+ gAlice->SetRootGeometry();
+ gAlice->SetGeometryFromFile("geometry.root");
+ }
+
+ AliRunLoader* rl
+ = AliRunLoader::Open("galice.root",
+ AliConfig::GetDefaultEventFolderName(),
+ "recreate");
+ if ( ! rl ) {
+ gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+ return;
+ }
+ rl->SetCompressionLevel(2);
+ rl->SetNumberOfEventsPerFile(3);
+ gAlice->SetRunLoader(rl);
+
+ //=======================================================================
+ // Trigger configuration
+ //=======================================================================
+
+ gAlice->SetTriggerDescriptor("Pb-Pb");
+ cout<<"Trigger configuration is set to Pb-Pb"<<endl;
+
+ // =============================
+ // Magnetic field
+ // =============================
+
+ // Field (L3 0.4 T)
+ if (smag == AliMagF::k2kG) {
+ comment = comment.Append(" | L3 field 0.2 T");
+ }
+ else if (smag == AliMagF::k5kG) {
+ comment = comment.Append(" | L3 field 0.5 T");
+ }
+ // OK
+ AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., smag);
+ TGeoGlobalMagField::Instance()->SetField(field);
+
+ printf("\n \n Comment: %s \n \n", comment.Data());
+
+ // =============================
+ // Modules
+ // =============================
+
+ rl->CdGAFile();
+
+ Int_t iABSO = 1;
+ Int_t iDIPO = 1;
+ Int_t iFMD = 1;
+ Int_t iFRAME = 1;
+ Int_t iHALL = 1;
+ Int_t iITS = 1;
+ Int_t iMAG = 1;
+ Int_t iMUON = 1;
+ Int_t iPHOS = 1;
+ Int_t iPIPE = 1;
+ Int_t iPMD = 1;
+ Int_t iHMPID = 1;
+ Int_t iSHIL = 1;
+ Int_t iT0 = 1;
+ Int_t iTOF = 1;
+ Int_t iTPC = 1;
+ Int_t iTRD = 1;
+ Int_t iZDC = 1;
+ Int_t iEMCAL = 1;
+ Int_t iACORDE = 0;
+ Int_t iVZERO = 1;
+/*
+ Int_t iABSO = 0;
+ Int_t iDIPO = 0;
+ Int_t iFMD = 0;
+ Int_t iFRAME = 0;
+ Int_t iHALL = 0;
+ Int_t iITS = 0;
+ Int_t iMAG = 0;
+ Int_t iMUON = 0;
+ Int_t iPHOS = 0;
+ Int_t iPIPE = 0;
+ Int_t iPMD = 0;
+ Int_t iHMPID = 0;
+ Int_t iSHIL = 0;
+ Int_t iT0 = 0;
+ Int_t iTOF = 0;
+ Int_t iTPC = 1;
+ Int_t iTRD = 0;
+ Int_t iZDC = 0;
+ Int_t iEMCAL = 0;
+ Int_t iACORDE = 0;
+ Int_t iVZERO = 0;
+*/
+ rl->CdGAFile();
+ //=================== Alice BODY parameters =============================
+ AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+ if (iMAG)
+ {
+ //=================== MAG parameters ============================
+ // --- Start with Magnet since detector layouts may be depending ---
+ // --- on the selected Magnet dimensions ---
+ AliMAG *MAG = new AliMAG("MAG", "Magnet");
+ }
+
+
+ if (iABSO)
+ {
+ //=================== ABSO parameters ============================
+ AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
+ }
+
+ if (iDIPO)
+ {
+ //=================== DIPO parameters ============================
+
+ AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
+ }
+
+ if (iHALL)
+ {
+ //=================== HALL parameters ============================
+
+ AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
+ }
+
+
+ if (iFRAME)
+ {
+ //=================== FRAME parameters ============================
+
+ AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+ FRAME->SetHoles(1);
+ }
+
+ if (iSHIL)
+ {
+ //=================== SHIL parameters ============================
+
+ AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
+ }
+
+
+ if (iPIPE)
+ {
+ //=================== PIPE parameters ============================
+
+ AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
+ }
+
+ if (iITS)
+ {
+ //=================== ITS parameters ============================
+
+ AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+ }
+
+ if (iTPC)
+ {
+ //============================ TPC parameters ===================
+ AliTPC *TPC = new AliTPCv2("TPC", "Default");
+ }
+
+
+ if (iTOF) {
+ //=================== TOF parameters ============================
+ AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
+ }
+
+
+ if (iHMPID)
+ {
+ //=================== HMPID parameters ===========================
+ AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
+
+ }
+
+
+ if (iZDC)
+ {
+ //=================== ZDC parameters ============================
+
+ AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
+ }
+
+ if (iTRD)
+ {
+ //=================== TRD parameters ============================
+
+ AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+ }
+
+ if (iFMD)
+ {
+ //=================== FMD parameters ============================
+ AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+ }
+
+ if (iMUON)
+ {
+ //=================== MUON parameters ===========================
+ // New MUONv1 version (geometry defined via builders)
+ AliMUON *MUON = new AliMUONv1("MUON", "default");
+ }
+ //=================== PHOS parameters ===========================
+
+ if (iPHOS)
+ {
+ AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+ }
+
+
+ if (iPMD)
+ {
+ //=================== PMD parameters ============================
+ AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+ }
+
+ if (iT0)
+ {
+ //=================== T0 parameters ============================
+ AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
+ }
+
+ if (iEMCAL)
+ {
+ //=================== EMCAL parameters ============================
+ AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
+ }
+
+ if (iACORDE)
+ {
+ //=================== ACORDE parameters ============================
+ AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
+ }
+
+ if (iVZERO)
+ {
+ //=================== ACORDE parameters ============================
+ AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
+ }
+
+ AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
+
+ cout << "Running ConfigCommon1.C finished ... " << endl;
+}
+
+void LoadPythia()
+{
+ // Load Pythia related libraries
+ gSystem->Load("liblhapdf.so"); // Parton density functions
+ gSystem->Load("libEGPythia6.so"); // TGenerator interface
+ gSystem->Load("libpythia6.so"); // Pythia
+ gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
+}
--- /dev/null
+// $Id: g4ConfigCommon.C 30849 2009-02-01 11:42:22Z fca $
+//
+// AliRoot Configuration for running aliroot with Monte Carlo.
+// ConfigCommon2() includes the common setting for all MCs
+// which has to be called after MC is instantiated.
+// Called from g4Config.C
+//
+// By I. Hrivnacova, IPN Orsay
+
+// Functions
+Float_t EtaToTheta(Float_t arg);
+AliGenerator* GeneratorFactory();
+
+void ConfigCommon2()
+{
+ cout << "Running ConfigCommon2.C ... " << endl;
+
+ //=======================================================================
+ // Steering parameters for ALICE simulation
+ //=======================================================================
+
+ gMC->SetProcess("DCAY",1);
+ gMC->SetProcess("PAIR",1);
+ gMC->SetProcess("COMP",1);
+ gMC->SetProcess("PHOT",1);
+ gMC->SetProcess("PFIS",0);
+ gMC->SetProcess("DRAY",0);
+ gMC->SetProcess("ANNI",1);
+ gMC->SetProcess("BREM",1);
+ gMC->SetProcess("MUNU",1);
+ gMC->SetProcess("CKOV",1);
+ gMC->SetProcess("HADR",1);
+ gMC->SetProcess("LOSS",2);
+ gMC->SetProcess("MULS",1);
+ //gMC->SetProcess("RAYL",1);
+
+ Float_t cut = 1.e-3; // 1MeV cut by default
+ Float_t tofmax = 1.e10;
+
+ gMC->SetCut("CUTGAM", cut);
+ gMC->SetCut("CUTELE", cut);
+ gMC->SetCut("CUTNEU", cut);
+ gMC->SetCut("CUTHAD", cut);
+ gMC->SetCut("CUTMUO", cut);
+ gMC->SetCut("BCUTE", cut);
+ gMC->SetCut("BCUTM", cut);
+ gMC->SetCut("DCUTE", cut);
+ gMC->SetCut("DCUTM", cut);
+ gMC->SetCut("PPCUTM", cut);
+ gMC->SetCut("TOFMAX", tofmax);
+
+ //=======================================================================
+ // External decayer
+ //=======================================================================
+
+ TVirtualMCDecayer *decayer = new AliDecayerPythia();
+ decayer->SetForceDecay(kAll);
+ decayer->Init();
+
+ //forbid some decays
+ AliPythia * py= AliPythia::Instance();
+ py->SetMDME(737,1,0); //forbid D*+->D+ + pi0
+ py->SetMDME(738,1,0);//forbid D*+->D+ + gamma
+
+ for(Int_t d=747; d<=762; d++){
+ py->SetMDME(d,1,0);
+ }
+
+ for(Int_t d=764; d<=807; d++){
+ py->SetMDME(d,1,0);
+ }
+
+ gMC->SetExternalDecayer(decayer);
+
+ //=======================================================================
+ // Event generator
+ //=======================================================================
+
+ // Set Random Number seed
+ gRandom->SetSeed(123456); // Set 0 to use the currecnt time
+ AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
+
+ int nParticles = 100;
+ if (gSystem->Getenv("CONFIG_NPARTICLES")) {
+ nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
+ }
+
+ AliGenCocktail *gener = new AliGenCocktail();
+ gener->SetPhiRange(0, 360);
+ // Set pseudorapidity range from -8 to 8.
+ Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
+ Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
+ gener->SetThetaRange(thmin,thmax);
+ gener->SetOrigin(0, 0, 0); //vertex position
+ gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
+
+ AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
+ hijingparam->SetMomentumRange(0.2, 999);
+ gener->AddGenerator(hijingparam,"HIJING PARAM",1);
+ gener->Init();
+
+ // Activate this line if you want the vertex smearing to happen
+ // track by track
+ //
+ //gener->SetVertexSmear(perTrack);
+
+/*
+ // External generator configuration
+ AliGenerator* gener = GeneratorFactory();
+ gener->SetOrigin(0, 0, 0); // vertex position
+ gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
+ gener->SetCutVertexZ(1.); // Truncate at 1 sigma
+ gener->SetVertexSmear(kPerEvent);
+ gener->SetTrackingFlag(1);
+ gener->Init();
+*/
+ cout << "Running ConfigCommon2.C finished ... " << endl;
+}
+
+Float_t EtaToTheta(Float_t arg){
+ return (180./TMath::Pi())*2.*atan(exp(-arg));
+}
+
+AliGenerator* GeneratorFactory() {
+
+ AliGenExtFile *gener = new AliGenExtFile(-1);
+ AliGenReaderTreeK * reader = new AliGenReaderTreeK();
+
+ reader->SetFileName("galice.root");
+ reader->AddDir("gen");
+ gener->SetReader(reader);
+
+ return gener;
+}
+
// AliRoot setup
//
- gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon.C");
- ConfigCommon(kFALSE);
+ gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon1.C");
+ ConfigCommon1(kFALSE);
cout << "Running g4ConfigGometry.C finished ... " << endl;
gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
gInterpreter->ProcessLine("g4libs()");
+ // Load ALICE Geant4 library
+ //cout << "Loading g4alice library ..." << endl;
+ //gSystem->Load("libg4alice");
+
// Menu
TControlBar* menu = new TControlBar("vertical","Alice Geant4 menu");
menu->AddButton("Geometry", "MakeGeometry()", "Generate Root geometry file");
- menu->AddButton("Run", "RunSimulation()", "Process Alice run");
- menu->AddButton("Init", "Init()", "Initialize Alice for simulation");
+ menu->AddButton("Run G4", "RunG4Simulation()", "Process Alice run");
+ menu->AddButton("Run G4 batch", "RunG4Simulation(); >& g4.out", "Process Alice run");
+ menu->AddButton("Run G3", "RunG3Simulation()", "Process Alice run");
+ menu->AddButton("Run G3 batch", "RunG3Simulation(); >& g3.out", "Process Alice run");
+ menu->AddButton("Init", "Init();", "Initialize Alice for G4 simulation");
+ menu->AddButton("Init batch","Init(); >& g4init.out", "Initialize Alice for G4 simulation");
menu->AddButton("Geant4UI", "StartGeant4UI()","Go to Geant4 Interactive session");
menu->AddButton("AGDD", "GenerateAGDD()","Generate XML (AGDD) file with geometry description");
//menu->AddButton("GDML", "GenerateGDML()","Generate XML (GDML) file with geometry description");
gInterpreter->ProcessLine(gAlice->GetConfigFunction());
gAlice->GetMCApp()->Init();
+ ((TGeant4*)gMC)->ProcessGeantCommand("/mcDet/printMedia");
+
cout << endl
<< "Only MonteCarlo initialization has been performed. " << endl
<< "To run simulation you have to re-run aliroot and choose Run in g4menu." << endl;
}
-void RunSimulation()
+void RunG4Simulation()
{
AliSimulation sim("$ALICE_ROOT/macros/g4Config.C");
+ sim.SetMakeSDigits("");
sim.SetMakeDigits("");
+ //sim.SetMakeDigitsFromHits("ITS TPC");
+ //sim.SetMakeDigitsFromHits("ITS");
+ sim.SetMakeDigitsFromHits("");
+ sim.SetRunHLT("");
+ sim.SetNumberOfEvents(1000);
+ TStopwatch timer;
+ timer.Start();
+ sim.Run(1);
+ timer.Stop();
+ timer.Print();
+}
+
+void RunG3Simulation()
+{
+ AliSimulation sim("$ALICE_ROOT/macros/g3Config.C");
sim.SetMakeSDigits("");
+ sim.SetMakeDigits("");
+ //sim.SetMakeDigitsFromHits("ITS TPC");
+ //sim.SetMakeDigitsFromHits("ITS");
+ sim.SetMakeDigitsFromHits("");
sim.SetRunHLT("");
- sim.SetNumberOfEvents(1);
+ sim.SetNumberOfEvents(1000);
TStopwatch timer;
timer.Start();
sim.Run(1);