2 // Macro designed for use with the AliAnalysisTaskDptDptCorrelations task.
4 // Author: Claude Pruneau & Prabhat Pujahari, Wayne State
6 // system: 0: PbPb 1: pp
7 // singlesOnly: 0: full correlations 1: singles only
8 // useWeights: 0: no 1: yes
9 // centralityMethod: 3: track count 4: V0 centrality
10 // chargeSet: 0: ++ 1: +- 2: -+ 3: --
11 /////////////////////////////////////////////////////////////////////////////////
12 AliAnalysisTaskDptDptCorrelations *AddTaskDptDptCorrelations2010(int system = 0,
15 int centralityMethod = 4,
18 // Set Default Configuration of this analysis
19 // ==========================================
22 int rejectPairConversion = 1;
27 double minCentrality[10];
28 double maxCentrality[10];
30 if (system==0) // PbPb
32 if (centralityMethod == 4)
35 minCentrality[0] = 0.5; maxCentrality[0] = 5.0;
36 minCentrality[1] = 5.0; maxCentrality[1] = 10.;
37 minCentrality[2] = 10.; maxCentrality[2] = 20.;
38 minCentrality[3] = 20.; maxCentrality[3] = 30.;
39 minCentrality[4] = 30.; maxCentrality[4] = 40.;
40 minCentrality[5] = 40.; maxCentrality[5] = 50.;
41 minCentrality[6] = 50.; maxCentrality[6] = 60.;
42 minCentrality[7] = 60.; maxCentrality[7] = 70.;
43 minCentrality[8] = 70.; maxCentrality[8] = 80.;
44 minCentrality[9] = 80.; maxCentrality[9] = 90.;
49 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
53 else if (system==1) // pp
55 if (centralityMethod == 3)
58 minCentrality[0] = 2; maxCentrality[0] = 100.0;
59 minCentrality[1] = 2; maxCentrality[1] = 20.;
60 minCentrality[2] = 20.; maxCentrality[2] = 50.;
61 minCentrality[3] = 50.; maxCentrality[3] = 100.;
65 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
71 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". Option NOT CURRENTLY AVAILABLE. ABORT."
81 double dcaZMin = -3.0;
83 double dcaXYMin = -3.0;
84 double dcaXYMax = 3.0;
86 double dedxMax = 20000.0;
88 int trackFilterBit = 128;
90 int requestedCharge1 = 1; //default
91 int requestedCharge2 = -1; //default
94 // Get the pointer to the existing analysis manager via the static access method.
95 // ==============================================================================
96 AliAnalysisManager *analysisManager = AliAnalysisManager::GetAnalysisManager();
100 ::Error("AddTaskDptDptCorrelations2010", "No analysis manager to connect to.");
107 TString prefixName = "Corr_";
108 TString pileupRejecSuffix = "_PileupRejec";
109 TString pairRejecSuffix = "_PairRejec";
110 TString calibSuffix = "_calib";
111 TString singlesOnlySuffix = "_SO";
114 TString inputPath = ".";
115 TString outputPath = ".";
119 TString inputHistogramFileName;
120 TString outputHistogramFileName;
122 // Create the task and add subtask.
123 // ===========================================================================
124 int iTask = 0; // task counter
125 AliAnalysisDataContainer *taskInputContainer;
126 AliAnalysisDataContainer *taskOutputContainer;
127 AliAnalysisTaskDptDptCorrelations* task;
129 for (int iCentrality=0; iCentrality < nCentrality; ++iCentrality)
133 case 0: part1Name = "P_"; part2Name = "P_"; requestedCharge1 = 1; requestedCharge2 = 1; sameFilter = 1; break;
134 case 1: part1Name = "P_"; part2Name = "M_"; requestedCharge1 = 1; requestedCharge2 = -1; sameFilter = 0; break;
135 case 2: part1Name = "M_"; part2Name = "P_"; requestedCharge1 = -1; requestedCharge2 = 1; sameFilter = 0; break;
136 case 3: part1Name = "M_"; part2Name = "M_"; requestedCharge1 = -1; requestedCharge2 = -1; sameFilter = 1; break;
138 //part1Name += int(1000*etaMin);
140 part1Name += int(1000*etaMax);
142 part1Name += int(1000*ptMin);
144 part1Name += int(1000*ptMax);
146 //part2Name += int(1000*etaMin);
148 part2Name += int(1000*etaMax);
150 part2Name += int(1000*ptMin);
152 part2Name += int(1000*ptMax);
155 eventName += int(10.*minCentrality[iCentrality] );
157 eventName += int(10.*maxCentrality[iCentrality] );
159 //eventName += int(10*zMin );
161 //eventName += int(10*zMax );
162 //if (rejectPileup) eventName += pileupRejecSuffix;
163 //if (rejectPairConversion) eventName += pairRejecSuffix;
164 baseName = prefixName;
165 baseName += part1Name;
166 baseName += part2Name;
167 baseName += eventName;
171 inputHistogramFileName = "alien:///alice/cern.ch/user/p/prabhat/CalibFiles/PbPb276Calibration_2010.root";
172 outputHistogramFileName = baseName;
173 if (singlesOnly) outputHistogramFileName += singlesOnlySuffix;
174 outputHistogramFileName += ".root";
176 /* cout << "============================================================" << endl;
177 cout << " iTask: " << iTask << endl;
178 cout << " Task Name: " << taskName << endl;
179 cout << " List Name: " << listName << endl;
180 cout << " inputHistogramFileName: " << inputHistogramFileName << endl;
181 cout << " outputHistogramFileName: " << outputHistogramFileName << endl;
182 cout << " system: " << system << endl;
183 cout << " singlesOnly: " << singlesOnly << endl;
184 cout << " using weights: " << useWeights << endl;
185 cout << " centralityMethod: " << centralityMethod << endl;
186 cout << " chargeSet: " << chargeSet << endl;
187 cout << " debugLevel: " << debugLevel << endl;
188 cout << " rejectPileup: " << rejectPileup << endl;
189 cout << " rejectPairConversion: " << rejectPairConversion << endl;
190 cout << " sameFilter: " << sameFilter << endl;
191 cout << " zMin: " << zMin << endl;
192 cout << " zMax: " << zMax << endl;
193 cout << " ptMin: " << ptMin << endl;
194 cout << " ptMax: " << ptMax << endl;
195 cout << " etaMin: " << etaMin << endl;
196 cout << " etaMax: " << etaMax << endl;
197 cout << " dcaZMin: " << dcaZMin << endl;
198 cout << " dcaZMax: " << dcaZMax << endl;
199 cout << " dcaXYMin: " << dcaXYMin << endl;
200 cout << " dcaXYMax: " << dcaXYMax << endl;
201 cout << " dedxMin: " << dedxMin << endl;
202 cout << " dedxMax: " << dedxMax << endl;
203 cout << " nClusterMin: " << nClusterMin << endl;
204 cout << " trackFilterBit: " << trackFilterBit << endl;
205 cout << " requestedCharge1: " << requestedCharge1 << endl;
206 cout << " requestedCharge2: " << requestedCharge2 << endl;
207 cout << "============================================================" << endl;
210 TFile * inputFile = 0;
211 TList * histoList = 0;
216 TGrid::Connect("alien:");
217 inputFile = TFile::Open(inputHistogramFileName,"OLD");
220 cout << "Requested file:" << inputHistogramFileName << " was not opened. ABORT." << endl;
223 TString nameHistoBase = "correction_";
225 nameHistoBase += eventName;
226 if (requestedCharge1 == 1)
228 nameHisto = nameHistoBase + "_p";
229 cout << "Input Histogram named: " << nameHisto << endl;
230 weight_1 = (TH3F *) inputFile->Get(nameHisto);
234 nameHisto = nameHistoBase + "_m";
235 cout << "Input Histogram named: " << nameHisto << endl;
236 weight_1 = (TH3F *) inputFile->Get(nameHisto);
240 cout << "Requested histogram 'correction_p/m' was not found. ABORT." << endl;
247 if (requestedCharge2 == 1)
249 nameHisto = nameHistoBase + "_p";
250 cout << "Input Histogram named: " << nameHisto << endl;
251 weight_2 = (TH3F *) inputFile->Get(nameHisto);
255 nameHisto = nameHistoBase + "_m";
256 cout << "Input Histogram named: " << nameHisto << endl;
257 weight_2 = (TH3F *) inputFile->Get(nameHisto);
261 cout << "Requested histogram 'correction_p/m' was not found. ABORT." << endl;
266 task = new AliAnalysisTaskDptDptCorrelations(taskName);
268 task->SetDebugLevel( debugLevel );
269 task->SetSameFilter( sameFilter );
270 task->SetSinglesOnly( singlesOnly );
271 task->SetUseWeights( useWeights );
272 task->SetRejectPileup( rejectPileup );
273 task->SetRejectPairConversion(rejectPairConversion);
274 task->SetVertexZMin( zMin );
275 task->SetVertexZMax( zMax );
276 task->SetVertexXYMin( -1. );
277 task->SetVertexXYMax( 1. );
278 task->SetCentralityMethod( centralityMethod);
279 task->SetCentrality( minCentrality[iCentrality], maxCentrality[iCentrality]);
280 task->SetPtMin1( ptMin );
281 task->SetPtMax1( ptMax );
282 task->SetEtaMin1( etaMin );
283 task->SetEtaMax1( etaMax );
284 task->SetPtMin2( ptMin );
285 task->SetPtMax2( ptMax );
286 task->SetEtaMin2( etaMin );
287 task->SetEtaMax2( etaMax );
288 task->SetDcaZMin( dcaZMin );
289 task->SetDcaZMax( dcaZMax );
290 task->SetDcaXYMin( dcaXYMin );
291 task->SetDcaXYMax( dcaXYMax );
292 task->SetDedxMin( dedxMin );
293 task->SetDedxMax( dedxMax );
294 task->SetNClusterMin( nClusterMin );
295 task->SetTrackFilterBit( trackFilterBit );
296 task->SetRequestedCharge_1( requestedCharge1);
297 task->SetRequestedCharge_2( requestedCharge2);
298 task->SetWeigth_1( weight_1 );
299 task->SetWeigth_2( weight_2 );
302 cout << "Creating task output container" << endl;
303 taskOutputContainer = analysisManager->CreateContainer(listName,
305 AliAnalysisManager::kOutputContainer,
306 Form("%s:Histos", AliAnalysisManager::GetCommonFileName()));
307 cout << "Add task to analysis manager and connect it to input and output containers" << endl;
308 analysisManager->AddTask(task);
309 analysisManager->ConnectInput( task, 0, analysisManager->GetCommonInputContainer());
310 analysisManager->ConnectOutput(task, 0, taskOutputContainer );
311 cout << "Task added ...." << endl;