]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/READMEmuon
Bug Fix: Forgot to call the initialization of
[u/mrichter/AliRoot.git] / PWG3 / READMEmuon
index b9558f89a47e23d5fc37b5802fcb7665e90320e7..8cb6ffb3c64344c3350b9311be05b733d3ecad92 100644 (file)
@@ -1,13 +1,67 @@
 ===================================================
-  ESDMuonFilter task for filling the muon information in the AOD from the ESD
-  Roberta ARNALDI, Torino
+  Code to include the muon information in the 
+  creation of the standard AOD from the ESD
+  Roberta ARNALDI, Enrico SCOMPARIN Torino
 ---------------------------------------------------------------
 
-1) AnalysisTrainMuonLocal.C --> macro to run locally the AliAnalysisTaskESDMuonFilter
-2) AliAnalysisTaskESDMuonFilter.h  --> analysis task to produce the Muon AOD from ESD
-3) AliAnalysisTaskESDMuonFilter.cxx --> analysis task to produce the Muon AOD from ESD
-4) libPWG3muon.pkg
-5) PWG3muonLinkDef.h 
+The following filter is used in the official analysis train, in order to copy the muon information from the ESD to the standard AOD.
+
+1) AliAnalysisTaskESDMuonFilter.h  --> analysis task to copy the muon information from the ESD to the standard AOD
+2) AliAnalysisTaskESDMuonFilter.cxx --> analysis task to copy the muon information from the ESD to the standard AOD
+
+In order to test the analysis train from the ESD to the Standard AOD production, the following macro is provided:
+
+  AnalysisTrainFromESDToAOD.C
+
+Input file: ESD
+Output files: standard AOD (+AOD tags)
+
+Two wagons are attached to the analysis train: 
+   1) $ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C 
+   2) $ALICE_ROOT/PWG3/muon/AddTaskTagCreation.C 
+
+Several flags can be activated: 
+   1) iESDfilter: to activate, using AddTaskESDFilter.C, the copy of the ESD information into the AOD.
+      In AddTaskESDFilter.C there is the possibility to apply cuts on the tracks and muon tracks in order
+      to reject them before filling the AOD. 
+   2) iAODAddMCBranch: to activate the inclusion of the MC branch (containing Kinematics info) into a branch of the AOD 
+   3) iAODTagCreation: to activate, using AddTaskTagCreation.C, the AOD tag creation
+      
+Runninng options tested: 
+   1) GRID (with/without AliEn plugin)
+   2) LOCAL 
+
+If the AliEn plugin is required, the macro 
+   CreateAlienHandler_FromESDToAOD.C
+can be used, in order to configure the jdl.
+
+AnalysisTrainFromESDToAOD.C is an updated version of the macro AnalysisTrainMuonLocal.C 
+(input file: ESD, output files standard AOD and the AOD tag file)
+The main differences are related to implementations to be compliant with the analysis framework,
+possibility to run on the grid with/without the Alien Plugin and possibility of adding the MC truth in a branch of the AOD.
+
+The macro ReadAOD_MCBranch.C is an example on how to access MC information stored in the AOD.
+   
+===================================================
+  Creation of the MUON-AOD from the standard AOD
+  Roberta ARNALDI, Enrico SCOMPARIN Torino
+---------------------------------------------------------------
+
+Code to produce a muon-AOD, i.e. a replica of the standard AOD containing only events where 
+at least one muon in the dimuon spectrometer is present
+
+1) AnalysisTrainFromStandardToMuonAODLocal.C --> macro to produce the MUON-AOD (it runs locally)
+2) AliAnalysisTaskFromStandardToMuonAOD.h  --> analysis task to replicate the AOD content for interesting events
+3) AliAnalysisTaskFromStandardToMuonAOD.cxx --> analysis task to replicate the AOD content for interesting events
+
+- The input files are the standard AOD and the AOD tag file.
+  The AOD tag file can be created in the previous step from ESD to Standard AOD, using AnalysisTrainMuonLocal.C, or it can be
+  produced on the fly with this macro.
+- Events containing at least one muon in the muon spectrometer can be selected using the AOD tag files.
+- The contents of the MUON-AOD can be defined by the user in the AnalysisTrainFromStandardToMuonAODLocal.C
+  macro with some settings as
+  SetNeedsTracksBranchReplication(), SetNeedsVerticesBranchReplication() 
+  (defined in STEER/AliAODHandler.h)...
 
 ===================================================
   Calculation of the LUT 
