]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/Config.C
AliMUONTrackerIO:
[u/mrichter/AliRoot.git] / MUON / Config.C
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');");
25
26 void Config(char directory[100]="", char option[6]="param", const char* digitstore="AliMUONDigitStoreV2S")
27 {
28   //=====================================================================
29   // Config file for MUON test
30   //=====================================================================
31   //  Libraries required by geant321
32   gSystem->Load("libgeant321.so");
33   new TGeant3TGeo("C++ Interface to Geant3");
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(
42                           filename, AliConfig::GetDefaultEventFolderName(), "recreate");
43   if (rl == 0x0) 
44     { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
45       return; }
46   rl->SetCompressionLevel(2);
47   rl->SetNumberOfEventsPerFile(100);
48   gAlice->SetRunLoader(rl);
49   //=======================================================================
50   // For having more debuging messages
51   //AliLog::SetModuleDebugLevel("MUON", 1);
52   //=======================================================================
53   // Set External decayer
54   TVirtualMCDecayer *decayer = new AliDecayerPythia();
55   decayer->SetForceDecay(kAll);
56   decayer->Init();
57   gMC->SetExternalDecayer(decayer);
58   //=======================================================================
59   // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
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); 
87   //=======================================================================
88   // Examples of generators. Only option param is sistematically tested
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);
94     gener->SetPart(kMuonMinus);           // Muons
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")) {
99     AliGenFixed *gener = new AliGenFixed(1);
100     gener->SetMomentum(10);
101     gener->SetPhiRange(0.);
102     gener->SetThetaRange(0.);
103     gener->SetOrigin(30,30,-1200);//vertex position
104     gener->SetPart(kMuonMinus);          //GEANT particle type  13 is muons
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")) {
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   }
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   }  
168   //============================================================= 
169   // Field (L3 0.5 T)
170   AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
171   gAlice->SetField(field);
172   //============================================================= 
173   //=================== Alice BODY parameters =============================
174   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
175   //=================== ABSO parameters ============================
176   AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
177   //=================== DIPO parameters ============================
178   AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
179   //================== HALL parameters ============================
180   AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
181   //=================== PIPE parameters ============================
182   AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
183   //=================== SHIL parameters ============================
184   AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
185
186   //=================== MUON Subsystem ===========================
187   AliMUON *MUON = new AliMUONv1("MUON", "default");
188
189   // The 3 switches below are to be used for the trigger code
190   // their default value is set in AliMUON.h
191   // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
192   //  MUON->SetTriggerResponseV1(0);
193   // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
194   //  MUON->SetTriggerCoinc44(0);
195   // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
196   //  MUON->SetTriggerEffCells(0);
197
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   
203   // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
204   //MUON->SetDigitizerWithNoise(kFALSE);
205
206   // Use fast raw data decoder
207   // MUON->SetFastDecoder(kTRUE);  
208   
209   //
210   // If SetAlign, the detection elements transformations
211   // are taken from the input file and not from the code
212   // MUON->SetAlign("transform.dat");
213
214   // To generate and read scaler trigger events in rawdata
215   // MUON->SetTriggerScalerEvent();
216   
217   // To switch off the tail effect
218   // MUON->SetTailEffect(kFALSE);
219
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));
227 }