2 * @file AddTaskForwarddNdeta.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 pwglf_forward_scripts_tasks
13 * Create the MCTruth @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 pwglf_forward_dndeta
27 AddTaskMCTruthdNdeta(const char* trig = "INEL",
30 Bool_t useCent = false,
31 const char* scheme = 0,
32 Bool_t cutEdges = false)
34 // --- Load libraries ----------------------------------------------
35 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
37 // --- Get analysis manager ----------------------------------------
38 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
40 // --- Make our object ---------------------------------------------
41 AliMCTruthdNdetaTask* task = new AliMCTruthdNdetaTask("MCTruth");
42 // Set the vertex range to use
43 task->SetVertexRange(vzMin, vzMax);
44 // Set the trigger mask to use (INEL,INEL>0,NSD)
45 task->SetTriggerMask(trig);
46 // Set the trigger efficiency
47 // task->SetTriggerEff(0.997535);
48 // Whether to cut edges when re-binning
49 task->SetCutEdges(cutEdges);
50 // Whether to correct for empty bins when projecting
51 task->SetCorrEmpty(true);
52 // Whether to use TH2::ProjectionX
53 task->SetUseROOTProjectX(false);
56 // kNone Normalise to accepted events
57 // kEventLevel Normalise to all events in selected range
58 // kAltEventLevel Normalise to all events in selected range
59 // kBackground Also correct for background triggers
60 // kShape Correct shape
62 // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
63 // If neither kEventLevel, nor kAltEventLevel is specified, then
64 // kNone is assumed. kBackground (when implemented) only makes
65 // sense with kEventLevel and kAltEventLevel. Furthermore, there
66 // are some constants that encode the common cases
68 // kFull = kEventLevel | kBackground | kShape
69 // kAltFull = kAltEventLevel | kBackground | kShape
72 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
73 if (scheme) task->SetNormalizationScheme(scheme);
74 // Set the centrality bins to use. These are mutually exclusive.
75 // Note, that a bin specified as a-b, covers the interval from a,
76 // inclusive to b exclusive. An upper bound of 100 is treated
77 // especially, and the upper bound is inclusive in that case .
79 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
80 task->SetCentralityAxis(11, bins);
84 // --- create containers for input/output --------------------------
85 AliAnalysisDataContainer *sums =
86 mgr->CreateContainer("MCTruthSums", TList::Class(),
87 AliAnalysisManager::kOutputContainer,
88 AliAnalysisManager::GetCommonFileName());
89 AliAnalysisDataContainer *output =
90 mgr->CreateContainer("MCTruthResults", TList::Class(),
91 AliAnalysisManager::kParamContainer,
92 AliAnalysisManager::GetCommonFileName());
94 // --- connect input/output ----------------------------------------
95 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
96 mgr->ConnectOutput(task, 1, sums);
97 mgr->ConnectOutput(task, 2, output);
103 //________________________________________________________________________