]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C
Updates to scripts. Mostly documentation and some new functionalities
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskForwarddNdeta.C
CommitLineData
b2e7f2d6 1/**
2 * @file AddTaskForwarddNdeta.C
3 * @author Christian Holm Christensen <cholm@nbi.dk>
4 * @date Fri Jan 28 10:22:26 2011
5 *
6 * @brief Script to add a multiplicity task for the central
7 * @f$\eta@f$ region
8 *
9 *
ffca499d 10 * @ingroup pwg2_forward_scripts_tasks
11 */
12/**
13 * Create the Forward @f$ dN/d\eta@f$ analysis task
14 *
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
c6115ede 21 * @param mcanalysisfilename Take final MC corrections from this - if present
ffca499d 22 *
23 * @return Newly created and configured task
24 *
25 * @ingroup pwg2_forward_dndeta
b2e7f2d6 26 */
27AliAnalysisTask*
e308a636 28AddTaskForwarddNdeta(const char* trig = "INEL",
29 Double_t vzMin = -10,
30 Double_t vzMax = +10,
31 Bool_t useCent = false,
ffca499d 32 const char* scheme = 0,
c89b9ac1 33 Bool_t cutEdges = false,
34 const char* mcanalysisfilename = "none")
b2e7f2d6 35{
56236b95 36 // --- Load libraries ----------------------------------------------
37 gROOT->LoadClass("AliAODForwardMult", "libPWG2forward2");
38
ffca499d 39 // --- Analysis manager --------------------------------------------
b2e7f2d6 40 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
0be6c8cd 41
ffca499d 42 // --- Make our object ---------------------------------------------
b2e7f2d6 43 AliForwarddNdetaTask* task = new AliForwarddNdetaTask("Forward");
c89b9ac1 44 //Set the filename of the corresponding MC analysis
45 task->SetMCFinalCorrFilename(mcanalysisfilename);
46
ffca499d 47 // Set the vertex range to use
b2e7f2d6 48 task->SetVertexRange(vzMin, vzMax);
ffca499d 49 // Set the trigger mask to use (INEL,INEL>0,NSD)
b2e7f2d6 50 task->SetTriggerMask(trig);
f709afcf 51 // Set the trigger efficiency
52 // task->SetTriggerEff(0.997535);
ffca499d 53 // Whether to cut edges when re-binning
e28f5fc5 54 task->SetCutEdges(cutEdges);
c25b5e1b 55 // Whether to correct for empty bins when projecting
56 task->SetCorrEmpty(true);
57 // Whether to use TH2::ProjectionX
58 task->SetUseROOTProjectX(false);
ffca499d 59 // Bit mask of
60 //
61 // kNone Normalise to accepted events
62 // kEventLevel Normalise to all events in selected range
63 // kAltEventLevel Normalise to all events in selected range
64 // kBackground Also correct for background triggers
65 // kShape Correct shape
66 //
67 // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
68 // If neither kEventLevel, nor kAltEventLevel is specified, then
69 // kNone is assumed. kBackground (when implemented) only makes
70 // sense with kEventLevel and kAltEventLevel. Furthermore, there
71 // are some constants that encode the common cases
72 //
73 // kFull = kEventLevel | kBackground | kShape
74 // kAltFull = kAltEventLevel | kBackground | kShape
75 //
76 // Default is kFull
77 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
78 if (scheme) task->SetNormalizationScheme(scheme);
79 // Set the centrality bins to use. These are mutually exclusive.
80 // Note, that a bin specified as a-b, covers the interval from a,
81 // inclusive to b exclusive. An upper bound of 100 is treated
82 // especially, and the upper bound is inclusive in that case .
e308a636 83 if (useCent) {
84 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
85 task->SetCentralityAxis(11, bins);
86 }
b2e7f2d6 87 mgr->AddTask(task);
88
ffca499d 89 // --- create containers for input/output --------------------------
b2e7f2d6 90 AliAnalysisDataContainer *sums =
91 mgr->CreateContainer("ForwardSums", TList::Class(),
92 AliAnalysisManager::kOutputContainer,
93 AliAnalysisManager::GetCommonFileName());
94 AliAnalysisDataContainer *output =
95 mgr->CreateContainer("ForwardResults", TList::Class(),
96 AliAnalysisManager::kParamContainer,
97 AliAnalysisManager::GetCommonFileName());
98
ffca499d 99 // --- connect input/output ----------------------------------------
b2e7f2d6 100 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
101 mgr->ConnectOutput(task, 1, sums);
102 mgr->ConnectOutput(task, 2, output);
103
104 return task;
105}
106
107
108//________________________________________________________________________
109//
110// EOF
111//