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