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 Forward @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
23 * @return Newly created and configured task
25 * @ingroup pwglf_forward_dndeta
28 AddTaskForwarddNdeta(const char* trig = "INEL",
31 Bool_t useCent = false,
32 const char* scheme = 0,
33 Bool_t cutEdges = false,
35 Double_t trigEff0 = 1,
36 Bool_t corrEmpty= false,
37 const char* mcanalysisfilename = "none")
39 // --- Load libraries ----------------------------------------------
40 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
42 // --- Analysis manager --------------------------------------------
43 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
45 // --- Check that we have an AOD input handler ---------------------
46 UShort_t aodInput = 0;
47 if (!(aodInput = AliForwardUtil::CheckForAOD()))
48 Fatal("","Cannot proceed without and AOD handler");
50 !AliForwardUtil::CheckForTask("AliForwardMultiplicityBase"))
51 Fatal("","The relevant task wasn't added to the train");
54 // --- Make our object ---------------------------------------------
55 AliForwarddNdetaTask* task = new AliForwarddNdetaTask("Forward");
56 //Set the filename of the corresponding MC analysis
57 task->SetMCFinalCorrFilename(mcanalysisfilename);
59 // Set the vertex range to use
60 task->SetVertexRange(vzMin, vzMax);
61 // Set the trigger mask to use (INEL,INEL>0,NSD)
62 task->SetTriggerMask(trig);
63 // Set the trigger efficiency
64 task->SetTriggerEff(trigEff); // 0.997535);
65 task->SetTriggerEff0(trigEff0);
66 // Whether to cut edges when re-binning
67 task->SetCutEdges(cutEdges);
68 // Whether to correct for empty bins when projecting
69 // task->SetCorrEmpty(true);
70 task->SetCorrEmpty(corrEmpty);
71 // Whether to use TH2::ProjectionX
72 task->SetUseROOTProjectX(false);
75 // kNone Normalise to accepted events
76 // kEventLevel Normalise to all events in selected range
77 // kAltEventLevel Normalise to all events in selected range
78 // kBackground Also correct for background triggers
79 // kShape Correct shape
81 // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
82 // If neither kEventLevel, nor kAltEventLevel is specified, then
83 // kNone is assumed. kBackground (when implemented) only makes
84 // sense with kEventLevel and kAltEventLevel. Furthermore, there
85 // are some constants that encode the common cases
87 // kFull = kEventLevel | kBackground | kShape
88 // kAltFull = kAltEventLevel | kBackground | kShape
91 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
92 if (scheme) task->SetNormalizationScheme(scheme);
93 // Set the centrality bins to use. These are mutually exclusive.
94 // Note, that a bin specified as a-b, covers the interval from a,
95 // inclusive to b exclusive. An upper bound of 100 is treated
96 // especially, and the upper bound is inclusive in that case .
98 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
99 task->SetCentralityAxis(11, bins);
103 // --- create containers for input/output --------------------------
104 AliAnalysisDataContainer *sums =
105 mgr->CreateContainer("ForwardSums", TList::Class(),
106 AliAnalysisManager::kOutputContainer,
107 AliAnalysisManager::GetCommonFileName());
108 AliAnalysisDataContainer *output =
109 mgr->CreateContainer("ForwardResults", TList::Class(),
110 AliAnalysisManager::kParamContainer,
111 AliAnalysisManager::GetCommonFileName());
113 // --- connect input/output ----------------------------------------
114 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
115 mgr->ConnectOutput(task, 1, sums);
116 mgr->ConnectOutput(task, 2, output);
122 //________________________________________________________________________