Updated documentation (Marian)
[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 }
bd0cb923 136 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
137 AliGenHijing *gener = new AliGenHijing(-1);
138 // centre of mass energy
139 gener->SetEnergyCMS(5500.);
140 // reference frame
141 gener->SetReferenceFrame("CMS");
142 // projectile
143 gener->SetProjectile("A", 208, 82);
144 gener->SetTarget ("A", 208, 82);
145 // tell hijing to keep the full parent child chain
146 gener->KeepFullEvent();
147 // enable jet quenching
148 gener->SetJetQuenching(1);
149 // enable shadowing
150 gener->SetShadowing(1);
151 // neutral pion and heavy particle decays switched off
152 gener->SetDecaysOff(1);
153 // Don't track spectators
154 gener->SetSpectators(0);
155 // kinematic selection
156 gener->SetSelectAll(0);
157 // impact parameter range
158 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
159 gener->Init();
160 }
161 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
162 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
163 gener->SetPtRange(1.,100.); // Transverse momentum range
164 gener->SetPhiRange(0.,360.); // Azimuthal angle range
165 gener->SetYRange(-4.0,-2.5);
166 gener->SetMuonPtCut(0.5);
167 gener->SetMuonThetaCut(171.,178.);
168 gener->SetMuonMultiplicity(2);
169 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
170 gener->SetVertexSmear(kPerTrack);
171 gener->SetOrigin(0,0,0); // Vertex position
172 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
173 gener->Init();
174 }
8d6c1ae0 175 //=============================================================
bd0cb923 176 // Field (L3 0.5 T)
177 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
8d6c1ae0 178 gAlice->SetField(field);
bd0cb923 179 //=============================================================
8d6c1ae0 180 //=================== Alice BODY parameters =============================
181 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
182 //=================== ABSO parameters ============================
654302a0 183 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
8d6c1ae0 184 //=================== DIPO parameters ============================
654302a0 185 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
8d6c1ae0 186 //================== HALL parameters ============================
654302a0 187 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
8d6c1ae0 188 //=================== PIPE parameters ============================
654302a0 189 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
8d6c1ae0 190 //=================== SHIL parameters ============================
654302a0 191 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
e107e560 192
8d6c1ae0 193 //=================== MUON Subsystem ===========================
9bf406e1 194 AliMUON *MUON = new AliMUONv1("MUON", "default");
e107e560 195
2849388f 196 // The 3 switches below are to be used for the trigger code
08db3bf4 197 // their default value is set in AliMUON.h
afb3ccf0 198 // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
199 // MUON->SetTriggerResponseV1(0);
08db3bf4 200 // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
afb3ccf0 201 // MUON->SetTriggerCoinc44(0);
202 // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
08db3bf4 203 // MUON->SetTriggerEffCells(0);
204
5ee595ac 205 // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
206 MUON->SetDigitStoreClassName(digitstore);
207
208 cout << "MUON DigitStore is " << MUON->DigitStoreClassName().Data() << endl;
209
0aaf64c2 210 // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
d07a7866 211 //MUON->SetDigitizerWithNoise(kFALSE);
5812b5ad 212
bee76de2 213 // Use fast raw data decoder
481d8064 214 //MUON->SetFastTrackerDecoder(kTRUE);
215 //MUON->SetFastTriggerDecoder(kTRUE);
bee76de2 216
826f8de7 217 //
599766cd 218 // If SetAlign, the detection elements transformations
219 // are taken from the input file and not from the code
220 // MUON->SetAlign("transform.dat");
df729182 221
d83a3fce 222 // To generate and read scaler trigger events in rawdata
223 // MUON->SetTriggerScalerEvent();
542e9a38 224
5fe36481 225 // To switch off the tail effect
226 // MUON->SetTailEffect(kFALSE);
df729182 227
e107e560 228 // If you want to play with builders, first reset the geometry builder,
229 // and then add yours.
230 // MUON->ResetGeometryBuilder();
231 // MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
232 // MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
233 // MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
234 // MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
8d6c1ae0 235}