]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C
adding planes
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskCentraldNdeta.C
CommitLineData
b00b37ad 1/**
2 * @file AddTaskCentraldNdeta.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 central @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
b00b37ad 25 */
26AliAnalysisTask*
e308a636 27AddTaskCentraldNdeta(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)
b00b37ad 33{
ffca499d 34 // --- Analysis manager --------------------------------------------
b00b37ad 35 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
0be6c8cd 36
ffca499d 37 // --- Make our object ---------------------------------------------
b00b37ad 38 AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central");
ffca499d 39 // Set the vertex range to use
b00b37ad 40 task->SetVertexRange(vzMin, vzMax);
ffca499d 41 // Set the trigger mask to use (INEL,INEL>0,NSD)
b00b37ad 42 task->SetTriggerMask(trig);
ffca499d 43 // Whether to cut edges when re-binning
e308a636 44 task->SetCutEdges(cutEdges);
ffca499d 45 // Bit mask of
46 //
0be6c8cd 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
ffca499d 52 //
0be6c8cd 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
ffca499d 56 // are some constants that encode the common cases
57 //
0be6c8cd 58 // kFull = kEventLevel | kBackground | kShape | kTriggerEfficiency
ffca499d 59 //
60 // Default is kFull
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 .
e308a636 67 if (useCent) {
68 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
69 task->SetCentralityAxis(11, bins);
70 }
b00b37ad 71 mgr->AddTask(task);
72
ffca499d 73 // --- create containers for input/output --------------------------
b00b37ad 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());
82
ffca499d 83 // --- connect input/output ----------------------------------------
b00b37ad 84 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
85 mgr->ConnectOutput(task, 1, sums);
86 mgr->ConnectOutput(task, 2, output);
ffca499d 87
b00b37ad 88 return task;
89}
90
91
92//________________________________________________________________________
93//
94// EOF
95//