changes in the MagF constructor
[u/mrichter/AliRoot.git] / macros / Config_PDC07_MBias_MUON.C
CommitLineData
2dd2096a 1// Config file MUON + ITS (for vertex) + VZERO + FMD for PDC07
2// Tuned for p+p min biais and quarkonia production, heavy quark production
3// from AliGenCorrHF(AliGenMUONCocktailpp)
4// Remember to define the directory and option
5// gAlice->SetConfigFunction("Config('$HOME','box');");
6// april 3rd: added L3 magnet
7
8void Config(char directory[100]="", char option[6]="trgAll")
9{
10
11 static Int_t sseed = 0; // Set 0 to use the current time
ee621efa 12
13 // Load Pythia libraries
14 LoadPythia();
2dd2096a 15
16 //=====================================================================
17 // Libraries required by geant321
18 gSystem->Load("libgeant321.so");
37ff1457 19
2dd2096a 20 new TGeant3TGeo("C++ Interface to Geant3");
21 //=======================================================================
22
23 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
162637e4 24 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
2dd2096a 25 AliCDBManager::Instance()->SetRun(0);
26 }
27
28 // Set Random Number seed
29 gRandom->SetSeed(sseed);
30
31 // Create the output file
32 Text_t filename[100];
33 sprintf(filename,"%sgalice.root",directory);
34
35 AliRunLoader* rl=0x0;
36 rl = AliRunLoader::Open(
37 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
38 if (rl == 0x0) {
39 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
40 return;
41 }
42 rl->SetCompressionLevel(2);
43 rl->SetNumberOfEventsPerFile(1000);
44 gAlice->SetRunLoader(rl);
45
46 //=======================================================================
47 // Set the trigger configuration - not needed here for MUON in
48 // stand-alone mode
49 // gAlice->SetTriggerDescriptor("p-p");
50 // cout<<"Trigger configuration is set to p-p"<<endl;
51
52 //=======================================================================
53 // Set External decayer
54 TVirtualMCDecayer *decayer = new AliDecayerPythia();
55 decayer->SetForceDecay(kAll);
56 decayer->Init();
57 gMC->SetExternalDecayer(decayer);
58
59 //=======================================================================
60 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
61 gMC->SetProcess("DCAY",1);
62 gMC->SetProcess("PAIR",1);
63 gMC->SetProcess("COMP",1);
64 gMC->SetProcess("PHOT",1);
65 gMC->SetProcess("PFIS",0);
66 gMC->SetProcess("DRAY",0);
67 gMC->SetProcess("ANNI",1);
68 gMC->SetProcess("BREM",1);
69 gMC->SetProcess("MUNU",1);
70 gMC->SetProcess("CKOV",1);
71 gMC->SetProcess("HADR",1);
72 gMC->SetProcess("LOSS",2);
73 gMC->SetProcess("MULS",1);
74 gMC->SetProcess("RAYL",1);
75
76 Float_t cut = 1.e-3; // 1MeV cut by default
77 Float_t tofmax = 1.e10;
78
79 gMC->SetCut("CUTGAM", cut);
80 gMC->SetCut("CUTELE", cut);
81 gMC->SetCut("CUTNEU", cut);
82 gMC->SetCut("CUTHAD", cut);
83 gMC->SetCut("CUTMUO", cut);
84 gMC->SetCut("BCUTE", cut);
85 gMC->SetCut("BCUTM", cut);
86 gMC->SetCut("DCUTE", cut);
87 gMC->SetCut("DCUTM", cut);
88 gMC->SetCut("PPCUTM", cut);
89 gMC->SetCut("TOFMAX", tofmax);
90 //
91 //=======================================================================
92 // ************* STEERING parameters FOR ALICE SIMULATION **************
93 // Chamber positions
94 // From AliMUONConstants class we get :
95 // Position Z (along beam) of the chambers (in cm)
96 // (from AliMUONConstants class):
97 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5,
98 // 1416.5, 1443.5, 1610, 1625., 1710., 1725.
99 // Internal Radius (in cm)
100 // 36.4, 46.2, 66.0, 80., 80., 100., 100.
101 // External Radius (in cm)
102 // 183., 245., 395., 560., 563., 850., 900.
103 //=======================================================================
104
37ff1457 105 AliGenPythia* PythiaForMUONCocktail(Decay_t dt)
106 {
107 AliGenPythia *pythia = new AliGenPythia(1);
108 pythia->SetProcess(kPyMbMSEL1);
109 pythia->SetStrucFunc(kCTEQ5L);
110 pythia->SetEnergyCMS(14000.);
111 pythia->SetForceDecay(dt);
112 pythia->SetPtRange(0.,100.);
113 pythia->SetYRange(-8.,8.);
114 pythia->SetPhiRange(0.,360.);
115 pythia->SetPtHard(2.76,-1.0);
116 pythia->SwitchHFOff();
117 return pythia;
118 }
119
2dd2096a 120 if (!strcmp(option,"trg2mu")) {
121 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
122 gener->SetPtRange(0.,100.);
123 gener->SetYRange(-4.,-2.4);
124 gener->SetPhiRange(0., 360.);
125 gener->SetMuonMultiplicity(2);
126 gener->SetMuonPtCut(0.5);
127 gener->SetMuonThetaRange(171.,178.);
128 gener->SetOrigin(0.,0.,0.);
129 gener->SetSigma(0.,0.,5.);
130 gener->SetVertexSmear(kPerEvent);
37ff1457 131 Decay_t dt = gener->GetDecayModePythia();
132 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
133 pythia->Init();
134 gener->AddGenerator(pythia,"Pythia",1);
2dd2096a 135 gener->Init();
136 }
137
138 if (!strcmp(option,"trg1mu")) {
139 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
140 gener->SetPtRange(0.,100.);
141 gener->SetYRange(-4.,-2.4);
142 gener->SetPhiRange(0., 360.);
143 gener->SetMuonMultiplicity(1);
144 gener->SetMuonPtCut(0.5);
145 gener->SetMuonThetaRange(171.,178.);
146 gener->SetOrigin(0.,0.,0.);
147 gener->SetSigma(0.,0.,5.);
148 gener->SetVertexSmear(kPerEvent);
37ff1457 149 Decay_t dt = gener->GetDecayModePythia();
150 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
151 pythia->Init();
152 gener->AddGenerator(pythia,"Pythia",1);
2dd2096a 153 gener->Init();
154 }
155 if (!strcmp(option,"trgAll")) {
156 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
157 gener->SetPtRange(0.,100.);
158 gener->SetYRange(-4.,-2.4);
159 gener->SetPhiRange(0., 360.);
160 gener->SetMuonMultiplicity(0);
161 gener->SetMuonPtCut(0.);
162 gener->SetOrigin(0.,0.,0.);
163 gener->SetSigma(0.,0.,5.3);
164 gener->SetVertexSmear(kPerEvent);
37ff1457 165 Decay_t dt = gener->GetDecayModePythia();
166 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
167 pythia->Init();
168 gener->AddGenerator(pythia,"Pythia",1);
2dd2096a 169 gener->Init();
170 }
171 //=============================================================
172 // Field (L3 0.5 T) outside dimuon spectrometer
4642ac4b 173 AliMagF* field = new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG);
2dd2096a 174 field->SetL3ConstField(0); // Using const. field in the barrel
f7a1cc68 175 TGeoGlobalMagField::Instance()->SetField(field);
2dd2096a 176
177 Int_t iITS = 1;
178 Int_t iFMD = 1;
179 Int_t iVZERO = 1;
180
181 rl->CdGAFile();
182
183 //=================== Alice BODY parameters =============================
184 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
185 //=================== ABSO parameters ============================
186 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
187 //=================== DIPO parameters ============================
188 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
189 //================== HALL parameters ============================
190 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
191 //================== The L3 Magnet ==============================
192 AliMAG *MAG = new AliMAG("MAG", "L3 Magnet");
193 //=================== PIPE parameters ============================
194 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
195 //=================== SHIL parameters ============================
196 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
197 //=================== ITS parameters =============================
198 if(iITS) {
99887042 199 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
2dd2096a 200 }
201 //=================== FMD parameters =============================
202 if(iFMD) {
203 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
204 }
205 //=================== VZERO parameters =============================
206 if (iVZERO) {
207 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
208 }
209
210 //=================== MUON Subsystem ===========================
211 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
212
213 AliMUON *MUON = new AliMUONv1("MUON");
214}
215
216Float_t EtaToTheta(Float_t arg){
217 return (180./TMath::Pi())*2.*atan(exp(-arg));
218}
37ff1457 219
ee621efa 220
221
222void LoadPythia()
223{
224 // Load Pythia related libraries
225 gSystem->Load("liblhapdf.so"); // Parton density functions
226 gSystem->Load("libEGPythia6.so"); // TGenerator interface
227 gSystem->Load("libpythia6.so"); // Pythia
228 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
229}