2 * @file AddTaskCentraldNdeta.C
3 * @author Christian Holm Christensen <cholm@nbi.dk>
4 * @date Fri Jan 28 10:22:26 2011
6 * @brief Script to add a multiplicity task for the central
10 * @ingroup pwg2_forward_scripts_tasks
13 * Create the central @f$ dN/d\eta@f$ analysis task
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
22 * @return Newly created and configured task
24 * @ingroup pwg2_forward_dndeta
27 AddTaskCentraldNdeta(const char* trig = "INEL",
30 Bool_t useCent = false,
31 const char* scheme = 0,
32 Bool_t cutEdges = false)
34 // --- Analysis manager --------------------------------------------
35 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
37 // --- Make our object ---------------------------------------------
38 AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central");
39 // Set the vertex range to use
40 task->SetVertexRange(vzMin, vzMax);
41 // Set the trigger mask to use (INEL,INEL>0,NSD)
42 task->SetTriggerMask(trig);
43 // Whether to cut edges when re-binning
44 task->SetCutEdges(cutEdges);
47 // kNone Normalise to accepted events
48 // kEventLevel Normalise to all events in selected range
49 // kBackground Also correct for background triggers
50 // kTriggerEfficiency Correct for trigger efficiency
51 // kShape Correct shape
53 // kNone and kEventLevel are mutually exclusive. If kEventLevel is
54 // not specified, then kNone is assumed. kBackground only makes
55 // sense with kEventLevel. Furthermore, there
56 // are some constants that encode the common cases
58 // kFull = kEventLevel | kBackground | kShape | kTriggerEfficiency
61 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
62 if (scheme) task->SetNormalizationScheme(scheme);
63 // Set the centrality bins to use. These are mutually exclusive.
64 // Note, that a bin specified as a-b, covers the interval from a,
65 // inclusive to b exclusive. An upper bound of 100 is treated
66 // especially, and the upper bound is inclusive in that case .
68 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
69 task->SetCentralityAxis(11, bins);
73 // --- create containers for input/output --------------------------
74 AliAnalysisDataContainer *sums =
75 mgr->CreateContainer("CentralSums", TList::Class(),
76 AliAnalysisManager::kOutputContainer,
77 AliAnalysisManager::GetCommonFileName());
78 AliAnalysisDataContainer *output =
79 mgr->CreateContainer("CentralResults", TList::Class(),
80 AliAnalysisManager::kParamContainer,
81 AliAnalysisManager::GetCommonFileName());
83 // --- connect input/output ----------------------------------------
84 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
85 mgr->ConnectOutput(task, 1, sums);
86 mgr->ConnectOutput(task, 2, output);
92 //________________________________________________________________________