]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskCentraldNdeta.C
Merge branch 'master' into TRDdev
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskCentraldNdeta.C
CommitLineData
b00b37ad 1/**
2 * @file AddTaskCentraldNdeta.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 *
bd6f5206 10 * @ingroup pwglf_forward_scripts_tasks
ffca499d 11 */
12/**
13 * Create the central @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
33438b4c 22 * @param trigEff Trigger efficiency
23 * @param trigEff0 Trigger efficiency for 0-bin
24 * @param corrEmpty Correct for empty bins
ffca499d 25 *
26 * @return Newly created and configured task
27 *
bd6f5206 28 * @ingroup pwglf_forward_dndeta
b00b37ad 29 */
30AliAnalysisTask*
93df36ef 31AddTaskCentraldNdeta(const char* trig = "INEL",
32 Double_t vzMin = -10,
33 Double_t vzMax = +10,
34 Bool_t useCent = false,
35 const char* scheme = 0,
36 Bool_t cutEdges = false,
37 Double_t trigEff = 1,
38 Double_t trigEff0 = 1,
1ff25622 39 Bool_t corrEmpty = true,
c89b9ac1 40 const char* mcanalysisfilename = "none")
b00b37ad 41{
56236b95 42 // --- Load libraries ----------------------------------------------
bd6f5206 43 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
56236b95 44
ffca499d 45 // --- Analysis manager --------------------------------------------
b00b37ad 46 AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
0be6c8cd 47
290052e7 48 // --- Check that we have an AOD input handler ---------------------
49 UShort_t aodInput = 0;
50 if (!(aodInput = AliForwardUtil::CheckForAOD()))
51 Fatal("","Cannot proceed without and AOD handler");
52 if (aodInput == 2 &&
53 !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask"))
54 Fatal("","The relevant task wasn't added to the train");
55
ffca499d 56 // --- Make our object ---------------------------------------------
b00b37ad 57 AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central");
c89b9ac1 58 task->SetMCFinalCorrFilename(mcanalysisfilename);
59
ffca499d 60 // Set the vertex range to use
c8b1a7db 61 task->SetIpZRange(vzMin, vzMax);
ffca499d 62 // Set the trigger mask to use (INEL,INEL>0,NSD)
b00b37ad 63 task->SetTriggerMask(trig);
66cf95f2 64 task->SetTriggerEff(trigEff); // 0.997535);
65 task->SetTriggerEff0(trigEff0);
ffca499d 66 // Whether to cut edges when re-binning
e308a636 67 task->SetCutEdges(cutEdges);
c25b5e1b 68 // Whether to correct for empty bins when projecting
93df36ef 69 task->SetCorrEmpty(corrEmpty);
c25b5e1b 70 // Whether to use TH2::ProjectionX
71 task->SetUseROOTProjectX(false);
ffca499d 72 // Bit mask of
73 //
0be6c8cd 74 // kNone Normalise to accepted events
75 // kEventLevel Normalise to all events in selected range
76 // kBackground Also correct for background triggers
77 // kTriggerEfficiency Correct for trigger efficiency
78 // kShape Correct shape
ffca499d 79 //
0be6c8cd 80 // kNone and kEventLevel are mutually exclusive. If kEventLevel is
81 // not specified, then kNone is assumed. kBackground only makes
82 // sense with kEventLevel. Furthermore, there
ffca499d 83 // are some constants that encode the common cases
84 //
0be6c8cd 85 // kFull = kEventLevel | kBackground | kShape | kTriggerEfficiency
ffca499d 86 //
87 // Default is kFull
88 task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
89 if (scheme) task->SetNormalizationScheme(scheme);
90 // Set the centrality bins to use. These are mutually exclusive.
91 // Note, that a bin specified as a-b, covers the interval from a,
92 // inclusive to b exclusive. An upper bound of 100 is treated
93 // especially, and the upper bound is inclusive in that case .
e308a636 94 if (useCent) {
836a9d97 95 Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100 };
96 task->SetCentralityAxis(10, bins);
e308a636 97 }
c8b1a7db 98 task->Connect(0,0);
b00b37ad 99
b00b37ad 100 return task;
101}
102
103
104//________________________________________________________________________
105//
106// EOF
107//