A better way to specify the Nch axis for the MultDists task.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardMultDists.C
CommitLineData
bfab35d9 1/**
2 * @file AddTaskForwarddNdeta.C
3 * @author Christian Holm Christensen <cholm@nbi.dk>
4 * @date Fri Jan 28 10:22:26 2011
5 *
6 * @brief Script to add a multiplicity task for the central
7 * @f$\eta@f$ region
8 *
9 *
10 * @ingroup pwglf_forward_scripts_tasks
11 */
12/**
13 * Create the Forward @f$ dN/d\eta@f$ analysis task
14 *
15 * @param trig Trigger to use
16 * @param vzMin Smallest @f$ v_z@f$
17 * @param vzMax Biggest @f$ v_z@f$
18 * @param maxN Maximum Nch
19 * @param usePhiAcc Use stored phi acceptance
20 * @param useAsymm Make asymmetric bins
21 *
22 * @return Newly created and configured task
23 *
24 * @ingroup pwglf_forward_dndeta
25 */
52b36573 26
bfab35d9 27AliAnalysisTask*
28AddTaskForwardMultDists(const char* trig = "V0AND",
29 Double_t vzMin = -4,
30 Double_t vzMax = +4,
bfab35d9 31 Bool_t usePhiAcc = true,
32 Bool_t useAsymm = false)
33{
34 // --- Load libraries ----------------------------------------------
35 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
36
37 // --- Analysis manager --------------------------------------------
38 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
39
40 // --- Check that we have an AOD input handler ---------------------
41 UShort_t aodInput = 0;
42 if (!(aodInput = AliForwardUtil::CheckForAOD()))
43 Fatal("","Cannot proceed without and AOD handler");
44 if (aodInput == 2 &&
45 !AliForwardUtil::CheckForTask("AliForwardMultiplicityBase"))
46 Fatal("","The relevant task wasn't added to the train");
47
48
49 // --- Make our object ---------------------------------------------
50 AliForwardMultDists* task = new AliForwardMultDists("Forward");
51
52 // Set the vertex range to use
53 task->SetIpZRange(vzMin, vzMax);
54 // Set the trigger mask to use (INEL,INEL>0,NSD)
55 task->SetTriggerMask(trig);
bfab35d9 56 // Set whether to use stored phi acceptance
57 task->SetUsePhiAcc(usePhiAcc);
58 // add the task
59 mgr->AddTask(task);
60
52b36573 61 // Variable size axis objects
62 // for |eta|<0.5 from CMD
63 AliForwardMultDists::BinSpec b05(-0.5, 0.5, -0.5);
64 b05.Push(21, 1);
65 b05.Push(1, 3);
66 b05.Push(1, 5);
67 b05.Push(3, 5); // <-- Extra
68
69 // for |eta|<0.5 from ALICE
70 AliForwardMultDists::BinSpec a05(-0.5, 0.5, -0.5);
71 a05.Push(21, 1);
72 a05.Push(3, 2);
73
74 // For |eta|<1 from CMS
75 AliForwardMultDists::BinSpec b10(-1.0, 1.0, -0.5);
76 b10.Push(35, 1);
77 b10.Push(1, 3);
78 b10.Push(4, 5);
79 b10.Push(2, 5); // <-- Extra
80
81 // For |eta|<1 from ALICE
82 AliForwardMultDists::BinSpec a10(-1.0, 1.0, -0.5);
83 a10.Push(41, 1);
84 a10.Push(1, 2);
85
86 // For |eta|<1.3 from ALICE
87 AliForwardMultDists::BinSpec a13(-1.3, 1.3, -0.5);
88 a13.Push(41, 1);
89 a13.Push(7, 2);
90
91 // For |eta|<1.5 from CMS
92 AliForwardMultDists::BinSpec b15(-1.5, 1.5, -0.5);
93 b15.Push(46, 1);
94 b15.Push(1, 2);
95 b15.Push(1, 3);
96 b15.Push(4, 5);
97 b15.Push(4, 5); // <-- Extra
98
99 // for |eta|<2.0 from CMS
100 AliForwardMultDists::BinSpec b20(-2.0, 2.0, -0.5);
101 b20.Push(62, 1);
102 b20.Push(2, 2);
103 b20.Push(1, 4);
104 b20.Push(3, 10);
105 b20.Push(2, 10); // <-- Extra
106
107 // for |eta|<2 from CMS
108 AliForwardMultDists::BinSpec b24(-2.4, 2.4, -0.5);
109 b24.Push(57, 1);
110 b24.Push(1, 2);
111 b24.Push(1, 3);
112 b24.Push(3, 10);
113 b24.Push(4, 10); // <-- Extra
114
bfab35d9 115 // Add bins
52b36573 116 AliForwardMultDists::BinSpec* bs[] = { &b05, &b10, &b15, &b20, &b24, 0 };
117 AliForwardMultDists::BinSpec** pb = bs;
118 while (*pb) {
119 AliForwardMultDists::BinSpec* b = *pb;
120 task->AddBin(*b);
bfab35d9 121 if (useAsymm) {
52b36573 122 task->AddBin(b->fEtaMin, 0, b->Axis());
123 task->AddBin(0, b->fEtaMax, b->Axis());
bfab35d9 124 }
52b36573 125 pb++;
bfab35d9 126 }
127
128 // --- create containers for input/output --------------------------
129 AliAnalysisDataContainer *sums =
130 mgr->CreateContainer("ForwardMultSums", TList::Class(),
131 AliAnalysisManager::kOutputContainer,
132 AliAnalysisManager::GetCommonFileName());
133 AliAnalysisDataContainer *output =
134 mgr->CreateContainer("ForwardMultResults", TList::Class(),
135 AliAnalysisManager::kParamContainer,
136 AliAnalysisManager::GetCommonFileName());
137
138 // --- connect input/output ----------------------------------------
139 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
140 mgr->ConnectOutput(task, 1, sums);
141 mgr->ConnectOutput(task, 2, output);
142
143 return task;
144}
145
146
147//________________________________________________________________________
148//
149// EOF
150//