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