]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AddTaskMCTruthdNdeta.C
Coverity (Ruben)
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskMCTruthdNdeta.C
CommitLineData
9ecab72f 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 pwg2_forward_scripts_tasks
11 */
12/**
13 * Create the MCTruth @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
25 */
26AliAnalysisTask*
27AddTaskMCTruthdNdeta(const char* trig = "INEL",
28 Double_t vzMin = -10,
29 Double_t vzMax = +10,
30 Bool_t useCent = false,
31 const char* scheme = 0,
32 Bool_t cutEdges = false)
33{
34 // --- Analysis manager --------------------------------------------
35 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
36
37 // --- Make our object ---------------------------------------------
38 AliMCTruthdNdetaTask* task = new AliMCTruthdNdetaTask("MCTruth");
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 // Set the trigger efficiency
44 // task->SetTriggerEff(0.997535);
45 // Whether to cut edges when re-binning
46 task->SetCutEdges(cutEdges);
47 // Whether to correct for empty bins when projecting
48 task->SetCorrEmpty(true);
49 // Whether to use TH2::ProjectionX
50 task->SetUseROOTProjectX(false);
51 // Bit mask of
52 //
53 // kNone Normalise to accepted events
54 // kEventLevel Normalise to all events in selected range
55 // kAltEventLevel Normalise to all events in selected range
56 // kBackground Also correct for background triggers
57 // kShape Correct shape
58 //
59 // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
60 // If neither kEventLevel, nor kAltEventLevel is specified, then
61 // kNone is assumed. kBackground (when implemented) only makes
62 // sense with kEventLevel and kAltEventLevel. Furthermore, there
63 // are some constants that encode the common cases
64 //
65 // kFull = kEventLevel | kBackground | kShape
66 // kAltFull = kAltEventLevel | kBackground | kShape
67 //
68 // Default is kFull
69 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
70 if (scheme) task->SetNormalizationScheme(scheme);
71 // Set the centrality bins to use. These are mutually exclusive.
72 // Note, that a bin specified as a-b, covers the interval from a,
73 // inclusive to b exclusive. An upper bound of 100 is treated
74 // especially, and the upper bound is inclusive in that case .
75 if (useCent) {
76 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
77 task->SetCentralityAxis(11, bins);
78 }
79 mgr->AddTask(task);
80
81 // --- create containers for input/output --------------------------
82 AliAnalysisDataContainer *sums =
83 mgr->CreateContainer("MCTruthSums", TList::Class(),
84 AliAnalysisManager::kOutputContainer,
85 AliAnalysisManager::GetCommonFileName());
86 AliAnalysisDataContainer *output =
87 mgr->CreateContainer("MCTruthResults", TList::Class(),
88 AliAnalysisManager::kParamContainer,
89 AliAnalysisManager::GetCommonFileName());
90
91 // --- connect input/output ----------------------------------------
92 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
93 mgr->ConnectOutput(task, 1, sums);
94 mgr->ConnectOutput(task, 2, output);
95
96 return task;
97}
98
99
100//________________________________________________________________________
101//
102// EOF
103//