6 // libraries required by geant321
7 gSystem->Load("libgeant321");
9 new TGeant3("C++ Interface to Geant3");
11 // Create the output file
12 TFile *rootfile = new TFile("TRD_test.root","recreate");
13 rootfile->SetCompressionLevel(2);
15 // Define the monte carlo
16 TGeant3 *geant3 = (TGeant3*) gMC;
19 cout << "AliTRDconfig.C: Creating Run Loader ..." <<endl;
20 rl = AliRunLoader::Open("TRD_test.root"
21 ,AliConfig::GetDefaultEventFolderName()
24 gAlice->Fatal("AliTRDconfig.C","Can not instatiate the Run Loader");
27 rl->SetCompressionLevel(2);
28 rl->SetNumberOfEventsPerFile(3);
29 gAlice->SetRunLoader(rl);
31 // Set external decayer
32 TVirtualMCDecayer *decayer = new AliDecayerPythia();
33 decayer->SetForceDecay(kAll);
35 gMC->SetExternalDecayer(decayer);
37 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
38 geant3->SetTRIG(1); // Number of events to be processed
39 geant3->SetSWIT(4,10);
40 geant3->SetDEBU(0,0,1);
41 //geant3->SetSWIT(2,2);
52 geant3->SetHADR(1); // Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
56 geant3->SetAUTO(1); // Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
57 geant3->SetABAN(0); // Restore 3.16 behaviour for abandoned tracks
58 geant3->SetOPTI(2); // Select optimisation level for GEANT geometry searches (0,1,2)
59 geant3->SetERAN(5.e-7);
61 Float_t cut = 1.e-3; // 1MeV cut by default
62 Float_t tofmax = 1.e10;
63 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
64 geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax);
66 // ************* STEERING parameters FOR ALICE SIMULATION **************
67 // --- Specify event type to be tracked through the ALICE setup
68 // --- All positions are in cm, angles in degrees, and P and E in GeV
70 AliGenCocktail *gener = new AliGenCocktail();
72 AliGenBox *genEl = new AliGenBox(100);
73 genEl->SetOrigin(0,0,0); // Vertex position
74 genEl->SetSigma(0,0,0); // Sigma in (X,Y,Z) (cm) on IP position
75 genEl->SetPart(11); // Only electrons
77 AliGenBox *genPi = new AliGenBox(100);
78 genPi->SetOrigin(0,0,0); // Vertex position
79 genPi->SetSigma(0,0,0); // Sigma in (X,Y,Z) (cm) on IP position
80 genPi->SetPart(-211); // Only pions
82 gener->AddGenerator(genEl,"Electrons",1);
83 gener->AddGenerator(genPi,"Pions" ,1);
87 // With magnetic field on
88 AliGenerator *gg = gener->FirstGenerator()->Generator();
89 gg->SetMomentumRange(3.00,3.01);
90 gg->SetPhiRange(76.0,92.0);
91 gg->SetThetaRange(83.0,97.0);
92 gg = gener->NextGenerator()->Generator();
93 gg->SetMomentumRange(0.560,0.561);
94 gg->SetPhiRange(62.0,78.0);
95 gg->SetThetaRange(83.0,97.0);
99 // Specify maximum magnetic field in Tesla (neg. ==> default field)
101 gAlice->SetField(-999,2,2.0);
106 // With magnetic field off
107 AliGenerator *gg = gener->FirstGenerator()->Generator();
108 gg->SetMomentumRange(3.00,3.01);
109 gg->SetPhiRange(82.0,98.0);
110 gg->SetThetaRange(83.0,97.0);
111 gg = gener->NextGenerator()->Generator();
112 gg->SetMomentumRange(0.560,0.561);
113 gg->SetPhiRange(82.0,98.0);
114 gg->SetThetaRange(83.0,97.0);
118 // Specify maximum magnetic field in Tesla (neg. ==> default field)
137 //=================== Alice BODY parameters =============================
138 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
141 //=================== MAG parameters ============================
142 // --- Start with Magnet since detector layouts may be depending ---
143 // --- on the selected Magnet dimensions ---
144 AliMAG *MAG = new AliMAG("MAG","Magnet");
148 //=================== ABSO parameters ============================
149 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
153 //=================== DIPO parameters ============================
154 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
158 //=================== HALL parameters ============================
159 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
163 //=================== FRAME parameters ============================
164 AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
168 //=================== SHIL parameters ============================
169 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
173 //=================== PIPE parameters ============================
174 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
178 //=================== ITS parameters ============================
180 // EUCLID is a flag to output (=1) both geometry and media to two ASCII files
181 // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
182 // understandable to the CAD system EUCLID. The default (=0) means that you
183 // dont want to use this facility.
186 AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
192 //============================ TPC parameters ================================
193 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
194 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
195 // --- sectors are specified, any value other than that requires at least one
196 // --- sector (lower or upper)to be specified!
197 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
198 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
199 // --- SecLows - number of lower sectors specified (up to 6)
200 // --- SecUps - number of upper sectors specified (up to 12)
201 // --- Sens - sensitive strips for the Slow Simulator !!!
202 // --- This does NOT work if all S or L-sectors are specified, i.e.
203 // --- if SecAL or SecAU < 0
206 //-----------------------------------------------------------------------------
208 AliTPC *TPC = new AliTPCv2("TPC","Default");
209 // All sectors included
216 //=================== TRD parameters ============================
218 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
219 TRD->SetSensChamber(2);
220 TRD->SetSensSector(13);
222 // Set to detailed display
223 TRD->SetDisplayType(1);
229 AliTRDsim *TRDsim = TRD->CreateTR();