Possibility to use loadlibs.C on Solaris x86
[u/mrichter/AliRoot.git] / macros / Config_PDC06_MUON.C
CommitLineData
dfd0f589 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');");
e1f732d4 5// april 3rd: added L3 magnet
dfd0f589 6
e1f732d4 7void Config(char directory[100]="", char option[6]="trg1mu")
dfd0f589 8{
9
10 static Int_t sseed = 0; // Set 0 to use the current time
11
12 //=====================================================================
13 // Libraries required by geant321
14 gSystem->Load("libgeant321.so");
15 new TGeant3TGeo("C++ Interface to Geant3");
16 //=======================================================================
17
18 // Set Random Number seed
19 gRandom->SetSeed(sseed);
20
21 // Create the output file
22 Text_t filename[100];
23 sprintf(filename,"%sgalice.root",directory);
24
25 AliRunLoader* rl=0x0;
26 rl = AliRunLoader::Open(
27 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
28 if (rl == 0x0) {
29 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
30 return;
31 }
32 rl->SetCompressionLevel(2);
e1f732d4 33 rl->SetNumberOfEventsPerFile(1000);
dfd0f589 34 gAlice->SetRunLoader(rl);
35
36 //=======================================================================
6521ae06 37 // Set the trigger configuration
38 gAlice->SetTriggerDescriptor("p-p");
39 cout<<"Trigger configuration is set to p-p"<<endl;
40
41 //=======================================================================
dfd0f589 42 // Set External decayer
43 TVirtualMCDecayer *decayer = new AliDecayerPythia();
44 decayer->SetForceDecay(kAll);
45 decayer->Init();
46 gMC->SetExternalDecayer(decayer);
47
48 //=======================================================================
49 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
50 gMC->SetProcess("DCAY",1);
51 gMC->SetProcess("PAIR",1);
52 gMC->SetProcess("COMP",1);
53 gMC->SetProcess("PHOT",1);
54 gMC->SetProcess("PFIS",0);
55 gMC->SetProcess("DRAY",0);
56 gMC->SetProcess("ANNI",1);
57 gMC->SetProcess("BREM",1);
58 gMC->SetProcess("MUNU",1);
59 gMC->SetProcess("CKOV",1);
60 gMC->SetProcess("HADR",1);
61 gMC->SetProcess("LOSS",2);
62 gMC->SetProcess("MULS",1);
63 gMC->SetProcess("RAYL",1);
64
65 Float_t cut = 1.e-3; // 1MeV cut by default
66 Float_t tofmax = 1.e10;
67
68 gMC->SetCut("CUTGAM", cut);
69 gMC->SetCut("CUTELE", cut);
70 gMC->SetCut("CUTNEU", cut);
71 gMC->SetCut("CUTHAD", cut);
72 gMC->SetCut("CUTMUO", cut);
73 gMC->SetCut("BCUTE", cut);
74 gMC->SetCut("BCUTM", cut);
75 gMC->SetCut("DCUTE", cut);
76 gMC->SetCut("DCUTM", cut);
77 gMC->SetCut("PPCUTM", cut);
78 gMC->SetCut("TOFMAX", tofmax);
79 //
80 //=======================================================================
81 // ************* STEERING parameters FOR ALICE SIMULATION **************
82 // Chamber positions
83 // From AliMUONConstants class we get :
84 // Position Z (along beam) of the chambers (in cm)
85 // (from AliMUONConstants class):
86 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5,
87 // 1416.5, 1443.5, 1610, 1625., 1710., 1725.
88 // Internal Radius (in cm)
89 // 36.4, 46.2, 66.0, 80., 80., 100., 100.
90 // External Radius (in cm)
91 // 183., 245., 395., 560., 563., 850., 900.
92 //=======================================================================
93
94 if (!strcmp(option,"trg2mu")) {
95 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
96 gener->SetPtRange(0.,100.);
97 gener->SetYRange(-4.,-2.4);
e1f732d4 98 gener->SetPhiRange(0.,360.);
dfd0f589 99 gener->SetMuonMultiplicity(2);
e1f732d4 100 gener->SetMuonPtCut(0.5);
dfd0f589 101 gener->SetMuonThetaRange(171.,178.);
102 gener->SetOrigin(0.,0.,0.);
103 gener->SetSigma(0.,0.,5.);
104 gener->SetVertexSmear(kPerEvent);
105 gener->Init();
106 }
107
108 if (!strcmp(option,"trg1mu")) {
109 AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
110 gener->SetPtRange(0.,100.);
111 gener->SetYRange(-4.,-2.4);
e1f732d4 112 gener->SetPhiRange(0.,360.);
dfd0f589 113 gener->SetMuonMultiplicity(1);
e1f732d4 114 gener->SetMuonPtCut(0.5);
dfd0f589 115 gener->SetMuonThetaRange(171.,178.);
116 gener->SetOrigin(0.,0.,0.);
117 gener->SetSigma(0.,0.,5.);
118 gener->SetVertexSmear(kPerEvent);
119 gener->Init();
120 }
121 //=============================================================
e1f732d4 122 // Field (L3 0.5 T) outside dimuon spectrometer
123 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
f3cba114 124 field->SetL3ConstField(0); // Using const. field in the barrel
dfd0f589 125 gAlice->SetField(field);
126
e1f732d4 127 Int_t iITS = 1;
128 Int_t iZDC = 1;
129 Int_t iFMD = 1;
130 Int_t iPHOS = 1;
131 Int_t iPMD = 1;
132 Int_t iSTART = 1;
133 Int_t iVZERO = 1;
134
dfd0f589 135 rl->CdGAFile();
136
137 //=================== Alice BODY parameters =============================
138 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
139 //=================== ABSO parameters ============================
140 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
141 //=================== DIPO parameters ============================
142 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
143 //================== HALL parameters ============================
144 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
145 //================== The L3 Magnet ==============================
146 AliMAG *MAG = new AliMAG("MAG", "L3 Magnet");
147 //=================== PIPE parameters ============================
148 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
149 //=================== SHIL parameters ============================
150 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
151 //=================== ITS parameters =============================
152 if(iITS) {
153 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
154 }
e1f732d4 155 //=================== ZDC parameters =============================
156 if(iZDC) {
157 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
158 }
159 //=================== FMD parameters =============================
160 if(iFMD) {
161 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
162 }
163 //=================== PHOS parameters =============================
164 if(iPHOS) {
165 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
166 }
167 //=================== PMD parameters =============================
168 if(iPMD) {
169 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
170 }
171 //=================== START parameters =============================
172 if (iSTART) {
173 AliSTART *START = new AliSTARTv1("START", "START Detector");
174 }
175 //=================== VZERO parameters =============================
176 if (iVZERO) {
177 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
178 }
dfd0f589 179
180 //=================== MUON Subsystem ===========================
181 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
182
183 // With the following compactor, what you get (in case you wonder...) is :
184 //
185 // - "FactoryV4", that is all stations using new segmentations/mapping
186 // - "sdigitizer:AliMUONSDigitizerV2", performing decalibration
187 // - "digitizer:NewDigitizerOldTrigger" <=> digitizer=AliMUONDigitizerV3,
188 // using the "old" trigger code, performing calibration
189 //
190 AliMUON *MUON = new AliMUONv1("MUON");
191}
192
193Float_t EtaToTheta(Float_t arg){
194 return (180./TMath::Pi())*2.*atan(exp(-arg));
195}