1 // Macro designed for use with the AliAnalysisTaskDptDptCorrelations task.
2 // Author: Prabhat Pujahari & Claude Pruneau, Wayne State
3 // system: 0: PbPb 1: pPb
4 // singlesOnly: 0: full correlations 1: singles only
5 // useWeights: 0: no 1: yes
6 // centralityMethod: 3: track count 4: V0 centrality 7: V0A centrality for pPb
7 // chargeSet: 0: ++ 1: +- 2: -+ 3: --
8 /////////////////////////////////////////////////////////////////////////////////
9 AliAnalysisTaskDptDptCorrelations *AddTaskDptDptCorr_dca1
13 int centralityMethod = 4,
17 int trackFilterBit = 128,
19 double eta1Min = -0.8,
21 double eta2Min = -0.8,
23 double dcaZMin = -3.2,
25 double dcaXYMin = -2.4,
26 double dcaXYMax = 2.4,
28 Bool_t trigger = kFALSE,
29 const char* taskname = "dcaz2",
30 char *inputHistogramFileName = "alien:///alice/cern.ch/user/p/prabhat/CalibFiles/PbPbCalib_dca1.root")
33 // Set Default Configuration of this analysis
34 // ==========================================
37 int rejectPairConversion = 1;
41 double minCentrality[10];
42 double maxCentrality[10];
44 if (system==0) // PbPb
46 if (centralityMethod == 4)
48 minCentrality[0] = 0.0; maxCentrality[0] = 5.0;
49 minCentrality[1] = 10.; maxCentrality[1] = 20.;
50 minCentrality[2] = 30.; maxCentrality[2] = 40.;
51 minCentrality[3] = 50.; maxCentrality[3] = 60.;
52 minCentrality[4] = 70.; maxCentrality[4] = 80.;
56 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
60 else if (system==1) // pPb
62 if (centralityMethod == 7)
64 minCentrality[0] = 0; maxCentrality[0] = 20.0;
65 minCentrality[1] = 20.; maxCentrality[1] = 40.;
66 minCentrality[2] = 40.; maxCentrality[2] = 60.;
67 minCentrality[3] = 60.; maxCentrality[3] = 80.;
71 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". centralityMethod:" << centralityMethod << " Option NOT AVAILABLE. ABORT."
77 //cout << "-F- AddTaskDptDptCorrelations() system:" << system << ". Option NOT CURRENTLY AVAILABLE. ABORT."
86 double dedxMax = 20000.0;
87 int requestedCharge1 = 1; //default
88 int requestedCharge2 = -1; //default
91 // Get the pointer to the existing analysis manager via the static access method.
92 // ==============================================================================
93 AliAnalysisManager *analysisManager = AliAnalysisManager::GetAnalysisManager();
97 ::Error("AddTaskDptDptCorrelations", "No analysis manager to connect to.");
104 TString prefixName = "Corr_";
105 TString pileupRejecSuffix = "_PileupRejec";
106 TString pairRejecSuffix = "_PairRejec";
107 TString calibSuffix = "_calib";
108 TString singlesOnlySuffix = "_SO";
111 TString inputPath = ".";
112 TString outputPath = ".";
116 //TString inputHistogramFileName;
117 TString outputHistogramFileName;
119 // Create the task and add subtask.
120 // ===========================================================================
121 int iTask = 0; // task counter
122 AliAnalysisDataContainer *taskInputContainer;
123 AliAnalysisDataContainer *taskOutputContainer;
124 AliAnalysisTaskDptDptCorrelations* task;
126 for (int iCentrality=0; iCentrality < nCentrality; ++iCentrality)
130 case 0: part1Name = "P_"; part2Name = "P_"; requestedCharge1 = 1; requestedCharge2 = 1; sameFilter = 1; break;
131 case 1: part1Name = "P_"; part2Name = "M_"; requestedCharge1 = 1; requestedCharge2 = -1; sameFilter = 0; break;
132 case 2: part1Name = "M_"; part2Name = "P_"; requestedCharge1 = -1; requestedCharge2 = 1; sameFilter = 0; break;
133 case 3: part1Name = "M_"; part2Name = "M_"; requestedCharge1 = -1; requestedCharge2 = -1; sameFilter = 1; break;
137 part1Name += int(1000*eta1Max);
139 part1Name += int(1000*ptMin);
141 part1Name += int(1000*ptMax);
143 part1Name += int(1000*dcaZMin);
145 part1Name += int(1000*dcaZMax);
149 part2Name += int(1000*eta2Max);
151 part2Name += int(1000*ptMin);
153 part2Name += int(1000*ptMax);
155 part2Name += int(1000*dcaZMin);
157 part2Name += int(1000*dcaZMax);
161 eventName += int(10.*minCentrality[iCentrality] );
163 eventName += int(10.*maxCentrality[iCentrality] );
165 baseName = prefixName;
166 baseName += part1Name;
167 baseName += part2Name;
168 baseName += eventName;
173 outputHistogramFileName = baseName;
174 if (singlesOnly) outputHistogramFileName += singlesOnlySuffix;
175 outputHistogramFileName += ".root";
178 TFile * inputFile = 0;
179 TList * histoList = 0;
184 TGrid::Connect("alien:");
185 inputFile = TFile::Open(inputHistogramFileName,"OLD");
188 //cout << "Requested file:" << inputHistogramFileName << " was not opened. ABORT." << endl;
191 TString nameHistoBase = "correction_";
193 nameHistoBase += eventName;
194 if (requestedCharge1 == 1)
196 nameHisto = nameHistoBase + "_p";
197 //cout << "Input Histogram named: " << nameHisto << endl;
198 weight_1 = (TH3F *) inputFile->Get(nameHisto);
202 nameHisto = nameHistoBase + "_m";
203 //cout << "Input Histogram named: " << nameHisto << endl;
204 weight_1 = (TH3F *) inputFile->Get(nameHisto);
208 //cout << "Requested histogram 'correction_p/m' was not found. ABORT." << endl;
215 if (requestedCharge2 == 1)
217 nameHisto = nameHistoBase + "_p";
218 //cout << "Input Histogram named: " << nameHisto << endl;
219 weight_2 = (TH3F *) inputFile->Get(nameHisto);
223 nameHisto = nameHistoBase + "_m";
224 //cout << "Input Histogram named: " << nameHisto << endl;
225 weight_2 = (TH3F *) inputFile->Get(nameHisto);
229 //cout << "Requested histogram 'correction_p/m' was not found. ABORT." << endl;
234 task = new AliAnalysisTaskDptDptCorrelations(taskName);
236 task->SetDebugLevel( debugLevel );
237 task->SetSameFilter( sameFilter );
238 task->SetSinglesOnly( singlesOnly );
239 task->SetUseWeights( useWeights );
240 task->SetRejectPileup( rejectPileup );
241 task->SetRejectPairConversion(rejectPairConversion);
242 task->SetVertexZMin( zMin );
243 task->SetVertexZMax( zMax );
244 task->SetVertexXYMin( -1. );
245 task->SetVertexXYMax( 1. );
246 task->SetCentralityMethod( centralityMethod);
247 task->SetCentrality( minCentrality[iCentrality], maxCentrality[iCentrality]);
248 task->SetPtMin1( ptMin );
249 task->SetPtMax1( ptMax );
250 task->SetEtaMin1( eta1Min );
251 task->SetEtaMax1( eta1Max );
252 task->SetPtMin2( ptMin );
253 task->SetPtMax2( ptMax );
254 task->SetEtaMin2( eta2Min );
255 task->SetEtaMax2( eta2Max );
256 task->SetDcaZMin( dcaZMin );
257 task->SetDcaZMax( dcaZMax );
258 task->SetDcaXYMin( dcaXYMin );
259 task->SetDcaXYMax( dcaXYMax ); //checking by prp
260 task->SetDedxMin( dedxMin );
261 task->SetDedxMax( dedxMax );
262 task->SetNClusterMin( nClusterMin );
263 task->SetTrackFilterBit( trackFilterBit );
264 task->SetRequestedCharge_1( requestedCharge1);
265 task->SetRequestedCharge_2( requestedCharge2);
266 task->SetWeigth_1( weight_1 );
267 task->SetWeigth_2( weight_2 );
270 if(trigger) task->SelectCollisionCandidates(AliVEvent::kINT7);
271 else task->SelectCollisionCandidates(AliVEvent::kMB);
273 cout << "Creating task output container" << endl;
275 taskOutputContainer = analysisManager->CreateContainer(listName,
277 AliAnalysisManager::kOutputContainer,
278 Form("%s:%s", AliAnalysisManager::GetCommonFileName(),taskname));
279 cout << "Add task to analysis manager and connect it to input and output containers" << endl;
281 analysisManager->AddTask(task);
282 analysisManager->ConnectInput( task, 0, analysisManager->GetCommonInputContainer());
283 analysisManager->ConnectOutput(task, 0, taskOutputContainer );
284 //cout << "Task added ...." << endl;