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