3 // Configuration for the Physics Data Challenge 2006
9 // One can use the configuration macro in compiled mode by
11 // root [0] gSystem->Load("libgeant321");
13 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
15 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
17 // root [0] .x grun.C(1,"Config_PDC06.C++")
21 #if !defined(__CINT__) || defined(__MAKECINT__)
23 #include <Riostream.h>
31 #include <TVirtualMC.h>
33 #include <TGeant3TGeo.h>
35 #include "EVGEN/AliGenCocktail.h"
37 #include "EVGEN/AliGenParam.h"
39 #include "EVGEN/AliGenMUONlib.h"
41 #include "STEER/AliRunLoader.h"
43 #include "STEER/AliRun.h"
45 #include "STEER/AliConfig.h"
47 #include "PYTHIA6/AliDecayerPythia.h"
49 #include "PYTHIA6/AliGenPythia.h"
51 #include "STEER/AliMagFMaps.h"
53 #include "STRUCT/AliBODY.h"
55 #include "STRUCT/AliMAG.h"
57 #include "STRUCT/AliABSOv0.h"
59 #include "STRUCT/AliDIPOv2.h"
61 #include "STRUCT/AliHALL.h"
63 #include "STRUCT/AliFRAMEv2.h"
65 #include "STRUCT/AliSHILv2.h"
67 #include "STRUCT/AliPIPEv0.h"
69 #include "ITS/AliITSgeom.h"
71 #include "ITS/AliITSvPPRasymmFMD.h"
73 #include "TPC/AliTPCv2.h"
75 #include "TOF/AliTOFv5T0.h"
77 #include "HMPID/AliHMPIDv1.h"
79 #include "ZDC/AliZDCv2.h"
81 #include "TRD/AliTRDv1.h"
83 #include "FMD/AliFMDv1.h"
85 #include "MUON/AliMUONv1.h"
87 #include "PHOS/AliPHOSv1.h"
89 #include "PMD/AliPMDv1.h"
91 #include "T0/AliT0v1.h"
93 #include "EMCAL/AliEMCALv2.h"
95 #include "CRT/AliCRTv0.h"
97 #include "VZERO/AliVZEROv7.h"
103 //--- Trigger config ---
109 kDefaultPPTrig, kDefaultPbPbTrig
115 const char * TrigConfName[] = {
133 kNature, kHadr, kSemiEl, kSemiMu
137 //--- Rapidity Cut ---
143 kFull, kBarrel, kMuonArm
147 //--- Magnetic Field ---
159 void ProcessEnvironmentVars();
163 // This part for configuration
165 static DecayHvFl_t decHvFl = kNature;
167 static YCut_t ycut = kFull;
169 static Mag_t mag = k5kG;
171 static TrigConf_t trig = kDefaultPPTrig;
173 //========================//
175 // Set Random Number seed //
177 //========================//
181 static UInt_t seed = dt.Get();
189 static TString comment;
201 // Get settings from environment variables
203 ProcessEnvironmentVars();
207 gRandom->SetSeed(seed);
209 // gRandom->SetSeed(12345);
211 cerr<<"Seed for random number generation= "<<seed<<endl;
215 // libraries required by geant321
217 #if defined(__CINT__)
219 gSystem->Load("libgeant321");
225 new TGeant3TGeo("C++ Interface to Geant3");
229 //=======================================================================
231 // Create the output file
237 AliRunLoader* rl=0x0;
241 cout<<"Config.C: Creating Run Loader ..."<<endl;
243 rl = AliRunLoader::Open("galice.root",
245 AliConfig::GetDefaultEventFolderName(),
253 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
259 rl->SetCompressionLevel(2);
261 rl->SetNumberOfEventsPerFile(1000);
263 gAlice->SetRunLoader(rl);
267 // Set the trigger configuration
269 gAlice->SetTriggerDescriptor(TrigConfName[trig]);
271 cout<<"Trigger configuration is set to "<<TrigConfName[trig]<<endl;
277 //=======================================================================
279 // ************* STEERING parameters FOR ALICE SIMULATION **************
281 // --- Specify event type to be tracked through the ALICE setup
283 // --- All positions are in cm, angles in degrees, and P and E in GeV
289 gMC->SetProcess("DCAY",1);
291 gMC->SetProcess("PAIR",1);
293 gMC->SetProcess("COMP",1);
295 gMC->SetProcess("PHOT",1);
297 gMC->SetProcess("PFIS",0);
299 gMC->SetProcess("DRAY",0);
301 gMC->SetProcess("ANNI",1);
303 gMC->SetProcess("BREM",1);
305 gMC->SetProcess("MUNU",1);
307 gMC->SetProcess("CKOV",1);
309 gMC->SetProcess("HADR",1);
311 gMC->SetProcess("LOSS",2);
313 gMC->SetProcess("MULS",1);
315 gMC->SetProcess("RAYL",1);
319 Float_t cut = 1.e-3; // 1MeV cut by default
321 Float_t tofmax = 1.e10;
325 gMC->SetCut("CUTGAM", cut);
327 gMC->SetCut("CUTELE", cut);
329 gMC->SetCut("CUTNEU", cut);
331 gMC->SetCut("CUTHAD", cut);
333 gMC->SetCut("CUTMUO", cut);
335 gMC->SetCut("BCUTE", cut);
337 gMC->SetCut("BCUTM", cut);
339 gMC->SetCut("DCUTE", cut);
341 gMC->SetCut("DCUTM", cut);
343 gMC->SetCut("PPCUTM", cut);
345 gMC->SetCut("TOFMAX", tofmax);
347 // ((TGeant3 *) gMC)->SetSWIT(2,2);
349 // ((TGeant3 *) gMC)->SetDEBU(1,999,1);
359 // Set External decayer //
361 //======================//
363 TVirtualMCDecayer* decayer = new AliDecayerPythia();
373 decayer->SetForceDecay(kAll);
379 decayer->SetForceDecay(kHadronicD);
385 decayer->SetForceDecay(kSemiElectronic);
391 decayer->SetForceDecay(kSemiMuonic);
399 gMC->SetExternalDecayer(decayer);
403 //=========================//
405 // Generator Configuration //
407 //=========================//
409 AliGenBox* gener = new AliGenBox();
411 gener->SetThetaRange(45,135);
413 gener->SetPhiRange(30,150);
415 gener->SetMomentumRange(9.8,10.2);
417 gener->SetPart(kMuonMinus);
419 gener->SetNumberParticles(20);
435 comment = comment.Append(" | L3 field 0.2 T");
437 } else if (mag == k4kG) {
439 comment = comment.Append(" | L3 field 0.4 T");
441 } else if (mag == k5kG) {
443 comment = comment.Append(" | L3 field 0.5 T");
447 printf("\n \n Comment: %s \n \n", comment.Data());
451 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
453 field->SetL3ConstField(0); //Using const. field in the barrel
457 gAlice->SetField(field);
511 //=================== Alice BODY parameters =============================
513 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
523 //=================== MAG parameters ============================
525 // --- Start with Magnet since detector layouts may be depending ---
527 // --- on the selected Magnet dimensions ---
529 AliMAG *MAG = new AliMAG("MAG", "Magnet");
541 //=================== ABSO parameters ============================
543 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
553 //=================== DIPO parameters ============================
557 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
567 //=================== HALL parameters ============================
571 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
583 //=================== FRAME parameters ============================
587 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
597 //=================== SHIL parameters ============================
601 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
613 //=================== PIPE parameters ============================
617 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
627 //=================== ITS parameters ============================
631 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
633 // almost all other detectors. This involves the fact that the ITS geometry
635 // still has several options to be followed in parallel in order to determine
637 // the best set-up which minimizes the induced background. All the geometries
639 // available to date are described in the following. Read carefully the comments
641 // and use the default version (the only one uncommented) unless you are making
643 // comparisons and you know what you are doing. In this case just uncomment the
645 // ITS geometry you want to use and run Aliroot.
649 // Detailed geometries:
655 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
659 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
663 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
665 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
667 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
669 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
671 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
673 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
675 ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
677 ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
679 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
681 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
685 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
687 // for reconstruction !):
693 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
695 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
697 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
701 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
703 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
705 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
713 // Geant3 <-> EUCLID conversion
715 // ============================
719 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
721 // media to two ASCII files (called by default ITSgeometry.euc and
723 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
725 // The default (=0) means that you dont want to use this facility.
739 //============================ TPC parameters =====================
741 AliTPC *TPC = new AliTPCv2("TPC", "Default");
751 //=================== TOF parameters ============================
753 AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
755 // Partial geometry: modules at 2,3,4,6,7,11,12,14,15,16
757 // starting at 6h in positive direction
759 // Int_t TOFSectors[18]={-1,-1,0,0,0,-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0};
761 // Partial geometry: modules at 1,2,6,7,9,10,11,12,15,16,17
763 // (ALICE numbering convention)
765 Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};
767 TOF->SetTOFSectors(TOFSectors);
779 //=================== HMPID parameters ===========================
781 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
795 //=================== ZDC parameters ============================
799 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
809 //=================== TRD parameters ============================
813 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
815 AliTRDgeometry *geoTRD = TRD->GetGeometry();
817 // Partial geometry: modules at 2,3,4,6,11,12,14,15
819 // starting at 6h in positive direction
821 geoTRD->SetSMstatus(0,0);
823 geoTRD->SetSMstatus(1,0);
825 geoTRD->SetSMstatus(5,0);
827 geoTRD->SetSMstatus(7,0);
829 geoTRD->SetSMstatus(8,0);
831 geoTRD->SetSMstatus(9,0);
833 geoTRD->SetSMstatus(10,0);
835 geoTRD->SetSMstatus(13,0);
837 geoTRD->SetSMstatus(16,0);
839 geoTRD->SetSMstatus(17,0);
849 //=================== FMD parameters ============================
851 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
861 //=================== MUON parameters ===========================
863 // New MUONv1 version (geometry defined via builders)
865 AliMUON *MUON = new AliMUONv1("MUON", "default");
869 //=================== PHOS parameters ===========================
877 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
889 //=================== PMD parameters ============================
891 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
901 //=================== T0 parameters ============================
903 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
913 //=================== EMCAL parameters ============================
915 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
925 //=================== ACORDE parameters ============================
927 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
929 // ACORDE->SetITSGeometry(kTRUE);
931 // ACORDE->SetCreateCavern(kFALSE);
941 //=================== VZERO parameters =============================
943 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
951 void ProcessEnvironmentVars()
957 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
959 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
961 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
963 proc = (PDC06Proc_t)iRun;
965 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
975 // Random Number seed
977 if (gSystem->Getenv("CONFIG_SEED")) {
979 seed = atoi(gSystem->Getenv("CONFIG_SEED"));