]>
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* | |
e308a636 | 32 | AddTaskForwarddNdeta(const char* trig = "INEL", |
33 | Double_t vzMin = -10, | |
34 | Double_t vzMax = +10, | |
35 | Bool_t useCent = false, | |
ffca499d | 36 | const char* scheme = 0, |
c89b9ac1 | 37 | Bool_t cutEdges = false, |
66cf95f2 | 38 | Double_t trigEff = 1, |
39 | Double_t trigEff0 = 1, | |
93df36ef | 40 | Bool_t corrEmpty= false, |
bfab35d9 | 41 | Bool_t satVtx = false, |
42 | const char* mcanalysisfilename = "/home/hehi/alex/work/dispVtxDNdeta/mcCorrectionPos.root") | |
b2e7f2d6 | 43 | { |
56236b95 | 44 | // --- Load libraries ---------------------------------------------- |
bd6f5206 | 45 | gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2"); |
56236b95 | 46 | |
ffca499d | 47 | // --- Analysis manager -------------------------------------------- |
b2e7f2d6 | 48 | AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager(); |
0be6c8cd | 49 | |
290052e7 | 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"); | |
54 | if (aodInput == 2 && | |
55 | !AliForwardUtil::CheckForTask("AliForwardMultiplicityBase")) | |
56 | Fatal("","The relevant task wasn't added to the train"); | |
57 | ||
58 | ||
ffca499d | 59 | // --- Make our object --------------------------------------------- |
b2e7f2d6 | 60 | AliForwarddNdetaTask* task = new AliForwarddNdetaTask("Forward"); |
c89b9ac1 | 61 | //Set the filename of the corresponding MC analysis |
62 | task->SetMCFinalCorrFilename(mcanalysisfilename); | |
63 | ||
ffca499d | 64 | // Set the vertex range to use |
c8b1a7db | 65 | task->SetIpZRange(vzMin, vzMax); |
ffca499d | 66 | // Set the trigger mask to use (INEL,INEL>0,NSD) |
b2e7f2d6 | 67 | task->SetTriggerMask(trig); |
f709afcf | 68 | // Set the trigger efficiency |
66cf95f2 | 69 | task->SetTriggerEff(trigEff); // 0.997535); |
70 | task->SetTriggerEff0(trigEff0); | |
ffca499d | 71 | // Whether to cut edges when re-binning |
e28f5fc5 | 72 | task->SetCutEdges(cutEdges); |
c25b5e1b | 73 | // Whether to correct for empty bins when projecting |
93df36ef | 74 | // task->SetCorrEmpty(true); |
75 | task->SetCorrEmpty(corrEmpty); | |
c25b5e1b | 76 | // Whether to use TH2::ProjectionX |
77 | task->SetUseROOTProjectX(false); | |
ffca499d | 78 | // Bit mask of |
79 | // | |
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 | |
85 | // | |
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 | |
91 | // | |
92 | // kFull = kEventLevel | kBackground | kShape | |
93 | // kAltFull = kAltEventLevel | kBackground | kShape | |
94 | // | |
95 | // Default is kFull | |
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 . | |
e308a636 | 102 | if (useCent) { |
103 | Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; | |
104 | task->SetCentralityAxis(11, bins); | |
105 | } | |
bfab35d9 | 106 | // Set satellite vertex flag |
107 | task->SetSatelliteVertices(satVtx); | |
108 | ||
c8b1a7db | 109 | task->Connect(0,0); |
b2e7f2d6 | 110 | return task; |
111 | } | |
112 | ||
113 | ||
114 | //________________________________________________________________________ | |
115 | // | |
116 | // EOF | |
117 | // |