2 // Macro designed for use with the AliAnalysisTaskDptDptCorrelations task.
4 // Author: Prabhat Pujahari & Claude Pruneau, 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,
17 int trackFilterBit = 128,
24 // Set Default Configuration of this analysis
25 // ==========================================
28 int rejectPairConversion = 1;
33 double minCentrality[10];
34 double maxCentrality[10];
36 if (system==0) // PbPb
38 if (centralityMethod == 4)
43 minCentrality[0] = 0.0; maxCentrality[0] = 5.0;
44 minCentrality[1] = 5.0; maxCentrality[1] = 10.;
45 minCentrality[2] = 10.; maxCentrality[2] = 20.;
46 minCentrality[3] = 20.; maxCentrality[3] = 30.;
47 minCentrality[4] = 30.; maxCentrality[4] = 40.;
48 minCentrality[5] = 40.; maxCentrality[5] = 50.;
49 minCentrality[6] = 50.; maxCentrality[6] = 60.;
50 minCentrality[7] = 60.; maxCentrality[7] = 70.;
51 minCentrality[8] = 70.; maxCentrality[8] = 80.;
52 minCentrality[9] = 80.; maxCentrality[9] = 90.;
57 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
61 else if (system==1) // pp
63 if (centralityMethod == 3)
66 minCentrality[0] = 2; maxCentrality[0] = 100.0;
67 minCentrality[1] = 2; maxCentrality[1] = 20.;
68 minCentrality[2] = 20.; maxCentrality[2] = 50.;
69 minCentrality[3] = 50.; maxCentrality[3] = 100.;
73 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
79 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". Option NOT CURRENTLY AVAILABLE. ABORT."
87 //double etaMin = -0.9;
88 //double etaMax = 0.9;
89 double dcaZMin = -3.0;
91 double dcaXYMin = -2.4;
92 double dcaXYMax = 2.4;
94 double dedxMax = 20000.0;
95 //int nClusterMin = 80;
96 //int trackFilterBit = 128;//TPC only
97 //int trackFilterBit = 272; //Hybrid
99 int requestedCharge1 = 1; //default
100 int requestedCharge2 = -1; //default
103 // Get the pointer to the existing analysis manager via the static access method.
104 // ==============================================================================
105 AliAnalysisManager *analysisManager = AliAnalysisManager::GetAnalysisManager();
107 if (!analysisManager)
109 ::Error("AddTaskDptDptCorrelations", "No analysis manager to connect to.");
116 TString prefixName = "Corr_";
117 TString pileupRejecSuffix = "_PileupRejec";
118 TString pairRejecSuffix = "_PairRejec";
119 TString calibSuffix = "_calib";
120 TString singlesOnlySuffix = "_SO";
123 TString inputPath = ".";
124 TString outputPath = ".";
128 TString inputHistogramFileName;
129 TString outputHistogramFileName;
131 // Create the task and add subtask.
132 // ===========================================================================
133 int iTask = 0; // task counter
134 AliAnalysisDataContainer *taskInputContainer;
135 AliAnalysisDataContainer *taskOutputContainer;
136 AliAnalysisTaskDptDptCorrelations* task;
138 for (int iCentrality=0; iCentrality < nCentrality; ++iCentrality)
142 case 0: part1Name = "P_"; part2Name = "P_"; requestedCharge1 = 1; requestedCharge2 = 1; sameFilter = 1; break;
143 case 1: part1Name = "P_"; part2Name = "M_"; requestedCharge1 = 1; requestedCharge2 = -1; sameFilter = 0; break;
144 case 2: part1Name = "M_"; part2Name = "P_"; requestedCharge1 = -1; requestedCharge2 = 1; sameFilter = 0; break;
145 case 3: part1Name = "M_"; part2Name = "M_"; requestedCharge1 = -1; requestedCharge2 = -1; sameFilter = 1; break;
147 //part1Name += int(1000*etaMin);
149 part1Name += int(1000*etaMax);
151 part1Name += int(1000*ptMin);
153 part1Name += int(1000*ptMax);
155 //part2Name += int(1000*etaMin);
157 part2Name += int(1000*etaMax);
159 part2Name += int(1000*ptMin);
161 part2Name += int(1000*ptMax);
164 eventName += int(10.*minCentrality[iCentrality] );
166 eventName += int(10.*maxCentrality[iCentrality] );
168 //eventName += int(10*zMin );
170 //eventName += int(10*zMax );
171 //if (rejectPileup) eventName += pileupRejecSuffix;
172 //if (rejectPairConversion) eventName += pairRejecSuffix;
173 baseName = prefixName;
174 baseName += part1Name;
175 baseName += part2Name;
176 baseName += eventName;
181 inputHistogramFileName = "alien:///alice/cern.ch/user/p/prabhat/CalibFiles/PbPb276Calibration_2010.root";
182 //inputHistogramFileName = "/Users/prabhat/MyTestforEta/eta900/128/PbPb276Calibration_2010.root";
184 outputHistogramFileName = baseName;
185 if (singlesOnly) outputHistogramFileName += singlesOnlySuffix;
186 outputHistogramFileName += ".root";
188 /*cout << "============================================================" << endl;
189 cout << " iTask: " << iTask << endl;
190 cout << " Task Name: " << taskName << endl;
191 cout << " List Name: " << listName << endl;
192 cout << " inputHistogramFileName: " << inputHistogramFileName << endl;
193 cout << " outputHistogramFileName: " << outputHistogramFileName << endl;
194 cout << " system: " << system << endl;
195 cout << " singlesOnly: " << singlesOnly << endl;
196 cout << " using weights: " << useWeights << endl;
197 cout << " centralityMethod: " << centralityMethod << endl;
198 cout << " chargeSet: " << chargeSet << endl;
199 cout << " debugLevel: " << debugLevel << endl;
200 cout << " rejectPileup: " << rejectPileup << endl;
201 cout << " rejectPairConversion: " << rejectPairConversion << endl;
202 cout << " sameFilter: " << sameFilter << endl;
203 cout << " zMin: " << zMin << endl;
204 cout << " zMax: " << zMax << endl;
205 cout << " ptMin: " << ptMin << endl;
206 cout << " ptMax: " << ptMax << endl;
207 cout << " etaMin: " << etaMin << endl;
208 cout << " etaMax: " << etaMax << endl;
209 cout << " dcaZMin: " << dcaZMin << endl;
210 cout << " dcaZMax: " << dcaZMax << endl;
211 cout << " dcaXYMin: " << dcaXYMin << endl;
212 cout << " dcaXYMax: " << dcaXYMax << endl;
213 cout << " dedxMin: " << dedxMin << endl;
214 cout << " dedxMax: " << dedxMax << endl;
215 cout << " nClusterMin: " << nClusterMin << endl;
216 cout << " trackFilterBit: " << trackFilterBit << endl;
217 cout << " requestedCharge1: " << requestedCharge1 << endl;
218 cout << " requestedCharge2: " << requestedCharge2 << endl;
219 cout << "============================================================" << endl;
221 TFile * inputFile = 0;
222 TList * histoList = 0;
227 TGrid::Connect("alien:");
228 inputFile = TFile::Open(inputHistogramFileName,"OLD");
231 //cout << "Requested file:" << inputHistogramFileName << " was not opened. ABORT." << endl;
234 TString nameHistoBase = "correction_";
236 nameHistoBase += eventName;
237 if (requestedCharge1 == 1)
239 nameHisto = nameHistoBase + "_p";
240 //cout << "Input Histogram named: " << nameHisto << endl;
241 weight_1 = (TH3F *) inputFile->Get(nameHisto);
245 nameHisto = nameHistoBase + "_m";
246 //cout << "Input Histogram named: " << nameHisto << endl;
247 weight_1 = (TH3F *) inputFile->Get(nameHisto);
251 //cout << "Requested histogram 'correction_p/m' was not found. ABORT." << endl;
258 if (requestedCharge2 == 1)
260 nameHisto = nameHistoBase + "_p";
261 //cout << "Input Histogram named: " << nameHisto << endl;
262 weight_2 = (TH3F *) inputFile->Get(nameHisto);
266 nameHisto = nameHistoBase + "_m";
267 //cout << "Input Histogram named: " << nameHisto << endl;
268 weight_2 = (TH3F *) inputFile->Get(nameHisto);
272 //cout << "Requested histogram 'correction_p/m' was not found. ABORT." << endl;
277 task = new AliAnalysisTaskDptDptCorrelations(taskName);
279 task->SetDebugLevel( debugLevel );
280 task->SetSameFilter( sameFilter );
281 task->SetSinglesOnly( singlesOnly );
282 task->SetUseWeights( useWeights );
283 task->SetRejectPileup( rejectPileup );
284 task->SetRejectPairConversion(rejectPairConversion);
285 task->SetVertexZMin( zMin );
286 task->SetVertexZMax( zMax );
287 task->SetVertexXYMin( -1. );
288 task->SetVertexXYMax( 1. );
289 task->SetCentralityMethod( centralityMethod);
290 task->SetCentrality( minCentrality[iCentrality], maxCentrality[iCentrality]);
291 task->SetPtMin1( ptMin );
292 task->SetPtMax1( ptMax );
293 task->SetEtaMin1( etaMin );
294 task->SetEtaMax1( etaMax );
295 task->SetPtMin2( ptMin );
296 task->SetPtMax2( ptMax );
297 task->SetEtaMin2( etaMin );
298 task->SetEtaMax2( etaMax );
299 //task->SetDcaZMin( dcaZMin );
300 //task->SetDcaZMax( dcaZMax );
301 //task->SetDcaXYMin( dcaXYMin );
302 //task->SetDcaXYMax( dcaXYMax ); //checking by prp
303 task->SetDedxMin( dedxMin );
304 task->SetDedxMax( dedxMax );
305 task->SetNClusterMin( nClusterMin );
306 task->SetTrackFilterBit( trackFilterBit );
307 task->SetRequestedCharge_1( requestedCharge1);
308 task->SetRequestedCharge_2( requestedCharge2);
309 task->SetWeigth_1( weight_1 );
310 task->SetWeigth_2( weight_2 );
313 //cout << "Creating task output container" << endl;
314 taskOutputContainer = analysisManager->CreateContainer(listName,
316 AliAnalysisManager::kOutputContainer,
317 Form("%s:Histos", AliAnalysisManager::GetCommonFileName()));
318 //cout << "Add task to analysis manager and connect it to input and output containers" << endl;
319 analysisManager->AddTask(task);
320 analysisManager->ConnectInput( task, 0, analysisManager->GetCommonInputContainer());
321 analysisManager->ConnectOutput(task, 0, taskOutputContainer );
322 //cout << "Task added ...." << endl;