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