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 trigEff Trigger efficiency
22 * @param trigEff0 Trigger efficiency for 0-bin
23 * @param corrEmpty Correct for empty bins
24 * @param satVtx Set to true for satellite analysis
25 * @param mcanalysisfilename Take final MC corrections from this - if present
27 * @return Newly created and configured task
29 * @ingroup pwglf_forward_dndeta
32 AddTaskForwarddNdeta(const char* trig = "INEL",
35 Bool_t useCent = false,
36 const char* scheme = 0,
37 Bool_t cutEdges = false,
39 Double_t trigEff0 = 1,
40 Bool_t corrEmpty= false,
41 Bool_t satVtx = false,
42 const char* mcanalysisfilename = "/home/hehi/alex/work/dispVtxDNdeta/mcCorrectionPos.root")
44 // --- Load libraries ----------------------------------------------
45 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
47 // --- Analysis manager --------------------------------------------
48 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
50 // --- Check that we have an AOD input handler ---------------------
51 UShort_t aodInput = 0;
52 if (!(aodInput = AliForwardUtil::CheckForAOD()))
53 Fatal("","Cannot proceed without and AOD handler");
55 !AliForwardUtil::CheckForTask("AliForwardMultiplicityBase"))
56 Fatal("","The relevant task wasn't added to the train");
59 // --- Make our object ---------------------------------------------
60 AliForwarddNdetaTask* task = new AliForwarddNdetaTask("Forward");
61 //Set the filename of the corresponding MC analysis
62 task->SetMCFinalCorrFilename(mcanalysisfilename);
64 // Set the vertex range to use
65 task->SetIpZRange(vzMin, vzMax);
66 // Set the trigger mask to use (INEL,INEL>0,NSD)
67 task->SetTriggerMask(trig);
68 // Set the trigger efficiency
69 task->SetTriggerEff(trigEff); // 0.997535);
70 task->SetTriggerEff0(trigEff0);
71 // Whether to cut edges when re-binning
72 task->SetCutEdges(cutEdges);
73 // Whether to correct for empty bins when projecting
74 // task->SetCorrEmpty(true);
75 task->SetCorrEmpty(corrEmpty);
76 // Whether to use TH2::ProjectionX
77 task->SetUseROOTProjectX(false);
80 // kNone Normalise to accepted events
81 // kEventLevel Normalise to all events in selected range
82 // kAltEventLevel Normalise to all events in selected range
83 // kBackground Also correct for background triggers
84 // kShape Correct shape
86 // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
87 // If neither kEventLevel, nor kAltEventLevel is specified, then
88 // kNone is assumed. kBackground (when implemented) only makes
89 // sense with kEventLevel and kAltEventLevel. Furthermore, there
90 // are some constants that encode the common cases
92 // kFull = kEventLevel | kBackground | kShape
93 // kAltFull = kAltEventLevel | kBackground | kShape
96 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
97 if (scheme) task->SetNormalizationScheme(scheme);
98 // Set the centrality bins to use. These are mutually exclusive.
99 // Note, that a bin specified as a-b, covers the interval from a,
100 // inclusive to b exclusive. An upper bound of 100 is treated
101 // especially, and the upper bound is inclusive in that case .
103 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100 };
104 task->SetCentralityAxis(10, bins);
106 // Set satellite vertex flag
107 task->SetSatelliteVertices(satVtx);
114 //________________________________________________________________________