2 * @file AddTaskCentraldNdeta.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 central @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 mcanalysisfilename Take final MC corrections from this - if present
22 * @param trigEff Trigger efficiency
23 * @param trigEff0 Trigger efficiency for 0-bin
24 * @param corrEmpty Correct for empty bins
26 * @return Newly created and configured task
28 * @ingroup pwglf_forward_dndeta
31 AddTaskCentraldNdeta(const char* config = "dNdetaConfig.C",
32 const char* trig = "INEL",
35 const char* cent = "",
36 const char* scheme = 0,
38 Double_t trigEff0 = 1,
39 Bool_t satVtx = false)
41 // --- Load libraries ----------------------------------------------
42 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
44 // --- Analysis manager --------------------------------------------
45 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
47 // --- Check that we have an AOD input handler ---------------------
48 UShort_t aodInput = 0;
49 if (!(aodInput = AliForwardUtil::CheckForAOD()))
50 Fatal("","Cannot proceed without and AOD handler");
52 !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask"))
53 Fatal("","The relevant task wasn't added to the train");
55 // --- Make our object ---------------------------------------------
56 AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central");
58 // Set the vertex range to use
59 task->SetIpZRange(vzMin, vzMax);
60 // Set the trigger mask to use (INEL,INEL>0,NSD)
61 task->SetTriggerMask(trig);
62 task->SetTriggerEff(trigEff); // 0.997535);
63 task->SetTriggerEff0(trigEff0);
67 // kNone Normalise to accepted events
68 // kEventLevel Normalise to all events in selected range
69 // kBackground Also correct for background triggers
70 // kTriggerEfficiency Correct for trigger efficiency
72 // kNone and kEventLevel are mutually exclusive. If kEventLevel is
73 // not specified, then kNone is assumed. kBackground only makes
74 // sense with kEventLevel. Furthermore, there
75 // are some constants that encode the common cases
77 // kFull = kEventLevel | kBackground | kTriggerEfficiency
80 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
81 if (scheme) task->SetNormalizationScheme(scheme);
82 // Set the centrality bins to use. These are mutually exclusive.
83 // Note, that a bin specified as a-b, covers the interval from a,
84 // inclusive to b exclusive. An upper bound of 100 is treated
85 // especially, and the upper bound is inclusive in that case .
87 if (task->SetCentralityMethod(cent)) {
88 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100 };
89 task->SetCentralityAxis(10, bins);
93 // Set-up task using a script
94 task->Configure(config);
103 //________________________________________________________________________