]>
Commit | Line | Data |
---|---|---|
745d6088 | 1 | void run(Char_t* data, Long64_t nRuns = -1, Long64_t offset = 0, Bool_t aDebug = kFALSE, Int_t aProof = 0, Bool_t mc = kTRUE, const char* option = "") |
a9017e49 | 2 | { |
745d6088 | 3 | // aProof option: 0 no proof |
4 | // 1 proof with chain | |
5 | // 2 proof with dataset | |
6 | ||
7 | if (nRuns < 0) | |
8 | nRuns = 1234567890; | |
9 | ||
a9017e49 | 10 | if (aProof) |
11 | { | |
69b09e3b | 12 | TProof::Open("alicecaf"); |
13 | //gProof->SetParallel(1); | |
a9017e49 | 14 | |
15 | // Enable the needed package | |
dca331bb | 16 | if (1) |
17 | { | |
18 | gProof->UploadPackage("$ALICE_ROOT/STEERBase"); | |
19 | gProof->EnablePackage("$ALICE_ROOT/STEERBase"); | |
20 | gProof->UploadPackage("$ALICE_ROOT/ESD"); | |
21 | gProof->EnablePackage("$ALICE_ROOT/ESD"); | |
22 | gProof->UploadPackage("$ALICE_ROOT/AOD"); | |
23 | gProof->EnablePackage("$ALICE_ROOT/AOD"); | |
24 | gProof->UploadPackage("$ALICE_ROOT/ANALYSIS"); | |
25 | gProof->EnablePackage("$ALICE_ROOT/ANALYSIS"); | |
26 | gProof->UploadPackage("$ALICE_ROOT/ANALYSISalice"); | |
27 | gProof->EnablePackage("$ALICE_ROOT/ANALYSISalice"); | |
28 | } | |
29 | else | |
30 | { | |
69b09e3b | 31 | gProof->UploadPackage("$ALICE_ROOT/AF-v4-16"); |
32 | gProof->EnablePackage("$ALICE_ROOT/AF-v4-16"); | |
dca331bb | 33 | } |
745d6088 | 34 | |
35 | gProof->UploadPackage("$ALICE_ROOT/PWG0base"); | |
36 | gProof->EnablePackage("$ALICE_ROOT/PWG0base"); | |
a9017e49 | 37 | } |
38 | else | |
39 | { | |
40 | gSystem->Load("libVMC"); | |
41 | gSystem->Load("libTree"); | |
42 | gSystem->Load("libSTEERBase"); | |
43 | gSystem->Load("libESD"); | |
dca331bb | 44 | gSystem->Load("libAOD"); |
a9017e49 | 45 | gSystem->Load("libANALYSIS"); |
dca331bb | 46 | gSystem->Load("libANALYSISalice"); |
a9017e49 | 47 | gSystem->Load("libPWG0base"); |
48 | } | |
49 | ||
a9017e49 | 50 | // Create the analysis manager |
dca331bb | 51 | mgr = new AliAnalysisManager; |
a9017e49 | 52 | |
69b09e3b | 53 | AliPWG0Helper::AnalysisMode analysisMode = AliPWG0Helper::kSPD; |
a2cdb42c | 54 | AliPWG0Helper::Trigger trigger = AliPWG0Helper::kMB1; |
55 | ||
56 | AliPWG0Helper::PrintConf(analysisMode, trigger); | |
a9017e49 | 57 | |
58 | TString taskName("AliMultiplicityTask.cxx+"); | |
59 | if (aDebug) | |
60 | taskName += "+g"; | |
61 | ||
62 | // Create, add task | |
745d6088 | 63 | if (aProof > 0) { |
a9017e49 | 64 | gProof->Load(taskName); |
65 | } else | |
66 | gROOT->Macro(taskName); | |
67 | ||
2fa65f52 | 68 | task = new AliMultiplicityTask(option); |
f3eb27f6 | 69 | |
70 | if (analysisMode != AliPWG0Helper::kSPD) | |
71 | { | |
72 | // selection of esd tracks | |
73 | gROOT->ProcessLine(".L ../CreateStandardCuts.C"); | |
74 | AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(analysisMode); | |
75 | if (!esdTrackCuts) | |
76 | { | |
77 | printf("ERROR: esdTrackCuts could not be created\n"); | |
78 | return; | |
79 | } | |
80 | ||
81 | task->SetTrackCuts(esdTrackCuts); | |
82 | } | |
69b09e3b | 83 | else |
84 | task->SetDeltaPhiCut(0.05); | |
f3eb27f6 | 85 | |
745d6088 | 86 | task->SetAnalysisMode(analysisMode); |
a2cdb42c | 87 | task->SetTrigger(trigger); |
2fa65f52 | 88 | |
89 | if (mc) | |
90 | task->SetReadMC(); | |
91 | ||
f3eb27f6 | 92 | //task->SetUseMCVertex(); |
93 | ||
a9017e49 | 94 | mgr->AddTask(task); |
95 | ||
69b09e3b | 96 | TString optionStr(option); |
97 | ||
2fa65f52 | 98 | if (mc) { |
99 | // Enable MC event handler | |
100 | AliMCEventHandler* handler = new AliMCEventHandler; | |
69b09e3b | 101 | if (!optionStr.Contains("particle-efficiency")) |
102 | handler->SetReadTR(kFALSE); | |
2fa65f52 | 103 | mgr->SetMCtruthEventHandler(handler); |
104 | } | |
a9017e49 | 105 | |
dca331bb | 106 | // pt study |
dca331bb | 107 | if (optionStr.Contains("pt-spectrum-func")) |
108 | { | |
69b09e3b | 109 | TF1* func = new TF1("func", "1", 0, 0.2); |
110 | //TF1* func = new TF1("func", "1.5 - x / 0.2 * 0.5", 0, 0.2); | |
111 | //TF1* func = new TF1("func", "1.25 - x / 0.2 * 0.25", 0, 0.2); | |
112 | //TF1* func = new TF1("func", "0.75 + x / 0.2 * 0.25", 0, 0.2); | |
113 | hist = func->GetHistogram(); | |
dca331bb | 114 | //new TCanvas; func->Draw(); |
115 | //inputList.Add(func->GetHistogram()->Clone("pt-spectrum")); | |
116 | ||
dca331bb | 117 | new TCanvas; hist->Draw(); |
69b09e3b | 118 | task->SetPtSpectrum((TH1D*) hist->Clone("pt-spectrum")); |
dca331bb | 119 | } |
120 | ||
a9017e49 | 121 | // Add ESD handler |
122 | AliESDInputHandler* esdH = new AliESDInputHandler; | |
69b09e3b | 123 | esdH->SetInactiveBranches("AliESDACORDE FMD ALIESDTZERO ALIESDZDC AliRawDataErrorLogs CaloClusters Cascades EMCALCells EMCALTrigger ESDfriend Kinks AliESDTZERO ALIESDACORDE MuonTracks TrdTracks"); |
a9017e49 | 124 | mgr->SetInputEventHandler(esdH); |
125 | ||
126 | // Attach input | |
861795a8 | 127 | cInput = mgr->GetCommonInputContainer(); |
a9017e49 | 128 | mgr->ConnectInput(task, 0, cInput); |
129 | ||
130 | // Attach output | |
131 | cOutput = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer); | |
132 | //cOutput->SetDataOwned(kTRUE); | |
133 | mgr->ConnectOutput(task, 0, cOutput); | |
134 | ||
135 | // Enable debug printouts | |
136 | if (aDebug) | |
137 | mgr->SetDebugLevel(2); | |
138 | ||
139 | // Run analysis | |
140 | mgr->InitAnalysis(); | |
141 | mgr->PrintStatus(); | |
745d6088 | 142 | |
143 | if (aProof == 2) | |
144 | { | |
145 | // process dataset | |
146 | ||
147 | mgr->StartAnalysis("proof", data, nRuns, offset); | |
148 | } | |
69b09e3b | 149 | else if (aProof == 3) |
150 | { | |
151 | gROOT->ProcessLine(".L CreateChainFromDataSet.C"); | |
152 | ds = gProof->GetDataSet(data)->GetStagedSubset(); | |
153 | chain = CreateChainFromDataSet(ds); | |
154 | mgr->StartAnalysis("local", chain, nRuns, offset); | |
155 | } | |
745d6088 | 156 | else |
157 | { | |
158 | // Create chain of input files | |
159 | gROOT->LoadMacro("../CreateESDChain.C"); | |
160 | chain = CreateESDChain(data, nRuns, offset); | |
161 | ||
162 | mgr->StartAnalysis((aProof > 0) ? "proof" : "local", chain); | |
163 | } | |
a9017e49 | 164 | } |