From Jochen: changes accumulated during Feb/Mar cosmic run and some coding convention...
[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
32 gSystem->Load("libgeant321.so");
6570c14d 33 new TGeant3TGeo("C++ Interface to Geant3");
8d6c1ae0 34 //=======================================================================
35 // Create the output file
36 Text_t filename[100];
37 sprintf(filename,"%sgalice.root",directory);
38 cout << ">>> Output file is " << filename << endl;
39 cout << ">>> Config.C: Creating Run Loader ..."<<endl;
40 AliRunLoader* rl=0x0;
41 rl = AliRunLoader::Open(
bd0cb923 42 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
43 if (rl == 0x0)
44 { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
45 return; }
8d6c1ae0 46 rl->SetCompressionLevel(2);
47 rl->SetNumberOfEventsPerFile(100);
48 gAlice->SetRunLoader(rl);
bd0cb923 49 //=======================================================================
50 // For having more debuging messages
b5fb1f3e 51 //AliLog::SetModuleDebugLevel("MUON", 1);
8d6c1ae0 52 //=======================================================================
53 // Set External decayer
54 TVirtualMCDecayer *decayer = new AliDecayerPythia();
55 decayer->SetForceDecay(kAll);
56 decayer->Init();
57 gMC->SetExternalDecayer(decayer);
8d6c1ae0 58 //=======================================================================
59 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
bd0cb923 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);
74 Float_t cut = 1.e-3; // 1MeV cut by default
75 Float_t tofmax = 1.e10;
76 gMC->SetCut("CUTGAM", cut);
77 gMC->SetCut("CUTELE", cut);
78 gMC->SetCut("CUTNEU", cut);
79 gMC->SetCut("CUTHAD", cut);
80 gMC->SetCut("CUTMUO", cut);
81 gMC->SetCut("BCUTE", cut);
82 gMC->SetCut("BCUTM", cut);
83 gMC->SetCut("DCUTE", cut);
84 gMC->SetCut("DCUTM", cut);
85 gMC->SetCut("PPCUTM", cut);
86 gMC->SetCut("TOFMAX", tofmax);
8d6c1ae0 87 //=======================================================================
bd0cb923 88 // Examples of generators. Only option param is sistematically tested
8d6c1ae0 89 if (!strcmp(option,"box")) {
90 AliGenBox * gener = new AliGenBox(1);
91 gener->SetMomentumRange(20.,20.1);
92 gener->SetPhiRange(0., 360.);
93 gener->SetThetaRange(171.000,178.001);
9bb2665f 94 gener->SetPart(kMuonMinus); // Muons
8d6c1ae0 95 gener->SetOrigin(0.,0., 0.); //vertex position
96 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
97 }
98 if (!strcmp(option,"gun")) {
f47563ed 99 AliGenFixed *gener = new AliGenFixed(1);
8d6c1ae0 100 gener->SetMomentum(10);
101 gener->SetPhiRange(0.);
102 gener->SetThetaRange(0.);
f47563ed 103 gener->SetOrigin(30,30,-1200);//vertex position
9bb2665f 104 gener->SetPart(kMuonMinus); //GEANT particle type 13 is muons
8d6c1ae0 105 }
106 if (!strcmp(option,"scan")) {
107 AliGenScan *gener = new AliGenScan(-1);
108 gener->SetMomentumRange(10,10);
109 gener->SetPhiRange(0, 0);
110 gener->SetThetaRange(-180, -180);
111 //vertex position
112 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
113 gener->SetPart(kRootino);
114 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
115 }
116 if (!strcmp(option,"param")) {
8d6c1ae0 117 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
118 gener->SetMomentumRange(0,999);
119 gener->SetPtRange(0,100.);
120 gener->SetPhiRange(0., 360.);
121 gener->SetCutOnChild(1);
122 gener->SetChildPhiRange(0.,360.);
123 gener->SetChildThetaRange(171.0,178.0);
124 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
125 gener->SetForceDecay(kDiMuon);
126 gener->SetTrackingFlag(1);
127 gener->Init();
128 }
bd0cb923 129 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
130 AliGenHijing *gener = new AliGenHijing(-1);
131 // centre of mass energy
132 gener->SetEnergyCMS(5500.);
133 // reference frame
134 gener->SetReferenceFrame("CMS");
135 // projectile
136 gener->SetProjectile("A", 208, 82);
137 gener->SetTarget ("A", 208, 82);
138 // tell hijing to keep the full parent child chain
139 gener->KeepFullEvent();
140 // enable jet quenching
141 gener->SetJetQuenching(1);
142 // enable shadowing
143 gener->SetShadowing(1);
144 // neutral pion and heavy particle decays switched off
145 gener->SetDecaysOff(1);
146 // Don't track spectators
147 gener->SetSpectators(0);
148 // kinematic selection
149 gener->SetSelectAll(0);
150 // impact parameter range
151 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
152 gener->Init();
153 }
154 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
155 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
156 gener->SetPtRange(1.,100.); // Transverse momentum range
157 gener->SetPhiRange(0.,360.); // Azimuthal angle range
158 gener->SetYRange(-4.0,-2.5);
159 gener->SetMuonPtCut(0.5);
160 gener->SetMuonThetaCut(171.,178.);
161 gener->SetMuonMultiplicity(2);
162 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
163 gener->SetVertexSmear(kPerTrack);
164 gener->SetOrigin(0,0,0); // Vertex position
165 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
166 gener->Init();
167 }
8d6c1ae0 168 //=============================================================
bd0cb923 169 // Field (L3 0.5 T)
170 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
8d6c1ae0 171 gAlice->SetField(field);
bd0cb923 172 //=============================================================
8d6c1ae0 173 //=================== Alice BODY parameters =============================
174 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
175 //=================== ABSO parameters ============================
654302a0 176 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
8d6c1ae0 177 //=================== DIPO parameters ============================
654302a0 178 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
8d6c1ae0 179 //================== HALL parameters ============================
654302a0 180 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
8d6c1ae0 181 //=================== PIPE parameters ============================
654302a0 182 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
8d6c1ae0 183 //=================== SHIL parameters ============================
654302a0 184 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
e107e560 185
8d6c1ae0 186 //=================== MUON Subsystem ===========================
9bf406e1 187 AliMUON *MUON = new AliMUONv1("MUON", "default");
e107e560 188
2849388f 189 // The 3 switches below are to be used for the trigger code
08db3bf4 190 // their default value is set in AliMUON.h
afb3ccf0 191 // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
192 // MUON->SetTriggerResponseV1(0);
08db3bf4 193 // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
afb3ccf0 194 // MUON->SetTriggerCoinc44(0);
195 // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
08db3bf4 196 // MUON->SetTriggerEffCells(0);
197
5ee595ac 198 // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
199 MUON->SetDigitStoreClassName(digitstore);
200
201 cout << "MUON DigitStore is " << MUON->DigitStoreClassName().Data() << endl;
202
0aaf64c2 203 // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
d07a7866 204 //MUON->SetDigitizerWithNoise(kFALSE);
5812b5ad 205
bee76de2 206 // Use fast raw data decoder
207 // MUON->SetFastDecoder(kTRUE);
208
826f8de7 209 //
599766cd 210 // If SetAlign, the detection elements transformations
211 // are taken from the input file and not from the code
212 // MUON->SetAlign("transform.dat");
df729182 213
d83a3fce 214 // To generate and read scaler trigger events in rawdata
215 // MUON->SetTriggerScalerEvent();
542e9a38 216
5fe36481 217 // To switch off the tail effect
218 // MUON->SetTailEffect(kFALSE);
df729182 219
e107e560 220 // If you want to play with builders, first reset the geometry builder,
221 // and then add yours.
222 // MUON->ResetGeometryBuilder();
223 // MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
224 // MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
225 // MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
226 // MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
8d6c1ae0 227}