]>
Commit | Line | Data |
---|---|---|
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 |
ffca499d | 22 | * |
23 | * @return Newly created and configured task | |
24 | * | |
bd6f5206 | 25 | * @ingroup pwglf_forward_dndeta |
b00b37ad | 26 | */ |
27 | AliAnalysisTask* | |
93df36ef | 28 | AddTaskCentraldNdeta(const char* trig = "INEL", |
29 | Double_t vzMin = -10, | |
30 | Double_t vzMax = +10, | |
31 | Bool_t useCent = false, | |
32 | const char* scheme = 0, | |
33 | Bool_t cutEdges = false, | |
34 | Double_t trigEff = 1, | |
35 | Double_t trigEff0 = 1, | |
1ff25622 | 36 | Bool_t corrEmpty = true, |
c89b9ac1 | 37 | const char* mcanalysisfilename = "none") |
b00b37ad | 38 | { |
56236b95 | 39 | // --- Load libraries ---------------------------------------------- |
bd6f5206 | 40 | gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2"); |
56236b95 | 41 | |
ffca499d | 42 | // --- Analysis manager -------------------------------------------- |
b00b37ad | 43 | AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager(); |
0be6c8cd | 44 | |
290052e7 | 45 | // --- Check that we have an AOD input handler --------------------- |
46 | UShort_t aodInput = 0; | |
47 | if (!(aodInput = AliForwardUtil::CheckForAOD())) | |
48 | Fatal("","Cannot proceed without and AOD handler"); | |
49 | if (aodInput == 2 && | |
50 | !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask")) | |
51 | Fatal("","The relevant task wasn't added to the train"); | |
52 | ||
ffca499d | 53 | // --- Make our object --------------------------------------------- |
b00b37ad | 54 | AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central"); |
c89b9ac1 | 55 | task->SetMCFinalCorrFilename(mcanalysisfilename); |
56 | ||
ffca499d | 57 | // Set the vertex range to use |
b00b37ad | 58 | task->SetVertexRange(vzMin, vzMax); |
ffca499d | 59 | // Set the trigger mask to use (INEL,INEL>0,NSD) |
b00b37ad | 60 | task->SetTriggerMask(trig); |
66cf95f2 | 61 | task->SetTriggerEff(trigEff); // 0.997535); |
62 | task->SetTriggerEff0(trigEff0); | |
ffca499d | 63 | // Whether to cut edges when re-binning |
e308a636 | 64 | task->SetCutEdges(cutEdges); |
c25b5e1b | 65 | // Whether to correct for empty bins when projecting |
93df36ef | 66 | task->SetCorrEmpty(corrEmpty); |
c25b5e1b | 67 | // Whether to use TH2::ProjectionX |
68 | task->SetUseROOTProjectX(false); | |
ffca499d | 69 | // Bit mask of |
70 | // | |
0be6c8cd | 71 | // kNone Normalise to accepted events |
72 | // kEventLevel Normalise to all events in selected range | |
73 | // kBackground Also correct for background triggers | |
74 | // kTriggerEfficiency Correct for trigger efficiency | |
75 | // kShape Correct shape | |
ffca499d | 76 | // |
0be6c8cd | 77 | // kNone and kEventLevel are mutually exclusive. If kEventLevel is |
78 | // not specified, then kNone is assumed. kBackground only makes | |
79 | // sense with kEventLevel. Furthermore, there | |
ffca499d | 80 | // are some constants that encode the common cases |
81 | // | |
0be6c8cd | 82 | // kFull = kEventLevel | kBackground | kShape | kTriggerEfficiency |
ffca499d | 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 . | |
e308a636 | 91 | if (useCent) { |
92 | Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; | |
93 | task->SetCentralityAxis(11, bins); | |
94 | } | |
b00b37ad | 95 | mgr->AddTask(task); |
96 | ||
ffca499d | 97 | // --- create containers for input/output -------------------------- |
b00b37ad | 98 | AliAnalysisDataContainer *sums = |
99 | mgr->CreateContainer("CentralSums", TList::Class(), | |
100 | AliAnalysisManager::kOutputContainer, | |
101 | AliAnalysisManager::GetCommonFileName()); | |
102 | AliAnalysisDataContainer *output = | |
103 | mgr->CreateContainer("CentralResults", TList::Class(), | |
104 | AliAnalysisManager::kParamContainer, | |
105 | AliAnalysisManager::GetCommonFileName()); | |
106 | ||
ffca499d | 107 | // --- connect input/output ---------------------------------------- |
b00b37ad | 108 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); |
109 | mgr->ConnectOutput(task, 1, sums); | |
110 | mgr->ConnectOutput(task, 2, output); | |
ffca499d | 111 | |
b00b37ad | 112 | return task; |
113 | } | |
114 | ||
115 | ||
116 | //________________________________________________________________________ | |
117 | // | |
118 | // EOF | |
119 | // |