]>
Commit | Line | Data |
---|---|---|
c3201ac4 | 1 | $Id$ |
50837721 | 2 | |
88cb7938 | 3 | ========================================================== |
4 | Please add to this README file all information concerning | |
5 | config files, simulation, digitalization, clusterization, | |
6 | reconstruction and macro analysis | |
7 | ||
6b1e4b22 | 8 | ========================================================== |
9 | How to check that your aliroot is working well | |
10 | ========================================================== | |
8c4c70f6 | 11 | There is a script file AlirootRun_MUONtest.sh which |
6b1e4b22 | 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 | |
15 | directory. | |
8c4c70f6 | 16 | You have to type : |
17 | source $ALICE_ROOT/MUON/AlirootRun_MUONtest.sh | |
c57f3c5b | 18 | The results of this test are saved in test_out/ directory. |
60fff730 | 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 | |
22 | subdirectories. | |
6b1e4b22 | 23 | |
7f42a16f | 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 | |
33 | directory. | |
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 !! | |
37 | ||
38 | You have to type : | |
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 | |
42 | ||
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 ) | |
46 | ||
88cb7938 | 47 | ========================================================== |
7985603c | 48 | How to run a MUON generation |
88cb7938 | 49 | ========================================================== |
50 | aliroot | |
fc1fafa5 | 51 | root [0] gAlice->Run(10,"$ALICE_ROOT/MUON/Config.C"); |
88cb7938 | 52 | |
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 | |
56 | execution directory. | |
88cb7938 | 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\" );"); | |
60 | ||
88cb7938 | 61 | ============================================================ |
cd4f4ea4 | 62 | How to dump the content of Root data files |
88cb7938 | 63 | ============================================================ |
c58ae721 | 64 | To check the content of Root data files, the AliMUON*DataInterface classes |
cd4f4ea4 | 65 | provides the functions to produce an ASCII output on the screen |
66 | which can be redirected on the file: | |
88cb7938 | 67 | |
c58ae721 | 68 | for MC information, use AliMUONMCDataInterface : |
69 | ||
70 | > aliroot (or root with just the loading of MUON libs, see loadlibs.C) | |
71 | root [0] AliMUONMCDataInterface mcdi("galice.root"); | |
72 | root [1] mcdi.DumpKine(5); > dump.kine | |
73 | root [2] mcdi.DumpHits(5); > dump.hits | |
74 | root [3] mcdi.DumpTrackRefs(5); > dump.trackrefs | |
88cb7938 | 75 | |
c58ae721 | 76 | for all other information, use AliMUONDataInterface : |
2b32c661 | 77 | |
c58ae721 | 78 | > aliroot |
79 | root [0] AliMUONDataInterface di("galice.root"); | |
80 | root [1] di.DumpDigits(5); > dump.digits | |
81 | root [2] di.DumpSDigits(5); > dump.sdigits | |
82 | root [3] di.DumpRecPoints(5); > dump.recpoints | |
83 | root [4] di.DumpTrigger(5); > dump.rectrigger | |
88cb7938 | 84 | |
6570c14d | 85 | ============================================================ |
86 | How to check the Geometry with the new Geometrical modeler | |
87 | ftp://root.cern.ch/root/doc/chapter16.pdf | |
88 | http://agenda.cern.ch/fullAgenda.php?ida=a05212 | |
89 | ============================================================ | |
90 | gAlice->Init("$ALICE_ROOT/MUON/Config.C"); | |
91 | gGeoManager->GetMasterVolume()->Draw(); | |
92 | ||
02d8f072 | 93 | |
b3ba6823 | 94 | ============================================================ |
95 | How to check the overlap with the new Geometrical modeler | |
96 | ftp://root.cern.ch/root/doc/chapter16.pdf | |
97 | http://agenda.cern.ch/fullAgenda.php?ida=a05212 | |
98 | ============================================================ | |
99 | gAlice->Init("$ALICE_ROOT/MUON/Config.C"); | |
100 | gGeoManager->CheckOverlaps(); | |
101 | gGeoManager->PrintOverlaps(); | |
102 | ||
7985603c | 103 | ============================================================ |
104 | How to run MUONdisplay | |
105 | ============================================================ | |
1eccde20 | 106 | First you need to perform a full simulation: |
7985603c | 107 | generation, digitalisation and clusterisation |
cd0f8cc8 | 108 | To run MUONdisplay with Root 5.04/00 you need to get a fix in |
109 | the gpad/src/TPad.cxx from Root CVS: | |
110 | cvs update -r 1.200 gpad/src/TPad.cxx | |
111 | and recompile root. | |
112 | ||
7985603c | 113 | .L $ALICE_ROOT/MUON/MUONdisplay.C |
114 | MUONdisplay(0,"galice.root") | |
115 | ||
02d8f072 | 116 | ============================================================ |
117 | Tracking parameters, cuts, energy loss and physics processes | |
118 | ============================================================ | |
119 | Tracking parameters in MUON are automatically defined by GEANT | |
120 | MUON takes the default values of CUTs and physics processes | |
121 | defined by the Config files, except for the gas mixture medium | |
122 | of the tracking chambers. The CUT's and physics processes of | |
123 | the gas mixture medium is then defined in the galice.cuts file | |
124 | in the data directory. In particular ILOSS parameter MUST be | |
125 | equal unity (1) in order simulate a realistic energy loss | |
126 | distribution (mean value and fluctuations) in the active gas. | |
a88eb0d0 | 127 | |
128 | ============================================================ | |
129 | Tracking of particle in the magnetic field | |
130 | ============================================================ | |
131 | GEANT has two ways for tracking charged particles in the | |
132 | magnetic field: HELIX et RKUTA. | |
133 | HELIX is faster and works well if the gradient of magnetic | |
134 | field is small. | |
135 | For MUON, HELIX is a not a good approximation and we must | |
136 | use RKUTA to get the optimal mass resolution of the | |
137 | spectrometer. The choice of HELIX or RKUTA is done in the | |
138 | config file when the magnetic field is defined: | |
b97b210c | 139 | AliMagFMaps* field = new AliMagFMaps("Maps","Maps", TRACKING, FACTOR, MAXB, AliMagFMaps::k5kG); |
a88eb0d0 | 140 | gAlice->SetField(field); |
141 | TRACKING must be 1 for RKUTA and 2 for HELIX (the default value for aliroot is 2 (HELIX)) | |
142 | FACTOR allows you to set the magnetic field to 0, just putting FACTOR=0. Default value is 1. | |
143 | MAXB is the maximum magnetic field which is 10.T | |
2b32c661 | 144 | |
f4f795ed | 145 | =========================================================== |
146 | MUON cocktail for physics .............. | |
147 | =========================================================== | |
148 | There is a MUON cocktail generator of the muon sources in the | |
149 | EVGEN directory. This class derives from AliGenCocktail. | |
150 | In the init of this class I have filled the cocktail with | |
151 | the muon sources: J/Psi, Upsilon, Open Charm, Open Beauty, | |
152 | Pion, Kaons. The code needs only the production cross section | |
153 | at 4pi (for the moment this values are in the code since I | |
154 | prefere them do not be modified), and the code calculates the | |
155 | rate of particles in the acceptance, making the scaling based | |
156 | on the number of collisions for the hard probes and on the | |
157 | number of participants for soft sources: Pions and Kaons. | |
158 | ||
159 | In the Genereate of this class all entries in the cocktail | |
160 | are called and we define a "primordial trigger" with requires | |
161 | a minimum number of muons above a Pt cut in the required acceptance. | |
162 | In order to normalized to the real number of simulated events, | |
163 | there are 2 data members in the class fNsuceeded adn fNGenerate | |
164 | which tell us what is the biais source. | |
165 | ||
166 | Enclose an example to use this generator: | |
167 | AliGenMUONCocktail * gener = new AliGenMUONCocktail(); | |
168 | gener->SetPtRange(1.,100.); // Transverse momentum range | |
169 | gener->SetPhiRange(0.,360.); // Azimuthal angle range | |
170 | gener->SetYRange(-4.0,-2.4); | |
171 | gener->SetMuonPtCut(1.); | |
172 | gener->SetMuonThetaCut(171.,178.); | |
173 | gener->SetMuonMultiplicity(2); | |
35e21dec | 174 | gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions |
f4f795ed | 175 | gener->SetVertexSmear(kPerTrack); |
176 | gener->SetOrigin(0,0,0); // Vertex position | |
177 | gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position | |
178 | gener->Init(); | |
179 | ||
a2da7817 | 180 | ================================================================ |
69be760c | 181 | csh Script for the full reconstruction with raw data generator |
a2da7817 | 182 | ================================================================ |
183 | The rawdata generation and analysis is working with the new segmentation. | |
184 | So the config file must use the version "AliMUONFactoryV3" | |
185 | ||
186 | Generation | |
187 | The method AliSimulation::SetWriteRawData("MUON") enables on | |
188 | the muon rawdata generation | |
189 | aliroot -b << EOF | |
190 | AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C") | |
10c8d1ce | 191 | MuonSim.SetMakeTrigger("MUON"); |
a2da7817 | 192 | MuonSim.SetWriteRawData("MUON") |
193 | MuonSim.Run(10) | |
194 | .q | |
195 | EOF | |
196 | ||
197 | Reconstruction | |
198 | aliroot -b << EOF | |
199 | AliReconstruction MuonRec("galice.root"); | |
200 | MuonRec.SetInput("$YOUR_WORKING_DIRECTORY/"); Do not forget the slash at the end! | |
201 | MuonRec.SetRunVertexFinder(kFALSE); | |
202 | MuonRec.SetRunLocalReconstruction("MUON"); | |
203 | MuonRec.SetRunTracking(""); | |
204 | MuonRec.SetFillESD("MUON"); | |
8e0ae46c | 205 | MuonRec.SetOption("MUON", "VS"); // to use VS cluster finder |
206 | // MuonRec.SetOption("MUON", "VS Original"); // to run VS and original track finder | |
207 | // MuonRec.SetOption("MUON", "Combi"); // to run combined cluster / track finder | |
208 | MMuonRec.Run(); | |
a2da7817 | 209 | .q |
210 | EOF | |
211 | ||
a7641a57 | 212 | ============================================================ |
213 | How to read & decode raw data | |
214 | ============================================================ | |
215 | These macros can read & decode DDL files, root and DATE files. | |
216 | Nevertheless for the two latter, aliroot has to be compiled with DATE. | |
217 | ||
218 | For tracker raw data | |
219 | .includepath $ALICE_ROOT/STEER | |
220 | .includepath $ALICE_ROOT/MUON | |
221 | .includepath $ALICE_ROOT/RAW | |
222 | .L $ALICE_ROOT/MUON/MUONRawStreamTracker.C+ | |
223 | MUONRawStreamTracker(maxEvent, firstDDL, lastDDL, rawFileName) | |
224 | ||
225 | For trigger raw data | |
226 | .includepath $ALICE_ROOT/STEER | |
227 | .includepath $ALICE_ROOT/MUON | |
228 | .includepath $ALICE_ROOT/RAW | |
229 | .L $ALICE_ROOT/MUON/MUONRawStreamTrigger.C+ | |
230 | MUONRawStreamTrigger(maxEvent, firstDDL, lastDDL, rawFileName) | |
231 | ||
232 | Default wise the macro read all DDL files from the current directory for 1000 events. | |
233 | For root file rawFileName must end with .root, for date file rawFileName | |
234 | must be no extention. For DDL files you have to specified the directory | |
235 | where the raw0...n subdirectories are located: | |
236 | MUONRawStreamTracker(maxEvent, "$YOUR_WORKING_DIRECTORY/"); //Do not forget the slash at the end! | |
a88eb0d0 | 237 | |
b8dc484b | 238 | |
239 | ============================================================ | |
240 | How to run MUONRecoCheck macro | |
241 | ============================================================ | |
62548066 | 242 | |
b8dc484b | 243 | To check the muon reconstruction by comparing the reconstructed tracks |
62548066 | 244 | with the reference tracks made of "AliTrackReference" for the hits in chamber (0..9) |
245 | and kinematic informations (TreeK) for the vertex. | |
b8dc484b | 246 | This macro can be used to check the track reconstruction e.g. efficiency, |
247 | momentum resolution ... but also to make physics analysis whenever | |
248 | track identification is needed. | |
249 | ||
250 | To compile MUONRecoCheck.C | |
251 | .includepath $ALICE_ROOT/STEER | |
252 | .includepath $ALICE_ROOT/MUON | |
253 | .L $ALICE_ROOT/MUON/MUONRecoCheck.C+ | |
254 | ||
255 | // To run MUONRecoCheck | |
61093423 | 256 | MUONRecoCheck(nEvent,"geometry.root", "galice.root"); // nEvent = nb of events |
b8dc484b | 257 | |
29fc2c86 | 258 | |
259 | ============================================================ | |
260 | How to run MUONTracker macro | |
261 | ============================================================ | |
262 | To make the track reconstruction directly from AliTrackReference hits | |
263 | which are recorded in TrackRefs.root during the simulation. | |
264 | It can be used to check the reconstruction without clusterization. | |
265 | ||
266 | To compile MUONTracker.C | |
267 | .includepath $ALICE_ROOT/STEER | |
268 | .includepath $ALICE_ROOT/MUON | |
269 | .L $ALICE_ROOT/MUON/MUONTracker.C+ | |
270 | ||
271 | // To run MUONTracker | |
272 | MUONTracker(iEventMin,iEventMax,"galice.root"); // iEventMin: first event | |
fc1fafa5 | 273 | |
274 | =========================================================== | |
275 | Macro MUONGenerateGeometryData.C | |
276 | =========================================================== | |
277 | ||
d228b279 | 278 | Macro for generating the geometry data files |
d228b279 | 279 | |
280 | Geometry data files: | |
281 | - MUON/data/volpath.dat file contains the volume paths | |
282 | for all alignable objects (modules & detection | |
283 | elements). | |
284 | - MUON/data/transform.dat file contains the transformations | |
285 | data (translation and rotation) for all alignable objects | |
286 | (modules & detection elements) | |
65087afe | 287 | - MUON/data/svmap.dat file contains all the information to link |
fc1fafa5 | 288 | each geant volume (it can be extended to other virtual MC) with |
289 | a detection element. The point here is that a given detection | |
d228b279 | 290 | element, i.e. a slat chamber can consist of more geant volumes. |
fc1fafa5 | 291 | the correspondence is then defined in an input file. |
65087afe | 292 | Each time there is a change in the definition of MC geometry, these |
fc1fafa5 | 293 | input files must be re-generated via the macro |
294 | MUONGenerateGeometryData.C | |
295 | ||
296 | To be run from aliroot: | |
297 | .x MUONGenerateGeometryData.C | |
298 | ||
299 | The generated files do not replace the existing ones | |
300 | but have different names (with extension ".out"). | |
65087afe | 301 | Replacement with new files has to be done manually. |
29fc2c86 | 302 | |
61093423 | 303 | =========================================================== |
304 | Macros to generate Mis-alignment data | |
305 | =========================================================== | |
306 | ||
307 | Macro for generating the geometry mis-alignment data: | |
308 | MakeMUONFullMisAlignment.C | |
309 | MakeMUONResMisAlignment.C | |
310 | MakeMUONZeroMisAlignment.C | |
311 | ||
312 | To be run from aliroot: | |
313 | .x MakeMUONFullMisAlignment.C etc. | |
314 | ||
315 | If the environment variable TOCDB is not set to "kTRUE", | |
316 | the misalignment data are generated in a local file: | |
317 | (MUONFullMisalignment.root, etc.) | |
318 | ||
319 | If the data are stored in CDB, the storage can be specified in | |
320 | the environment variable STORAGE. The misalignment data are then | |
321 | generated in the CDB folder (defaults are ResMisAlignCDB and FullMisAlignCDB | |
d228b279 | 322 | in the working directory). Inside the local CDB the path for the |
323 | alignment data is (and must be) "MUON/Align/Data/". | |
324 | Residual misalignment: Default is our current estimate of | |
325 | misalignment after all our alignment procedure has been applied. | |
326 | Full misalignment: Default is our current estimate of initial | |
327 | misalignment. | |
328 | ||
329 | ========================================================== | |
330 | How to simulate events with misaligned geometry in local CDB | |
331 | ========================================================== | |
332 | ||
333 | If you want to use a misaligned geometry to simulate some | |
334 | events you can use a local CDB. For this need to follow | |
335 | the next steps: | |
336 | ||
337 | - Generate misaligned data in local CDB. | |
338 | You can use MUONGenerateGeometryData.C as described above in | |
339 | the corresponding section. Let's assume you used the default | |
340 | residual misalignment settings, then you have a local CDB in | |
341 | your working directory called ResMisAlignCDB containing | |
342 | misalignement data (ResMisAlignCDB/MUON/Align). | |
343 | ||
0d24599f | 344 | - Tell AliSimulation you want to use your local CDB for |
345 | MUON/Align/Data | |
d228b279 | 346 | To do this you need to instantiate the AliCDBManager, set the |
0d24599f | 347 | default storage and set the specific storage for MUON/Align/Data, |
348 | before instantiating AliSimulation (see for example the commented | |
d228b279 | 349 | lines AlirootRun_MUONtest.sh). |
350 | ||
351 | aliroot -b >& testSim.out << EOF | |
352 | AliCDBManager* man = AliCDBManager::Instance(); | |
353 | man->SetDefaultStorage("local://$ALICE_ROOT"); | |
0d24599f | 354 | man->SetSpecificStorage("MUON/align/Data","local://ResMisAlignCDB"); |
d228b279 | 355 | AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C"); |
356 | MuonSim.SetWriteRawData("MUON"); | |
357 | MuonSim.Run(10); | |
358 | .q | |
359 | EOF | |
29fc2c86 | 360 | |
86cd713c | 361 | ========================================================== |
362 | How to check the alignment software | |
363 | ========================================================== | |
364 | ||
365 | The script AlirootRun_MUONtestAlign.sh allows you to check the software for | |
366 | the alignment with physics tracks. The script will: | |
367 | - Generate a misaligned geometry in a local CDB (default FullMisAlignCDB) | |
368 | - Simulate 1000 events using previously misaligned geometry | |
369 | - Reconstruct the events using perfect geometry | |
370 | - Run the alignment code over the above events using MUONAlignment.C | |
371 | ||
372 | To run you need to type: | |
373 | $ALICE_ROOT/MUON/AlirootRun_MUONtestAlign.sh | |
374 | ||
375 | The results of the test are saved in test_align/ directory. The file measShifts.root | |
376 | contains useful graphs for studying the alignment performances. A local CDB | |
377 | containing the realigned geometry is also created (default is ReAlignCDB). The | |
378 | file $ALICE_ROOT/MUON/data/transform2ReAlign.dat contains the | |
379 | transformations describing the realigned geometry to be compared with the | |
380 | used misaligned geometry $ALICE_ROOT/MUON/data/transform2.dat. | |
381 | ||
382 | IMPORTANT NOTE: For a useful test of the alignment performances, the | |
383 | order of 100 000 tracks is needed, it is then advisable to generate and | |
384 | reconstruct enough events separately and run MUONAlignment.C providing a file list | |
385 | afterwards. | |
386 | ||
cd85a354 | 387 | ========================================================== |
388 | How to Merge events | |
389 | ========================================================== | |
390 | ||
391 | You can merge 2 types of simulated events. For example, | |
392 | you can simulate Hijing events, and then simulate muons | |
393 | merging both. | |
394 | ||
395 | Merging is done at the sdigits level, so Kinematics files | |
396 | of the merged events will just correspond to the | |
397 | Config.C simulated file (not to Config_HIJING.C). | |
398 | ||
399 | You must, first, do the Hijing simulation and store it | |
400 | in directory $HIJING_SIM. Note that for merging you | |
401 | won't need Kinematics files of the Hijing simulation... | |
402 | ||
403 | Hijing simulation | |
404 | ||
405 | aliroot -b << EOF | |
406 | AliSimulation HijingSim("$HIJING_SIM/Config_HIJING.C") | |
407 | HijingSim.Run(5) | |
408 | .q | |
409 | EOF | |
410 | ||
411 | ||
412 | Then you can do muon simulation and reconstruction | |
413 | merging both simulated events. In next example, we are | |
414 | merging 20 times each Hijing event in order to simulate | |
415 | 100 muons merged with 5 Hijing events. | |
416 | ||
417 | ||
418 | aliroot -b << EOF | |
419 | AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C") | |
420 | MuonSim.MergeWith("$HIJING_SIM/galice.root",20) //parameters are the Hijing simulation file and the number of times we use each Hijing event | |
421 | MuonSim.Run(100) // number of muon (Config.C) events | |
422 | .q | |
423 | EOF | |
424 | ||
425 | ||
426 | aliroot -b << EOF | |
427 | TPluginManager * pluginmanager = gROOT->GetPluginManager() | |
428 | pluginmanager->AddHandler("AliReconstructor","MUON","AliMUONReconstructor","MUON","AliMUONReconstructor()") | |
429 | AliReconstruction MuonRec("galice.root") | |
430 | MuonRec.SetRunTracking("") | |
431 | MuonRec.SetRunVertexFinder(kFALSE) | |
432 | MuonRec.SetRunLocalReconstruction("MUON") | |
433 | MuonRec.SetFillESD("MUON") | |
434 | MuonRec.Run() | |
435 | .q | |
436 | EOF | |
437 | ||
60fff730 | 438 | ========================================================== |
439 | How to play with the CDB | |
440 | ========================================================== | |
441 | ||
442 | If you'd like to see how the CDB is created, please have a look at the | |
443 | MUONCDB.C (work in progress, though). | |
444 | ||
d228b279 | 445 | ========================================================== |
446 | ...on track numbering | |
447 | ========================================================== | |
448 | ||
449 | All generated particles, including primary and secondary | |
450 | particles are put on the stack. The secondary particles are kept | |
451 | in the stack only if they gave a hit in *any* of the ALICE detectors | |
452 | The number of all particles placed on the stack for a given event | |
453 | can be obtained with | |
454 | Int_t nPart = AliStack::GetNtrack(); | |
455 | Looping from 0 to nPart via AliStack::Particle(ipart) | |
456 | gives the particle listing as obtained from the particle generator (primaries) | |
457 | and Monte Carlo (secondaries). | |
458 | ||
459 | The particle response in the detector, a hit, is registered | |
460 | in the hits tree and the hits are filled with each primary track. | |
461 | The total number of "tracks" (fills of the tree) can be obtained | |
c58ae721 | 462 | with ntracks = AliMUONMCDataInterface::NumberOfTracks(event) and is usually smaller than "nPart". |
d228b279 | 463 | Since particles can also deposit hits in other detectors than |
464 | the MUON spectrometer, there will be many "tracks" (fills) in the hit-tree | |
465 | without a hit in MUON. | |
466 | ||
467 | The correspondence between "track ID" in the hits-tree ("itr") and the | |
468 | particle ID for particles on the stack (i.e. generated particles) can be | |
469 | obtained via: | |
470 | for (Int_t itr = 0; itr < ntracks; itr++) { | |
c58ae721 | 471 | AliMUONVHitStore* hitStore = mcDataInterface.HitStore(event,itr); |
472 | //track "itr" of the hits-tree | |
473 | Int_t nhitstot = hitStore->GetSize(); | |
474 | AliMUONHit* mHit; | |
475 | TIter next(hitStore->CreateIterator()); | |
476 | while ( ( mHit = static_cast<AliMUONHit*>(next()) ) ) | |
477 | { | |
478 | Int_t id = mHit->Track(); //gives particle ID on stack | |
479 | TParticle* particle = mcDataInterface.Stack(event)->Particle(id); | |
d228b279 | 480 | } |
481 | } | |
482 | ||
c58ae721 | 483 | where mcDataInterface has been obtained by |
484 | AliMUONMCDataInterface mcDataInterface("galice.root"); | |
485 | ||
d228b279 | 486 | During the procedure to go from hits to digits, the hits |
487 | are summed up such that more than one track can contribute | |
488 | to a given digit. As a consequence the method | |
489 | Int_t AliMUONDigit::Track(Int_t trackID) | |
490 | takes an argument, where "trackID" runs from 0 to | |
491 | AliMUONDigit::Ntracks() to provide the reference to *all* | |
492 | tracks that contributed to it. The returned track ID is the one | |
493 | referred to in the hit-tree. To know which is the generated particle | |
494 | that deposited a given digit one has to follow the sequence of the kind: | |
c58ae721 | 495 | (shown here using the simple, but not fast, DataInterface interfaces) : |
496 | ||
497 | AliMUONMCDataInterface mcdi("galice.root"); | |
498 | AliMUONDataInterface di("galice.root"); | |
d228b279 | 499 | |
c58ae721 | 500 | AliMUONVDigitStore* digitStore = di.DigitStore(event); |
501 | AliMUONVDigit* mDigit = ... get some digit from the digitStore | |
d228b279 | 502 | |
c58ae721 | 503 | for (int tr = 0; tr < mDigit->Ntracks(); tr++) |
504 | { | |
d228b279 | 505 | Int_t hitTrackID = mDigit->Track(tr); |
c58ae721 | 506 | // get the hits corresponding to this trackID |
507 | AliMUONHitStore* hitStore = mcdi.HitStore(event,hitTrackID); | |
508 | // loop over the hits | |
509 | TIter hNext(hitStore->CreateIterator()); | |
510 | AliMUONHit* mHit; | |
511 | while ( ( mHit = static_cast<AliMUONHit*>(hNext()) ) ) | |
512 | { | |
513 | Int_t numPart = mHit->Track(); //gives ID of particle on the stack | |
514 | Int_t idTrack = mHit->Particle(); //gives flavour code of the particle | |
515 | } | |
d228b279 | 516 | } |
d228b279 | 517 | |
5be7de69 | 518 | ========================================================== |
62548066 | 519 | Macros for MC studies |
5be7de69 | 520 | ========================================================== |
521 | ||
62548066 | 522 | For MC studies the classes "AliMUONTrackLight" and "AliMUONPairLight" can be |
523 | used in order to fill not only the single muon / dimuon's kinematics (charge, | |
524 | pT, rapidity, etc) at the generation AND reconstruction level, but also for | |
525 | "decoding" the Pythia output and for the storing of the single muon's history. | |
526 | This allows to tag if two muons of a given event come from a certain, well-defined | |
527 | process, such as J/psi, Upsilons, correlated open charm or open beauty or the | |
528 | low masses or if they are of uncorrelated origin. For open beauty/charm it also | |
529 | tags the creation process (pair creation, flavour excitation or gluon splitting). | |
530 | The classes also allow to tag feed-down or neutral B meson oscillation and | |
531 | has a method that checks whether the reconstructed track is a muon or not. | |
532 | ||
533 | The macros ReadRecoCocktail.C, DecodeRecoCocktail.C and MergeMuonLight.C | |
534 | are examples how to use these two classes. DecodeRecoCocktail.C opens the | |
535 | generated files, loops over the events and fills an AliMUONTrackLight object | |
536 | for every reconstructed track for which the reference to its generated particle | |
537 | could be established, using the AliMUONRecoCheck class. | |
538 | It then takes the AliMUONTrackLight objects and forms - event by event - | |
539 | AliMUONPairLight objects, on a combinatorial basis. For a given event these | |
540 | objects are stored in respective TClonesArrays which are then stored in a tree. | |
541 | By default, the produced output file is called "MuonLight.root". | |
542 | This root file can then be taken by the macro "ReadRecoCocktail.C" that shows, | |
543 | on the example of the reconstructed mass and pT of the AliMUONPairLight object, | |
544 | how to access the available information. For large statistics, in which many | |
545 | individual MuonLight.root files are produced, MergeMuonLight.C can be used | |
546 | to merge the files and produce one common output root file. | |
547 | ||
5be7de69 | 548 | To read a generation/reconstrution from PDC06 preproduction, and write a file |
549 | with a tree of AliMUONTrackLight / AliMUONPairLight : | |
550 | go to the directory containing the generation/reconstruction. From there run | |
551 | aliroot | |
62548066 | 552 | .L DecodeRecoCocktail.C+ |
553 | DecodeRecoCocktail(); | |
5be7de69 | 554 | .q |
555 | ||
556 | To read the file previously generated: | |
557 | aliroot | |
62548066 | 558 | .L ReadRecoCocktail.C+ |
559 | ReadRecoCocktail(); | |
5be7de69 | 560 | .q |
561 | ||
068f96bd | 562 | =========================================================== |
563 | How to reprocess trigger decision from already produced digits | |
564 | =========================================================== | |
565 | The MUONTrigger.C macro can be used to check the trigger algorithm w/o | |
566 | having to (re-)perform simulation and digitalization. | |
567 | It loads the digits, erase TreeR and store the current trigger output in | |
568 | TreeR. | |
569 | The different trigger outputs can be compared by looking at the GLT branch | |
570 | of TreeD (filled during simulation) and the TC branch of TreeR (filled from | |
571 | a copy of TreeD during reconstruction or with this macro). | |
572 | Note: rec points from tracking chamber will be lost. | |
573 | Usage: | |
574 | root [0] .L $ALICE_ROOT/MUON/MUONTrigger.C+ | |
575 | root [1] MUONTrigger() | |
576 | ||
91cec494 | 577 | =========================================================== |
578 | How to check integrated trigger efficiency | |
579 | =========================================================== | |
580 | The MUONTriggerEfficiency.C macro (included in the check scripts) calculates | |
581 | the trigger efficiency for the 2 pt cuts. | |
582 | The output is stored in MUONTriggerEfficiency.out file. | |
583 | Usage: | |
584 | root [0] .L $ALICE_ROOT/MUON/MUONTriggerEfficiency.C+ | |
585 | root [1] MUONTriggerEfficiency() | |
586 | For the CVS default version of the trigger LUT (i.e. lutAptLpt1Hpt1p7.root), | |
587 | The reference for J/psi and Upsilon is as below | |
588 | For 1000 Jpsi events with: | |
589 | AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kJpsi); | |
590 | gener->SetMomentumRange(0,999); | |
591 | gener->SetPtRange(0,100.); | |
592 | gener->SetPhiRange(0., 360.); | |
593 | gener->SetCutOnChild(1); | |
594 | gener->SetChildPhiRange(0.,360.); | |
595 | gener->SetChildThetaRange(171.0,178.0); | |
596 | gener->SetOrigin(0,0,0); | |
597 | gener->SetForceDecay(kDiMuon); | |
598 | gener->SetTrackingFlag(1); | |
599 | the output should be | |
600 | Efficiency Lpt cut = 0.7362 +/- 0.0391 | |
601 | Efficiency Hpt cut = 0.2662 +/- 0.0201 | |
602 | Similarly, for 1000 Upsilon events, the output should be | |
603 | Efficiency Lpt cut = 0.9806 +/- 0.0457 | |
604 | Efficiency Hpt cut = 0.9537 +/- 0.0448 | |
605 | ||
068f96bd | 606 | =========================================================== |
607 | How to check single muon trigger efficiency versus pt | |
608 | =========================================================== | |
609 | The MUONTriggerEfficiencyPt.C macro produces trigger single muon efficiency | |
610 | versus pt plots for the 2 pt cuts. | |
611 | Results are compared to the reference (red curves). | |
612 | To be used with (at least) 10000 events as follows | |
613 | AliGenBox * gener = new AliGenBox(1); | |
614 | gener->SetPtRange(0.,10.); | |
615 | gener->SetPhiRange(0., 360.); | |
616 | gener->SetThetaRange(171.000,178.001); | |
617 | gener->SetPart(13); // or -13 | |
618 | gener->SetOrigin(0.,0., 0.); | |
619 | gener->SetSigma(0.0, 0.0, 0.0); | |
91cec494 | 620 | Outputs are stored in MUONTriggerEfficiencyPt.gif/eps/out files |
068f96bd | 621 | Important note: this macro works with one (real) muon track per event only |
622 | Usage: | |
623 | root [0] .L $ALICE_ROOT/MUON/MUONTriggerEfficiencyPt.C+ | |
624 | root [1] MUONTriggerEfficiencyPt() | |
625 | ||
825f8cb2 | 626 | =========================================================== |
627 | How to process invariant mass spectra for J/psi or Upsilon | |
628 | =========================================================== | |
629 | The macro MUONmassPlot_ESD.C reads back the MUON ESD informations and compute | |
630 | the invariant mass spectra and corresponding uncorelated background. | |
631 | Moreover gives the number of event in the resonance peak and the number of triggers. | |
632 | Usage: | |
633 | root [0] .L $ALICE_ROOT/MUON/MUONmassPlot_ESD.C+ | |
634 | root [1] MUONmassPlot_ESD(ExtrapToVertex, | |
635 | geoFilenam, filename | |
636 | FirstEvent, LastEvent, | |
637 | esdFileName, | |
638 | ResType, Chi2Cut, | |
639 | PtCutMin, PtCutMax, | |
640 | massMin, massMax) | |
641 | ||
642 | with: | |
643 | ExtrapToVertex (default -1) | |
644 | <0: no extrapolation; | |
645 | =0: extrapolation to (0,0,0); | |
646 | >0: extrapolation to ESDVertex if available, else to (0,0,0) | |
647 | geoFilename (default "geometry.root") geometry file name needed to extrap to vertex | |
648 | filename (default "galice.root") galice root file name | |
649 | FirstEvent (default 0) | |
650 | LastEvent (default 10000) | |
651 | esdFileName (default "AliESDs.root") esd root file name | |
652 | ResType (default 553): 553 for Upsilon, anything else for J/Psi | |
653 | Chi2Cut (default 100): keep only tracks with chi2 per d.o.f. < Chi2Cut | |
654 | PtCutMin (default 1): keep only tracks with transverse momentum > PtCutMin | |
655 | PtCutMax (default 10000): keep only tracks with transverse momentum < PtCutMax | |
656 | massMin (default 9.17 for Upsilon) keep only invariant masses with | |
657 | massMax (default 9.77 for Upsilon) massMin < mass < massMax | |
658 | ||
1d1c1e6d | 659 | =========================================================== |
660 | How to tune muon track reconstruction | |
661 | =========================================================== | |
662 | several options and adjustable parameters are available for both Kalman and Original | |
663 | tracking algorithms (hard coded for the moment in AliMUONVTrackReconstructor.cxx): | |
664 | - *fgkSigmaToCutForTracking* : quality cut used to select new clusters to be | |
665 | attached to the track candidate and to select good tracks. | |
666 | - *fgkTrackAllTracks* : according to the value of this flag, in case that several | |
667 | new clusters pass the quality cut, either we consider all the possibilities | |
668 | (duplicating tracks) or we attach only the best cluster. | |
669 | - *fgkRecoverTracks* : if this flag is set to 'true', we try to recover the tracks | |
670 | lost during the tracking by removing the worst of the 2 clusters attached in the | |
671 | previous station. | |
672 | - *fgkImproveTracks* : if this flag is set to 'true', we try to improve the quality | |
673 | of the tracks at the end of the tracking by removing clusters that do not pass | |
674 | new quality cut (within the limit that we must keep at least one cluster per | |
675 | the station). | |
676 | - *fgkSigmaToCutForImprovement* : quality cut used when we try to improve the | |
677 | quality of the tracks. | |
678 | ||
23567f21 | 679 | =========================================================== |
680 | How to get trigger chamber efficiency from data | |
681 | =========================================================== | |
682 | Trigger chamber efficiency map is calculated during reconstruction and saved in AliESDs.root | |
683 | In order to view and save the map, use macro MUONTriggerChamberEfficiency.C | |
684 | ||
685 | To compile MUONTriggerChamberEfficiency.C | |
686 | .includepath $ALICE_ROOT/MUON | |
687 | .L $ALICE_ROOT/MUON/MUONTriggerChamberEfficiency.C+ | |
688 | ||
689 | // To run MUONTriggerChamberEfficiency.C | |
690 | MUONTriggerChamberEfficiency(); | |
691 | ||
692 | //If you want to make the calculated map available for next simulation use option kTRUE, i.e. | |
693 | MUONTriggerChamberEfficiency(kTRUE); | |
694 | ||
695 | When running next simulation, please remember to activate trigger efficiency | |
696 | by adding in Config.C: | |
697 | MUON->SetTriggerEffCells(1); | |
698 | ||
88cb7938 | 699 | =========================================================== |
700 | Still working .............. | |
701 | =========================================================== |