]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/README
Change description related to CDB
[u/mrichter/AliRoot.git] / MUON / README
index 9af9cc99213abf5fe3c6c80bf1a15d69e29eb2ff..868e7441e186ffda1f8ef99084345e6093355034 100644 (file)
+/**************************************************************************
+ * 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$ */
+
 ==========================================================
 Please add  to this README file all information concerning 
 config files, simulation, digitalization, clusterization, 
 reconstruction and macro analysis
 
 ==========================================================
- How to run a MUON simulation 
+ How to check that your aliroot is working well
+==========================================================
+There is a script file AlirootRun_MUONtest.sh which 
+allows for simulating, reconstructing and making the
+invariant analysis of the generated Upsilon (1S).
+The used configuration file is Config.C in MUON 
+directory.
+You have to type :
+source $ALICE_ROOT/MUON/AlirootRun_MUONtest.sh 
+The results of this test are saved in test_out/ directory.
+Please note that the CDB (Condition DataBase) is now always *required* 
+to perform either simulation or reconstruction. For the moment, a version
+ of that CDB is stored in CVS, so you should have one already in MUON/Calib
+subdirectories.
+
+==========================================================
+ How to check that your aliroot is working VERY well
+==========================================================
+There is a script file AlirootRun_MUONlongtest.sh which
+allows for simulating, reconstructing and making the
+-+invariant analysis of the generated Upsilon (1S).
+This script generates a large number of Upsilon (20k) 
+in order to access differential quantities. 
+The used configuration file is Config.C in MUON
+directory.
+One should really run this script to check if the MUON 
+code can process a large number of events WITHOUT errors,
+in particular before making important commits !!
+
+You have to type :
+$ALICE_ROOT/MUON/AlirootRun_MUONtestlong.sh
+The results of this test are saved in testlong_out/ directory
+and will be kept in CVS
+
+(NOTE: the macros performing the calculations/plots MUONefficiency.C 
+and MUONplotEfficiency.C are also able to handle J/Psi if 
+Config.C is modified accordingly )
+
+==========================================================
+ How to run a MUON generation
 ==========================================================
 aliroot
-root [0] gAlice->Run(10,"$ALICE_ROOT/MUON/Config_MUON_test.C");
+root [0] gAlice->Run(10,"$ALICE_ROOT/MUON/Config.C");
 
 1 single muon of 7 GeV/c in the MUON spectrometer 
 acceptance will be simulated using geant3. 
 Hit information will be store in the root file in the
 execution directory.
-
 If you want to change the option or to define a new directory
 for hits, you have to do the following before:
 root [0] gAlice->SetConfigFunction("Config( \"/home/martinez/aliroot/work_NewIO/test/\" , \"box\" );"); 
 
 ============================================================
- How to run MUON Digitalization
+ How to run MUONCheck macro
 ============================================================
-To process the digitalization of hits the AliRunDigitizer 
-framework is used:
+To check the content of a root data file, the MUONCheck
+provides a ascii output on screen.
+
+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")
 
