]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/PHOS_Correlation/AddTaskPi0Correlations.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_Correlation / AddTaskPi0Correlations.C
1 AliPHOSCorrelations* AddTaskPi0Correlations (           const char* name = "Pi0Corr",
2                                                 const char* options = "11h",
3                                                 Double_t sigmaWidth = 3.,
4                                                 Int_t downCentLimit = 0,
5                                                 Int_t upCentLimit = 90,
6                                                 const char* suffix = "" )
7 {
8         //Author: Ponomarenko Daniil (Daniil.Ponomarenko@cern.ch)
9         /* $Id$ */
10
11         AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12         if (!mgr) 
13         {
14                 ::Error("AddTaskPi0Correlations", "No analysis manager to connect to");
15                 return NULL;
16         }
17
18         if (!mgr->GetInputEventHandler()) 
19         {
20                 ::Error("AddTaskPi0Correlations", "This task requires an input event handler");
21                 return NULL;
22         }
23         
24         
25         TString className = name;
26         TString sigmaName = Form( "%2iSigma", int(sigmaWidth*10.) ) ;
27         if( sigmaWidth==0 ) sigmaName = "00Sigma";
28         TString sName = Form("%s%s%sCB%it%iCnt", className.Data(), suffix, sigmaName.Data(), downCentLimit, upCentLimit);
29
30         TString combinedName;
31         combinedName.Form("%sTask", sName.Data());
32
33         AliPHOSCorrelations* task = new AliPHOSCorrelations( combinedName );
34
35         if( TString(options).Contains("10h") )  
36         {
37                 task->SetCentralityEstimator("V0M");
38         }
39         
40         if( TString(options).Contains("11h") )  
41         {
42                 task->SetCentralityEstimator("V0M");
43                 if( downCentLimit == 0 && upCentLimit == 10 ) 
44                 {
45                         Double_t meanParametrs[2]  = {-0.000129767, 0.138874 };
46                         Double_t sigmaParametrs[4] = {5.73226e-06, -0.00879368, 0.00462739 };
47                         task->SetMassMeanParametrs(meanParametrs);
48                         task->SetMassSigmaParametrs(sigmaParametrs);
49                 }
50
51                 if( downCentLimit == 20 && upCentLimit == 50 ) 
52                 {
53                         Double_t meanParametrs[2]  = {-8.35555e-05, 0.136538 };
54                         Double_t sigmaParametrs[4] = {-7.61949e-06, 1.20701e-06, 0.00474992 };
55                         task->SetMassMeanParametrs(meanParametrs);
56                         task->SetMassSigmaParametrs(sigmaParametrs);
57                 }
58         }
59         
60         if( TString(options).Contains("13") )   
61         {
62                 task->SetCentralityEstimator("V0A");
63                 if( downCentLimit == 0 && upCentLimit == 10 ) 
64                 {
65                         Double_t meanParametrs[2]  = {-4.64539e-05, 0.134773 };
66                         Double_t sigmaParametrs[3] = {0.00383029, 0.0041709, 0.00468736 };
67                         task->SetMassMeanParametrs(meanParametrs);
68                         task->SetMassSigmaParametrs(sigmaParametrs);
69                 }
70
71                 if( downCentLimit == 20 && upCentLimit == 50 ) 
72                 {
73                         Double_t meanParametrs[2]  = {-4.90799e-06, 0.134566 };
74                         Double_t sigmaParametrs[4] = {0.00293721, 0.00622308, 0.00468625 };
75                         task->SetMassMeanParametrs(meanParametrs);
76                         task->SetMassSigmaParametrs(sigmaParametrs);
77                 }
78         }
79
80
81         // Mixed binning 
82         //Central:
83         if( downCentLimit == 0 && upCentLimit == 10 ) 
84         {
85                 const int nbins = 5;
86                 Double_t cbin[nbins+1] = {0., 2., 4., 6., 8., 10.};
87                 TArrayD tbin(nbins+1, cbin);
88                 Int_t    nMixed[nbins] = {10, 10, 10, 10, 10};
89                 TArrayI tNMixed(nbins, nMixed);
90                 task->SetCentralityBinning(tbin, tNMixed);
91         }
92         // SemiCentral:
93         if( downCentLimit == 20 && upCentLimit == 50 ) 
94         {
95                 const int nbins = 6;
96                 Double_t cbin[nbins+1] = {20., 25., 30., 35., 40., 45., 50.};
97                 TArrayD tbin(nbins+1, cbin);
98                 Int_t    nMixed[nbins] = {10, 10, 10, 10, 10, 10};
99                 TArrayI tNMixed(nbins, nMixed);
100                 task->SetCentralityBinning(tbin, tNMixed);
101         }
102
103
104         // Period setup
105         task->SetPeriodName( TString(options) );
106         // Events
107         task->SelectCollisionCandidates(AliVEvent::kAny);
108         task->SetCentralityBorders((Double_t)downCentLimit , (Double_t)upCentLimit) ;
109         // Clasters
110         task->EnableTOFCut(false, 100.e-9);
111         task->SwitchOnPionEfficiency();
112         task->SwitchOnMassParametrisation();
113         task->SetSigmaWidth(sigmaWidth);
114         // Tracks
115         task->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
116     task->SetTrackStatus(AliVTrack::kITSrefit);
117     task->SetTPCSharedClusterFraction(0.4);
118     task->SwitchOnAODTrackSharedClusterSelection();
119     task->SwitchOffTrackHitSPDSelection();
120     task->SetTrackFilterMask(786);
121
122         mgr->AddTask(task);
123         mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
124
125         TString cname(Form("%sCoutput1", combinedName.Data()));
126         TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), combinedName.Data()));
127         AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
128         mgr->ConnectOutput(task, 1, coutput1);
129
130         return task;
131 }
132