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
8 void Config(char directory[100]="", char option[6]="trgAll")
11 static Int_t sseed = 0; // Set 0 to use the current time
13 // Load Pythia libraries
16 //=====================================================================
17 // Libraries required by geant321
18 gSystem->Load("libgeant321.so");
20 new TGeant3TGeo("C++ Interface to Geant3");
21 //=======================================================================
23 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
24 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
25 AliCDBManager::Instance()->SetRun(0);
28 // Set Random Number seed
29 gRandom->SetSeed(sseed);
31 // Create the output file
33 sprintf(filename,"%sgalice.root",directory);
36 rl = AliRunLoader::Open(
37 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
39 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
42 rl->SetCompressionLevel(2);
43 rl->SetNumberOfEventsPerFile(1000);
44 gAlice->SetRunLoader(rl);
46 //=======================================================================
47 // Set the trigger configuration - not needed here for MUON in
49 // AliSimulation::Instance()->SetTriggerConfig("p-p");
50 // cout<<"Trigger configuration is set to p-p"<<endl;
52 //=======================================================================
53 // Set External decayer
54 TVirtualMCDecayer *decayer = new AliDecayerPythia();
55 decayer->SetForceDecay(kAll);
57 gMC->SetExternalDecayer(decayer);
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);
76 Float_t cut = 1.e-3; // 1MeV cut by default
77 Float_t tofmax = 1.e10;
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);
91 //=======================================================================
92 // ************* STEERING parameters FOR ALICE SIMULATION **************
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 //=======================================================================
105 AliGenPythia* PythiaForMUONCocktail(Decay_t dt)
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();
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);
131 Decay_t dt = gener->GetDecayModePythia();
132 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
134 gener->AddGenerator(pythia,"Pythia",1);
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);
149 Decay_t dt = gener->GetDecayModePythia();
150 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
152 gener->AddGenerator(pythia,"Pythia",1);
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);
165 Decay_t dt = gener->GetDecayModePythia();
166 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
168 gener->AddGenerator(pythia,"Pythia",1);
171 //=============================================================
172 // Field (L3 0.5 T) outside dimuon spectrometer
173 AliMagF* field = new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG);
174 field->SetL3ConstField(0); // Using const. field in the barrel
175 TGeoGlobalMagField::Instance()->SetField(field);
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 =============================
199 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
201 //=================== FMD parameters =============================
203 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
205 //=================== VZERO parameters =============================
207 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
210 //=================== MUON Subsystem ===========================
211 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
213 AliMUON *MUON = new AliMUONv1("MUON");
216 Float_t EtaToTheta(Float_t arg){
217 return (180./TMath::Pi())*2.*atan(exp(-arg));
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