]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/EBYE/macros/configLRCAnalysis.C
coverity fixes in LRC (Igor Altsybeev <Igor.Altsybeev@cern.ch>)
[u/mrichter/AliRoot.git] / PWGCF / EBYE / macros / configLRCAnalysis.C
1 /*enum EtaWindowSets
2 {
3  en_eta_standart,
4  en_eta_forward_keep_small_and_distant,
5 };*/
6
7 //#include "AliLRCProcess.h"
8 //#include "AliEventShape.h"
9 //#include "etaWindowsConfigEnumerator.h"
10
11 enum etaWindowsConfigurations
12 {
13     en_etaWinConfig_standart = 0,
14     en_etaWinConfig_empty,
15     en_etaWinConfig_standart_extended,
16     en_etaWinConfig_fixedFwd,
17     en_etaWinConfig_fixedBkwd,
18     en_etaWinConfig_phiSectors,
19     //en_etaWinConfig_phiSectorsWithFixedFwdWindow,
20     //en_etaWinConfig_phiSectorsWithFixedBkwdWindow,
21     en_etaWinConfig_phiSectorsWithFixedBkwdWindow_eta0_4,
22     en_etaWinConfig_twistedPhiWindows,
23     en_etaWinConfig_longRangeEtaWindows,
24     en_etaWinConfig_ridge_eta0_2_step_0_2_phi_8
25
26 };
27
28
29
30 AliESDtrackCuts* createAliLRCcuts(TString mode)//char* mode)
31 {
32
33     if(mode=="Global2_TPC_clusters_20")
34     {
35         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
36         cuts->SetMinNClustersTPC(20);
37         cuts->SetMinNClustersITS(2);
38         cuts->SetMaxChi2PerClusterTPC(4.0);
39         cuts->SetRequireTPCRefit(kTRUE);
40         cuts->SetRequireITSRefit(kTRUE);
41         cuts->SetAcceptKinkDaughters(kFALSE);
42         cuts->SetMaxDCAToVertexXY(0.5);
43         cuts->SetMaxDCAToVertexZ(0.5);
44         cuts->SetPtRange(0.15,100);
45         cuts->SetEtaRange(-1.8,1.8);
46         cuts->SaveHistograms("trackCuts");
47
48         return cuts;
49     }
50
51     if(mode=="Global2_TPC_clusters_40")
52     {
53         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
54         cuts->SetMinNClustersTPC(40);
55         cuts->SetMinNClustersITS(2);
56         cuts->SetMaxChi2PerClusterTPC(4.0);
57         cuts->SetRequireTPCRefit(kTRUE);
58         cuts->SetRequireITSRefit(kTRUE);
59         cuts->SetAcceptKinkDaughters(kFALSE);
60         cuts->SetMaxDCAToVertexXY(0.5);
61         cuts->SetMaxDCAToVertexZ(0.5);
62         cuts->SetPtRange(0.15,100);
63         cuts->SetEtaRange(-1.8,1.8);
64         cuts->SaveHistograms("trackCuts");
65
66         return cuts;
67     }
68
69
70     if(mode=="Global2_TPC_clusters_100")
71     {
72         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
73         cuts->SetMinNClustersTPC(100);
74         cuts->SetMinNClustersITS(2);
75         cuts->SetMaxChi2PerClusterTPC(4.0);
76         cuts->SetRequireTPCRefit(kTRUE);
77         cuts->SetRequireITSRefit(kTRUE);
78         cuts->SetAcceptKinkDaughters(kFALSE);
79         cuts->SetMaxDCAToVertexXY(0.5);
80         cuts->SetMaxDCAToVertexZ(0.5);
81         cuts->SetPtRange(0.15,100);
82         cuts->SetEtaRange(-1.8,1.8);
83         cuts->SaveHistograms("trackCuts");
84
85         return cuts;
86     }
87     /*
88     if(mode=="Global2_TPC_clusters_110")
89     {
90         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
91         cuts->SetMinNClustersTPC(110);
92         cuts->SetMinNClustersITS(2);
93         cuts->SetMaxChi2PerClusterTPC(4.0);
94         cuts->SetRequireTPCRefit();
95         cuts->SetRequireITSRefit();
96         cuts->SetAcceptKinkDaughters(kFALSE);
97         cuts->SetMaxDCAToVertexXY(0.5);
98         cuts->SetMaxDCAToVertexZ(0.5);
99         cuts->SetPtRange(0.15,100);
100         cuts->SetEtaRange(-1.8,1.8);
101         cuts->SaveHistograms("trackCuts");
102
103         return cuts;
104     }*/
105
106
107     if(mode=="Global2_TPC_clusters_120")
108     {
109         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
110         cuts->SetMinNClustersTPC(120);
111         cuts->SetMinNClustersITS(2);
112         cuts->SetMaxChi2PerClusterTPC(4.0);
113         cuts->SetRequireTPCRefit(kTRUE);
114         cuts->SetRequireITSRefit(kTRUE);
115         cuts->SetAcceptKinkDaughters(kFALSE);
116         cuts->SetMaxDCAToVertexXY(0.5);
117         cuts->SetMaxDCAToVertexZ(0.5);
118         cuts->SetPtRange(0.15,100);
119         cuts->SetEtaRange(-1.8,1.8);
120         cuts->SaveHistograms("trackCuts");
121
122         return cuts;
123     }
124
125     if(mode=="Global2_DCA_0.1")
126     {
127         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
128         cuts->SetMinNClustersTPC(80);
129         cuts->SetMinNClustersITS(2);
130         cuts->SetMaxChi2PerClusterTPC(4.0);
131         cuts->SetRequireTPCRefit(kTRUE);
132         cuts->SetRequireITSRefit(kTRUE);
133         cuts->SetAcceptKinkDaughters(kFALSE);
134         cuts->SetMaxDCAToVertexXY(0.1);
135         cuts->SetMaxDCAToVertexZ(0.1);
136         cuts->SetPtRange(0.15,100);
137         cuts->SetEtaRange(-1.8,1.8);
138         cuts->SaveHistograms("trackCuts");
139
140         return cuts;
141     }
142
143     /*
144     if(mode=="Global2_DCA_0.3")
145     {
146         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
147         cuts->SetMinNClustersTPC(80);
148         cuts->SetMinNClustersITS(2);
149         cuts->SetMaxChi2PerClusterTPC(4.0);
150         cuts->SetRequireTPCRefit(kTRUE);
151         cuts->SetRequireITSRefit(kTRUE);
152         cuts->SetAcceptKinkDaughters(kFALSE);
153         cuts->SetMaxDCAToVertexXY(0.3);
154         cuts->SetMaxDCAToVertexZ(0.3);
155         cuts->SetPtRange(0.15,100);
156         cuts->SetEtaRange(-1.8,1.8);
157         cuts->SaveHistograms("trackCuts");
158
159         return cuts;
160     }*/
161     
162     if(mode=="Global2_DCA_2.0")
163     {
164         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
165         cuts->SetMinNClustersTPC(80);
166         cuts->SetMinNClustersITS(2);
167         cuts->SetMaxChi2PerClusterTPC(4.0);
168         cuts->SetRequireTPCRefit(kTRUE);
169         cuts->SetRequireITSRefit(kTRUE);
170         cuts->SetAcceptKinkDaughters(kFALSE);
171         cuts->SetMaxDCAToVertexXY(2.);
172         cuts->SetMaxDCAToVertexZ(2.);
173         cuts->SetPtRange(0.15,100);
174         cuts->SetEtaRange(-1.8,1.8);
175         cuts->SaveHistograms("trackCuts");
176
177         return cuts;
178     }
179     
180     if(mode=="Global2_min_ITS_clusters_0")
181     {
182         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
183         cuts->SetMinNClustersTPC(80);
184         cuts->SetMinNClustersITS(0);
185         cuts->SetMaxChi2PerClusterTPC(4.0);
186         cuts->SetRequireTPCRefit(kTRUE);
187         cuts->SetRequireITSRefit(kTRUE);
188         cuts->SetAcceptKinkDaughters(kFALSE);
189         cuts->SetMaxDCAToVertexXY(0.5);
190         cuts->SetMaxDCAToVertexZ(0.5);
191         cuts->SetPtRange(0.15,100);
192         cuts->SetEtaRange(-1.8,1.8);
193         cuts->SaveHistograms("trackCuts");
194
195         return cuts;
196     }
197
198     if(mode=="Global2_min_ITS_clusters_4")
199     {
200         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
201         cuts->SetMinNClustersTPC(80);
202         cuts->SetMinNClustersITS(4);
203         cuts->SetMaxChi2PerClusterTPC(4.0);
204         cuts->SetRequireTPCRefit(kTRUE);
205         cuts->SetRequireITSRefit(kTRUE);
206         cuts->SetAcceptKinkDaughters(kFALSE);
207         cuts->SetMaxDCAToVertexXY(0.5);
208         cuts->SetMaxDCAToVertexZ(0.5);
209         cuts->SetPtRange(0.15,100);
210         cuts->SetEtaRange(-1.8,1.8);
211         cuts->SaveHistograms("trackCuts");
212
213         return cuts;
214     }
215
216     if(mode=="Global2_no_refits")
217     {
218         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
219         cuts->SetMinNClustersTPC(80);
220         cuts->SetMinNClustersITS(2);
221         cuts->SetMaxChi2PerClusterTPC(4.0);
222         cuts->SetRequireTPCRefit(kFALSE);
223         cuts->SetRequireITSRefit(kFALSE);
224         cuts->SetAcceptKinkDaughters(kFALSE);
225         cuts->SetMaxDCAToVertexXY(0.5);
226         cuts->SetMaxDCAToVertexZ(0.5);
227         cuts->SetPtRange(0.15,100);
228         cuts->SetEtaRange(-1.8,1.8);
229         cuts->SaveHistograms("trackCuts");
230
231         return cuts;
232     }
233
234
235     if(mode=="Global2")
236     {
237         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
238         cuts->SetMinNClustersTPC(80);
239         //cuts->SetMinNCrossedRowsTPC(80);
240         cuts->SetMinNClustersITS(2);
241         cuts->SetMaxChi2PerClusterTPC(4.0);
242         cuts->SetRequireTPCRefit(kTRUE);
243         cuts->SetRequireITSRefit(kTRUE);
244         cuts->SetAcceptKinkDaughters(kFALSE);
245         cuts->SetMaxDCAToVertexXY(0.5);
246         cuts->SetMaxDCAToVertexZ(0.5);
247         cuts->SetPtRange(0.15,100);
248         cuts->SetEtaRange(-1.8,1.8);
249         cuts->SaveHistograms("trackCuts");
250
251         return cuts;
252     }
253     
254     if(mode=="Global2_noPtCut")
255     {
256         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
257         cuts->SetMinNClustersTPC(80);
258         cuts->SetMinNClustersITS(2);
259         cuts->SetMaxChi2PerClusterTPC(4.0);
260         cuts->SetRequireTPCRefit(kTRUE);
261         cuts->SetRequireITSRefit(kTRUE);
262         cuts->SetAcceptKinkDaughters(kFALSE);
263         cuts->SetMaxDCAToVertexXY(0.5);
264         cuts->SetMaxDCAToVertexZ(0.5);
265         cuts->SetPtRange(0.01,100);
266         cuts->SetEtaRange(-1.8,1.8);
267         cuts->SaveHistograms("trackCuts");
268
269         return cuts;
270     }
271     /*
272     if(mode=="Global2_old_AI")
273     {
274         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
275         cuts->SetMinNClustersTPC(70);
276         cuts->SetMinNClustersITS(2);
277         cuts->SetMaxChi2PerClusterTPC(4.0);
278         cuts->SetRequireTPCRefit();
279         cuts->SetRequireITSRefit();
280         cuts->SetAcceptKinkDaughters(kFALSE);
281         cuts->SetMaxDCAToVertexXY(0.5);
282         cuts->SetMaxDCAToVertexZ(0.5);
283         cuts->SetPtRange(0.15,100);
284         cuts->SetEtaRange(-1.8,1.8);
285         cuts->SaveHistograms("trackCuts");
286
287         return cuts;
288     }*/
289     
290     
291     if(mode=="Global2_softCuts")
292     {
293         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
294         cuts->SetMinNClustersTPC(40);
295         cuts->SetMinNClustersITS(0);
296         cuts->SetMaxChi2PerClusterTPC(4.0);
297         cuts->SetRequireTPCRefit(kFALSE);
298         cuts->SetRequireITSRefit(kFALSE);
299         cuts->SetAcceptKinkDaughters(kFALSE);
300         cuts->SetMaxDCAToVertexXY(3.);
301         cuts->SetMaxDCAToVertexZ(3.);
302         cuts->SetPtRange(0.1,100);
303         cuts->SetEtaRange(-2.,2.);
304         cuts->SaveHistograms("trackCuts");
305
306         return cuts;
307     }
308     
309     
310     if(mode=="StandardITSTPCTrackCuts2010")
311     {
312         AliESDtrackCuts *cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE);
313
314
315         return cuts;
316     }
317     
318     if(mode=="StandardITSTPCTrackCuts2010no")
319     {
320         AliESDtrackCuts *cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE);
321
322
323         return cuts;
324     }
325     
326     if(mode=="StandardITSTPCTrackCuts2010trueAndCrossRows")
327     {
328         AliESDtrackCuts *cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE, 1);
329
330
331         return cuts;
332     }
333     
334     if(mode=="StandardTPCOnlyTrackCuts")
335     {
336         AliESDtrackCuts *cuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
337
338
339         return cuts;
340     }
341
342     if(mode=="StandardITSSATrackCuts2010")
343     {
344         AliESDtrackCuts *cuts = AliESDtrackCuts::GetStandardITSSATrackCuts2010();
345
346
347         return cuts;
348     }
349
350
351
352
353     /*if(mode=="Global2_eta_in_1")
354     {
355         AliESDtrackCuts *cuts = new AliESDtrackCuts("lrcCuts","lrcCuts");
356         cuts->SetMinNClustersTPC(70);
357         cuts->SetMinNClustersITS(2);
358         cuts->SetMaxChi2PerClusterTPC(4.0);
359         cuts->SetRequireTPCRefit(kTRUE);
360         cuts->SetRequireITSRefit(kTRUE);
361         cuts->SetAcceptKinkDaughters(kFALSE);
362         cuts->SetMaxDCAToVertexXY(2.);
363         cuts->SetMaxDCAToVertexZ(2.);
364         cuts->SetPtRange(0.15,100);
365         cuts->SetEtaRange(-1.,1.);
366         cuts->SaveHistograms("trackCuts");
367
368         return cuts;
369     }*/
370     
371 }
372
373 //===========================================================================
374 AliAnalysisTaskLRC* createLRCtaskSkeleton(char* name="Task_LRC", Bool_t RunKine=kFALSE)
375 {
376     AliAnalysisTaskLRC *taskLRC = new AliAnalysisTaskLRC(name,RunKine);
377     taskLRC->SetMinPtLimit(0.2);
378     taskLRC->SetMaxPtLimit(3.5);
379     taskLRC->SetCheckForVtxPosition(kTRUE);
380     taskLRC->SetVtxDiamond(0.4,0.4,5.0);
381     return taskLRC;
382 }
383 //===========================================================================
384
385
386 void tuneEtaPhiWindows( AliAnalysisTaskLRC* taskLRC
387                         , int nEtaWindows
388                         , int nPhiWindows
389                         , double etaWinWidth
390                         , double etaWindowStep
391                         , int ridgeStudy = 0
392                         , double phiWindowWidthByHand = -1
393         )
394 {
395     //create processors, tune Eta
396     for(int i = 0; i < nPhiWindows; i++)
397     {
398         //double etaWinWidth = 0.2;
399         //double etaWindowStep = 0.2;//1;
400         for ( int etaId = 0; etaId < nEtaWindows; etaId++ )
401         {
402             if ( ridgeStudy == 0 )
403             {
404                 double winEtaBegin  = etaWindowStep * (etaId)-etaWinWidth/2;
405                 double winEtaEnd    = etaWindowStep * (etaId)-etaWinWidth/2 + etaWinWidth;
406                 taskLRC->AddLRCProcess( new AliLRCProcess(-winEtaEnd,-winEtaBegin,winEtaBegin,winEtaEnd));
407
408 //                const int includeSameEtaGapWindows = 1; //simply add same eta window processors
409 //                if ( includeSameEtaGapWindows )
410 //                {
411
412 //                    if ( etaId == 0 ) //put same eta gap windows
413 //                        taskLRC->AddLRCProcess( new AliLRCProcess(-etaWinWidth/2,etaWinWidth/2,-etaWinWidth/2,etaWinWidth/2));
414 //                    else // continue with symmetrical
415 //                    {
416 //                        double winEtaBegin  = etaWindowStep * (etaId - 1);
417 //                        double winEtaEnd    = etaWindowStep * (etaId - 1) + etaWinWidth;
418 //                        taskLRC->AddLRCProcess( new AliLRCProcess(-winEtaEnd,-winEtaBegin,winEtaBegin,winEtaEnd));
419 //                    }
420 //                }
421 //                else //usual simmetrical study without overlaping
422 //                {
423 //                    double winEtaBegin  = etaWindowStep * etaId;
424 //                    double winEtaEnd    = etaWindowStep * etaId + etaWinWidth;
425 //                    taskLRC->AddLRCProcess( new AliLRCProcess(-winEtaEnd,-winEtaBegin,winEtaBegin,winEtaEnd));
426 //                }
427             }
428             else if ( ridgeStudy == 1 )
429             {
430                 double winEtaBegin0  = etaWindowStep * ( nEtaWindows/2 - 1 );
431                 double winEtaEnd0    = winEtaBegin0 + etaWinWidth;
432
433                 double winEtaBegin  = -winEtaBegin0 + etaWindowStep * etaId;
434                 double winEtaEnd    = -winEtaEnd0 + etaWindowStep * etaId;
435                 //double fwdFixedBegin  = etaWindowStep * ( nEtaWindows - 1 );
436                 //double fwdFixedEnd    = etaWindowStep * ( nEtaWindows - 1 ) + etaWinWidth;
437
438                 taskLRC->AddLRCProcess( new AliLRCProcess(winEtaEnd,winEtaBegin,winEtaBegin0,winEtaEnd0));
439             }
440             else if ( ridgeStudy == 51 ) //expanding windows study - win pair position more precise, close eta
441             {
442                 //cout << "study win pair position" << endl;
443                 double shiftEta = etaId * 0.2;
444                 taskLRC->AddLRCProcess( new AliLRCProcess( -0.8 + shiftEta,-0.6+ shiftEta, -0.6 + shiftEta, -0.4 + shiftEta ));
445             }
446             else if ( ridgeStudy == 52 ) //expanding windows study - win pair position more precise, wide gap
447             {
448                 //cout << "study win pair position" << endl;
449                 double shiftEta = etaId * 0.2;
450                 taskLRC->AddLRCProcess( new AliLRCProcess( -0.8 + shiftEta,-0.6+ shiftEta, -0.2 + shiftEta, -0.0 + shiftEta ));
451             }
452         }
453     }
454     //tune Phi
455     //!!!taskLRC->SetNumberOfPhiSectors( nPhiWindows );
456     double phiStep = 2 * TMath::Pi() / nPhiWindows;
457     for ( Int_t sectorId = 0; sectorId < nPhiWindows; sectorId++ )
458     {
459         for ( Int_t i = nEtaWindows * sectorId; i < nEtaWindows * ( sectorId + 1 ); i++ )
460         {
461             double lFwdWinWidth = phiStep;
462             double lBkwPhi_1 = phiStep * sectorId;
463             double lBkwPhi_2 = phiStep * ( sectorId + 1 );
464
465             if ( phiWindowWidthByHand > 0 ) // width by hand!
466             {
467                 lFwdWinWidth = phiWindowWidthByHand;
468                 lBkwPhi_2 = phiStep * sectorId + phiWindowWidthByHand;
469             }
470             AliLRCBase* lrcBaseTmp = (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)));
471             //            Double_t a;
472             //            Double_t b;
473             //            Double_t c;
474             //            Double_t d;
475             //            lrcBaseTmp->GetPhiWindows(a,b,c,d);
476             lrcBaseTmp->SetForwardWindowPhi( 0, lFwdWinWidth );
477             lrcBaseTmp->SetBackwardWindowPhi( lBkwPhi_1, lBkwPhi_2 );
478         }
479     }
480
481
482 //    taskLRC->SetNumberOfPhiSectors( nPhiWindows );
483 //    double phiStep = 2 * TMath::Pi() / nPhiWindows;
484 //    for ( Int_t sectorId = 0; sectorId < nPhiWindows; sectorId++ )
485 //    {
486 //        for ( Int_t i = nEtaWindows * sectorId; i < nEtaWindows * ( sectorId + 1 ); i++ )
487 //        {
488 //            double lBkwPhi_1 = phiStep * sectorId;
489 //            double lBkwPhi_2 = phiStep * ( sectorId + 1 );
490
491 //            (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetForwardWindowPhi( 0, phiStep );
492 //            (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetBackwardWindowPhi( lBkwPhi_1, lBkwPhi_2 );
493 //        }
494 //    }
495     //end of eta-phi windows settings
496 }
497
498
499
500 //===========================================================================
501 void addAliLRCProcessors(AliAnalysisTaskLRC* taskLRC
502                          , Int_t windowsConfigurationSetId = en_etaWinConfig_standart
503         , Int_t nPhiSectors = 1
504         , Double_t gapAsPartOfPi = 0. // for twisted sectors
505         )
506 {
507
508     int nLRCprocessors = 0;
509
510     if( windowsConfigurationSetId == en_etaWinConfig_standart/*0*/ ) //standart eta window set
511     {
512         nLRCprocessors = 11;
513         for(int i = 0; i < nPhiSectors; i++)
514         {
515             //FB
516             taskLRC->AddLRCProcess(new AliLRCProcess(-0.2,-0.0,0.0,0.2));
517             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,0.0,0.4));
518             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.0,0.0,0.6));
519             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.0,0.0,0.8));
520             //0.2 gap
521             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.2,0.2,0.4));
522             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.4,0.4,0.6));
523             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.6,0.6,0.8));
524             //0.4 gap
525             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.2,0.2,0.6));
526             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,0.4,0.8));
527             //0.6 gap
528             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.2,0.2,0.8));
529
530             //FULL
531             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,0.8,-0.8,0.8));
532         }
533     }
534     else if( windowsConfigurationSetId == en_etaWinConfig_empty ) // add nothing
535     {
536
537     }
538     else if( windowsConfigurationSetId == en_etaWinConfig_standart_extended/*0*/ ) //standart eta window set
539     {
540         nLRCprocessors = 8;//14;
541         for(int i = 0; i < nPhiSectors; i++)
542         {
543             //FB
544             taskLRC->AddLRCProcess(new AliLRCProcess(-0.2,-0.0,0.0,0.2));
545 //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,0.0,0.4));
546 //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.0,0.0,0.6));
547 //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.0,0.0,0.8));
548             //0.2 gap
549             taskLRC->AddLRCProcess(new AliLRCProcess(-0.3,-0.1,0.1,0.3));
550             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.2,0.2,0.4));
551             taskLRC->AddLRCProcess(new AliLRCProcess(-0.5,-0.3,0.3,0.5));
552             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.4,0.4,0.6));
553             taskLRC->AddLRCProcess(new AliLRCProcess(-0.7,-0.5,0.5,0.7));
554             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.6,0.6,0.8));
555             //0.4 gap
556 //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.2,0.2,0.6));
557 //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,0.4,0.8));
558             //0.6 gap
559 //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.2,0.2,0.8));
560
561             //FULL
562             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,0.8,-0.8,0.8));
563         }
564     }
565     else if( windowsConfigurationSetId == en_etaWinConfig_fixedFwd/*1*/ ) //fixing fwd win (to test independance from bkwd width)
566     {
567         nLRCprocessors = 13;
568         for(int i = 0; i < nPhiSectors; i++)
569         {
570             cout << "fixed fwd win" << endl;
571             double windowMin = -0.8;
572             double windowMax = -0.6;
573             //FB
574             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.0,0.2));
575             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.0,0.4));
576             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.0,0.6));
577             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.0,0.8));
578             //0.2 gap
579             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.1,0.3));
580             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.2,0.4));
581             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.3,0.5));
582             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.4,0.6));
583             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.5,0.7));
584             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.6,0.8));
585             //0.4 gap
586             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.2,0.6));
587             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.4,0.8));
588             //0.6 gap
589             taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,0.2,0.8));
590
591             //FULL
592             //taskLRC->AddLRCProcess(new AliLRCProcess( windowMin, windowMax,-0.8,0.8));
593         }
594     }
595     else if( windowsConfigurationSetId == en_etaWinConfig_fixedBkwd/*2*/ )  //fixing BKW win, and for phi-voroching with fixed window
596     {
597         nLRCprocessors = 13;
598         for(int i = 0; i < nPhiSectors; i++)
599         {
600             cout << "fixed fwd win" << endl;
601             double windowMin = 0.6;
602             double windowMax = 0.8;
603             //FB
604             taskLRC->AddLRCProcess(new AliLRCProcess(-0.2,-0.0, windowMin, windowMax));
605             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0, windowMin, windowMax));
606             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.0, windowMin, windowMax));
607             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.0, windowMin, windowMax));
608             //0.2 gap
609             taskLRC->AddLRCProcess(new AliLRCProcess(-0.3,-0.1, windowMin, windowMax));
610             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.2, windowMin, windowMax));
611             taskLRC->AddLRCProcess(new AliLRCProcess(-0.5,-0.3, windowMin, windowMax));
612             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.4, windowMin, windowMax));
613             taskLRC->AddLRCProcess(new AliLRCProcess(-0.7,-0.5, windowMin, windowMax));
614             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.6, windowMin, windowMax));
615             //0.4 gap
616             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.2, windowMin, windowMax));
617             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4, windowMin, windowMax));
618             //0.6 gap
619             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.2, windowMin, windowMax));
620
621             //FULL
622             //taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,0.8, windowMin, windowMax));
623         }
624     }
625     else if( windowsConfigurationSetId == en_etaWinConfig_phiSectors/*3*/ )  //phi-sectors configs //TMP?..
626     {
627         cout << "fixed FWD win" << endl;
628         double windowMin = -0.8;
629         double windowMax = -0.6;
630         nLRCprocessors = 11;//8;
631         for(int i = 0; i < nPhiSectors; i++)
632         {
633             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,0.6,0.8));
634             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,0.4,0.6));
635             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,0.2,0.4));
636             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,0.0,0.2));
637             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,-0.2,-0.0));
638             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,-0.4,-0.2));
639             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,-0.6,-0.4));
640             //            taskLRC->AddLRCProcess(new AliLRCProcess(windowMin,windowMax,-0.8,-0.6));
641             
642             //taskLRC->AddLRCProcess( new AliLRCProcess(-0.8,-0.4,0.4,0.8) );
643             //taskLRC->AddLRCProcess( new AliLRCProcess(-0.4, 0.0,0.0,0.4) );
644             taskLRC->AddLRCProcess(new AliLRCProcess(-0.2,-0.0,0.0,0.2));
645             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,0.0,0.4));
646             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.0,0.0,0.6));
647             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.0,0.0,0.8));
648             //0.2 gap
649             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.2,0.2,0.4));
650             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.4,0.4,0.6));
651             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.6,0.6,0.8));
652             //0.4 gap
653             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.2,0.2,0.6));
654             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,0.4,0.8));
655             //0.6 gap
656             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.2,0.2,0.8));
657             //FULL
658             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,0.8,-0.8,0.8));
659         }
660     }
661     /*    else if( windowsConfigurationSetId == en_etaWinConfig_phiSectorsWithFixedBkwdWindow ) //4
662     {
663         nLRCprocessors = 10;
664         for(int i = 0; i < nPhiSectors; i++)
665         {
666             cout << "fixed fwd win" << endl;
667             double windowMin = 0.6;
668             double windowMax = 0.8;
669             //FB
670             taskLRC->AddLRCProcess(new AliLRCProcess(-0.2,-0.0,windowMin,windowMax));
671             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,windowMin,windowMax));
672             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.0,windowMin,windowMax));
673             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.0,windowMin,windowMax));
674             //0.2 gap
675             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.2,windowMin,windowMax));
676             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.4,windowMin,windowMax));
677             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.6,windowMin,windowMax));
678             //0.4 gap
679             taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.2,windowMin,windowMax));
680             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,windowMin,windowMax));
681             //0.6 gap
682             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.2,windowMin,windowMax));
683         }
684     }*/
685     else if( windowsConfigurationSetId == en_etaWinConfig_phiSectorsWithFixedBkwdWindow_eta0_4/*5*/ )  //fixing BKW win, and for phi-rotating with fixed window (0.4 phi-width)
686     {
687         cout << "fixed bkwd win" << endl;
688         double windowMin = 0.4;
689         double windowMax = 0.8;
690         nLRCprocessors = 4;
691         for(int i = 0; i < nPhiSectors; i++)
692         {
693             taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,windowMin,windowMax));
694             taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,windowMin,windowMax));
695             taskLRC->AddLRCProcess(new AliLRCProcess(0.0,0.4,windowMin,windowMax));
696             taskLRC->AddLRCProcess(new AliLRCProcess(0.4,0.8,windowMin,windowMax));
697         }
698     }
699     else if( windowsConfigurationSetId == en_etaWinConfig_twistedPhiWindows/*6*/ )  // 3.09.12 - twisted windows in phi
700     {
701         cout << "studying TWISTED phi windows..." << endl;
702         nLRCprocessors = 18;//11;
703         const int nPhiTwistedSectors = 3; //const number of twisted windows
704         for(int i = 0; i < nPhiTwistedSectors; i++)
705         {
706             double etaWinWidth = 0.5; //this tuned for true MC, when we have wide eta
707             double windowStep = 0.25;
708             for ( int etaId = 0; etaId < nLRCprocessors; etaId++ )
709             {
710                 double winEtaBegin  = windowStep * etaId; //etaWinWidth * etaId;
711                 double winEtaEnd    = windowStep * etaId + etaWinWidth; //etaWinWidth * ( etaId + windowOverlap);
712                 taskLRC->AddLRCProcess(new AliLRCProcess(-winEtaEnd,-winEtaBegin,winEtaBegin,winEtaEnd));
713             }
714             //            //FB
715             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.2,-0.0,0.0,0.2));
716             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,0.0,0.4));
717             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.0,0.0,0.6));
718             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.0,0.0,0.8));
719             //            //0.2 gap
720             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.2,0.2,0.4));
721             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.4,0.4,0.6));
722             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.6,0.6,0.8));
723             //            //0.4 gap
724             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.6,-0.2,0.2,0.6));
725             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,0.4,0.8));
726             //            //0.6 gap
727             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.2,0.2,0.8));
728
729             //            //FULL
730             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,0.8,-0.8,0.8));
731         }
732         //tune phi for processors:
733         taskLRC->SetNumberOfPhiSectors(6); // make rotation for 6 times!
734
735         //double phiStep = 2 * TMath::Pi() / nPhiSectors;
736         double gapInPhiBetweenWins = gapAsPartOfPi;
737         for ( Int_t sectorId = 0; sectorId < nPhiTwistedSectors; sectorId++ )
738         {
739             for ( Int_t i = nLRCprocessors * sectorId; i < nLRCprocessors * ( sectorId + 1 ); i++ )
740             {
741                 double lBkwPhi_1 = 0;   //phiStep * sectorId;
742                 double lBkwPhi_2 = 0;   //phiStep * ( sectorId + 1 );
743                 if ( sectorId == 0 ) // || phi-windows
744                 {
745                     lBkwPhi_1 = 0 + gapInPhiBetweenWins;
746                     lBkwPhi_2 = 2./3. * TMath::Pi() - gapInPhiBetweenWins;
747                 }
748                 else if ( sectorId == 1 ) // transverse phi-windows
749                 {
750                     lBkwPhi_1 = 2./3. * TMath::Pi() + gapInPhiBetweenWins;
751                     lBkwPhi_2 = TMath::Pi() - gapInPhiBetweenWins;
752                 }
753                 else if ( sectorId == 2 ) // opposite phi-windows
754                 {
755                     lBkwPhi_1 = TMath::Pi() + gapInPhiBetweenWins;
756                     lBkwPhi_2 = 5./3. * TMath::Pi() - gapInPhiBetweenWins;
757                 }
758
759                 (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetForwardWindowPhi( 0 + gapInPhiBetweenWins, 2./3. * TMath::Pi() - gapInPhiBetweenWins );
760                 (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetBackwardWindowPhi( lBkwPhi_1, lBkwPhi_2 );
761                 if ( sectorId == 1 ) // transverse phi-windows
762                     (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetDoubleSidedBackwardWindowPhi( true );
763             }
764         }
765     }
766     else if( windowsConfigurationSetId == en_etaWinConfig_longRangeEtaWindows ) //for MC truth study
767     {
768         nLRCprocessors = 8;//7;//14;
769         for(int i = 0; i < nPhiSectors; i++)
770         {
771             double etaWinWidth = 0.2;
772             double windowStep = 0.1;//1;
773             for ( int etaId = 0; etaId < nLRCprocessors; etaId++ )
774             {
775                 double winEtaBegin  = windowStep * etaId;
776                 double winEtaEnd    = windowStep * etaId + etaWinWidth;
777                 //                double winEtaBegin = etaWinWidth * etaId;
778                 //                double winEtaEnd = etaWinWidth * ( etaId + 1);
779                 taskLRC->AddLRCProcess(new AliLRCProcess(-winEtaEnd,-winEtaBegin,winEtaBegin,winEtaEnd));
780             }
781         }
782     }
783     else if( windowsConfigurationSetId == en_etaWinConfig_ridge_eta0_2_step_0_2_phi_8 )
784     {
785         cout << "fixed bkwd win" << endl;
786         double windowMin = 0.4;
787         double windowMax = 0.8;
788         double etaWinWidth = windowMax - windowMin;
789         double windowStep = 0.4;//1;
790         nLRCprocessors = 4;
791         for(int i = 0; i < nPhiSectors; i++)
792         {
793             for ( int etaId = nLRCprocessors-1; etaId >=0 ; etaId-- )
794             {
795                 double winEtaBegin  = windowStep * etaId;
796                 double winEtaEnd    = windowStep * etaId + etaWinWidth;
797                 //                double winEtaBegin = etaWinWidth * etaId;
798                 //                double winEtaEnd = etaWinWidth * ( etaId + 1);
799                 taskLRC->AddLRCProcess(new AliLRCProcess(windowMax-winEtaEnd,windowMax-winEtaBegin
800                                                          ,windowMin,windowMax));
801             }
802             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.8,-0.4,windowMin,windowMax));
803             //            taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,windowMin,windowMax));
804             //            taskLRC->AddLRCProcess(new AliLRCProcess(0.0,0.4,windowMin,windowMax));
805             //            taskLRC->AddLRCProcess(new AliLRCProcess(0.4,0.8,windowMin,windowMax));
806         }
807     }
808     else if( windowsConfigurationSetId == 100 )  //event shape
809     {
810         cout << "event shape" << endl;
811         //double windowMin = 0.4;
812         //double windowMax = 0.8;
813         nLRCprocessors = 1;
814         //for(int i = 0; i < nPhiSectors; i++)
815         //{
816         taskLRC->AddLRCProcess(new AliEventShape(-0.8,0.8,-0.8,0.8));
817         //taskLRC->AddLRCProcess(new AliLRCProcess(-0.4,-0.0,windowMin,windowMax));
818         //taskLRC->AddLRCProcess(new AliLRCProcess(0.0,0.4,windowMin,windowMax));
819         //taskLRC->AddLRCProcess(new AliLRCProcess(0.4,0.8,windowMin,windowMax));
820         //}
821     }
822
823     if ( nPhiSectors > 1 ) //tune phi sectors
824     {
825         taskLRC->SetNumberOfPhiSectors(nPhiSectors);
826         //int nLRCprocessors = 8;
827         double phiStep = 2 * TMath::Pi() / nPhiSectors;
828         for ( Int_t sectorId = 0; sectorId < nPhiSectors; sectorId++ )
829         {
830             for ( Int_t i = nLRCprocessors * sectorId; i < nLRCprocessors * ( sectorId + 1 ); i++ )
831             {
832                 double lBkwPhi_1 = phiStep * sectorId;
833                 double lBkwPhi_2 = phiStep * ( sectorId + 1 );
834
835                 (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetForwardWindowPhi( 0, phiStep );
836                 (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetBackwardWindowPhi( lBkwPhi_1, lBkwPhi_2 );
837             }
838         }
839
840     } // endif AddPhiWindows IA variant
841
842
843     
844 }
845
846 void setHistPtRange(AliAnalysisTaskLRC* taskLRC,  Double_t LoPt,Double_t HiPt, Double_t PtStep = 0.005, Int_t xAxisRebinFactor = 1 )
847 {
848     Int_t nPtBins = (Int_t) ((HiPt - LoPt) / PtStep ); // divide by "resolution" of Pt histogram to obtain number of bins
849     for(Int_t i=0; i < taskLRC->GetListOfProcessors()->GetEntries(); i++)
850     {
851         (dynamic_cast<AliLRCBase*> (taskLRC->Proc(i)))->SetHistPtRange( LoPt, HiPt, nPtBins );
852         (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetHistPtRangeForwardWindowRebinFactor( xAxisRebinFactor );
853     }
854 }
855
856 void setHistMultRange(AliAnalysisTaskLRC* taskLRC,  Int_t whichWindow, Int_t LoMult,Int_t HiMult
857                       ,Bool_t isStandartWindowSet = kTRUE, Int_t MultBins=0) // Sets range for Nch histos axis
858 {
859     //whichWindow - 0=for both, 1=for fwd, 2=bwd
860     if (isStandartWindowSet ) //usual case
861         for(Int_t i=0; i < taskLRC->GetListOfProcessors()->GetEntries(); i++)
862         {
863             (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetHistMultRange( whichWindow, LoMult, HiMult );
864         }
865     else  //try to tune bins according to eta-width
866     {
867         double eta[4];
868         AliLRCProcess* process;
869         for(Int_t i=0; i < taskLRC->GetListOfProcessors()->GetEntries(); i++)
870         {
871             process = (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)));
872             process->GetETAWindows(eta[0],eta[1],eta[2],eta[3]);
873             //look at window width and correct NN mult bins!
874             //standart is 70-270 for dEtaF+dEtaB == 0.4
875             double dEtaF = fabs( eta[1] - eta[0] );
876             double dEtaB = fabs( eta[3] - eta[2] );
877             double multCoeff = ( dEtaF + dEtaB ) / 0.4;
878             process->SetHistMultRange( whichWindow, LoMult*multCoeff, HiMult*multCoeff  );
879             //Int_t lowM = LoMult;
880             //Int_t hiM = HiMult;
881             /*Int_t shift = ( HiMult  ) / 2.;
882
883         if ( i == 1 || i == 7 || i == 8 )
884             (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetHistMultRange( whichWindow, 2*shift - 1.5*shift, 2*shift + 1.5*shift );
885         else if ( i == 2|| i == 9 )
886             (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetHistMultRange( whichWindow, 3*shift - 1.*shift, 3*shift + 2.*shift );
887         else if ( i == 3 )
888             (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetHistMultRange( whichWindow, 4*shift - 0.5*shift, 4*shift + 2.5*shift );
889         else            //if ( i == 0 || i == 4 || i == 5 || i == 6 )
890             (dynamic_cast<AliLRCProcess*> (taskLRC->Proc(i)))->SetHistMultRange( whichWindow, 0 , 2*shift );//LoMult, HiMult );
891                 */
892         }
893     }
894
895 }
896
897
898
899
900
901 //===========================================================================
902 void configureLRCtaskOutput(AliAnalysisTaskLRC* taskLRC/*,TString OutputRootFolder=":PWG2LRC"*/
903                             , TString strPrefixName= "", TString strRunMode = "default"/*by IA*/)
904 {
905     if(!taskLRC)
906         return;
907     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
908     if (!mgr)
909     {
910         Error("configureLRCtaskOutput", "No analysis manager to connect to.");
911         return ;
912     }
913
914     if (!mgr->GetInputEventHandler())
915     {
916         Error("AddTaskLRC", "This task requires an input event handler");
917         return ;
918     }
919
920     //TString type = mgr->GetInputEventHandler()->GetDataType();
921
922     TString outputFileName= mgr->GetCommonFileName();
923     if( outputFileName == "" )
924         outputFileName = "LRC." + strRunMode + ".root";
925     TString strOutputRootFolder = ":PWGCFLRC_" + strPrefixName;
926     outputFileName += strOutputRootFolder ;
927
928     TString listOutName;
929     listOutName = taskLRC->GetName();
930
931     AliAnalysisDataContainer *cout_LRC = mgr->CreateContainer(listOutName, TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data());
932     mgr->ConnectInput(taskLRC, 0, mgr->GetCommonInputContainer());
933     mgr->ConnectOutput(taskLRC, 1, cout_LRC);
934 //    if ( 1 )//taskLRC->GetIncludeEventTreeInOutput() )
935 //    {
936 //        AliAnalysisDataContainer *outLRCtree = mgr->CreateContainer("eventTreeContainer", TTree::Class(),AliAnalysisManager::kOutputContainer,outputFileName);
937 //        mgr->ConnectOutput(taskLRC, 2, outLRCtree);
938 //    }
939
940     cout << "N of LRC Processors ="<< taskLRC->GetListOfProcessors()->GetEntries() <<"\n";
941     for(Int_t i=0; i < taskLRC->GetListOfProcessors()->GetEntries(); i++)
942     {
943         mgr->ConnectOutput(taskLRC,taskLRC->Proc(i)->GetOutputSlotNumber(),mgr->CreateContainer(strPrefixName+"_"+((taskLRC->Proc(i)->GetShortDef()+"_")+=i),TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName));
944     }
945
946 }
947
948