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