changes in the MagF constructor
[u/mrichter/AliRoot.git] / MUON / Config.C
CommitLineData
e54bf126 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18/// \ingroup macros
19/// \file Config.C
20/// \brief Configuration macro for MUON spectormeter simulation
21///
22/// Remember to define the directory and event generator option:
23///
24/// gAlice->SetConfigFunction("Config('$HOME','box');");
8d6c1ae0 25
40312696 26void Config(char directory[100]="", char option[6]="param", const char* digitstore="AliMUONDigitStoreV2S")
8d6c1ae0 27{
bd0cb923 28 //=====================================================================
8d6c1ae0 29 // Config file for MUON test
8d6c1ae0 30 //=====================================================================
31 // Libraries required by geant321
eeb4f277 32 gSystem->Load("liblhapdf.so"); // Parton density functions
33 gSystem->Load("libpythia6.so"); // Pythia
c5cee034 34 gSystem->Load("libgeant321.so");
35 gSystem->Load("libEG");
36 gSystem->Load("libEGPythia6");
eeb4f277 37 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
38
6570c14d 39 new TGeant3TGeo("C++ Interface to Geant3");
eeb4f277 40
8d6c1ae0 41 //=======================================================================
42 // Create the output file
43 Text_t filename[100];
44 sprintf(filename,"%sgalice.root",directory);
45 cout << ">>> Output file is " << filename << endl;
46 cout << ">>> Config.C: Creating Run Loader ..."<<endl;
47 AliRunLoader* rl=0x0;
48 rl = AliRunLoader::Open(
bd0cb923 49 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
50 if (rl == 0x0)
51 { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
52 return; }
8d6c1ae0 53 rl->SetCompressionLevel(2);
54 rl->SetNumberOfEventsPerFile(100);
55 gAlice->SetRunLoader(rl);
bd0cb923 56 //=======================================================================
57 // For having more debuging messages
b5fb1f3e 58 //AliLog::SetModuleDebugLevel("MUON", 1);
8d6c1ae0 59 //=======================================================================
60 // Set External decayer
61 TVirtualMCDecayer *decayer = new AliDecayerPythia();
62 decayer->SetForceDecay(kAll);
63 decayer->Init();
64 gMC->SetExternalDecayer(decayer);
8d6c1ae0 65 //=======================================================================
66 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
bd0cb923 67 gMC->SetProcess("DCAY",1);
68 gMC->SetProcess("PAIR",1);
69 gMC->SetProcess("COMP",1);
70 gMC->SetProcess("PHOT",1);
71 gMC->SetProcess("PFIS",0);
72 gMC->SetProcess("DRAY",0);
73 gMC->SetProcess("ANNI",1);
74 gMC->SetProcess("BREM",1);
75 gMC->SetProcess("MUNU",1);
76 gMC->SetProcess("CKOV",1);
77 gMC->SetProcess("HADR",1);
78 gMC->SetProcess("LOSS",2);
79 gMC->SetProcess("MULS",1);
80 gMC->SetProcess("RAYL",1);
81 Float_t cut = 1.e-3; // 1MeV cut by default
82 Float_t tofmax = 1.e10;
83 gMC->SetCut("CUTGAM", cut);
84 gMC->SetCut("CUTELE", cut);
85 gMC->SetCut("CUTNEU", cut);
86 gMC->SetCut("CUTHAD", cut);
87 gMC->SetCut("CUTMUO", cut);
88 gMC->SetCut("BCUTE", cut);
89 gMC->SetCut("BCUTM", cut);
90 gMC->SetCut("DCUTE", cut);
91 gMC->SetCut("DCUTM", cut);
92 gMC->SetCut("PPCUTM", cut);
93 gMC->SetCut("TOFMAX", tofmax);
8d6c1ae0 94 //=======================================================================
bd0cb923 95 // Examples of generators. Only option param is sistematically tested
8d6c1ae0 96 if (!strcmp(option,"box")) {
97 AliGenBox * gener = new AliGenBox(1);
98 gener->SetMomentumRange(20.,20.1);
99 gener->SetPhiRange(0., 360.);
100 gener->SetThetaRange(171.000,178.001);
9bb2665f 101 gener->SetPart(kMuonMinus); // Muons
8d6c1ae0 102 gener->SetOrigin(0.,0., 0.); //vertex position
103 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
104 }
105 if (!strcmp(option,"gun")) {
f47563ed 106 AliGenFixed *gener = new AliGenFixed(1);
8d6c1ae0 107 gener->SetMomentum(10);
108 gener->SetPhiRange(0.);
109 gener->SetThetaRange(0.);
f47563ed 110 gener->SetOrigin(30,30,-1200);//vertex position
9bb2665f 111 gener->SetPart(kMuonMinus); //GEANT particle type 13 is muons
8d6c1ae0 112 }
113 if (!strcmp(option,"scan")) {
114 AliGenScan *gener = new AliGenScan(-1);
115 gener->SetMomentumRange(10,10);
116 gener->SetPhiRange(0, 0);
117 gener->SetThetaRange(-180, -180);
118 //vertex position
119 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
120 gener->SetPart(kRootino);
121 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
122 }
123 if (!strcmp(option,"param")) {
8d6c1ae0 124 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
125 gener->SetMomentumRange(0,999);
126 gener->SetPtRange(0,100.);
127 gener->SetPhiRange(0., 360.);
128 gener->SetCutOnChild(1);
129 gener->SetChildPhiRange(0.,360.);
130 gener->SetChildThetaRange(171.0,178.0);
131 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
132 gener->SetForceDecay(kDiMuon);
133 gener->SetTrackingFlag(1);
134 gener->Init();
135 }
f80c094e 136 if (!strcmp(option,"paramJpsi")) {
137 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kJpsi);
138 gener->SetMomentumRange(0,999);
139 gener->SetPtRange(0,100.);
140 gener->SetPhiRange(0., 360.);
141 gener->SetCutOnChild(1);
142 gener->SetChildPhiRange(0.,360.);
143 gener->SetChildThetaRange(171.0,178.0);
144 gener->SetOrigin(0,0,0);
145 gener->SetForceDecay(kDiMuon);
146 gener->SetTrackingFlag(1);
147 gener->Init();
148 }
bd0cb923 149 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
150 AliGenHijing *gener = new AliGenHijing(-1);
151 // centre of mass energy
152 gener->SetEnergyCMS(5500.);
153 // reference frame
154 gener->SetReferenceFrame("CMS");
155 // projectile
156 gener->SetProjectile("A", 208, 82);
157 gener->SetTarget ("A", 208, 82);
158 // tell hijing to keep the full parent child chain
159 gener->KeepFullEvent();
160 // enable jet quenching
161 gener->SetJetQuenching(1);
162 // enable shadowing
163 gener->SetShadowing(1);
164 // neutral pion and heavy particle decays switched off
165 gener->SetDecaysOff(1);
166 // Don't track spectators
167 gener->SetSpectators(0);
168 // kinematic selection
169 gener->SetSelectAll(0);
170 // impact parameter range
171 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
172 gener->Init();
173 }
174 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
175 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
176 gener->SetPtRange(1.,100.); // Transverse momentum range
177 gener->SetPhiRange(0.,360.); // Azimuthal angle range
178 gener->SetYRange(-4.0,-2.5);
179 gener->SetMuonPtCut(0.5);
180 gener->SetMuonThetaCut(171.,178.);
181 gener->SetMuonMultiplicity(2);
182 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
183 gener->SetVertexSmear(kPerTrack);
184 gener->SetOrigin(0,0,0); // Vertex position
185 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
186 gener->Init();
187 }
8d6c1ae0 188 //=============================================================
bd0cb923 189 // Field (L3 0.5 T)
4642ac4b 190 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));
bd0cb923 191 //=============================================================
8d6c1ae0 192 //=================== Alice BODY parameters =============================
193 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
194 //=================== ABSO parameters ============================
654302a0 195 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
8d6c1ae0 196 //=================== DIPO parameters ============================
654302a0 197 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
8d6c1ae0 198 //================== HALL parameters ============================
654302a0 199 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
8d6c1ae0 200 //=================== PIPE parameters ============================
654302a0 201 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
8d6c1ae0 202 //=================== SHIL parameters ============================
654302a0 203 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
e107e560 204
8d6c1ae0 205 //=================== MUON Subsystem ===========================
9bf406e1 206 AliMUON *MUON = new AliMUONv1("MUON", "default");
e107e560 207
2849388f 208 // The 3 switches below are to be used for the trigger code
08db3bf4 209 // their default value is set in AliMUON.h
afb3ccf0 210 // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
211 // MUON->SetTriggerResponseV1(0);
08db3bf4 212 // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
afb3ccf0 213 // MUON->SetTriggerCoinc44(0);
214 // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
08db3bf4 215 // MUON->SetTriggerEffCells(0);
216
5ee595ac 217 // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
218 MUON->SetDigitStoreClassName(digitstore);
219
220 cout << "MUON DigitStore is " << MUON->DigitStoreClassName().Data() << endl;
221
0aaf64c2 222 // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
d07a7866 223 //MUON->SetDigitizerWithNoise(kFALSE);
5812b5ad 224
5f3519d9 225 // Use non-high performance raw data decoder
226 //MUON->SetFastTrackerDecoder(kFALSE);
227 //MUON->SetFastTriggerDecoder(kFALSE);
bee76de2 228
826f8de7 229 //
599766cd 230 // If SetAlign, the detection elements transformations
231 // are taken from the input file and not from the code
232 // MUON->SetAlign("transform.dat");
df729182 233
d83a3fce 234 // To generate and read scaler trigger events in rawdata
235 // MUON->SetTriggerScalerEvent();
542e9a38 236
5fe36481 237 // To switch off the tail effect
238 // MUON->SetTailEffect(kFALSE);
df729182 239
e107e560 240 // If you want to play with builders, first reset the geometry builder,
241 // and then add yours.
242 // MUON->ResetGeometryBuilder();
243 // MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
244 // MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
245 // MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
246 // MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
8d6c1ae0 247}