Adding generation of trigger masks, trigger lut and trigger effiency.
[u/mrichter/AliRoot.git] / MUON / README
CommitLineData
50837721 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
88cb7938 18==========================================================
19Please add to this README file all information concerning
20config files, simulation, digitalization, clusterization,
21reconstruction and macro analysis
22
6b1e4b22 23==========================================================
24 How to check that your aliroot is working well
25==========================================================
8c4c70f6 26There is a script file AlirootRun_MUONtest.sh which
6b1e4b22 27allows for simulating, reconstructing and making the
28invariant analysis of the generated Upsilon (1S).
29The used configuration file is Config.C in MUON
30directory.
8c4c70f6 31You have to type :
32source $ALICE_ROOT/MUON/AlirootRun_MUONtest.sh
c57f3c5b 33The results of this test are saved in test_out/ directory.
34Note that the first step of this script is to create a local Condition
35Database for MUON (containing fake values for pedestals, gains, and
36 dead channels), which is written under $ALICE_ROOT/MUON/CDB (using the
37MUONCDB.C compiled macro).
38That CDB is now always *required* to perform either simulation or
39reconstruction.
40It's created only once, and reused by subsequent use of the script.
41But in case of upgrade of MUON code, please rm -rf this
42directory in order to re-create it from scratch, just to be on the safe side.
6b1e4b22 43
7f42a16f 44==========================================================
45 How to check that your aliroot is working VERY well
46==========================================================
47There is a script file AlirootRun_MUONlongtest.sh which
48allows for simulating, reconstructing and making the
49-+invariant analysis of the generated Upsilon (1S).
50This script generates a large number of Upsilon (20k)
51in order to access differential quantities.
52The used configuration file is Config.C in MUON
53directory.
54One should really run this script to check if the MUON
55code can process a large number of events WITHOUT errors,
56in particular before making important commits !!
57
58You have to type :
59$ALICE_ROOT/MUON/AlirootRun_MUONtestlong.sh
60The results of this test are saved in testlong_out/ directory
61and will be kept in CVS
62
63(NOTE: the macros performing the calculations/plots MUONefficiency.C
64and MUONplotEfficiency.C are also able to handle J/Psi if
65Config.C is modified accordingly )
66
88cb7938 67==========================================================
7985603c 68 How to run a MUON generation
88cb7938 69==========================================================
70aliroot
fc1fafa5 71root [0] gAlice->Run(10,"$ALICE_ROOT/MUON/Config.C");
88cb7938 72
731 single muon of 7 GeV/c in the MUON spectrometer
74acceptance will be simulated using geant3.
75Hit information will be store in the root file in the
76execution directory.
88cb7938 77If you want to change the option or to define a new directory
78for hits, you have to do the following before:
79root [0] gAlice->SetConfigFunction("Config( \"/home/martinez/aliroot/work_NewIO/test/\" , \"box\" );");
80
88cb7938 81============================================================
82 How to run MUONCheck macro
83============================================================
84To check the content of a root data file, the MUONCheck
85provides a ascii output on screen.
86
87To compile MUONCheck.C
2058bf30 88.includepath $ALICE_ROOT/STEER
89.includepath $ALICE_ROOT/MUON
bf485fb9 90.includepath $ALICE_ROOT/MUON/mapping
2058bf30 91.L $ALICE_ROOT/MUON/MUONCheck.C++
bf17dbfd 92To Load
93gSystem->Load("$ALICE_ROOT/MUON/MUONCheck_C.so")
2058bf30 94
278a86d5 95To print Kine : (default file is galice.root )
7d6677d7 96MUONkine() or MUONkine(##,"galice.root") for the event number ##
88cb7938 97
98To print hits : (default file is galice.root if not MUONhits("toto.root""); )
7d6677d7 99MUONhits() or MUONhits(##,"galice.root") for the event number ##
88cb7938 100
101To print digits : (default file is galice.root)
7d6677d7 102MUONdigits() or MUONdigits(##,"galice.root") for the event number ##
c57f3c5b 103
104To print sdigits : (default file is galice.root)
105MUONsdigits() or MUONsdigits(##,"galice.root") for the event number ##
88cb7938 106
107To print rawcluster : (default file is galice.root)
7d6677d7 108MUONrecpoints() or MUONrecpoints(##,"galice.root") for the event number ##
88cb7938 109
110To print trigger : (default file is galice.root)
7d6677d7 111MUONrectrigger() or MUONrectrigger(##,"galice.root") for the event number ##
2b32c661 112
113....
88cb7938 114
6570c14d 115============================================================
116 How to check the Geometry with the new Geometrical modeler
117 ftp://root.cern.ch/root/doc/chapter16.pdf
118 http://agenda.cern.ch/fullAgenda.php?ida=a05212
119============================================================
120gAlice->Init("$ALICE_ROOT/MUON/Config.C");
121gGeoManager->GetMasterVolume()->Draw();
122
02d8f072 123
b3ba6823 124============================================================
125 How to check the overlap with the new Geometrical modeler
126 ftp://root.cern.ch/root/doc/chapter16.pdf
127 http://agenda.cern.ch/fullAgenda.php?ida=a05212
128============================================================
129gAlice->Init("$ALICE_ROOT/MUON/Config.C");
130gGeoManager->CheckOverlaps();
131gGeoManager->PrintOverlaps();
132
7985603c 133============================================================
134 How to run MUONdisplay
135============================================================
1eccde20 136First you need to perform a full simulation:
7985603c 137generation, digitalisation and clusterisation
cd0f8cc8 138To run MUONdisplay with Root 5.04/00 you need to get a fix in
139the gpad/src/TPad.cxx from Root CVS:
140 cvs update -r 1.200 gpad/src/TPad.cxx
141and recompile root.
142
7985603c 143.L $ALICE_ROOT/MUON/MUONdisplay.C
144MUONdisplay(0,"galice.root")
145
02d8f072 146============================================================
147 Tracking parameters, cuts, energy loss and physics processes
148============================================================
149Tracking parameters in MUON are automatically defined by GEANT
150MUON takes the default values of CUTs and physics processes
151defined by the Config files, except for the gas mixture medium
152of the tracking chambers. The CUT's and physics processes of
153the gas mixture medium is then defined in the galice.cuts file
154in the data directory. In particular ILOSS parameter MUST be
155equal unity (1) in order simulate a realistic energy loss
156distribution (mean value and fluctuations) in the active gas.
a88eb0d0 157
158============================================================
159 Tracking of particle in the magnetic field
160============================================================
161GEANT has two ways for tracking charged particles in the
162magnetic field: HELIX et RKUTA.
163HELIX is faster and works well if the gradient of magnetic
164field is small.
165For MUON, HELIX is a not a good approximation and we must
166use RKUTA to get the optimal mass resolution of the
167spectrometer. The choice of HELIX or RKUTA is done in the
168config file when the magnetic field is defined:
169 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", TRACKING, FACTOR, MAXB, AliMagFMaps::k4kG);
170 gAlice->SetField(field);
171TRACKING must be 1 for RKUTA and 2 for HELIX (the default value for aliroot is 2 (HELIX))
172FACTOR allows you to set the magnetic field to 0, just putting FACTOR=0. Default value is 1.
173MAXB is the maximum magnetic field which is 10.T
2b32c661 174
f4f795ed 175===========================================================
176 MUON cocktail for physics ..............
177===========================================================
178There is a MUON cocktail generator of the muon sources in the
179EVGEN directory. This class derives from AliGenCocktail.
180In the init of this class I have filled the cocktail with
181the muon sources: J/Psi, Upsilon, Open Charm, Open Beauty,
182Pion, Kaons. The code needs only the production cross section
183at 4pi (for the moment this values are in the code since I
184prefere them do not be modified), and the code calculates the
185rate of particles in the acceptance, making the scaling based
186on the number of collisions for the hard probes and on the
187number of participants for soft sources: Pions and Kaons.
188
189In the Genereate of this class all entries in the cocktail
190are called and we define a "primordial trigger" with requires
191a minimum number of muons above a Pt cut in the required acceptance.
192In order to normalized to the real number of simulated events,
193there are 2 data members in the class fNsuceeded adn fNGenerate
194which tell us what is the biais source.
195
196Enclose an example to use this generator:
197AliGenMUONCocktail * gener = new AliGenMUONCocktail();
198gener->SetPtRange(1.,100.); // Transverse momentum range
199gener->SetPhiRange(0.,360.); // Azimuthal angle range
200gener->SetYRange(-4.0,-2.4);
201gener->SetMuonPtCut(1.);
202gener->SetMuonThetaCut(171.,178.);
203gener->SetMuonMultiplicity(2);
35e21dec 204gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
f4f795ed 205gener->SetVertexSmear(kPerTrack);
206gener->SetOrigin(0,0,0); // Vertex position
207gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
208gener->Init();
209
a2da7817 210================================================================
69be760c 211 csh Script for the full reconstruction with raw data generator
a2da7817 212================================================================
213The rawdata generation and analysis is working with the new segmentation.
214So the config file must use the version "AliMUONFactoryV3"
215
216Generation
217The method AliSimulation::SetWriteRawData("MUON") enables on
218the muon rawdata generation
219aliroot -b << EOF
220AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
221MuonSim.SetWriteRawData("MUON")
222MuonSim.Run(10)
223.q
224EOF
225
226Reconstruction
227aliroot -b << EOF
228AliReconstruction MuonRec("galice.root");
229MuonRec.SetInput("$YOUR_WORKING_DIRECTORY/"); Do not forget the slash at the end!
230MuonRec.SetRunVertexFinder(kFALSE);
231MuonRec.SetRunLocalReconstruction("MUON");
232MuonRec.SetRunTracking("");
233MuonRec.SetFillESD("MUON");
8e0ae46c 234MuonRec.SetOption("MUON", "VS"); // to use VS cluster finder
235// MuonRec.SetOption("MUON", "VS Original"); // to run VS and original track finder
236// MuonRec.SetOption("MUON", "Combi"); // to run combined cluster / track finder
237MMuonRec.Run();
a2da7817 238.q
239EOF
240
a88eb0d0 241
b8dc484b 242
243============================================================
244 How to run MUONRecoCheck macro
245============================================================
246To check the muon reconstruction by comparing the reconstructed tracks
247with the reference tracks made of "AliTrackReference" for the hits and
248kinematic informations (TParticle) for the vertex.
249This macro can be used to check the track reconstruction e.g. efficiency,
250momentum resolution ... but also to make physics analysis whenever
251track identification is needed.
252
253To compile MUONRecoCheck.C
254.includepath $ALICE_ROOT/STEER
255.includepath $ALICE_ROOT/MUON
256.L $ALICE_ROOT/MUON/MUONRecoCheck.C+
257
258// To run MUONRecoCheck
259MUONRecoCheck(nEvent,"galice.root"); // nEvent = nb of events
260
29fc2c86 261
262============================================================
263 How to run MUONTracker macro
264============================================================
265To make the track reconstruction directly from AliTrackReference hits
266which are recorded in TrackRefs.root during the simulation.
267It can be used to check the reconstruction without clusterization.
268
269To compile MUONTracker.C
270.includepath $ALICE_ROOT/STEER
271.includepath $ALICE_ROOT/MUON
272.L $ALICE_ROOT/MUON/MUONTracker.C+
273
274// To run MUONTracker
275MUONTracker(iEventMin,iEventMax,"galice.root"); // iEventMin: first event
fc1fafa5 276
277===========================================================
278 Macro MUONGenerateGeometryData.C
279===========================================================
280
281Macro for generating the geometry data files:
65087afe 282(transform.dat, svmap.dat).
283- MUON/data/transform.dat file contains all the information
fc1fafa5 284about the transformation (traslation + rotation) needed for
285the positionning of each detection element of the MUON
286spectrometer.
65087afe 287- MUON/data/svmap.dat file contains all the information to link
fc1fafa5 288each geant volume (it can be extended to other virtual MC) with
289a detection element. The point here is that a given detection
290element, i.e. a slat chamber consists of many geant volumes.
291the correspondence is then defined in an input file.
65087afe 292Each time there is a change in the definition of MC geometry, these
fc1fafa5 293input files must be re-generated via the macro
294MUONGenerateGeometryData.C
295
296To be run from aliroot:
297.x MUONGenerateGeometryData.C
298
299The generated files do not replace the existing ones
300but have different names (with extension ".out").
65087afe 301Replacement with new files has to be done manually.
29fc2c86 302
303
cd85a354 304==========================================================
305 How to Merge events
306==========================================================
307
308You can merge 2 types of simulated events. For example,
309you can simulate Hijing events, and then simulate muons
310merging both.
311
312Merging is done at the sdigits level, so Kinematics files
313of the merged events will just correspond to the
314Config.C simulated file (not to Config_HIJING.C).
315
316You must, first, do the Hijing simulation and store it
317in directory $HIJING_SIM. Note that for merging you
318won't need Kinematics files of the Hijing simulation...
319
320Hijing simulation
321
322aliroot -b << EOF
323AliSimulation HijingSim("$HIJING_SIM/Config_HIJING.C")
324HijingSim.Run(5)
325.q
326EOF
327
328
329Then you can do muon simulation and reconstruction
330merging both simulated events. In next example, we are
331merging 20 times each Hijing event in order to simulate
332100 muons merged with 5 Hijing events.
333
334
335aliroot -b << EOF
336AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
337MuonSim.MergeWith("$HIJING_SIM/galice.root",20) //parameters are the Hijing simulation file and the number of times we use each Hijing event
338MuonSim.Run(100) // number of muon (Config.C) events
339.q
340EOF
341
342
343aliroot -b << EOF
344TPluginManager * pluginmanager = gROOT->GetPluginManager()
345pluginmanager->AddHandler("AliReconstructor","MUON","AliMUONReconstructor","MUON","AliMUONReconstructor()")
346AliReconstruction MuonRec("galice.root")
347MuonRec.SetRunTracking("")
348MuonRec.SetRunVertexFinder(kFALSE)
349MuonRec.SetRunLocalReconstruction("MUON")
350MuonRec.SetFillESD("MUON")
351MuonRec.Run()
352.q
353EOF
354
88cb7938 355===========================================================
356 Still working ..............
357===========================================================