]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/PHOS_Correlation/AddTaskPi0Correlations.C
logic update and bug fix
[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 {
7         //Author: Ponomarenko Daniil (Daniil.Ponomarenko@cern.ch)
8         /* $Id$ */
9
10         AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11         if (!mgr) 
12         {
13                 ::Error("AddTaskPi0Correlations", "No analysis manager to connect to");
14                 return NULL;
15         }
16
17         if (!mgr->GetInputEventHandler()) 
18         {
19                 ::Error("AddTaskPi0Correlations", "This task requires an input event handler");
20                 return NULL;
21         }
22         
23                 
24         stringstream ss;
25         ss << downCentLimit;
26         string strDownCentLimit = ss.str();
27         char text[255];
28         sprintf(text,"%2i",upCentLimit);
29         string strUpCentLimit = text;
30         TString centralityBorder = TString ("CB") + strDownCentLimit.c_str() + TString ("t") + strUpCentLimit.c_str() + TString ("Cnt");
31         TString sigmaBorder = Form("%2iSigma", int(sigmaWidth*10.));
32         if (sigmaWidth == 0) sigmaBorder = "00Sigma";
33         TString sName = TString (name) + sigmaBorder + centralityBorder ;
34
35
36         AliPHOSCorrelations* task = new AliPHOSCorrelations( Form("%sTask", sName.Data()) );
37
38         if( TString(options).Contains("10h") )  {
39                 task->SetPeriod( AliPHOSCorrelations::kLHC10h );
40                 task->SetCentralityEstimator("V0M");
41         }
42         if( TString(options).Contains("11h") )  {
43                 task->SetPeriod( AliPHOSCorrelations::kLHC11h );
44                 task->SetCentralityEstimator("V0M");
45         }
46         if( TString(options).Contains("13") )   {
47                 task->SetPeriod( AliPHOSCorrelations::kLHC13 );
48                 task->SetCentralityEstimator("V0A");
49         }
50
51
52         // Binning 
53         // TODO: Make other binning for 0-10% and 20-50%
54         //Central:
55         if( downCentLimit == 0 && upCentLimit == 10 ) 
56         {
57                 const int nbins = 5;
58                 Double_t cbin[nbins+1] = {0., 2., 4., 6., 8., 10.};
59                 TArrayD tbin(nbins+1, cbin);
60                 Int_t    nMixed[nbins] = {100, 100, 100, 100, 100};
61                 TArrayI tNMixed(nbins, nMixed);
62                 task->SetCentralityBinning(tbin, tNMixed);
63         }
64         // SemiCentral:
65         if( downCentLimit == 20 && upCentLimit == 50 ) 
66         {
67                 const int nbins = 6;
68                 Double_t cbin[nbins+1] = {20., 25., 30., 35., 40., 45., 50.};
69                 TArrayD tbin(nbins+1, cbin);
70                 Int_t    nMixed[nbins] = {100, 100, 100, 100, 100, 100};
71                 TArrayI tNMixed(nbins, nMixed);
72                 task->SetCentralityBinning(tbin, tNMixed);
73         }
74
75         task->SetAnalysisAlgoritmForReal("ME");
76         task->SetAnalysisAlgoritmForMix("ME");
77         task->EnableTOFCut(false, 100.e-9);
78         task->SelectCollisionCandidates(AliVEvent::kAny);
79         task->SetCentralityBorders(downCentLimit , upCentLimit) ;
80         task->SetSigmaWidth(sigmaWidth);
81
82         mgr->AddTask(task);
83         mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
84
85         TString cname(Form("%sCoutput1", sName.Data()));
86         TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), sName.Data()));
87         AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
88         mgr->ConnectOutput(task, 1, coutput1);
89
90         return task;
91 }
92