6 // libraries required by geant321
7 gSystem->Load("libgeant321");
9 new TGeant3TGeo("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 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME","Space Frame");
169 //=================== SHIL parameters ============================
170 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
174 //=================== PIPE parameters ============================
175 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
179 //=================== ITS parameters ============================
182 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR");
183 ITS->SetMinorVersion(2);
184 ITS->SetReadDet(kTRUE);
185 ITS->SetThicknessDet1(200.);
186 ITS->SetThicknessDet2(200.);
187 ITS->SetThicknessChip1(200.);
188 ITS->SetThicknessChip2(200.);
190 ITS->SetCoolingFluid(1);
196 //============================ TPC parameters ================================
197 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
198 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
199 // --- sectors are specified, any value other than that requires at least one
200 // --- sector (lower or upper)to be specified!
201 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
202 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
203 // --- SecLows - number of lower sectors specified (up to 6)
204 // --- SecUps - number of upper sectors specified (up to 12)
205 // --- Sens - sensitive strips for the Slow Simulator !!!
206 // --- This does NOT work if all S or L-sectors are specified, i.e.
207 // --- if SecAL or SecAU < 0
210 //-----------------------------------------------------------------------------
212 AliTPC *TPC = new AliTPCv2("TPC","Default");
213 // All sectors included
220 //=================== TRD parameters ============================
222 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
223 TRD->SetSensChamber(2);
224 TRD->SetSensSector(13);
226 // Set to detailed display
227 TRD->SetDisplayType(1);
233 AliTRDsim *TRDsim = TRD->CreateTR();