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