]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/README
Copy constructor implemented.
[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.
60fff730 34Please note that the CDB (Condition DataBase) is now always *required*
35to perform either simulation or reconstruction. For the moment, a version
36 of that CDB is stored in CVS, so you should have one already in MUON/Calib
37subdirectories.
6b1e4b22 38
7f42a16f 39==========================================================
40 How to check that your aliroot is working VERY well
41==========================================================
42There is a script file AlirootRun_MUONlongtest.sh which
43allows for simulating, reconstructing and making the
44-+invariant analysis of the generated Upsilon (1S).
45This script generates a large number of Upsilon (20k)
46in order to access differential quantities.
47The used configuration file is Config.C in MUON
48directory.
49One should really run this script to check if the MUON
50code can process a large number of events WITHOUT errors,
51in particular before making important commits !!
52
53You have to type :
54$ALICE_ROOT/MUON/AlirootRun_MUONtestlong.sh
55The results of this test are saved in testlong_out/ directory
56and will be kept in CVS
57
58(NOTE: the macros performing the calculations/plots MUONefficiency.C
59and MUONplotEfficiency.C are also able to handle J/Psi if
60Config.C is modified accordingly )
61
88cb7938 62==========================================================
7985603c 63 How to run a MUON generation
88cb7938 64==========================================================
65aliroot
fc1fafa5 66root [0] gAlice->Run(10,"$ALICE_ROOT/MUON/Config.C");
88cb7938 67
681 single muon of 7 GeV/c in the MUON spectrometer
69acceptance will be simulated using geant3.
70Hit information will be store in the root file in the
71execution directory.
88cb7938 72If you want to change the option or to define a new directory
73for hits, you have to do the following before:
74root [0] gAlice->SetConfigFunction("Config( \"/home/martinez/aliroot/work_NewIO/test/\" , \"box\" );");
75
88cb7938 76============================================================
cd4f4ea4 77 How to dump the content of Root data files
88cb7938 78============================================================
cd4f4ea4 79To check the content of Root data files, the AliMUONData class
80provides the functions to produce an ASCII output on the screen
81which can be redirected on the file:
88cb7938 82
cd4f4ea4 83aliroot
84root [0] AliMUONData data("galice.root");
85root [1] data.DumpKine(5); > dump.kine
86root [2] data.DumpHits(5); > dump.hits
87root [3] data.DumpDigits(5); > dump.digits
88root [4] data.DumpSDigits(5); > dump.sdigits
89root [5] data.DumpRecPoints(5); > dump.recpoints
90root [6] data.DumpRecTrigger(5); > dump.rectrigger
88cb7938 91
cd4f4ea4 92If the event number in the function argument is not specified,
93data are dumped for all events.
2b32c661 94
88cb7938 95
6570c14d 96============================================================
97 How to check the Geometry with the new Geometrical modeler
98 ftp://root.cern.ch/root/doc/chapter16.pdf
99 http://agenda.cern.ch/fullAgenda.php?ida=a05212
100============================================================
101gAlice->Init("$ALICE_ROOT/MUON/Config.C");
102gGeoManager->GetMasterVolume()->Draw();
103
02d8f072 104
b3ba6823 105============================================================
106 How to check the overlap with the new Geometrical modeler
107 ftp://root.cern.ch/root/doc/chapter16.pdf
108 http://agenda.cern.ch/fullAgenda.php?ida=a05212
109============================================================
110gAlice->Init("$ALICE_ROOT/MUON/Config.C");
111gGeoManager->CheckOverlaps();
112gGeoManager->PrintOverlaps();
113
7985603c 114============================================================
115 How to run MUONdisplay
116============================================================
1eccde20 117First you need to perform a full simulation:
7985603c 118generation, digitalisation and clusterisation
cd0f8cc8 119To run MUONdisplay with Root 5.04/00 you need to get a fix in
120the gpad/src/TPad.cxx from Root CVS:
121 cvs update -r 1.200 gpad/src/TPad.cxx
122and recompile root.
123
7985603c 124.L $ALICE_ROOT/MUON/MUONdisplay.C
125MUONdisplay(0,"galice.root")
126
02d8f072 127============================================================
128 Tracking parameters, cuts, energy loss and physics processes
129============================================================
130Tracking parameters in MUON are automatically defined by GEANT
131MUON takes the default values of CUTs and physics processes
132defined by the Config files, except for the gas mixture medium
133of the tracking chambers. The CUT's and physics processes of
134the gas mixture medium is then defined in the galice.cuts file
135in the data directory. In particular ILOSS parameter MUST be
136equal unity (1) in order simulate a realistic energy loss
137distribution (mean value and fluctuations) in the active gas.
a88eb0d0 138
139============================================================
140 Tracking of particle in the magnetic field
141============================================================
142GEANT has two ways for tracking charged particles in the
143magnetic field: HELIX et RKUTA.
144HELIX is faster and works well if the gradient of magnetic
145field is small.
146For MUON, HELIX is a not a good approximation and we must
147use RKUTA to get the optimal mass resolution of the
148spectrometer. The choice of HELIX or RKUTA is done in the
149config file when the magnetic field is defined:
b97b210c 150 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", TRACKING, FACTOR, MAXB, AliMagFMaps::k5kG);
a88eb0d0 151 gAlice->SetField(field);
152TRACKING must be 1 for RKUTA and 2 for HELIX (the default value for aliroot is 2 (HELIX))
153FACTOR allows you to set the magnetic field to 0, just putting FACTOR=0. Default value is 1.
154MAXB is the maximum magnetic field which is 10.T
2b32c661 155
f4f795ed 156===========================================================
157 MUON cocktail for physics ..............
158===========================================================
159There is a MUON cocktail generator of the muon sources in the
160EVGEN directory. This class derives from AliGenCocktail.
161In the init of this class I have filled the cocktail with
162the muon sources: J/Psi, Upsilon, Open Charm, Open Beauty,
163Pion, Kaons. The code needs only the production cross section
164at 4pi (for the moment this values are in the code since I
165prefere them do not be modified), and the code calculates the
166rate of particles in the acceptance, making the scaling based
167on the number of collisions for the hard probes and on the
168number of participants for soft sources: Pions and Kaons.
169
170In the Genereate of this class all entries in the cocktail
171are called and we define a "primordial trigger" with requires
172a minimum number of muons above a Pt cut in the required acceptance.
173In order to normalized to the real number of simulated events,
174there are 2 data members in the class fNsuceeded adn fNGenerate
175which tell us what is the biais source.
176
177Enclose an example to use this generator:
178AliGenMUONCocktail * gener = new AliGenMUONCocktail();
179gener->SetPtRange(1.,100.); // Transverse momentum range
180gener->SetPhiRange(0.,360.); // Azimuthal angle range
181gener->SetYRange(-4.0,-2.4);
182gener->SetMuonPtCut(1.);
183gener->SetMuonThetaCut(171.,178.);
184gener->SetMuonMultiplicity(2);
35e21dec 185gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
f4f795ed 186gener->SetVertexSmear(kPerTrack);
187gener->SetOrigin(0,0,0); // Vertex position
188gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
189gener->Init();
190
a2da7817 191================================================================
69be760c 192 csh Script for the full reconstruction with raw data generator
a2da7817 193================================================================
194The rawdata generation and analysis is working with the new segmentation.
195So the config file must use the version "AliMUONFactoryV3"
196
197Generation
198The method AliSimulation::SetWriteRawData("MUON") enables on
199the muon rawdata generation
200aliroot -b << EOF
201AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
10c8d1ce 202MuonSim.SetMakeTrigger("MUON");
a2da7817 203MuonSim.SetWriteRawData("MUON")
204MuonSim.Run(10)
205.q
206EOF
207
208Reconstruction
209aliroot -b << EOF
210AliReconstruction MuonRec("galice.root");
211MuonRec.SetInput("$YOUR_WORKING_DIRECTORY/"); Do not forget the slash at the end!
212MuonRec.SetRunVertexFinder(kFALSE);
213MuonRec.SetRunLocalReconstruction("MUON");
214MuonRec.SetRunTracking("");
215MuonRec.SetFillESD("MUON");
8e0ae46c 216MuonRec.SetOption("MUON", "VS"); // to use VS cluster finder
217// MuonRec.SetOption("MUON", "VS Original"); // to run VS and original track finder
218// MuonRec.SetOption("MUON", "Combi"); // to run combined cluster / track finder
219MMuonRec.Run();
a2da7817 220.q
221EOF
222
a7641a57 223============================================================
224 How to read & decode raw data
225============================================================
226These macros can read & decode DDL files, root and DATE files.
227Nevertheless for the two latter, aliroot has to be compiled with DATE.
228
229For tracker raw data
230.includepath $ALICE_ROOT/STEER
231.includepath $ALICE_ROOT/MUON
232.includepath $ALICE_ROOT/RAW
233.L $ALICE_ROOT/MUON/MUONRawStreamTracker.C+
234MUONRawStreamTracker(maxEvent, firstDDL, lastDDL, rawFileName)
235
236For trigger raw data
237.includepath $ALICE_ROOT/STEER
238.includepath $ALICE_ROOT/MUON
239.includepath $ALICE_ROOT/RAW
240.L $ALICE_ROOT/MUON/MUONRawStreamTrigger.C+
241MUONRawStreamTrigger(maxEvent, firstDDL, lastDDL, rawFileName)
242
243Default wise the macro read all DDL files from the current directory for 1000 events.
244For root file rawFileName must end with .root, for date file rawFileName
245must be no extention. For DDL files you have to specified the directory
246where the raw0...n subdirectories are located:
247MUONRawStreamTracker(maxEvent, "$YOUR_WORKING_DIRECTORY/"); //Do not forget the slash at the end!
a88eb0d0 248
b8dc484b 249
250============================================================
251 How to run MUONRecoCheck macro
252============================================================
253To check the muon reconstruction by comparing the reconstructed tracks
254with the reference tracks made of "AliTrackReference" for the hits and
255kinematic informations (TParticle) for the vertex.
256This macro can be used to check the track reconstruction e.g. efficiency,
257momentum resolution ... but also to make physics analysis whenever
258track identification is needed.
259
260To compile MUONRecoCheck.C
261.includepath $ALICE_ROOT/STEER
262.includepath $ALICE_ROOT/MUON
263.L $ALICE_ROOT/MUON/MUONRecoCheck.C+
264
265// To run MUONRecoCheck
266MUONRecoCheck(nEvent,"galice.root"); // nEvent = nb of events
267
29fc2c86 268
269============================================================
270 How to run MUONTracker macro
271============================================================
272To make the track reconstruction directly from AliTrackReference hits
273which are recorded in TrackRefs.root during the simulation.
274It can be used to check the reconstruction without clusterization.
275
276To compile MUONTracker.C
277.includepath $ALICE_ROOT/STEER
278.includepath $ALICE_ROOT/MUON
279.L $ALICE_ROOT/MUON/MUONTracker.C+
280
281// To run MUONTracker
282MUONTracker(iEventMin,iEventMax,"galice.root"); // iEventMin: first event
fc1fafa5 283
284===========================================================
285 Macro MUONGenerateGeometryData.C
286===========================================================
287
d228b279 288Macro for generating the geometry data files
289and mis-alignment data.
290
291Geometry data files:
292- MUON/data/volpath.dat file contains the volume paths
293for all alignable objects (modules & detection
294elements).
295- MUON/data/transform.dat file contains the transformations
296data (translation and rotation) for all alignable objects
297(modules & detection elements)
65087afe 298- MUON/data/svmap.dat file contains all the information to link
fc1fafa5 299each geant volume (it can be extended to other virtual MC) with
300a detection element. The point here is that a given detection
d228b279 301element, i.e. a slat chamber can consist of more geant volumes.
fc1fafa5 302the correspondence is then defined in an input file.
65087afe 303Each time there is a change in the definition of MC geometry, these
fc1fafa5 304input files must be re-generated via the macro
305MUONGenerateGeometryData.C
306
307To be run from aliroot:
308.x MUONGenerateGeometryData.C
309
310The generated files do not replace the existing ones
311but have different names (with extension ".out").
65087afe 312Replacement with new files has to be done manually.
29fc2c86 313
d228b279 314If the appropiate flags are set (zeroAlign, resMisAlign and/or fullMisAlign)
315zero, residual and/or full misalignment data are generated in a
316local CDB folder (defaults are ResMisAlignCDB and FullMisAlignCDB
317in the working directory). Inside the local CDB the path for the
318alignment data is (and must be) "MUON/Align/Data/".
319Residual misalignment: Default is our current estimate of
320misalignment after all our alignment procedure has been applied.
321Full misalignment: Default is our current estimate of initial
322misalignment.
323
324==========================================================
325How to simulate events with misaligned geometry in local CDB
326==========================================================
327
328If you want to use a misaligned geometry to simulate some
329events you can use a local CDB. For this need to follow
330the next steps:
331
332- Generate misaligned data in local CDB.
333You can use MUONGenerateGeometryData.C as described above in
334the corresponding section. Let's assume you used the default
335residual misalignment settings, then you have a local CDB in
336your working directory called ResMisAlignCDB containing
337misalignement data (ResMisAlignCDB/MUON/Align).
338
339- Copy the calibration data in your local CDB.
340cp -r $ALICE_ROOT/MUON/Calib ResMisAlignCDB/MUON
341
342- Tell AliSimulation you want to use your local CDB for MUON
343To do this you need to instantiate the AliCDBManager, set the
344default storage and set the specific storage for MUON, before
345instantiating AliSimulation (see for example the commented
346lines AlirootRun_MUONtest.sh).
347
348aliroot -b >& testSim.out << EOF
349AliCDBManager* man = AliCDBManager::Instance();
350man->SetDefaultStorage("local://$ALICE_ROOT");
351man->SetSpecificStorage("MUON","local://ResMisAlignCDB");
352AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C");
353MuonSim.SetWriteRawData("MUON");
354MuonSim.Run(10);
355.q
356EOF
29fc2c86 357
86cd713c 358==========================================================
359How to check the alignment software
360==========================================================
361
362The script AlirootRun_MUONtestAlign.sh allows you to check the software for
363the alignment with physics tracks. The script will:
364- Generate a misaligned geometry in a local CDB (default FullMisAlignCDB)
365- Simulate 1000 events using previously misaligned geometry
366- Reconstruct the events using perfect geometry
367- Run the alignment code over the above events using MUONAlignment.C
368
369To run you need to type:
370$ALICE_ROOT/MUON/AlirootRun_MUONtestAlign.sh
371
372The results of the test are saved in test_align/ directory. The file measShifts.root
373contains useful graphs for studying the alignment performances. A local CDB
374containing the realigned geometry is also created (default is ReAlignCDB). The
375file $ALICE_ROOT/MUON/data/transform2ReAlign.dat contains the
376transformations describing the realigned geometry to be compared with the
377used misaligned geometry $ALICE_ROOT/MUON/data/transform2.dat.
378
379IMPORTANT NOTE: For a useful test of the alignment performances, the
380order of 100 000 tracks is needed, it is then advisable to generate and
381reconstruct enough events separately and run MUONAlignment.C providing a file list
382afterwards.
383
cd85a354 384==========================================================
385 How to Merge events
386==========================================================
387
388You can merge 2 types of simulated events. For example,
389you can simulate Hijing events, and then simulate muons
390merging both.
391
392Merging is done at the sdigits level, so Kinematics files
393of the merged events will just correspond to the
394Config.C simulated file (not to Config_HIJING.C).
395
396You must, first, do the Hijing simulation and store it
397in directory $HIJING_SIM. Note that for merging you
398won't need Kinematics files of the Hijing simulation...
399
400Hijing simulation
401
402aliroot -b << EOF
403AliSimulation HijingSim("$HIJING_SIM/Config_HIJING.C")
404HijingSim.Run(5)
405.q
406EOF
407
408
409Then you can do muon simulation and reconstruction
410merging both simulated events. In next example, we are
411merging 20 times each Hijing event in order to simulate
412100 muons merged with 5 Hijing events.
413
414
415aliroot -b << EOF
416AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
417MuonSim.MergeWith("$HIJING_SIM/galice.root",20) //parameters are the Hijing simulation file and the number of times we use each Hijing event
418MuonSim.Run(100) // number of muon (Config.C) events
419.q
420EOF
421
422
423aliroot -b << EOF
424TPluginManager * pluginmanager = gROOT->GetPluginManager()
425pluginmanager->AddHandler("AliReconstructor","MUON","AliMUONReconstructor","MUON","AliMUONReconstructor()")
426AliReconstruction MuonRec("galice.root")
427MuonRec.SetRunTracking("")
428MuonRec.SetRunVertexFinder(kFALSE)
429MuonRec.SetRunLocalReconstruction("MUON")
430MuonRec.SetFillESD("MUON")
431MuonRec.Run()
432.q
433EOF
434
60fff730 435==========================================================
436 How to play with the CDB
437==========================================================
438
439If you'd like to see how the CDB is created, please have a look at the
440MUONCDB.C (work in progress, though).
441
d228b279 442==========================================================
443...on track numbering
444==========================================================
445
446All generated particles, including primary and secondary
447particles are put on the stack. The secondary particles are kept
448in the stack only if they gave a hit in *any* of the ALICE detectors
449The number of all particles placed on the stack for a given event
450can be obtained with
451Int_t nPart = AliStack::GetNtrack();
452Looping from 0 to nPart via AliStack::Particle(ipart)
453gives the particle listing as obtained from the particle generator (primaries)
454and Monte Carlo (secondaries).
455
456The particle response in the detector, a hit, is registered
457in the hits tree and the hits are filled with each primary track.
458The total number of "tracks" (fills of the tree) can be obtained
459with ntracks = AliMUONData::GetNtracks() and is usually smaller than "nPart".
460Since particles can also deposit hits in other detectors than
461the MUON spectrometer, there will be many "tracks" (fills) in the hit-tree
462without a hit in MUON.
463
464The correspondence between "track ID" in the hits-tree ("itr") and the
465particle ID for particles on the stack (i.e. generated particles) can be
466obtained via:
467for (Int_t itr = 0; itr < ntracks; itr++) {
468 MUONData->GetTrack(itr); //track "itr" of the hits-tree
469 Int_t nhitstot = MUONData->Hits()->GetEntriesFast();
470 AliMUONHit* mHit;
471 for (Int_t ihit=0; ihit<nhitstot; ihit++) {
472 mHit = static_cast<AliMUONHit*>(MUONData->Hits()->At(ihit));
473 Int_t id = muonHit->Track(); //gives particle ID on stack
474 TParticle* particle = gAlice->Stack()->Particle(id);
475 }
476}
477
478During the procedure to go from hits to digits, the hits
479are summed up such that more than one track can contribute
480to a given digit. As a consequence the method
481Int_t AliMUONDigit::Track(Int_t trackID)
482takes an argument, where "trackID" runs from 0 to
483AliMUONDigit::Ntracks() to provide the reference to *all*
484tracks that contributed to it. The returned track ID is the one
485referred to in the hit-tree. To know which is the generated particle
486that deposited a given digit one has to follow the sequence of the kind:
487
488
489mDigit = static_cast<AliMUONDigit*>(digits->At(idigit));
490for (int tr = 0; tr < mDigit->Ntracks(); tr++){
491 Int_t hitTrackID = mDigit->Track(tr);
492 MUONData->GetTrack(hitTrackID);
493 mHit = static_cast<AliMUONHit*>(MUONData->Hits()->At(0));
494 //just take first hit of given track
495 Int_t numPart = mHit->Track(); //gives ID of particle on the stack
496 Int_t idTrack = mHit->Particle(); //gives flavour code of the particle
497}
498In this example, for simplicity, only the first hit of a
499hit-track is used to check the particle ID.
500
5be7de69 501==========================================================
502Macro to process PDC06 preproduction
503==========================================================
504
505To read a generation/reconstrution from PDC06 preproduction, and write a file
506with a tree of AliMUONTrackLight / AliMUONPairLight :
507go to the directory containing the generation/reconstruction. From there run
508aliroot
509.x DecodeRecoCocktail.C+
510.q
511
512To read the file previously generated:
513aliroot
514.x ReadRecoCocktail.C+
515.q
516
88cb7938 517===========================================================
518 Still working ..............
519===========================================================