6 new AliGeant3("C++ Interface to Geant3");
8 // Create the output file
9 TFile *rootfile = new TFile("TRD_test.root","recreate");
10 rootfile->SetCompressionLevel(2);
12 // Define the monte carlo
13 TGeant3 *geant3 = (TGeant3*) gMC;
15 // Set external decayer
16 AliDecayer* decayer = new AliDecayerPythia();
17 decayer->SetForceDecay(kAll);
18 //decayer->SetForceDecay(kAll);
20 gMC->SetExternalDecayer(decayer);
22 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
23 geant3->SetTRIG(1); // Number of events to be processed
24 geant3->SetSWIT(4,10);
25 geant3->SetDEBU(0,0,1);
26 //geant3->SetSWIT(2,2);
37 geant3->SetHADR(1); // Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
41 geant3->SetAUTO(1); // Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
42 geant3->SetABAN(0); // Restore 3.16 behaviour for abandoned tracks
43 geant3->SetOPTI(2); // Select optimisation level for GEANT geometry searches (0,1,2)
44 geant3->SetERAN(5.e-7);
46 Float_t cut = 1.e-3; // 1MeV cut by default
47 Float_t tofmax = 1.e10;
48 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
49 geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax);
51 // ************* STEERING parameters FOR ALICE SIMULATION **************
52 // --- Specify event type to be tracked through the ALICE setup
53 // --- All positions are in cm, angles in degrees, and P and E in GeV
55 AliGenCocktail *gener = new AliGenCocktail();
57 AliGenBox *genEl = new AliGenBox(100);
58 genEl->SetOrigin(0,0,0); // Vertex position
59 genEl->SetSigma(0,0,0); // Sigma in (X,Y,Z) (cm) on IP position
60 genEl->SetPart(11); // Only electrons
62 AliGenBox *genPi = new AliGenBox(100);
63 genPi->SetOrigin(0,0,0); // Vertex position
64 genPi->SetSigma(0,0,0); // Sigma in (X,Y,Z) (cm) on IP position
65 genPi->SetPart(-211); // Only pions
67 gener->AddGenerator(genEl,"Electrons",1);
68 gener->AddGenerator(genPi,"Pions" ,1);
72 // With magnetic field on
73 AliGenerator *gg = gener->FirstGenerator()->Generator();
74 gg->SetMomentumRange(3.00,3.01);
75 gg->SetPhiRange(76.0,92.0);
76 gg->SetThetaRange(83.0,97.0);
77 gg = gener->NextGenerator()->Generator();
78 gg->SetMomentumRange(0.560,0.561);
79 gg->SetPhiRange(62.0,78.0);
80 gg->SetThetaRange(83.0,97.0);
84 // Specify maximum magnetic field in Tesla (neg. ==> default field)
86 gAlice->SetField(-999,2,2.0);
91 // With magnetic field off
92 AliGenerator *gg = gener->FirstGenerator()->Generator();
93 gg->SetMomentumRange(3.00,3.01);
94 gg->SetPhiRange(82.0,98.0);
95 gg->SetThetaRange(83.0,97.0);
96 gg = gener->NextGenerator()->Generator();
97 gg->SetMomentumRange(0.560,0.561);
98 gg->SetPhiRange(82.0,98.0);
99 gg->SetThetaRange(83.0,97.0);
103 // Specify maximum magnetic field in Tesla (neg. ==> default field)
120 //=================== Alice BODY parameters =============================
121 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
124 //=================== MAG parameters ============================
125 // --- Start with Magnet since detector layouts may be depending ---
126 // --- on the selected Magnet dimensions ---
127 AliMAG *MAG = new AliMAG("MAG","Magnet");
131 //=================== ABSO parameters ============================
132 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
136 //=================== DIPO parameters ============================
137 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
141 //=================== HALL parameters ============================
142 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
146 //=================== FRAME parameters ============================
147 AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
151 //=================== SHIL parameters ============================
152 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
156 //=================== PIPE parameters ============================
157 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
161 //=================== ITS parameters ============================
163 // EUCLID is a flag to output (=1) both geometry and media to two ASCII files
164 // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
165 // understandable to the CAD system EUCLID. The default (=0) means that you
166 // dont want to use this facility.
169 AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
175 //============================ TPC parameters ================================
176 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
177 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
178 // --- sectors are specified, any value other than that requires at least one
179 // --- sector (lower or upper)to be specified!
180 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
181 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
182 // --- SecLows - number of lower sectors specified (up to 6)
183 // --- SecUps - number of upper sectors specified (up to 12)
184 // --- Sens - sensitive strips for the Slow Simulator !!!
185 // --- This does NOT work if all S or L-sectors are specified, i.e.
186 // --- if SecAL or SecAU < 0
189 //-----------------------------------------------------------------------------
191 AliTPC *TPC = new AliTPCv2("TPC","Default");
192 // All sectors included
199 //=================== TRD parameters ============================
201 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
202 TRD->SetSensChamber(2);
203 TRD->SetSensSector(13);
205 // Get the pointer to the geometry object
206 AliTRDgeometry *TRDgeometry = TRD->GetGeometry();
208 // The number of timebins
209 TRDgeometry->SetNTimeBin(15);
211 // The additional timebins before and after the drift region
212 //TRDgeometry->SetExpandTimeBin(10,5);
214 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
217 // Set to detailed display
218 TRD->SetDisplayType(1);
224 AliTRDsim *TRDsim = TRD->CreateTR();