]>
Commit | Line | Data |
---|---|---|
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 | * | |
bd6f5206 | 10 | * @ingroup pwglf_forward_scripts_tasks |
ffca499d | 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 | |
33438b4c | 21 | * @param trigEff Trigger efficiency |
22 | * @param trigEff0 Trigger efficiency for 0-bin | |
23 | * @param corrEmpty Correct for empty bins | |
c8b1a7db | 24 | * @param satVtx Set to true for satellite analysis |
25 | * @param mcanalysisfilename Take final MC corrections from this - if present | |
ffca499d | 26 | * |
27 | * @return Newly created and configured task | |
28 | * | |
bd6f5206 | 29 | * @ingroup pwglf_forward_dndeta |
b2e7f2d6 | 30 | */ |
31 | AliAnalysisTask* | |
dc1adf8d | 32 | AddTaskForwarddNdeta(const char* config = "dNdetaConfig.C", |
33 | const char* trig = "INEL", | |
e308a636 | 34 | Double_t vzMin = -10, |
35 | Double_t vzMax = +10, | |
dc1adf8d | 36 | const char* cent = "none", |
ffca499d | 37 | const char* scheme = 0, |
66cf95f2 | 38 | Double_t trigEff = 1, |
39 | Double_t trigEff0 = 1, | |
dc1adf8d | 40 | Bool_t satVtx = false) |
b2e7f2d6 | 41 | { |
56236b95 | 42 | // --- Load libraries ---------------------------------------------- |
bd6f5206 | 43 | gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2"); |
56236b95 | 44 | |
ffca499d | 45 | // --- Analysis manager -------------------------------------------- |
b2e7f2d6 | 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("AliForwardMultiplicityBase")) | |
54 | Fatal("","The relevant task wasn't added to the train"); | |
55 | ||
56 | ||
ffca499d | 57 | // --- Make our object --------------------------------------------- |
b2e7f2d6 | 58 | AliForwarddNdetaTask* task = new AliForwarddNdetaTask("Forward"); |
c89b9ac1 | 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) |
b2e7f2d6 | 63 | task->SetTriggerMask(trig); |
f709afcf | 64 | // Set the trigger efficiency |
66cf95f2 | 65 | task->SetTriggerEff(trigEff); // 0.997535); |
66 | task->SetTriggerEff0(trigEff0); | |
ffca499d | 67 | // Bit mask of |
68 | // | |
69 | // kNone Normalise to accepted events | |
70 | // kEventLevel Normalise to all events in selected range | |
71 | // kAltEventLevel Normalise to all events in selected range | |
72 | // kBackground Also correct for background triggers | |
73 | // kShape Correct shape | |
74 | // | |
75 | // kNone, kEventLevel, and kAltEventLevel are mutually exclusive. | |
76 | // If neither kEventLevel, nor kAltEventLevel is specified, then | |
77 | // kNone is assumed. kBackground (when implemented) only makes | |
78 | // sense with kEventLevel and kAltEventLevel. Furthermore, there | |
79 | // are some constants that encode the common cases | |
80 | // | |
81 | // kFull = kEventLevel | kBackground | kShape | |
82 | // kAltFull = kAltEventLevel | kBackground | kShape | |
83 | // | |
84 | // Default is kFull | |
85 | task->SetNormalizationScheme(AliBasedNdetaTask::kFull); | |
86 | if (scheme) task->SetNormalizationScheme(scheme); | |
87 | // Set the centrality bins to use. These are mutually exclusive. | |
88 | // Note, that a bin specified as a-b, covers the interval from a, | |
89 | // inclusive to b exclusive. An upper bound of 100 is treated | |
90 | // especially, and the upper bound is inclusive in that case . | |
dc1adf8d | 91 | if (cent) { |
92 | Info("", "Centrality estimator is %s (AddTask)", cent); | |
93 | if (task->SetCentralityMethod(cent)) { | |
94 | Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100 }; | |
95 | task->SetCentralityAxis(10, bins); | |
96 | } | |
e308a636 | 97 | } |
bfab35d9 | 98 | // Set satellite vertex flag |
99 | task->SetSatelliteVertices(satVtx); | |
100 | ||
dc1adf8d | 101 | // Set-up task using a script |
102 | task->Configure(config); | |
103 | ||
104 | // Connect to manager | |
c8b1a7db | 105 | task->Connect(0,0); |
dc1adf8d | 106 | |
b2e7f2d6 | 107 | return task; |
108 | } | |
109 | ||
110 | ||
111 | //________________________________________________________________________ | |
112 | // | |
113 | // EOF | |
114 | // |