]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDconfig.C
Major upgrades to the strip structure
[u/mrichter/AliRoot.git] / TRD / AliTRDconfig.C
1 void Config()
2 {
3
4   new AliGeant3("C++ Interface to Geant3");
5
6   // Create the output file
7   TFile *rootfile = new TFile("TRD_test.root","recreate");
8   rootfile->SetCompressionLevel(2);
9
10   // Define the monte carlo
11   TGeant3 *geant3 = (TGeant3*) gMC;
12
13   // Set external decayer
14   AliDecayer* decayer = new AliDecayerPythia();
15   decayer->SetForceDecay(all);
16   decayer->Init();
17   gMC->SetExternalDecayer(decayer);
18
19   // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
20   geant3->SetTRIG(1); // Number of events to be processed 
21   geant3->SetSWIT(4,10);
22   geant3->SetDEBU(0,0,1);
23   //geant3->SetSWIT(2,2);
24   geant3->SetDCAY(1);
25   geant3->SetPAIR(1);
26   geant3->SetCOMP(1);
27   geant3->SetPHOT(1);
28   geant3->SetPFIS(0);
29   geant3->SetDRAY(0);
30   geant3->SetANNI(1);
31   geant3->SetBREM(1);
32   geant3->SetMUNU(1);
33   geant3->SetCKOV(1);
34   geant3->SetHADR(1); // Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
35   geant3->SetLOSS(2);
36   geant3->SetMULS(1);
37   geant3->SetRAYL(1);
38   geant3->SetAUTO(1); // Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
39   geant3->SetABAN(0); // Restore 3.16 behaviour for abandoned tracks
40   geant3->SetOPTI(2); // Select optimisation level for GEANT geometry searches (0,1,2)
41   geant3->SetERAN(5.e-7);
42
43   Float_t cut    = 1.e-3; // 1MeV cut by default
44   Float_t tofmax = 1.e10;
45   //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
46   geant3->SetCUTS(cut,cut, cut, cut, cut, cut,  cut,  cut, cut,  cut, tofmax);
47
48   // ************* STEERING parameters FOR ALICE SIMULATION **************
49   // --- Specify event type to be tracked through the ALICE setup
50   // --- All positions are in cm, angles in degrees, and P and E in GeV
51
52   AliGenCocktail *gener = new AliGenCocktail();
53
54   AliGenBox *genEl = new AliGenBox(100);
55   genEl->SetOrigin(0,0,0);        // Vertex position
56   genEl->SetSigma(0,0,0);         // Sigma in (X,Y,Z) (cm) on IP position
57   genEl->SetPart(11);             // Only electrons 
58
59   AliGenBox *genPi = new AliGenBox(100);
60   genPi->SetOrigin(0,0,0);        // Vertex position
61   genPi->SetSigma(0,0,0);         // Sigma in (X,Y,Z) (cm) on IP position
62   genPi->SetPart(-211);           // Only pions 
63
64   gener->AddGenerator(genEl,"Electrons",1);
65   gener->AddGenerator(genPi,"Pions"    ,1);
66
67   AliGenerator *gg = gener->FirstGenerator()->Generator();
68   gg->SetMomentumRange(1.0,3.0);
69   gg->SetPhiRange(75.0,95.0);
70   gg->SetThetaRange(70.0,110.0);
71   gg = gener->NextGenerator()->Generator();
72   gg->SetMomentumRange(2.5,3.0);
73   gg->SetPhiRange(75.0,95.0);
74   gg->SetThetaRange(70.0,110.0);
75
76   gener->Init();
77
78   // Specify maximum magnetic field in Tesla (neg. ==> default field)
79   // 0.4 T
80   gAlice->SetField(-999,2,2.0);    
81
82   Int_t iMAG   = 1;
83   Int_t iITS   = 1;
84   Int_t iTPC   = 1;
85   Int_t iTRD   = 1;
86   Int_t iABSO  = 1;
87   Int_t iDIPO  = 1;
88   Int_t iHALL  = 1;
89   Int_t iFRAME = 1;
90   Int_t iSHIL  = 1;
91   Int_t iPIPE  = 1;
92
93   //=================== Alice BODY parameters =============================
94   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
95
96   if (iMAG) {
97     //=================== MAG parameters ============================
98     // --- Start with Magnet since detector layouts may be depending ---
99     // --- on the selected Magnet dimensions ---
100     AliMAG *MAG  = new AliMAG("MAG","Magnet");
101   }
102
103   if (iABSO) { 
104     //=================== ABSO parameters ============================
105     AliABSO *ABSO  = new AliABSOv0("ABSO","Muon Absorber");
106   }
107
108   if (iDIPO) {
109     //=================== DIPO parameters ============================
110     AliDIPO *DIPO  = new AliDIPOv2("DIPO","Dipole version 2");
111   }
112
113   if (iHALL) {
114     //=================== HALL parameters ============================
115     AliHALL *HALL  = new AliHALL("HALL","Alice Hall");
116   }
117
118   if (iFRAME) {
119     //=================== FRAME parameters ============================
120     AliFRAME *FRAME  = new AliFRAMEv1("FRAME","Space Frame");
121   }
122
123   if (iSHIL) {
124     //=================== SHIL parameters ============================
125     AliSHIL *SHIL  = new AliSHILv0("SHIL","Shielding");
126   }
127
128   if (iPIPE) {
129     //=================== PIPE parameters ============================
130     AliPIPE *PIPE  = new AliPIPEv0("PIPE","Beam Pipe");
131   }
132
133   if (iITS) {
134     //=================== ITS parameters ============================
135     //
136     // EUCLID is a flag to output (=1) both geometry and media to two ASCII files 
137     // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
138     // understandable to the CAD system EUCLID. The default (=0) means that you 
139     // dont want to use this facility.
140     //
141     //AliITS *ITS  = new AliITSv5("ITS","normal ITS");
142     AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
143     ITS->SetEUCLID(0);
144   }
145
146   if (iTPC) {
147     //============================ TPC parameters ================================
148     // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
149     // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
150     // --- sectors are specified, any value other than that requires at least one 
151     // --- sector (lower or upper)to be specified!
152     // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
153     // ---           sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
154     // --- SecLows - number of lower sectors specified (up to 6)
155     // --- SecUps - number of upper sectors specified (up to 12)
156     // --- Sens - sensitive strips for the Slow Simulator !!!
157     // --- This does NOT work if all S or L-sectors are specified, i.e.
158     // --- if SecAL or SecAU < 0
159     //
160     //
161     //-----------------------------------------------------------------------------
162
163     //gROOT->LoadMacro("SetTPCParam.C");
164     //AliTPCParam *param = SetTPCParam();
165     //AliTPC *TPC  = new AliTPCv2("TPC","Default"); //v1 is default
166     //TPC->SetParam(param); // pass the parameter object to the TPC
167     //
168     // set gas mixture
169     //TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
170     //TPC->SetSecAL(4);
171     //TPC->SetSecAU(4);
172     //TPC->SetSecLows(1,  2,  3, 19, 20, 21);
173     //TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
174     //TPC->SetSens(1);
175     //
176     //if (TPC->IsVersion()==1) param->Write(param->GetTitle());
177
178     AliTPC *TPC  = new AliTPCv2("TPC","Default");
179     // All sectors included 
180     TPC->SetSecAL(-1);
181     TPC->SetSecAU(-1);
182
183   }
184
185   if (iTRD) {
186     //=================== TRD parameters ============================
187   
188     AliTRD *TRD  = new AliTRDv1("TRD","TRD slow simulator");
189     TRD->SetSensChamber(2);
190     TRD->SetSensSector(13);
191   
192     // Get the pointer to the geometry object
193     AliTRDgeometry *TRDgeometry = TRD->GetGeometry();
194
195     // The number of timebins
196     TRDgeometry->SetNTimeBin(15);
197
198     // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
199     TRD->SetGasMix(1);
200
201     // Set to detailed display
202     TRD->SetDisplayType(1);
203
204     // Switch on TR
205     AliTRDsim *TRDsim = TRD->CreateTR();
206
207   }
208         
209 }