@@ -87,3 +141,304 @@ The macro creates the file MUON.TriggerEfficiencyMap.root
 aliroot
 AliMUONTriggerEfficiencyCells effCells("MUON.TriggerEfficiencyMap.root")
 effCells.DisplayEfficiency()
+
+===================================================
+ Analysis task for checking the consistency of ESD and AOD filling and contents.
+ Mercedes LOPEZ NORIEGA, Orsay
+----------------------------------------------------------------
+
+Purpose:check the consistency between the ESDs and the AOD.
+
+The task works locally and on the grid, there are two macros depending where
+you want to run
+
+Files:
+AliAnalysisTaskAODvsESD.cxx   -source files of the analysis task
+AliAnalysisTaskAODvsESD.h
+
+AnalysisTrainMuonComp.C       - macro for analysis on the grid
+AnalysisTrainMuonCompLocal.C  - macro for local analysis
+
+To run the check:
+1. Copy the following packages in the current working directory
+  - STEERBase.par
+  - ESD.par
+  - AOD.par
+  - ANALYSIS.par
+  - ANALYSISalice.par
+  - PWG3muon.par
+
+2. To run locally:
+  root
+  .x AnalysisTrainMuonCompLocal.C
+
+  by default the macro searches for a tag file of ESDs in the 
+  working directory
+
+3. To run on the grid:
+  root
+  .x AnalysisTrainMuonComp.C
+
+  by default the macro searches for a wn.xml in the current directory, with the list
+  of grid files to analyse.
+
+4. Display results:
+The macro creates the file AODvsESDoutput.root
+It contains an Ntuple from the ESDs and Ntuple from the AODs and an inv. mass histo 
+for each case
+
+===================================================
+ Analysis task for extracting variables from the ESD for single muons
+ Nicole BASTID and Bogdan VULPESCU, Clermont-Ferrand
+----------------------------------------------------------------
+
+Purpose: the output is an ntuple with single muon tracks selected variables; a
+histogram collects the number of events in different trigger classes.
+
+Files:
+
+AliAnalysisTaskSingleMuESD.cxx  - source files of the analysis task
+AliAnalysisTaskSingleMuESD.h
+
+RunSingleMuonAnalysisFromESD.C  - macro to run the analysis (with xml input
+                                  collection and grid connection)
+
+
+How to run:
+
+1. Copy the following packages in the current working directory
+  - STEERBase.par
+  - ESD.par
+  - AOD.par
+  - ANALYSIS.par
+  - ANALYSISalice.par
+  - PWG3muon.par
+
+2. Run root
+
+gROOT->LoadMacro("$ALICE_ROOT/PWG3/muon/RunAnalysis.C");
+setupPar("STEERBase"); 
+setupPar("ESD"); 
+setupPar("AOD"); 
+setupPar("ANALYSIS"); 
+setupPar("ANALYSISalice"); 
+setupPar("PWG3muon");
+
+3. To analyse grid files, provide an XML collection file wn.xml and run
+
+gROOT->LoadMacro("$ALICE_ROOT/PWG3/muon/RunSingleMuonAnalysisFromESD.C");
+RunSingleMuonAnalysisFromESD()
+
+4. To analyse local files, modify RunSingleMuonAnalysisFromESD.C
+
+  } else {
+    chain->Add("/path_1_to/AliESDs.root");
+    chain->Add("/path_2_to/AliESDs.root");
+    chain->Add("/path_3_to/AliESDs.root");
+  }
+
+and run (notice the "1" argument)
+
+gROOT->LoadMacro("$ALICE_ROOT/PWG3/muon/RunSingleMuonAnalysisFromESD.C");
+RunSingleMuonAnalysisFromESD(1)
+
+5. Check the results in SingleMuESD.root
+
+Note: for some older runs (PDC08/LHC08t for instance) it is necessary to force 
+the values of the trigger mask, because the function 
+
+GetFiredTriggerClasses()
+
+from AliESDEvent does not return the proper names of the muon trigger classes.
+So one has to un-comment the line
+
+task->SetTriggerType("MUON");
+
+in the macro RunSingleMuonAnalysisFromESD.C, if the simulation was produced 
+with SetMakeTrigger("MUON")
+
+This bug is fixed starting with the TRUNK from 14.11.2008
+
+===================================================
+ Analysis task for RecoCheck analysis of ESD and Kinematics
+ Bogdan VULPESCU, Clermont-Ferrand
+----------------------------------------------------------------
+
+Purpose: the class MUON/AliMUONRecoCheck is used to extract single muon and
+muon pair information in objects of type AliMUONTrackLight and 
+AliMUONPairLight. The output file is RecoCheck.root and contains a tree with
+arrays of both objects.
+
+Files:
+
+AliAnalysisTaskRecoCheck.cxx  - source files of the analysis task
+AliAnalysisTaskRecoCheck.h
+
+RunRecoCheck.C  - macro to run the analysis (with xml input
+                  collection and grid connection)
+
+
+How to run:
+
+1. Run aliroot (not root!, the class is in the muondep library)
+
+2. gROOT->LoadMacro("$ALICE_ROOT/PWG3/muondep/RunRecoCheck.C");
+
+3. RunRecoCheck()
+
+4. To analyse local files, modify RunRecoCheck.C
+
+  } else {
+    chain->Add("/path_1_to/AliESDs.root");
+    chain->Add("/path_2_to/AliESDs.root");
+    chain->Add("/path_3_to/AliESDs.root");
+  }
+
+and run (notice the "1" argument)
+
+RunRecoCheck(1)
+
+5. Check results in RecoCheck.root
+
+Note: the magnetic field is needed in order to initialize the tracker. The
+corresponding field map is selected by looking at the value of the L3 current
+stored in the GRP database which was used for the reconstruction.
+
+===================================================
+ Analysis task to correlate ESD tracks to their corresponding Monte Carlo data.
+ Artur Szostak, INFN
+---------------------------------------------------------------
+
+The AliAnalysisTaskLinkToMC analysis task is used to correlate reconstructed tracks
+found in ESDs to their corresponding MC track information found in the kinematics
+tree. The the same algorithm is used as in MUON/AliMUONRecoCheck but without any
+dependancy on MUON library code. This analysis task will copy out ESD MUON track
+information into the AOD like AliAnalysisTaskESDMuonFilter does, however the MC
+track label in the AOD track class is filled with the label of the corresponding
+MC track. Thus, subsequent analysis tasks can easily find the correct MC track from
+the label.
+
+Files:
+
+AliAnalysisTaskLinkToMC.h    - The header file for the analysis task code.
+AliAnalysisTaskLinkToMC.cxx  - The source file for the analysis task code.
+
+RunLinkToMCAnalysisExample.C - An example macro for running the analysis task in
+  local mode over simulated data. The macro takes one argument which is the name
+  of the ESD file to process. By default it uses AliESDs.root in the current working
+  directory.
+
+PlotEfficiency.C  - This macro can be used to quickly check the control histograms
+  which are generated by RunLinkToMCAnalysisExample.C by default. The macro simply
+  calculates the reconstruction efficiency from the found and findable track histograms
+  that are filled by the analysis task.
+
+How to run:
+
+To run the analysis task in local mode with the example macro simply run the command
+ $ root RunLinkToMCAnalysisExample.C\(\"AliESDs.root\"\)
+where AliESDs.root can be replaced with the full path and name of the appropriate ESD
+file you wish to process. This command can also be run via AliRoot.
+
+
+===================================================
+ Analysis task to create mixed AOD events, containing a 
+ pair of muon tracks coming from two different real AOD events.
+ Alessandro De Falco and Antonio Uras, INFN Cagliari 
+---------------------------------------------------------------
+
+IMPORTANT: The AliAnalysisTaskCreateMixedDimuons analysis task needs
+           the class AliEventPoolMuon.
+
+In class AliEventPoolMuon the definition of the pools to be used 
+in the mixing is implemented. Up to now, it is possible to create 
+pools diving events by:
+ - total multiplicity
+ - forward muons multiplicity
+ - z-position of the primary vertex
+
+In class AliAnalysisTaskCreateMixedDimuons the mixing is performed between
+each pair of events which can be built up picking events from the internal 
+buffer: if the buffer contains n events, n(n-1)/2 mixed events are created 
+within the same call of the task.
+
+Some more details:
+ - the mixing task asks a completely fresh buffer for each call
+ - the mixing task creates output events from scratch
+ - output events are filled with two muon tracks (picked randomly
+   from the events being mixed and a vertex having its z-position in the middle
+   of the z-vertex bin defining the pool. Due to technical reasons,
+   the tracks are NOT connected with the vertex
+ - standard AOD are created as output, nearly completely empty
+
+Files:
+
+AliAnalysisTaskCreateMixedDimuons.(h,cxx)  - The analysis task class.
+AliEventPoolMuon.(h,cxx)                   - The class implementing the pool.
+
+AnalysisTrainCreateMixedDimuons.C - An example macro enabling connections between
+the pool manager, the input event handler, the input and output containers, 
+via the Analysis Manager. Input arguments: - directory containing AOD tag file
+                                           - name of the output file
+                                           - number of events to be loaded
+                                             in the internal buffer
+
+How to run:
+
+To run the analysis task in local mode with the example macro, simply run
+the AnalysisTrainCreateMixedDimuons.C macro (without compiling it) with 
+appropriate arguments.
+
+===============================================================================
+Analysis Task for (di)muons continuum from heavy flavors
+X. M. Zhang, Clermont-Ferrand and Wuhan
+===============================================================================
+1) AliAnalysisTaskSEMuonsHF.h (.cxx) -- analysis class for (di)muons continuum
+   from heavy flavors.
+2) AliMuonsHFHeader.h (.cxx) -- class used to collect and save the information
+   at event level (eg. vertex position and trigger mask).
+3) AliAODMuonTrack.h (.cxx) -- class used to extract and save information of
+   reconstracted muon tracks (from both AOD and ESD), selection the muon with
+   the set cuts.
+4) AliAODMuonPair.h (.cxx) -- class used to extract and save information of
+   muon pairs (both for like-sign and unlike-sign), the corresponding two
+   single muon tracks are linked by TRef.
+5) AliMCMuonTrack.h (.cxx) -- inherit from AliAODMuonTrack, class used to
+   extract and save the Monte-Carlo information of reconstracted muon tracks,
+   the generated kinematics and the history of the muon are filled in this
+   class.
+6) AliMCMuonPair.h (.cxx) -- inherit from AliAODMuonPair, class used to
+   extract and save the information of muon pair at Monte-Carlo level, the
+   relation between two muons can be obtain from this class.
+
+- the input of AOD and ESD are detected automatically.
+- three analysis modes:
+  mode0, analyze both single muon and dimuon
+  mode1, analyze only the single muon
+  mode2, analyze only the dimuon
+- two kinds of outputs:
+  - histogram, histograms for single muon and/or dimuon will be outputed
+    according to different running mode. Events with unreconstructed vertex
+    are discarded, cuts are set for (di)muons selection.
+  - tree, if flag for output tree switch on, tree with braches of event header
+    and/or single muon and/or dimuon will be gotten according to different
+    running mode. All events and all recontructed tracks are used to fill the
+    tree.
+- running with and without MC information:
+  - without MC information, AliAODMuonTrack and/or AliAODMuonPair are/is used
+    and filled in the tree (if switch on), output the histograms just with
+    reconstructed information.
+  - with MC information, AliMCMuonTrack and/or AliMCMuonPair are/is used and
+    filled in the tree (if switch on), additional histograms for different
+    single muon and/or dimuon source are outputed.
+  - at present the methods used to get the MC information from ESD is not
+    implemented for they depend on the MUON module. Although, we still keep
+    these codes in AliMCMuonTrack for private running, more details can be
+    found in AliMCMuonTrack.cxx 
+- all the flags and cuts are set in AddTaskMuonsHF.C
+    Int_t mode = 0;          \\ = 0 analyze both single muon and dimuon
+                             \\ = 1 analyze the single muon only
+                             \\ = 2 analyze the dimuon only
+    Bool_t isMC = kTRUE;     \\ get MC information
+    Bool_t isTree = kFALSE;  \\ flag for tree output
+    AliAnalysisTaskSEMuonsHF *taskMuonsHF = AddTaskMuonsHF(mode, isMC, isTree);