]>
Commit | Line | Data |
---|---|---|
c3201ac4 | 1 | $Id$ |
50837721 | 2 | |
88cb7938 | 3 | ========================================================== |
4 | Please add to this README file all information concerning | |
d55fa8e9 | 5 | general items about the MUON code or the libraries |
6 | base, simu and reco | |
7 | Other README file of the muon code are | |
8 | READMEevaluation | |
9 | READMEgeometry | |
10 | READMEraw | |
11 | READMEshuttle | |
12 | READMEtrigger | |
88cb7938 | 13 | |
6b1e4b22 | 14 | ========================================================== |
15 | How to check that your aliroot is working well | |
16 | ========================================================== | |
8c4c70f6 | 17 | There is a script file AlirootRun_MUONtest.sh which |
6b1e4b22 | 18 | allows for simulating, reconstructing and making the |
19 | invariant analysis of the generated Upsilon (1S). | |
20 | The used configuration file is Config.C in MUON | |
21 | directory. | |
8c4c70f6 | 22 | You have to type : |
d55fa8e9 | 23 | $ALICE_ROOT/MUON/AlirootRun_MUONtest.sh [option] |
24 | ||
25 | The complete list of the option is printed when you call | |
26 | the script with whatever non valid option, .eg. h: | |
27 | ||
28 | ./AlirootRun_MUONtest.sh h | |
29 | ERROR : extra option not recognized | |
30 | Usage: AlirootRun_MUONtest.sh options (-SRXsrxn:p:d:c:) | |
31 | -S (-s) perform (or not) simulation (default is do it, i.e -S) | |
32 | -R (-r) perform (or not) reconstruction (default is do it, i.e. -R) | |
33 | -X event (-x) perform (or not) checks and dumps (default is do it for event 5, i.e. -X 5) | |
34 | -n nevents (int) number of events to simulate (default 100) | |
35 | -p recoptions (quotified string) reconstruction options to use (default "SAVEDIGITS") | |
36 | -d full path to output directory (default /work/projects/alice/dev/AliRoot/MUON/test_out.100) | |
37 | -c full path to configuration file for simulation (default /work/projects/alice/dev/AliRoot/MUON/Config.C) | |
38 | ||
39 | The results of this test are saved in test_out.nevent directory. | |
60fff730 | 40 | Please note that the CDB (Condition DataBase) is now always *required* |
41 | to perform either simulation or reconstruction. For the moment, a version | |
d55fa8e9 | 42 | of that CDB is stored in CVS, so you should have one already in MUON/Calib |
60fff730 | 43 | subdirectories. |
6b1e4b22 | 44 | |
d55fa8e9 | 45 | |
7f42a16f | 46 | ========================================================== |
47 | How to check that your aliroot is working VERY well | |
48 | ========================================================== | |
49 | There is a script file AlirootRun_MUONlongtest.sh which | |
50 | allows for simulating, reconstructing and making the | |
51 | -+invariant analysis of the generated Upsilon (1S). | |
52 | This script generates a large number of Upsilon (20k) | |
53 | in order to access differential quantities. | |
54 | The used configuration file is Config.C in MUON | |
55 | directory. | |
56 | One should really run this script to check if the MUON | |
57 | code can process a large number of events WITHOUT errors, | |
58 | in particular before making important commits !! | |
59 | ||
60 | You have to type : | |
61 | $ALICE_ROOT/MUON/AlirootRun_MUONtestlong.sh | |
62 | The results of this test are saved in testlong_out/ directory | |
63 | and will be kept in CVS | |
64 | ||
65 | (NOTE: the macros performing the calculations/plots MUONefficiency.C | |
66 | and MUONplotEfficiency.C are also able to handle J/Psi if | |
67 | Config.C is modified accordingly ) | |
68 | ||
88cb7938 | 69 | ========================================================== |
7985603c | 70 | How to run a MUON generation |
88cb7938 | 71 | ========================================================== |
d55fa8e9 | 72 | You only need to run the simulation part of the test script |
73 | AlirootRun_MUONtest.sh | |
88cb7938 | 74 | |
88cb7938 | 75 | ============================================================ |
cd4f4ea4 | 76 | How to dump the content of Root data files |
88cb7938 | 77 | ============================================================ |
c58ae721 | 78 | To check the content of Root data files, the AliMUON*DataInterface classes |
cd4f4ea4 | 79 | provides the functions to produce an ASCII output on the screen |
80 | which can be redirected on the file: | |
88cb7938 | 81 | |
c58ae721 | 82 | for MC information, use AliMUONMCDataInterface : |
83 | ||
84 | > aliroot (or root with just the loading of MUON libs, see loadlibs.C) | |
85 | root [0] AliMUONMCDataInterface mcdi("galice.root"); | |
86 | root [1] mcdi.DumpKine(5); > dump.kine | |
87 | root [2] mcdi.DumpHits(5); > dump.hits | |
88 | root [3] mcdi.DumpTrackRefs(5); > dump.trackrefs | |
88cb7938 | 89 | |
c58ae721 | 90 | for all other information, use AliMUONDataInterface : |
2b32c661 | 91 | |
c58ae721 | 92 | > aliroot |
93 | root [0] AliMUONDataInterface di("galice.root"); | |
94 | root [1] di.DumpDigits(5); > dump.digits | |
95 | root [2] di.DumpSDigits(5); > dump.sdigits | |
96 | root [3] di.DumpRecPoints(5); > dump.recpoints | |
97 | root [4] di.DumpTrigger(5); > dump.rectrigger | |
88cb7938 | 98 | |
d55fa8e9 | 99 | Remind that during simulation and reconstruction two |
100 | differents galice.root are generated: one for the generation | |
101 | (simulation) and other during the reconstruction. | |
b3ba6823 | 102 | |
d55fa8e9 | 103 | If you open the wrong galice.root file you could get: |
104 | root [0] AliMUONMCDataInterface mcdi("galice.root"); | |
105 | root [1] mcdi.DumpKine(5); | |
106 | W-AliRunLoader::GetEvent: Stack not found in header | |
107 | E-TFile::TFile: file ./Kinematics.root does not exist | |
7985603c | 108 | |
02d8f072 | 109 | ============================================================ |
110 | Tracking parameters, cuts, energy loss and physics processes | |
111 | ============================================================ | |
112 | Tracking parameters in MUON are automatically defined by GEANT | |
113 | MUON takes the default values of CUTs and physics processes | |
114 | defined by the Config files, except for the gas mixture medium | |
115 | of the tracking chambers. The CUT's and physics processes of | |
116 | the gas mixture medium is then defined in the galice.cuts file | |
117 | in the data directory. In particular ILOSS parameter MUST be | |
118 | equal unity (1) in order simulate a realistic energy loss | |
119 | distribution (mean value and fluctuations) in the active gas. | |
a88eb0d0 | 120 | |
121 | ============================================================ | |
122 | Tracking of particle in the magnetic field | |
123 | ============================================================ | |
124 | GEANT has two ways for tracking charged particles in the | |
125 | magnetic field: HELIX et RKUTA. | |
126 | HELIX is faster and works well if the gradient of magnetic | |
127 | field is small. | |
128 | For MUON, HELIX is a not a good approximation and we must | |
129 | use RKUTA to get the optimal mass resolution of the | |
130 | spectrometer. The choice of HELIX or RKUTA is done in the | |
131 | config file when the magnetic field is defined: | |
b97b210c | 132 | AliMagFMaps* field = new AliMagFMaps("Maps","Maps", TRACKING, FACTOR, MAXB, AliMagFMaps::k5kG); |
a88eb0d0 | 133 | gAlice->SetField(field); |
134 | TRACKING must be 1 for RKUTA and 2 for HELIX (the default value for aliroot is 2 (HELIX)) | |
135 | FACTOR allows you to set the magnetic field to 0, just putting FACTOR=0. Default value is 1. | |
136 | MAXB is the maximum magnetic field which is 10.T | |
2b32c661 | 137 | |
d55fa8e9 | 138 | =========================================================== |
139 | How to tune muon track reconstruction | |
140 | =========================================================== | |
141 | several options and adjustable parameters are available for both Kalman and Original | |
142 | tracking algorithms (hard coded for the moment in AliMUONVTrackReconstructor.cxx): | |
143 | - *fgkSigmaToCutForTracking* : quality cut used to select new clusters to be | |
144 | attached to the track candidate and to select good tracks. | |
019df241 | 145 | - *fgkMakeTrackCandidatesFast* : if this flag is set to 'true', the track candidates |
146 | are made assuming linear propagation between stations 4 and 5. | |
d55fa8e9 | 147 | - *fgkTrackAllTracks* : according to the value of this flag, in case that several |
148 | new clusters pass the quality cut, either we consider all the possibilities | |
149 | (duplicating tracks) or we attach only the best cluster. | |
150 | - *fgkRecoverTracks* : if this flag is set to 'true', we try to recover the tracks | |
151 | lost during the tracking by removing the worst of the 2 clusters attached in the | |
152 | previous station. | |
153 | - *fgkImproveTracks* : if this flag is set to 'true', we try to improve the quality | |
154 | of the tracks at the end of the tracking by removing clusters that do not pass | |
155 | new quality cut (within the limit that we must keep at least one cluster per | |
156 | the station). | |
157 | - *fgkSigmaToCutForImprovement* : quality cut used when we try to improve the | |
158 | quality of the tracks. | |
159 | ||
f4f795ed | 160 | =========================================================== |
161 | MUON cocktail for physics .............. | |
162 | =========================================================== | |
163 | There is a MUON cocktail generator of the muon sources in the | |
164 | EVGEN directory. This class derives from AliGenCocktail. | |
165 | In the init of this class I have filled the cocktail with | |
166 | the muon sources: J/Psi, Upsilon, Open Charm, Open Beauty, | |
167 | Pion, Kaons. The code needs only the production cross section | |
168 | at 4pi (for the moment this values are in the code since I | |
169 | prefere them do not be modified), and the code calculates the | |
170 | rate of particles in the acceptance, making the scaling based | |
171 | on the number of collisions for the hard probes and on the | |
172 | number of participants for soft sources: Pions and Kaons. | |
173 | ||
174 | In the Genereate of this class all entries in the cocktail | |
175 | are called and we define a "primordial trigger" with requires | |
176 | a minimum number of muons above a Pt cut in the required acceptance. | |
177 | In order to normalized to the real number of simulated events, | |
178 | there are 2 data members in the class fNsuceeded adn fNGenerate | |
179 | which tell us what is the biais source. | |
180 | ||
181 | Enclose an example to use this generator: | |
182 | AliGenMUONCocktail * gener = new AliGenMUONCocktail(); | |
183 | gener->SetPtRange(1.,100.); // Transverse momentum range | |
184 | gener->SetPhiRange(0.,360.); // Azimuthal angle range | |
185 | gener->SetYRange(-4.0,-2.4); | |
186 | gener->SetMuonPtCut(1.); | |
187 | gener->SetMuonThetaCut(171.,178.); | |
188 | gener->SetMuonMultiplicity(2); | |
35e21dec | 189 | gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions |
f4f795ed | 190 | gener->SetVertexSmear(kPerTrack); |
191 | gener->SetOrigin(0,0,0); // Vertex position | |
192 | gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position | |
193 | gener->Init(); | |
194 | ||
d228b279 | 195 | ========================================================== |
196 | How to simulate events with misaligned geometry in local CDB | |
197 | ========================================================== | |
198 | ||
199 | If you want to use a misaligned geometry to simulate some | |
200 | events you can use a local CDB. For this need to follow | |
201 | the next steps: | |
202 | ||
203 | - Generate misaligned data in local CDB. | |
204 | You can use MUONGenerateGeometryData.C as described above in | |
205 | the corresponding section. Let's assume you used the default | |
206 | residual misalignment settings, then you have a local CDB in | |
207 | your working directory called ResMisAlignCDB containing | |
208 | misalignement data (ResMisAlignCDB/MUON/Align). | |
209 | ||
0d24599f | 210 | - Tell AliSimulation you want to use your local CDB for |
211 | MUON/Align/Data | |
d228b279 | 212 | To do this you need to instantiate the AliCDBManager, set the |
0d24599f | 213 | default storage and set the specific storage for MUON/Align/Data, |
214 | before instantiating AliSimulation (see for example the commented | |
d228b279 | 215 | lines AlirootRun_MUONtest.sh). |
216 | ||
217 | aliroot -b >& testSim.out << EOF | |
218 | AliCDBManager* man = AliCDBManager::Instance(); | |
219 | man->SetDefaultStorage("local://$ALICE_ROOT"); | |
0d24599f | 220 | man->SetSpecificStorage("MUON/align/Data","local://ResMisAlignCDB"); |
d228b279 | 221 | AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C"); |
222 | MuonSim.SetWriteRawData("MUON"); | |
223 | MuonSim.Run(10); | |
224 | .q | |
225 | EOF | |
29fc2c86 | 226 | |
86cd713c | 227 | |
cd85a354 | 228 | ========================================================== |
229 | How to Merge events | |
230 | ========================================================== | |
231 | ||
232 | You can merge 2 types of simulated events. For example, | |
233 | you can simulate Hijing events, and then simulate muons | |
234 | merging both. | |
235 | ||
236 | Merging is done at the sdigits level, so Kinematics files | |
237 | of the merged events will just correspond to the | |
d55fa8e9 | 238 | Config.C simulated file). |
cd85a354 | 239 | |
240 | You must, first, do the Hijing simulation and store it | |
241 | in directory $HIJING_SIM. Note that for merging you | |
242 | won't need Kinematics files of the Hijing simulation... | |
243 | ||
244 | Hijing simulation | |
245 | ||
246 | aliroot -b << EOF | |
d55fa8e9 | 247 | AliSimulation HijingSim("$HIJING_SIM/YourConfigForHIJING.C") |
cd85a354 | 248 | HijingSim.Run(5) |
249 | .q | |
250 | EOF | |
251 | ||
d55fa8e9 | 252 | You cand build YourConfigFroHIJING.C File from the |
253 | ConfigPPR file in AliRoot/macros module. | |
cd85a354 | 254 | |
255 | Then you can do muon simulation and reconstruction | |
256 | merging both simulated events. In next example, we are | |
257 | merging 20 times each Hijing event in order to simulate | |
258 | 100 muons merged with 5 Hijing events. | |
259 | ||
260 | ||
261 | aliroot -b << EOF | |
262 | AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C") | |
263 | MuonSim.MergeWith("$HIJING_SIM/galice.root",20) //parameters are the Hijing simulation file and the number of times we use each Hijing event | |
264 | MuonSim.Run(100) // number of muon (Config.C) events | |
265 | .q | |
266 | EOF | |
267 | ||
268 | ||
269 | aliroot -b << EOF | |
270 | TPluginManager * pluginmanager = gROOT->GetPluginManager() | |
271 | pluginmanager->AddHandler("AliReconstructor","MUON","AliMUONReconstructor","MUON","AliMUONReconstructor()") | |
272 | AliReconstruction MuonRec("galice.root") | |
273 | MuonRec.SetRunTracking("") | |
274 | MuonRec.SetRunVertexFinder(kFALSE) | |
275 | MuonRec.SetRunLocalReconstruction("MUON") | |
276 | MuonRec.SetFillESD("MUON") | |
277 | MuonRec.Run() | |
278 | .q | |
279 | EOF | |
280 | ||
d228b279 | 281 | ========================================================== |
282 | ...on track numbering | |
283 | ========================================================== | |
284 | ||
285 | All generated particles, including primary and secondary | |
286 | particles are put on the stack. The secondary particles are kept | |
287 | in the stack only if they gave a hit in *any* of the ALICE detectors | |
288 | The number of all particles placed on the stack for a given event | |
289 | can be obtained with | |
290 | Int_t nPart = AliStack::GetNtrack(); | |
291 | Looping from 0 to nPart via AliStack::Particle(ipart) | |
292 | gives the particle listing as obtained from the particle generator (primaries) | |
293 | and Monte Carlo (secondaries). | |
294 | ||
295 | The particle response in the detector, a hit, is registered | |
296 | in the hits tree and the hits are filled with each primary track. | |
297 | The total number of "tracks" (fills of the tree) can be obtained | |
c58ae721 | 298 | with ntracks = AliMUONMCDataInterface::NumberOfTracks(event) and is usually smaller than "nPart". |
d228b279 | 299 | Since particles can also deposit hits in other detectors than |
300 | the MUON spectrometer, there will be many "tracks" (fills) in the hit-tree | |
301 | without a hit in MUON. | |
302 | ||
303 | The correspondence between "track ID" in the hits-tree ("itr") and the | |
304 | particle ID for particles on the stack (i.e. generated particles) can be | |
305 | obtained via: | |
306 | for (Int_t itr = 0; itr < ntracks; itr++) { | |
c58ae721 | 307 | AliMUONVHitStore* hitStore = mcDataInterface.HitStore(event,itr); |
308 | //track "itr" of the hits-tree | |
309 | Int_t nhitstot = hitStore->GetSize(); | |
310 | AliMUONHit* mHit; | |
311 | TIter next(hitStore->CreateIterator()); | |
312 | while ( ( mHit = static_cast<AliMUONHit*>(next()) ) ) | |
313 | { | |
314 | Int_t id = mHit->Track(); //gives particle ID on stack | |
315 | TParticle* particle = mcDataInterface.Stack(event)->Particle(id); | |
d228b279 | 316 | } |
317 | } | |
318 | ||
c58ae721 | 319 | where mcDataInterface has been obtained by |
320 | AliMUONMCDataInterface mcDataInterface("galice.root"); | |
321 | ||
d228b279 | 322 | During the procedure to go from hits to digits, the hits |
323 | are summed up such that more than one track can contribute | |
324 | to a given digit. As a consequence the method | |
325 | Int_t AliMUONDigit::Track(Int_t trackID) | |
326 | takes an argument, where "trackID" runs from 0 to | |
327 | AliMUONDigit::Ntracks() to provide the reference to *all* | |
328 | tracks that contributed to it. The returned track ID is the one | |
329 | referred to in the hit-tree. To know which is the generated particle | |
330 | that deposited a given digit one has to follow the sequence of the kind: | |
c58ae721 | 331 | (shown here using the simple, but not fast, DataInterface interfaces) : |
332 | ||
333 | AliMUONMCDataInterface mcdi("galice.root"); | |
334 | AliMUONDataInterface di("galice.root"); | |
d228b279 | 335 | |
c58ae721 | 336 | AliMUONVDigitStore* digitStore = di.DigitStore(event); |
337 | AliMUONVDigit* mDigit = ... get some digit from the digitStore | |
d228b279 | 338 | |
c58ae721 | 339 | for (int tr = 0; tr < mDigit->Ntracks(); tr++) |
340 | { | |
d228b279 | 341 | Int_t hitTrackID = mDigit->Track(tr); |
c58ae721 | 342 | // get the hits corresponding to this trackID |
343 | AliMUONHitStore* hitStore = mcdi.HitStore(event,hitTrackID); | |
344 | // loop over the hits | |
345 | TIter hNext(hitStore->CreateIterator()); | |
346 | AliMUONHit* mHit; | |
347 | while ( ( mHit = static_cast<AliMUONHit*>(hNext()) ) ) | |
348 | { | |
349 | Int_t numPart = mHit->Track(); //gives ID of particle on the stack | |
350 | Int_t idTrack = mHit->Particle(); //gives flavour code of the particle | |
351 | } | |
d228b279 | 352 | } |
d228b279 | 353 | |
068f96bd | 354 | |
825f8cb2 | 355 | =========================================================== |
356 | How to process invariant mass spectra for J/psi or Upsilon | |
357 | =========================================================== | |
358 | The macro MUONmassPlot_ESD.C reads back the MUON ESD informations and compute | |
359 | the invariant mass spectra and corresponding uncorelated background. | |
360 | Moreover gives the number of event in the resonance peak and the number of triggers. | |
361 | Usage: | |
362 | root [0] .L $ALICE_ROOT/MUON/MUONmassPlot_ESD.C+ | |
363 | root [1] MUONmassPlot_ESD(ExtrapToVertex, | |
364 | geoFilenam, filename | |
365 | FirstEvent, LastEvent, | |
366 | esdFileName, | |
367 | ResType, Chi2Cut, | |
368 | PtCutMin, PtCutMax, | |
369 | massMin, massMax) | |
370 | ||
371 | with: | |
372 | ExtrapToVertex (default -1) | |
373 | <0: no extrapolation; | |
374 | =0: extrapolation to (0,0,0); | |
375 | >0: extrapolation to ESDVertex if available, else to (0,0,0) | |
376 | geoFilename (default "geometry.root") geometry file name needed to extrap to vertex | |
377 | filename (default "galice.root") galice root file name | |
378 | FirstEvent (default 0) | |
379 | LastEvent (default 10000) | |
380 | esdFileName (default "AliESDs.root") esd root file name | |
381 | ResType (default 553): 553 for Upsilon, anything else for J/Psi | |
382 | Chi2Cut (default 100): keep only tracks with chi2 per d.o.f. < Chi2Cut | |
383 | PtCutMin (default 1): keep only tracks with transverse momentum > PtCutMin | |
384 | PtCutMax (default 10000): keep only tracks with transverse momentum < PtCutMax | |
385 | massMin (default 9.17 for Upsilon) keep only invariant masses with | |
386 | massMax (default 9.77 for Upsilon) massMin < mass < massMax | |
387 | ||
23567f21 | 388 | |
23567f21 | 389 | |
88cb7938 | 390 | =========================================================== |
391 | Still working .............. | |
392 | =========================================================== |