]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/PHOSTasks/PHOS_Correlation/AddTaskPi0Correlations.C
Updating configuration for ACORDE and TRD.
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_Correlation / AddTaskPi0Correlations.C
CommitLineData
67ef08bd 1AliPHOSCorrelations* AddTaskPi0Correlations ( const char* name = "Pi0Corr",
2 const char* options = "11h",
3 const char* fPi0Parametrization = "Wide",
4 UInt_t offlineTriggerMask = AliVEvent::kCentral,
5 AliPHOSCorrelations::TriggerSelection internalTriggerSelection = AliPHOSCorrelations::kNoSelection,
6 Double_t mean = 0.135,
7 Double_t sigma = 0.04,
8 Int_t downCentLimit = 0,
9 Int_t upCentLimit = 90 )
10{
11 //Author: Ponomarenko Daniil
12 /* $Id$ */
13
14 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
15 if (!mgr)
16 {
17 ::Error("AddTaskPi0Correlations", "No analysis manager to connect to");
18 return NULL;
19 }
20
21 if (!mgr->GetInputEventHandler())
22 {
23 ::Error("AddTaskPi0Correlations", "This task requires an input event handler");
24 return NULL;
25 }
26
27
28 stringstream ss;
29 ss << downCentLimit;
30 string strDownCentLimit = ss.str();
31 char text[255];
32 sprintf(text,"%2i",upCentLimit);
33 string strUpCentLimit = text;
34 TString centralityBorder = TString ("CB") + strDownCentLimit.c_str() + TString ("t") + strUpCentLimit.c_str() + TString ("Cnt");
35 TString sName = TString (name) + TString (fPi0Parametrization) + centralityBorder ;
36
37
38 AliPHOSCorrelations* task = new AliPHOSCorrelations(Form("%sTask", sName.Data()),internalTriggerSelection);
39
40 if( TString(options).Contains("10h") )
41 task->SetPeriod( AliPHOSCorrelations::kLHC10h );
42 if( TString(options).Contains("11h") )
43 task->SetPeriod( AliPHOSCorrelations::kLHC11h );
44 if( TString(options).Contains("13") )
45 task->SetPeriod( AliPHOSCorrelations::kLHC13 );
46
47 // Binning
48 //Any:
49 if( AliVEvent::kAny == offlineTriggerMask )
50 {
51 const int nbins = 8;
52 Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
53 TArrayD tbin(nbins+1, cbin);
54 Int_t nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
55 TArrayI tNMixed(nbins, nMixed);
56 task->SetCentralityBinning(tbin, tNMixed);
57 }
58 //Central:
59 if( AliVEvent::kCentral == offlineTriggerMask )
60 {
61 const int nbins = 4;
62 Double_t cbin[nbins+1] = {0., 5., 8., 9., 10.};
63 TArrayD tbin(nbins+1, cbin);
64 Int_t nMixed[nbins] = {6, 6, 6, 6};
65 TArrayI tNMixed(nbins, nMixed);
66 task->SetCentralityBinning(tbin, tNMixed);
67 }
68 // SemiCentral:
69 if( AliVEvent::kSemiCentral == offlineTriggerMask )
70 {
71 const int nbins = 8;
72 Double_t cbin[nbins+1] = {10., 11., 12., 13., 15., 20., 30., 40., 50.};
73 TArrayD tbin(nbins+1, cbin);
74 Int_t nMixed[nbins] = {40, 40, 40, 40, 40, 40, 40, 40};
75 TArrayI tNMixed(nbins, nMixed);
76 task->SetCentralityBinning(tbin, tNMixed);
77 }
78 //INT7:
79 if( AliVEvent::kINT7 == offlineTriggerMask )
80 {
81 const int nbins = 8;
82 Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
83 TArrayD tbin(nbins+1, cbin);
84 Int_t nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
85 TArrayI tNMixed(nbins, nMixed);
86 task->SetCentralityBinning(tbin, tNMixed);
87 }
88 // MB or PHOS Trigger:
89 if( AliVEvent::kMB == offlineTriggerMask || AliVEvent::kPHOSPb == offlineTriggerMask )
90 {
91 const int nbins = 8;
92 Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
93 TArrayD tbin(nbins+1, cbin);
94 Int_t nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
95 TArrayI tNMixed(nbins, nMixed);
96 task->SetCentralityBinning(tbin, tNMixed);
97 }
98
99
100 task->SelectCollisionCandidates(offlineTriggerMask);
101 task->SetInternalTriggerSelection(internalTriggerSelection);
102 task->EnableTOFCut(true, 100.e-9);
103 task->SetMassWindow(mean-sigma, mean+sigma);
104 task->SetCentralityBorders(downCentLimit , upCentLimit) ;
105
106 mgr->AddTask(task);
107 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
108
109 TString cname(Form("%sCoutput1", sName.Data()));
110 TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), sName.Data()));
111 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
112 mgr->ConnectOutput(task, 1, coutput1);
113
114 return task;
115}