]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/muondep/RunMuonResolution.C
Update of DAs to use Monitoring Bit,
[u/mrichter/AliRoot.git] / PWG3 / muondep / RunMuonResolution.C
CommitLineData
7cbb1928 1//--------------------------------------------------------------------------
2// Base macro for submitting muon Resolution analysis.
3//
4// In case it is not run with full aliroot, it needs the following libraries:
5// - libSTEERBase.so
6// - libESD.so
7// - libAOD.so
8// - libANALYSIS.so
9// - libANALYSISalice.so
10// - libGui.so
11// - libMinuit.so
12// - libProofPlayer.so
13// - libXMLParser.so
14// - libRAWDatabase.so
15// - libCDB.so
16// - libSTEER.so
17// - libMUONcore.so
18// - libMUONmapping.so
19// - libMUONcalib.so
20// - libMUONgeometry.so
21// - libMUONtrigger.so
22// - libMUONraw.so
23// - libMUONbase.so
24// - libMUONrec.so
25// - libCORRFW.so
ce874155 26// - libPWG3base.so
7cbb1928 27// - libPWG3muondep.so
28//
00612ffc 29// It also needs to load magnetic field, mapping, geometry (+alignment), and reconstruction parameters from the OCDB
30//
31// The task reads ESDs
32// Intermediate results are stored in a file chamberResolution_step<#step>.root
33// Final results are stored in the file results.root
7cbb1928 34//
35// Author: Philippe Pillot - SUBATECH Nantes
36//--------------------------------------------------------------------------
37
00612ffc 38void LoadAlirootLocally(TString& extraLibs);
7cbb1928 39
00612ffc 40//______________________________________________________________________________
41void RunMuonResolution(TString smode = "local", TString inputFileName = "AliESDs.root",
42 TString alirootVersion = "VO_ALICE@AliRoot::v4-20-12-AN", Int_t nSteps = 5,
43 Bool_t selectPhysics = kFALSE, Bool_t selectTrigger = kFALSE, Bool_t matchTrig = kTRUE,
44 Bool_t applyAccCut = kTRUE, Double_t minMomentum = 0., Bool_t correctForSystematics = kTRUE,
45 Int_t extrapMode = 1, Int_t nevents = 1234567890)
7cbb1928 46{
47 /// Compute the cluster resolution by studying cluster-track residual, deconvoluting from track resolution
00612ffc 48 /// - smode = "local" or "proof"
49 /// - inputFileName = an ESD root file or a list of ESDs or a collection of ESDs or a dataset in proof mode
50 /// - alirootVersion = version of aliroot package to enable on AAF (only used in proof mode)
51 /// - nSteps = number of times to task is run (at each step it starts with the chamber resolution obtained in the previous one)
52 /// - selectPhysics : apply or not the physics selection
53 /// - selectTrigger : select only muon trigger events or not (the type of trigger can eventually be changed)
54 /// - matchTrigger : select only the tracks matching the trigger or not
55 /// - applyAccCut : select only the tracks passing the Rabs and the eta cut or not
56 /// - minMomentum : select only the tracks with a total momentum above this value
57 /// - if correctForSystematics == kTRUE: the systematic shifts of the residuals is included in the resolution
58 /// - if extrapMode == 0: extrapolate from the closest cluster
59 /// - if extrapMode == 1: extrapolate from the previous cluster except between stations 2-3-4
60 /// - nevents = maximum number of processed events
61
62 // Load libraries locally
ce874155 63 TString extraLibs = "RAWDatabase:CDB:STEER:MUONcore:MUONmapping:MUONcalib:MUONgeometry:MUONtrigger:MUONraw:MUONbase:MUONrec:CORRFW:PWG3base:PWG3muondep";
00612ffc 64 LoadAlirootLocally(extraLibs);
65
66 // compile analysis macro locally
67 gROOT->LoadMacro("$ALICE_ROOT/PWG3/muondep/MuonResolution.C++g");
68 MuonResolution(smode, inputFileName, alirootVersion, nSteps, selectPhysics, selectTrigger, matchTrig,
69 applyAccCut, minMomentum, correctForSystematics, extrapMode, nevents, extraLibs);
7cbb1928 70
00612ffc 71}
72
73//______________________________________________________________________________
74void LoadAlirootLocally(TString& extraLibs)
75{
76 /// Load libraries locally
7cbb1928 77
00612ffc 78 // Load common libraries
7cbb1928 79 gSystem->Load("libVMC");
00612ffc 80 gSystem->Load("libTree.so");
81 gSystem->Load("libPhysics.so");
82 gSystem->Load("libMinuit.so");
83 gSystem->Load("libXMLParser.so");
84 gSystem->Load("libGui.so");
7cbb1928 85 gSystem->Load("libSTEERBase");
86 gSystem->Load("libESD");
87 gSystem->Load("libAOD");
88 gSystem->Load("libANALYSIS");
89 gSystem->Load("libANALYSISalice");
90
91 // Load additional libraries
92 gSystem->Load("libProofPlayer");
7cbb1928 93 TObjArray* libs = extraLibs.Tokenize(":");
94 for (Int_t i = 0; i < libs->GetEntriesFast(); i++)
95 gSystem->Load(Form("lib%s",static_cast<TObjString*>(libs->UncheckedAt(i))->GetName()));
00612ffc 96 delete libs;
7cbb1928 97
00612ffc 98 // Load lib for final mchview display
99 gSystem->Load("libMUONgraphics");
7cbb1928 100
ce874155 101 // Add AliRoot includes to compile the macro
00612ffc 102 gROOT->ProcessLine(".include $ALICE_ROOT/include");
103 gROOT->ProcessLine(".include $ALICE_ROOT/MUON");
104 gROOT->ProcessLine(".include $ALICE_ROOT/MUON/mapping");
105 gROOT->ProcessLine(".include $ALICE_ROOT/ANALYSIS/macros");
7cbb1928 106
7cbb1928 107}
108