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