]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/DPhi/MuonHadron/RunAnalysisTaskMuonHadronCorrelations.C
modified Azimuthal HBT analysis (Vera R. Loggins <veraloggins@wayne.edu>)
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / MuonHadron / RunAnalysisTaskMuonHadronCorrelations.C
CommitLineData
07c2615a 1Bool_t RunAnalysisTaskMuonHadronCorrelations(Int_t runNumber = 188362, const char * runMode="full", TString centMethod="V0M") {
2
3 TString rootVersion = "v5-34-02-1";
4 TString alirootVersion = "v5-04-22-AN";
5 gSystem->AddIncludePath("-I$ALICE_ROOT/include ");
6
7 gSystem->Load("libTree.so") ;
8 gSystem->Load("libGeom.so") ;
9 gSystem->Load("libVMC.so") ;
10 gSystem->Load("libMinuit.so") ;
11 gSystem->Load("libPhysics.so") ;
12 gSystem->Load("libSTEERBase.so") ;
13 gSystem->Load("libESD.so") ;
14 gSystem->Load("libAOD.so") ;
15 gSystem->Load("libANALYSIS.so") ;
16 gSystem->Load("libOADB.so") ;
17 gSystem->Load("libANALYSISalice.so") ;
18 gSystem->Load("libCORRFW.so") ;
19 gSystem->Load("libPWGmuon.so") ;
20
21 // -------------------------------
22 // ANALYSIS MANAGER
23 // -------------------------------
24
25 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
26 if (mgr) delete mgr;
27 mgr = new AliAnalysisManager("AM","Analysis Manager");
28
29 // -------------------------------
30 // INPUT EVENT HANDLER
31 // -------------------------------
32
33 AliAODInputHandler* inputHandler = new AliAODInputHandler();
34 mgr->SetInputEventHandler(inputHandler);
35
36 // -------------------------------
37 // ANALYSIS PLUGIN CONFIGURATION
38 // -------------------------------
39
40 AliAnalysisAlien *analysisPlugin = new AliAnalysisAlien();
41 if (!analysisPlugin) { Printf("Error : analysisPlugin is null !!!"); return kFALSE; }
42 analysisPlugin->SetAPIVersion("V1.1x");
43 //analysisPlugin->SetROOTVersion(rootVersion.Data());
44 analysisPlugin->SetAliROOTVersion(alirootVersion.Data());
45 analysisPlugin->SetExecutableCommand("aliroot -b -q");
46
47 // Overwrite all generated files, datasets and output results from a previous session
48 analysisPlugin->SetOverwriteMode();
49 // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
50 analysisPlugin->SetRunMode(runMode); // VERY IMPORTANT
51
52 analysisPlugin->SetAdditionalRootLibs("CORRFW");
53 analysisPlugin->SetAdditionalRootLibs("PWGmuon");
54
55 // -------------------------------
56 // GRID CONFIG
57 // -------------------------------
58
59 // Location of Data
60 analysisPlugin->SetGridDataDir("/alice/data/2012/LHC12g");
61 analysisPlugin->SetDataPattern("*ESDs/pass2/AOD/*/AliAOD.root");
62 analysisPlugin->SetRunPrefix("000"); // real data
63
64 analysisPlugin->AddRunNumber(runNumber);
65
66 // Define alien work directory where all files will be copied. Relative to alien $HOME.
67 // analysisPlugin->SetGridWorkingDir("LHC11h_MUON");
68 analysisPlugin->SetGridWorkingDir("MuonHadronCorrelations_LHC12g");
69
70 // Declare alien output directory. Relative to working directory.
71 analysisPlugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
72
73 // Declare the analysis source files names separated by blancs. To be compiled runtime
74 // using ACLiC on the worker nodes.
75 analysisPlugin->SetAnalysisSource("AliAnalysisTaskMuonHadronCorrelations.cxx");
76
77 // Declare all libraries (other than the default ones for the framework. These will be
78 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
79 analysisPlugin->SetAdditionalLibs("libCORRFW.so libPWGmuon.so AliAnalysisTaskMuonHadronCorrelations.h AliAnalysisTaskMuonHadronCorrelations.cxx");
80
81 analysisPlugin->AddIncludePath("-I.");
82
83 //les repertoires individuels d'output des jobs sur la grille ont comme nom le numero du run
84 analysisPlugin->SetOutputToRunNo();
85
86 // Optionally define the files to be archived.
87 // analysisPlugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
88 // analysisPlugin->SetOutputArchive("log_archive.zip:stdout,stderr");
89
90 // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
91 analysisPlugin->SetAnalysisMacro("MuonHadronCorr.C");
92
93 // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
94 // analysisPlugin->SetSplitMaxInputFileNumber(20);
95 analysisPlugin->SetSplitMaxInputFileNumber(40);
96 // Number of runs per master job
97 analysisPlugin->SetNrunsPerMaster(1);
98
99 // Optionally modify the executable name (default analysis.sh)
100 analysisPlugin->SetExecutable("MuonHadronCorr.sh");
101
102 // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
103 // analysisPlugin->SetMaxInitFailed(5);
104
105 // Optionally resubmit threshold.
106 // analysisPlugin->SetMasterResubmitThreshold(90);
107
108 // Optionally set time to live (default 30000 sec)
109 analysisPlugin->SetTTL(30000);
110 // Optionally set input format (default xml-single)
111 analysisPlugin->SetInputFormat("xml-single");
112 // Optionally modify the name of the generated JDL (default analysis.jdl)
113 analysisPlugin->SetJDLName("MuonHadronCorr.jdl");
114 // Optionally modify job price (default 1)
115 analysisPlugin->SetPrice(1);
116 // Optionally modify split mode (default 'se')
117 analysisPlugin->SetSplitMode("se");
118
119 analysisPlugin->SetNtestFiles(5);
120 // analysisPlugin->SetMergeViaJDL(1);
121 analysisPlugin->SetOverwriteMode(kTRUE);
122
123 mgr->SetGridHandler(analysisPlugin);
124
125 // -------------------------------
126 // PHYSICS SELECTION
127 // -------------------------------
128 // gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
129 // AddTaskPhysicsSelection(0);
130 mgr->AddStatisticsTask(AliVEvent::kAny);
131
132 // -------------------------------
133 // MUON TRACK CUTS CONFIGURATION
134 // -------------------------------
135
136 gROOT->LoadMacro("AliAnalysisTaskMuonHadronCorrelations.cxx++g");
137 AliAnalysisTaskMuonHadronCorrelations *task = new AliAnalysisTaskMuonHadronCorrelations("AliAnalysisTaskMuonHadronCorrelations");
138
07c2615a 139 // Set analysis cuts
140 task->SetFilterBitCentralBarrel(7); // -> 128
141 task->SetMaxEtaCentralBarrel(1.0);
142 task->SetTriggerMatchLevelMuon(1);
143
6de71f1d 144 const Int_t nBinCent = 4;
145 Double_t centLimits[nBinCent+1] = {0., 20., 40, 60., 100.};
07c2615a 146 task->SetCentBinning(nBinCent, centLimits);
147
07c2615a 148 task->SetCentMethod(centMethod);
149
150 const Int_t nBinPt = 3;
151 Double_t ptLimits[nBinPt+1] = {0., 1., 2., 4.};
152 task->SetPtBinning(nBinPt, ptLimits);
153
154 mgr->AddTask(task);
155
156 // create output container
157 AliAnalysisDataContainer *output1 = mgr->CreateContainer("list", TList::Class(), AliAnalysisManager::kOutputContainer, "MuonHadronCorrelations.root");
158
159 // finaly connect input and output
160 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
161 mgr->ConnectOutput(task, 1, output1);
162
163 TStopwatch timer;
164 timer.Start();
165 // -------------------------------
166 // RUN ANALYSIS
167 // -------------------------------
168 mgr->InitAnalysis();
169 mgr->PrintStatus();
170
171 mgr->StartAnalysis("grid");
172
173 timer.Stop();
174 timer.Print();
175 return kTRUE;
176
177};