]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/README
Updated list of MUON libraries
[u/mrichter/AliRoot.git] / MUON / README
index a3f9fd2b199e699ca95fcb5628718fcff8ab6fe1..f5c03c7a4102bafd4f99ed7a9a483aebe0afb33c 100644 (file)
@@ -1,19 +1,4 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
+$Id$
 
 ==========================================================
 Please add  to this README file all information concerning 
@@ -74,38 +59,24 @@ for hits, you have to do the following before:
 root [0] gAlice->SetConfigFunction("Config( \"/home/martinez/aliroot/work_NewIO/test/\" , \"box\" );"); 
 
 ============================================================
- How to run MUONCheck macro
+ How to dump the content of Root data files 
 ============================================================
-To check the content of a root data file, the MUONCheck
-provides a ascii output on screen.
+To check the content of Root data files, the AliMUONData class
+provides the functions to produce an ASCII output on the screen
+which can be redirected on the file:
 
-To compile MUONCheck.C
-.includepath $ALICE_ROOT/STEER
-.includepath $ALICE_ROOT/MUON
-.includepath $ALICE_ROOT/MUON/mapping
-.L $ALICE_ROOT/MUON/MUONCheck.C++
-To Load
-gSystem->Load("$ALICE_ROOT/MUON/MUONCheck_C.so")
-
-To print Kine : (default file is galice.root )
-MUONkine() or MUONkine(##,"galice.root") for the event number ##
-
-To print hits : (default file is galice.root if not MUONhits("toto.root""); )
-MUONhits()  or MUONhits(##,"galice.root") for the event number ##
-
-To print digits : (default file is galice.root)
-MUONdigits()  or MUONdigits(##,"galice.root") for the event number ##
-
-To print sdigits : (default file is galice.root)
-MUONsdigits()  or MUONsdigits(##,"galice.root") for the event number ##
-
-To print rawcluster : (default file is galice.root)
-MUONrecpoints() or MUONrecpoints(##,"galice.root") for the event number ##
+aliroot
+root [0] AliMUONData data("galice.root");
+root [1] data.DumpKine(5);       > dump.kine
+root [2] data.DumpHits(5);       > dump.hits
+root [3] data.DumpDigits(5);     > dump.digits
+root [4] data.DumpSDigits(5);    > dump.sdigits
+root [5] data.DumpRecPoints(5);  > dump.recpoints
+root [6] data.DumpRecTrigger(5); > dump.rectrigger
 
-To print trigger : (default file is galice.root)
-MUONrectrigger() or MUONrectrigger(##,"galice.root") for the event number ##
+If the event number in the function argument is not specified,
+data are dumped for all events.
 
-....
 
 ============================================================
  How to check the Geometry with the new Geometrical modeler
@@ -161,7 +132,7 @@ For MUON, HELIX is a not a good approximation and we must
 use RKUTA to get the optimal mass resolution of the 
 spectrometer. The choice of HELIX or RKUTA is done in the
 config file when the magnetic field is defined:
-  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", TRACKING, FACTOR, MAXB, AliMagFMaps::k4kG);
+  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", TRACKING, FACTOR, MAXB, AliMagFMaps::k5kG);
   gAlice->SetField(field);
 TRACKING must be 1 for RKUTA and 2 for HELIX (the default value for aliroot is 2 (HELIX))
 FACTOR allows you to set the magnetic field to 0, just putting FACTOR=0. Default value is 1.
@@ -213,6 +184,7 @@ The method AliSimulation::SetWriteRawData("MUON") enables on
 the muon rawdata generation
 aliroot -b << EOF  
 AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
+MuonSim.SetMakeTrigger("MUON");
 MuonSim.SetWriteRawData("MUON")
 MuonSim.Run(10)
 .q
@@ -263,9 +235,10 @@ MUONRawStreamTracker(maxEvent, "$YOUR_WORKING_DIRECTORY/"); //Do not forget the
 ============================================================
  How to run MUONRecoCheck macro
 ============================================================
+
 To check the muon reconstruction by comparing the reconstructed tracks
-with the reference tracks made of "AliTrackReference" for the hits and
-kinematic informations (TParticle) for the vertex.
+with the reference tracks made of "AliTrackReference" for the hits in chamber (0..9)
+and kinematic informations (TreeK) for the vertex.
 This macro can be used to check the track reconstruction e.g. efficiency,
 momentum resolution ... but also to make physics analysis whenever
 track identification is needed.   
@@ -276,7 +249,7 @@ To compile MUONRecoCheck.C
 .L $ALICE_ROOT/MUON/MUONRecoCheck.C+
 
 // To run MUONRecoCheck
-MUONRecoCheck(nEvent,"galice.root"); // nEvent = nb of events
+MUONRecoCheck(nEvent,"geometry.root", "galice.root"); // nEvent = nb of events
 
 
 ============================================================
@@ -299,7 +272,6 @@ MUONTracker(iEventMin,iEventMax,"galice.root"); // iEventMin: first event
 ===========================================================
                                                
 Macro for generating the geometry data files
-and mis-alignment data.
 
 Geometry data files:
 - MUON/data/volpath.dat file contains the volume paths 
@@ -324,9 +296,25 @@ The generated files do not replace the existing ones
 but have different names (with extension ".out").
 Replacement with new files has to be done manually.
 
-If the appropiate flags are set (zeroAlign, resMisAlign and/or fullMisAlign)
-zero, residual and/or full misalignment data are generated in a
-local CDB folder (defaults are ResMisAlignCDB and FullMisAlignCDB
+===========================================================
+ Macros to generate Mis-alignment data
+===========================================================
+                                               
+Macro for generating the geometry mis-alignment data: 
+MakeMUONFullMisAlignment.C
+MakeMUONResMisAlignment.C
+MakeMUONZeroMisAlignment.C
+
+To be run from aliroot:
+.x MakeMUONFullMisAlignment.C etc.
+
+If the environment variable TOCDB is not set to "kTRUE",
+the misalignment data are generated in a local file:
+(MUONFullMisalignment.root, etc.)
+
+If the data are stored in CDB, the storage can be specified in 
+the environment variable STORAGE. The misalignment data are then
+generated in the CDB folder (defaults are ResMisAlignCDB and FullMisAlignCDB
 in the working directory). Inside the local CDB the path for the
 alignment data is (and must be) "MUON/Align/Data/".
 Residual misalignment: Default is our current estimate of
@@ -349,25 +337,49 @@ residual misalignment settings, then you have a local CDB in
 your working directory called ResMisAlignCDB containing
 misalignement data (ResMisAlignCDB/MUON/Align).
 
-- Copy the calibration data in your local CDB.
-cp -r $ALICE_ROOT/MUON/Calib ResMisAlignCDB/MUON
-
-- Tell AliSimulation you want to use your local CDB for MUON
+- Tell AliSimulation you want to use your local CDB for 
+MUON/Align/Data
 To do this you need to instantiate the AliCDBManager, set the
-default storage and set the specific storage for MUON, before
-instantiating AliSimulation (see for example the commented
+default storage and set the specific storage for MUON/Align/Data,
+before instantiating AliSimulation (see for example the commented
 lines AlirootRun_MUONtest.sh).
 
 aliroot -b  >& testSim.out << EOF
 AliCDBManager* man = AliCDBManager::Instance();
 man->SetDefaultStorage("local://$ALICE_ROOT");
-man->SetSpecificStorage("MUON","local://ResMisAlignCDB");
+man->SetSpecificStorage("MUON/align/Data","local://ResMisAlignCDB");
 AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C");
 MuonSim.SetWriteRawData("MUON");
 MuonSim.Run(10);
 .q
 EOF
 
+==========================================================
+How to check the alignment software
+==========================================================
+
+The script AlirootRun_MUONtestAlign.sh  allows you to check the software for
+the alignment with physics tracks. The script will:
+- Generate a misaligned geometry in a local CDB (default FullMisAlignCDB)
+- Simulate 1000 events using previously misaligned geometry
+- Reconstruct the events using perfect geometry
+- Run the alignment code over the above events using MUONAlignment.C
+
+To run you need to type:
+$ALICE_ROOT/MUON/AlirootRun_MUONtestAlign.sh
+
+The results of the test are saved in test_align/ directory. The file measShifts.root
+contains useful graphs for studying the alignment performances. A local CDB
+containing the realigned geometry is also created (default is ReAlignCDB). The
+file $ALICE_ROOT/MUON/data/transform2ReAlign.dat contains the
+transformations describing the realigned geometry to be compared with the
+used misaligned geometry $ALICE_ROOT/MUON/data/transform2.dat.
+
+IMPORTANT NOTE: For a useful test of the alignment performances, the
+order of 100 000 tracks is needed, it is then advisable to generate and
+reconstruct enough events separately and run MUONAlignment.C providing a file list
+afterwards.
+
 ==========================================================
  How to Merge events
 ==========================================================
@@ -485,6 +497,147 @@ for (int tr = 0; tr < mDigit->Ntracks(); tr++){
 In this example, for simplicity, only the first hit of a 
 hit-track is used to check the particle ID.
 
+==========================================================
+Macros for MC studies
+==========================================================
+
+For MC studies the classes "AliMUONTrackLight" and "AliMUONPairLight" can be 
+used in order to fill not only the single muon / dimuon's kinematics (charge, 
+pT, rapidity, etc) at the generation AND reconstruction level, but also for 
+"decoding" the Pythia output and for the storing of the single muon's history. 
+This allows to tag if two muons of a given event come from a certain, well-defined 
+process, such as J/psi, Upsilons, correlated open charm or open beauty or the 
+low masses or if they are of uncorrelated origin. For open beauty/charm it also 
+tags the creation process (pair creation, flavour excitation or gluon splitting). 
+The classes also allow to tag feed-down or neutral B meson oscillation and 
+has a method that checks whether the reconstructed track is a muon or not.
+
+The macros ReadRecoCocktail.C, DecodeRecoCocktail.C and MergeMuonLight.C 
+are examples how to use these two classes. DecodeRecoCocktail.C opens the 
+generated files, loops over the events and fills an AliMUONTrackLight object 
+for every reconstructed track for which the reference to its generated particle 
+could be established, using the AliMUONRecoCheck class. 
+It then takes the AliMUONTrackLight objects and forms - event by event - 
+AliMUONPairLight objects, on a combinatorial basis. For a given event these 
+objects are stored in respective TClonesArrays which are then stored in a tree. 
+By default, the produced output file is called "MuonLight.root". 
+This root file can then be taken by the macro "ReadRecoCocktail.C" that shows, 
+on the example of the reconstructed mass and pT of the AliMUONPairLight object,
+how to access the available information. For large statistics, in which many 
+individual MuonLight.root files are produced, MergeMuonLight.C can be used 
+to merge the files and produce one common output root file.
+
+To read a generation/reconstrution from PDC06 preproduction, and write a file 
+with a tree of AliMUONTrackLight / AliMUONPairLight :
+go to the directory containing the generation/reconstruction. From there run
+aliroot
+.L DecodeRecoCocktail.C+
+DecodeRecoCocktail();
+.q
+
+To read the file previously generated:
+aliroot
+.L ReadRecoCocktail.C+
+ReadRecoCocktail();
+.q
+
+===========================================================
+ How to reprocess trigger decision from already produced digits
+===========================================================
+The MUONTrigger.C macro can be used to check the trigger algorithm w/o 
+having to (re-)perform simulation and digitalization. 
+It loads the digits, erase TreeR and store the current trigger output in 
+TreeR.
+The different trigger outputs can be compared by looking at the GLT branch 
+of TreeD (filled during simulation) and the TC branch of TreeR (filled from 
+a copy of TreeD during reconstruction or with this macro).
+Note: rec points from tracking chamber will be lost.
+Usage:
+root [0] .L $ALICE_ROOT/MUON/MUONTrigger.C+
+root [1] MUONTrigger()
+
+===========================================================
+ How to check integrated trigger efficiency
+===========================================================
+The MUONTriggerEfficiency.C macro (included in the check scripts) calculates
+the trigger efficiency for the 2 pt cuts. 
+The output is stored in MUONTriggerEfficiency.out file.
+Usage:
+root [0] .L $ALICE_ROOT/MUON/MUONTriggerEfficiency.C+
+root [1] MUONTriggerEfficiency()
+For the CVS default version of the trigger LUT (i.e. lutAptLpt1Hpt1p7.root),
+The reference for J/psi and Upsilon is as below
+ For 1000 Jpsi events with:
+    AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kJpsi);
+    gener->SetMomentumRange(0,999);
+    gener->SetPtRange(0,100.);
+    gener->SetPhiRange(0., 360.);
+    gener->SetCutOnChild(1);
+    gener->SetChildPhiRange(0.,360.);
+    gener->SetChildThetaRange(171.0,178.0);
+    gener->SetOrigin(0,0,0);          
+    gener->SetForceDecay(kDiMuon);
+    gener->SetTrackingFlag(1);
+ the output should be 
+  Efficiency Lpt cut = 0.7362 +/- 0.0391
+  Efficiency Hpt cut = 0.2662 +/- 0.0201
+ Similarly, for 1000 Upsilon events, the output should be
+  Efficiency Lpt cut = 0.9806 +/- 0.0457
+  Efficiency Hpt cut = 0.9537 +/- 0.0448
+
+===========================================================
+ How to check single muon trigger efficiency versus pt
+===========================================================
+The MUONTriggerEfficiencyPt.C macro produces trigger single muon efficiency 
+versus pt plots for the 2 pt cuts. 
+Results are compared to the reference (red curves).   
+To be used with (at least) 10000 events as follows
+   AliGenBox * gener = new AliGenBox(1);
+   gener->SetPtRange(0.,10.);
+   gener->SetPhiRange(0., 360.);         
+   gener->SetThetaRange(171.000,178.001);
+   gener->SetPart(13);           // or -13
+   gener->SetOrigin(0.,0., 0.);  
+   gener->SetSigma(0.0, 0.0, 0.0);     
+Outputs are stored in MUONTriggerEfficiencyPt.gif/eps/out files
+Important note: this macro works with one (real) muon track per event only
+Usage:
+root [0] .L $ALICE_ROOT/MUON/MUONTriggerEfficiencyPt.C+
+root [1] MUONTriggerEfficiencyPt()
+
+===========================================================
+ How to process invariant mass spectra for J/psi or Upsilon
+===========================================================
+The macro MUONmassPlot_ESD.C reads back the MUON ESD informations and compute 
+the invariant mass spectra and corresponding uncorelated background. 
+Moreover gives the number of event in the resonance peak and the number of triggers.
+Usage:
+root [0] .L $ALICE_ROOT/MUON/MUONmassPlot_ESD.C+
+root [1] MUONmassPlot_ESD(ExtrapToVertex, 
+                       geoFilenam, filename
+                        FirstEvent, LastEvent, 
+                       esdFileName,
+                       ResType, Chi2Cut,
+                       PtCutMin, PtCutMax,
+                       massMin, massMax)
+
+with:
+ExtrapToVertex (default -1)
+      <0: no extrapolation;
+      =0: extrapolation to (0,0,0);
+      >0: extrapolation to ESDVertex if available, else to (0,0,0)
+geoFilename (default "geometry.root") geometry file name needed to extrap to vertex
+filename    (default "galice.root") galice root file name
+FirstEvent  (default 0)
+LastEvent   (default 10000)
+esdFileName (default "AliESDs.root") esd root file name
+ResType     (default 553):   553 for Upsilon, anything else for J/Psi
+Chi2Cut     (default 100):   keep only tracks with chi2 per d.o.f. < Chi2Cut
+PtCutMin    (default 1):     keep only tracks with transverse momentum > PtCutMin
+PtCutMax    (default 10000): keep only tracks with transverse momentum < PtCutMax
+massMin     (default 9.17 for Upsilon) keep only invariant masses with 
+massMax     (default 9.77 for Upsilon) massMin < mass < massMax
+
 ===========================================================
  Still working ..............
 ===========================================================