-AliRunDigitizer   * manager = new AliRunDigitizer(1,1);
-manager->SetInputStream(0,"galice.root");
-AliMUONDigitizerv1* dMUON   = new AliMUONDigitizerv1(manager);
-manager->AddDigitizer(dMUON);
-manager->Exec("deb");
+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 ##
+
+To print trigger : (default file is galice.root)
+MUONrectrigger() or MUONrectrigger(##,"galice.root") for the event number ##
+
+....
 
 ============================================================
- How to run MUON RecPoint clusterization
+ How to check the Geometry with the new Geometrical modeler
+ ftp://root.cern.ch/root/doc/chapter16.pdf
+ http://agenda.cern.ch/fullAgenda.php?ida=a05212
 ============================================================
-aliroot -b << EOF
-.L $ALICE_ROOT/MUON/MUONrawclusters.C
-MUONrawclusters("galice.root",0,10); 
+gAlice->Init("$ALICE_ROOT/MUON/Config.C");
+gGeoManager->GetMasterVolume()->Draw();
+
 
-First event and last event are given by hand, but this will change.
+============================================================
+ How to check the overlap with the new Geometrical modeler
+ ftp://root.cern.ch/root/doc/chapter16.pdf
+ http://agenda.cern.ch/fullAgenda.php?ida=a05212
+============================================================
+gAlice->Init("$ALICE_ROOT/MUON/Config.C");
+gGeoManager->CheckOverlaps();
+gGeoManager->PrintOverlaps();
 
 ============================================================
- How to run MUON Trigger
+ How to run MUONdisplay
 ============================================================
-.L $ALICE_ROOT/MUON/MUONtrigger.C
-MUONtrigger("galice.root",0,9); 
->> IMPORTANT NOTE: in the present version, one can only have either
->> rawclusters or trigger information written in MUON.RecPoints.root
->> but not both of them i.e. running MUONtrigger after MUONrawclusters
->> will erase rawclusters from TreeR and vice versa.
+First you need to perform a full simulation: 
+generation, digitalisation and clusterisation
+To run MUONdisplay with Root 5.04/00 you need to get a fix in
+the gpad/src/TPad.cxx from Root CVS:
+ cvs update -r 1.200 gpad/src/TPad.cxx
+and recompile root. 
+
+.L $ALICE_ROOT/MUON/MUONdisplay.C
+MUONdisplay(0,"galice.root")
 
-First event and last event are given by hand, but this will change.
+============================================================
+ Tracking parameters, cuts, energy loss and physics processes
+============================================================
+Tracking parameters in MUON are automatically defined by GEANT
+MUON takes the default values of CUTs  and physics processes
+defined by the Config files, except for the gas mixture medium 
+of the tracking chambers. The CUT's and physics processes of
+the gas mixture medium  is then defined in the galice.cuts file
+in the data directory. In particular ILOSS parameter MUST be
+equal unity (1) in order simulate a realistic energy loss
+distribution (mean value and fluctuations) in the active gas.
 
 ============================================================
- How to run MUON Tracking reconstruction
+ Tracking of particle in the magnetic field
 ============================================================
+GEANT has two ways for tracking charged particles in the 
+magnetic field: HELIX et RKUTA.
+HELIX is faster and works well if the gradient of magnetic 
+field is small. 
+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);
+  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.
+MAXB is the maximum magnetic field which is 10.T
+
+===========================================================
+ MUON cocktail for physics ..............
+===========================================================
+There is a MUON cocktail generator of the muon sources in the
+EVGEN directory. This class derives from AliGenCocktail.
+In the init of this class I have filled the cocktail with 
+the muon sources: J/Psi, Upsilon, Open Charm, Open Beauty, 
+Pion, Kaons. The code needs only the production cross section 
+at 4pi (for the moment this values are in the code since I 
+prefere them do not be modified), and the code calculates the  
+rate of particles in the acceptance, making the scaling based 
+on the number of collisions for the hard probes and on the  
+number of participants for soft sources: Pions and Kaons.
+
+In the Genereate of this class all entries in the cocktail 
+are called and we define a "primordial trigger" with requires 
+a minimum number of muons above a Pt cut in the required acceptance.
+In order to normalized to the real number of simulated events, 
+there are 2 data members in the class fNsuceeded adn fNGenerate 
+which tell us what is the biais source.
+
+Enclose an example to use this generator:   
+AliGenMUONCocktail * gener = new AliGenMUONCocktail();
+gener->SetPtRange(1.,100.);       // Transverse momentum range  
+gener->SetPhiRange(0.,360.);    // Azimuthal angle range 
+gener->SetYRange(-4.0,-2.4);
+gener->SetMuonPtCut(1.);
+gener->SetMuonThetaCut(171.,178.);
+gener->SetMuonMultiplicity(2);
+gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
+gener->SetVertexSmear(kPerTrack);  
+gener->SetOrigin(0,0,0);        // Vertex position
+gener->SetSigma(0,0,0.0);       // Sigma in (X,Y,Z) (cm) on IP position
+gener->Init();
+================================================================
+ csh Script for the full reconstruction with raw data generator
+================================================================
+The rawdata generation and analysis is working with the new segmentation.
+So the config file must use the version "AliMUONFactoryV3"
 
+Generation
+The method AliSimulation::SetWriteRawData("MUON") enables on 
+the muon rawdata generation
+aliroot -b << EOF  
+AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
+MuonSim.SetWriteRawData("MUON")
+MuonSim.Run(10)
+.q
+EOF
+
+Reconstruction
+aliroot -b << EOF 
+AliReconstruction MuonRec("galice.root");
+MuonRec.SetInput("$YOUR_WORKING_DIRECTORY/");  Do not forget the slash at the end!
+MuonRec.SetRunVertexFinder(kFALSE);
+MuonRec.SetRunLocalReconstruction("MUON");
+MuonRec.SetRunTracking("");
+MuonRec.SetFillESD("MUON");
+MuonRec.SetOption("MUON", "VS"); // to use VS cluster finder
+// MuonRec.SetOption("MUON", "VS Original"); // to run VS and original track finder
+// MuonRec.SetOption("MUON", "Combi"); // to run combined cluster / track finder
+MMuonRec.Run();
+.q
+EOF
+
+
+
+============================================================
+ 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.
+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.   
+
+To compile MUONRecoCheck.C
 .includepath $ALICE_ROOT/STEER
 .includepath $ALICE_ROOT/MUON
