]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/Config.C
Adding 4 new QA histos:
[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("liblhapdf.so");      // Parton density functions
33   gSystem->Load("libpythia6.so");     // Pythia
34   gSystem->Load("libgeant321.so");
35   gSystem->Load("libEG");
36   gSystem->Load("libEGPythia6");
37   gSystem->Load("libAliPythia6.so");  // ALICE specific implementations
38
39   new TGeant3TGeo("C++ Interface to Geant3");
40
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(
49                           filename, AliConfig::GetDefaultEventFolderName(), "recreate");
50   if (rl == 0x0) 
51     { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
52       return; }
53   rl->SetCompressionLevel(2);
54   rl->SetNumberOfEventsPerFile(100);
55   gAlice->SetRunLoader(rl);
56   //=======================================================================
57   // For having more debuging messages
58   //AliLog::SetModuleDebugLevel("MUON", 1);
59   //=======================================================================
60   // Set External decayer
61   TVirtualMCDecayer *decayer = new AliDecayerPythia();
62   decayer->SetForceDecay(kAll);
63   decayer->Init();
64   gMC->SetExternalDecayer(decayer);
65   //=======================================================================
66   // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
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); 
94   //=======================================================================
95   // Examples of generators. Only option param is sistematically tested
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);
101     gener->SetPart(kMuonMinus);           // Muons
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")) {
106     AliGenFixed *gener = new AliGenFixed(1);
107     gener->SetMomentum(10);
108     gener->SetPhiRange(0.);
109     gener->SetThetaRange(0.);
110     gener->SetOrigin(30,30,-1200);//vertex position
111     gener->SetPart(kMuonMinus);          //GEANT particle type  13 is muons
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")) {
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   }
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   }
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   }  
188   //============================================================= 
189   // Field (L3 0.5 T)
190   TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));
191   //============================================================= 
192   //=================== Alice BODY parameters =============================
193   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
194   //=================== ABSO parameters ============================
195   AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
196   //=================== DIPO parameters ============================
197   AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
198   //================== HALL parameters ============================
199   AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
200   //=================== PIPE parameters ============================
201   AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
202   //=================== SHIL parameters ============================
203   AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
204
205   //=================== MUON Subsystem ===========================
206   AliMUON *MUON = new AliMUONv1("MUON", "default");
207
208   // The 3 switches below are to be used for the trigger code
209   // their default value is set in AliMUON.h
210   // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
211   //  MUON->SetTriggerResponseV1(0);
212   // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
213   //  MUON->SetTriggerCoinc44(0);
214   // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
215   //  MUON->SetTriggerEffCells(0);
216
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   
222   // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
223   //MUON->SetDigitizerWithNoise(kFALSE);
224
225   // Use non-high performance raw data decoder 
226   //MUON->SetFastTrackerDecoder(kFALSE);  
227   //MUON->SetFastTriggerDecoder(kFALSE);  
228   
229   //
230   // If SetAlign, the detection elements transformations
231   // are taken from the input file and not from the code
232   // MUON->SetAlign("transform.dat");
233
234   // To generate and read scaler trigger events in rawdata
235   // MUON->SetTriggerScalerEvent();
236   
237   // To switch off the tail effect
238   // MUON->SetTailEffect(kFALSE);
239
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));
247 }