1 // Config file MUON + ITS (for vertex) for PDC06
2 // Tuned for p+p min biais and quarkonia production (AliGenMUONCocktailpp)
3 // Remember to define the directory and option
4 // gAlice->SetConfigFunction("Config('$HOME','box');");
5 // april 3rd: added L3 magnet
9 void Config(char directory[100]="", char option[6]="trg1mu")
12 static Int_t sseed = 0; // Set 0 to use the current time
14 //=====================================================================
16 gSystem->Load("libgeant321");
17 new TGeant3TGeo("C++ Interface to Geant3");
19 //=======================================================================
21 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
22 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
23 AliCDBManager::Instance()->SetRun(0);
26 // Set Random Number seed
27 gRandom->SetSeed(sseed);
29 // Create the output file
31 sprintf(filename,"%sgalice.root",directory);
34 rl = AliRunLoader::Open(
35 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
37 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
40 rl->SetCompressionLevel(2);
41 rl->SetNumberOfEventsPerFile(1000);
42 gAlice->SetRunLoader(rl);
43 // gAlice->SetGeometryFromFile("geometry.root");
44 // gAlice->SetGeometryFromCDB();
46 //=======================================================================
47 // Set the trigger configuration
48 AliSimulation::Instance()->SetTriggerConfig("p-p");
49 cout<<"Trigger configuration is set to p-p"<<endl;
51 //=======================================================================
52 // Set External decayer
53 TVirtualMCDecayer *decayer = new AliDecayerPythia();
54 decayer->SetForceDecay(kAll);
56 gMC->SetExternalDecayer(decayer);
58 //=======================================================================
59 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
60 gMC->SetProcess("DCAY",1);
61 gMC->SetProcess("PAIR",1);
62 gMC->SetProcess("COMP",1);
63 gMC->SetProcess("PHOT",1);
64 gMC->SetProcess("PFIS",0);
65 gMC->SetProcess("DRAY",0);
66 gMC->SetProcess("ANNI",1);
67 gMC->SetProcess("BREM",1);
68 gMC->SetProcess("MUNU",1);
69 gMC->SetProcess("CKOV",1);
70 gMC->SetProcess("HADR",1);
71 gMC->SetProcess("LOSS",2);
72 gMC->SetProcess("MULS",1);
73 gMC->SetProcess("RAYL",1);
75 Float_t cut = 1.e-3; // 1MeV cut by default
76 Float_t tofmax = 1.e10;
78 gMC->SetCut("CUTGAM", cut);
79 gMC->SetCut("CUTELE", cut);
80 gMC->SetCut("CUTNEU", cut);
81 gMC->SetCut("CUTHAD", cut);
82 gMC->SetCut("CUTMUO", cut);
83 gMC->SetCut("BCUTE", cut);
84 gMC->SetCut("BCUTM", cut);
85 gMC->SetCut("DCUTE", cut);
86 gMC->SetCut("DCUTM", cut);
87 gMC->SetCut("PPCUTM", cut);
88 gMC->SetCut("TOFMAX", tofmax);
90 //=======================================================================
91 // ************* STEERING parameters FOR ALICE SIMULATION **************
93 // From AliMUONConstants class we get :
94 // Position Z (along beam) of the chambers (in cm)
95 // (from AliMUONConstants class):
96 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5,
97 // 1416.5, 1443.5, 1610, 1625., 1710., 1725.
98 // Internal Radius (in cm)
99 // 36.4, 46.2, 66.0, 80., 80., 100., 100.
100 // External Radius (in cm)
101 // 183., 245., 395., 560., 563., 850., 900.
102 //=======================================================================
103 AliGenPythia* PythiaForMUONCocktail(Decay_t dt)
105 AliGenPythia *pythia = new AliGenPythia(1);
106 pythia->SetProcess(kPyMbMSEL1);
107 pythia->SetStrucFunc(kCTEQ5L);
108 pythia->SetEnergyCMS(14000.);
109 pythia->SetForceDecay(dt);
110 pythia->SetPtRange(0.,100.);
111 pythia->SetYRange(-8.,8.);
112 pythia->SetPhiRange(0.,360.);
113 pythia->SetPtHard(2.76,-1.0);
114 pythia->SwitchHFOff();
118 if (!strcmp(option,"trg2mu")) {
119 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
120 gener->SetPtRange(0.,100.);
121 gener->SetYRange(-4.,-2.4);
122 gener->SetPhiRange(0.,360.);
123 gener->SetMuonMultiplicity(2);
124 gener->SetMuonPtCut(0.5);
125 gener->SetMuonThetaRange(171.,178.);
126 gener->SetOrigin(0.,0.,0.);
127 gener->SetSigma(0.,0.,5.);
128 gener->SetVertexSmear(kPerEvent);
129 Decay_t dt = gener->GetDecayModePythia(dt);
130 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
132 gener->AddGenerator(pythia,"Pythia",1);
136 if (!strcmp(option,"trg1mu")) {
137 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
138 gener->SetPtRange(0.,100.);
139 gener->SetYRange(-4.,-2.4);
140 gener->SetPhiRange(0.,360.);
141 gener->SetMuonMultiplicity(1);
142 gener->SetMuonPtCut(0.5);
143 gener->SetMuonThetaRange(171.,178.);
144 gener->SetOrigin(0.,0.,0.);
145 gener->SetSigma(0.,0.,5.);
146 gener->SetVertexSmear(kPerEvent);
147 Decay_t dt = gener->GetDecayModePythia();
148 AliGenPythia* pythia = PythiaForMUONCocktail(dt);
150 gener->AddGenerator(pythia,"Pythia",1);
153 //=============================================================
154 // Field (L3 0.5 T) outside dimuon spectrometer
155 AliMagF* field = new AliMagF("Maps","Maps",1.,1.,AliMagF::k5kG);
156 field->SetL3ConstField(0); // Using const. field in the barrel
157 TGeoGlobalMagField::Instance()->SetField(field);
169 //=================== Alice BODY parameters =============================
170 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
171 //=================== ABSO parameters ============================
172 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
173 //=================== DIPO parameters ============================
174 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
175 //================== HALL parameters ============================
176 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
177 //================== The L3 Magnet ==============================
178 AliMAG *MAG = new AliMAG("MAG", "L3 Magnet");
179 //=================== PIPE parameters ============================
180 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
181 //=================== SHIL parameters ============================
182 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
183 //=================== ITS parameters =============================
185 AliITS *ITS = new AliITSv11("ITS","ITS v11");
187 //=================== ZDC parameters =============================
189 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
191 //=================== FMD parameters =============================
193 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
195 //=================== PHOS parameters =============================
197 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
199 //=================== PMD parameters =============================
201 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
203 //=================== T0 parameters =============================
205 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
207 //=================== VZERO parameters =============================
209 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
212 //=================== MUON Subsystem ===========================
213 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
215 // With the following compactor, what you get (in case you wonder...) is :
217 // - "FactoryV4", that is all stations using new segmentations/mapping
218 // - "sdigitizer:AliMUONSDigitizerV2", performing decalibration
219 // - "digitizer:NewDigitizerOldTrigger" <=> digitizer=AliMUONDigitizerV3,
220 // using the "old" trigger code, performing calibration
222 AliMUON *MUON = new AliMUONv1("MUON");
225 Float_t EtaToTheta(Float_t arg){
226 return (180./TMath::Pi())*2.*atan(exp(-arg));
232 // Load Pythia related libraries
233 gSystem->Load("liblhapdf"); // Parton density functions
234 gSystem->Load("libEGPythia6"); // TGenerator interface
235 gSystem->Load("libpythia6"); // Pythia
236 gSystem->Load("libAliPythia6"); // ALICE specific implementations