-.L $ALICE_ROOT/MUON/MUONrecoNtuple.C++
-MUONrecoNtuple(0,10,0,"galice.root")    
+.L $ALICE_ROOT/MUON/MUONRecoCheck.C+
+
+// To run MUONRecoCheck
+MUONRecoCheck(nEvent,"galice.root"); // nEvent = nb of events
 
-First event and last event are given by hand, but this will change.
 
 ============================================================
- How to run MUONCheck macro
+ How to run MUONTracker macro
 ============================================================
-To check the content of a root data file, the MUONCheck
-provides a ascii output on screen.
+To make the track reconstruction directly from AliTrackReference hits 
+which are recorded in TrackRefs.root during the simulation.
+It can be used to check the reconstruction without clusterization.     
 
-To compile MUONCheck.C
+To compile MUONTracker.C
 .includepath $ALICE_ROOT/STEER
 .includepath $ALICE_ROOT/MUON
-.L $ALICE_ROOT/MUON/MUONCheck.C++
+.L $ALICE_ROOT/MUON/MUONTracker.C+
 
+// To run MUONTracker
+MUONTracker(iEventMin,iEventMax,"galice.root"); // iEventMin: first event
 
-To print hits : (default file is galice.root if not MUONhits("toto.root""); )
-MUONhits()  
+===========================================================
+ Macro  MUONGenerateGeometryData.C
+===========================================================
+                                               
+Macro for generating the geometry data files:
+(transform.dat, svmap.dat).
+- MUON/data/transform.dat file contains all the information 
+about the transformation (traslation + rotation) needed for 
+the positionning of each detection element of the MUON
+spectrometer.
+- MUON/data/svmap.dat file contains all the information to link 
+each geant volume (it can be extended to other virtual MC) with
+a detection element. The point here is that a given detection
+element, i.e. a slat chamber consists of many geant volumes.
+the correspondence is then defined in an input file.
+Each time there is a change in the definition of MC geometry, these
+input files must be re-generated via the macro  
+MUONGenerateGeometryData.C
 
-To print digits : (default file is galice.root)
-MUONdigits()  
+To be run from aliroot:
+.x MUONGenerateGeometryData.C
 
-To print rawcluster : (default file is galice.root)
-MUONrecpoints()
+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.
 
-To print trigger : (default file is galice.root)
-MUONTestTrigger()
+
+==========================================================
+ How to Merge events
+==========================================================
+
+You can merge 2 types of simulated events. For example, 
+you can simulate Hijing events, and then simulate muons
+merging both.
+
+Merging is done at the sdigits level, so Kinematics files 
+of the merged events will just correspond to the 
+Config.C simulated file (not to Config_HIJING.C).
+
+You must, first, do the Hijing simulation and store it 
+in directory $HIJING_SIM. Note that for merging you 
+won't need Kinematics files of the Hijing simulation...
+
+Hijing simulation
+
+aliroot -b << EOF
+AliSimulation HijingSim("$HIJING_SIM/Config_HIJING.C")
+HijingSim.Run(5)
+.q
+EOF
+
+
+Then you can do muon simulation and reconstruction
+merging both simulated events. In next example, we are
+merging 20 times each Hijing event in order to simulate 
+100 muons merged with 5 Hijing events.
+
+
+aliroot -b << EOF
+AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C")
+MuonSim.MergeWith("$HIJING_SIM/galice.root",20) //parameters are the Hijing simulation file and the number of times we use each Hijing event
+MuonSim.Run(100) // number of muon (Config.C) events
+.q
+EOF
+
+
+aliroot -b << EOF
+TPluginManager * pluginmanager = gROOT->GetPluginManager()
+pluginmanager->AddHandler("AliReconstructor","MUON","AliMUONReconstructor","MUON","AliMUONReconstructor()")
+AliReconstruction  MuonRec("galice.root")
+MuonRec.SetRunTracking("")
+MuonRec.SetRunVertexFinder(kFALSE)
+MuonRec.SetRunLocalReconstruction("MUON")
+MuonRec.SetFillESD("MUON")
+MuonRec.Run()
+.q
+EOF
+
+==========================================================
+ How to play with the CDB
+==========================================================
+
+If you'd like to see how the CDB is created, please have a look at the 
+MUONCDB.C (work in progress, though).
 
 ===========================================================
  Still working ..............