]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C
Renamed script to add Central AOD task from
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskForwarddNdeta.C
CommitLineData
b2e7f2d6 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 *
ffca499d 10 * @ingroup pwg2_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 useCent Whether to use the centrality or not
19 * @param scheme Normalisation scheme
20 * @param cutEdges Whether to cut edges when rebinning
21 *
22 * @return Newly created and configured task
23 *
24 * @ingroup pwg2_forward_dndeta
b2e7f2d6 25 */
26AliAnalysisTask*
e308a636 27AddTaskForwarddNdeta(const char* trig = "INEL",
28 Double_t vzMin = -10,
29 Double_t vzMax = +10,
30 Bool_t useCent = false,
ffca499d 31 const char* scheme = 0,
e308a636 32 Bool_t cutEdges = false)
b2e7f2d6 33{
ffca499d 34 // --- Analysis manager --------------------------------------------
b2e7f2d6 35 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
0be6c8cd 36
37 // --- Fix up physics selection to give proper A,C, and E triggers -
38 AliInputEventHandler* ih =
39 static_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
40 AliPhysicsSelection* ps =
41 static_cast<AliPhysicsSelection*>(ih->GetEventSelection());
42
43 // Ignore trigger class when selecting events. This mean that we
44 // get offline+(A,C,E) events too
45 ps->SetSkipTriggerClassSelection(true);
b2e7f2d6 46
ffca499d 47 // --- Make our object ---------------------------------------------
b2e7f2d6 48 AliForwarddNdetaTask* task = new AliForwarddNdetaTask("Forward");
ffca499d 49 // Set the vertex range to use
b2e7f2d6 50 task->SetVertexRange(vzMin, vzMax);
ffca499d 51 // Set the trigger mask to use (INEL,INEL>0,NSD)
b2e7f2d6 52 task->SetTriggerMask(trig);
ffca499d 53 // Whether to cut edges when re-binning
e28f5fc5 54 task->SetCutEdges(cutEdges);
ffca499d 55 // Bit mask of
56 //
57 // kNone Normalise to accepted events
58 // kEventLevel Normalise to all events in selected range
59 // kAltEventLevel Normalise to all events in selected range
60 // kBackground Also correct for background triggers
61 // kShape Correct shape
62 //
63 // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
64 // If neither kEventLevel, nor kAltEventLevel is specified, then
65 // kNone is assumed. kBackground (when implemented) only makes
66 // sense with kEventLevel and kAltEventLevel. Furthermore, there
67 // are some constants that encode the common cases
68 //
69 // kFull = kEventLevel | kBackground | kShape
70 // kAltFull = kAltEventLevel | kBackground | kShape
71 //
72 // Default is kFull
73 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
74 if (scheme) task->SetNormalizationScheme(scheme);
75 // Set the centrality bins to use. These are mutually exclusive.
76 // Note, that a bin specified as a-b, covers the interval from a,
77 // inclusive to b exclusive. An upper bound of 100 is treated
78 // especially, and the upper bound is inclusive in that case .
e308a636 79 if (useCent) {
80 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
81 task->SetCentralityAxis(11, bins);
82 }
b2e7f2d6 83 mgr->AddTask(task);
84
ffca499d 85 // --- create containers for input/output --------------------------
b2e7f2d6 86 AliAnalysisDataContainer *sums =
87 mgr->CreateContainer("ForwardSums", TList::Class(),
88 AliAnalysisManager::kOutputContainer,
89 AliAnalysisManager::GetCommonFileName());
90 AliAnalysisDataContainer *output =
91 mgr->CreateContainer("ForwardResults", TList::Class(),
92 AliAnalysisManager::kParamContainer,
93 AliAnalysisManager::GetCommonFileName());
94
ffca499d 95 // --- connect input/output ----------------------------------------
b2e7f2d6 96 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
97 mgr->ConnectOutput(task, 1, sums);
98 mgr->ConnectOutput(task, 2, output);
99
100 return task;
101}
102
103
104//________________________________________________________________________
105//
106// EOF
107//