]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDconfig.C
Thread libraries filtered out
[u/mrichter/AliRoot.git] / TRD / AliTRDconfig.C
1 void Config()
2 {
3
4   Int_t iField = 0;
5
6   new AliGeant3("C++ Interface to Geant3");
7
8   // Create the output file
9   TFile *rootfile = new TFile("TRD_test.root","recreate");
10   rootfile->SetCompressionLevel(2);
11
12   // Define the monte carlo
13   TGeant3 *geant3 = (TGeant3*) gMC;
14
15   // Set external decayer
16   AliDecayer* decayer = new AliDecayerPythia();
17   decayer->SetForceDecay(kAll);
18   //decayer->SetForceDecay(kAll);
19   decayer->Init();
20   gMC->SetExternalDecayer(decayer);
21
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);
27   geant3->SetDCAY(1);
28   geant3->SetPAIR(1);
29   geant3->SetCOMP(1);
30   geant3->SetPHOT(1);
31   geant3->SetPFIS(0);
32   geant3->SetDRAY(0);
33   geant3->SetANNI(1);
34   geant3->SetBREM(1);
35   geant3->SetMUNU(1);
36   geant3->SetCKOV(1);
37   geant3->SetHADR(1); // Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
38   geant3->SetLOSS(2);
39   geant3->SetMULS(1);
40   geant3->SetRAYL(1);
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);
45
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);
50
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
54
55   AliGenCocktail *gener = new AliGenCocktail();
56
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 
61
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 
66
67   gener->AddGenerator(genEl,"Electrons",1);
68   gener->AddGenerator(genPi,"Pions"    ,1);
69
70   if (iField) {
71
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);
81
82     gener->Init();
83
84     // Specify maximum magnetic field in Tesla (neg. ==> default field)
85     // 0.4 T
86     gAlice->SetField(-999,2,2.0);    
87
88   }
89   else {
90
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);
100
101     gener->Init();
102
103     // Specify maximum magnetic field in Tesla (neg. ==> default field)
104     // No field
105     gAlice->SetField(0);    
106
107   }
108
109   Int_t iMAG   = 1;
110   Int_t iITS   = 1;
111   Int_t iTPC   = 1;
112   Int_t iTRD   = 1;
113   Int_t iABSO  = 1;
114   Int_t iDIPO  = 1;
115   Int_t iHALL  = 1;
116   Int_t iFRAME = 1;
117   Int_t iSHIL  = 1;
118   Int_t iPIPE  = 1;
119
120   //=================== Alice BODY parameters =============================
121   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
122
123   if (iMAG) {
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");
128   }
129
130   if (iABSO) { 
131     //=================== ABSO parameters ============================
132     AliABSO *ABSO  = new AliABSOv0("ABSO","Muon Absorber");
133   }
134
135   if (iDIPO) {
136     //=================== DIPO parameters ============================
137     AliDIPO *DIPO  = new AliDIPOv2("DIPO","Dipole version 2");
138   }
139
140   if (iHALL) {
141     //=================== HALL parameters ============================
142     AliHALL *HALL  = new AliHALL("HALL","Alice Hall");
143   }
144
145   if (iFRAME) {
146     //=================== FRAME parameters ============================
147     AliFRAME *FRAME  = new AliFRAMEv1("FRAME","Space Frame");
148   }
149
150   if (iSHIL) {
151     //=================== SHIL parameters ============================
152     AliSHIL *SHIL  = new AliSHILv0("SHIL","Shielding");
153   }
154
155   if (iPIPE) {
156     //=================== PIPE parameters ============================
157     AliPIPE *PIPE  = new AliPIPEv0("PIPE","Beam Pipe");
158   }
159
160   if (iITS) {
161     //=================== ITS parameters ============================
162     //
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.
167     //
168
169     AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
170     ITS->SetEUCLID(0);
171
172   }
173
174   if (iTPC) {
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
187     //
188     //
189     //-----------------------------------------------------------------------------
190
191     AliTPC *TPC  = new AliTPCv2("TPC","Default");
192     // All sectors included 
193     TPC->SetSecAL(-1);
194     TPC->SetSecAU(-1);
195
196   }
197
198   if (iTRD) {
199     //=================== TRD parameters ============================
200   
201     AliTRD *TRD  = new AliTRDv1("TRD","TRD slow simulator");
202     TRD->SetSensChamber(2);
203     TRD->SetSensSector(13);
204   
205     // Get the pointer to the geometry object
206     AliTRDgeometry *TRDgeometry = TRD->GetGeometry();
207
208     // The number of timebins
209     TRDgeometry->SetNTimeBin(15);
210
211     // The additional timebins before and after the drift region
212     //TRDgeometry->SetExpandTimeBin(10,5);
213
214     // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
215     TRD->SetGasMix(1);
216
217     // Set to detailed display
218     TRD->SetDisplayType(1);
219
220     // Draw TR photons
221     TRD->SetDrawTR(1);
222
223     // Switch on TR
224     AliTRDsim *TRDsim = TRD->CreateTR();
225
226   }
227         
228 }