]>
Commit | Line | Data |
---|---|---|
9ecab72f | 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 | * | |
10 | * @ingroup pwg2_forward_scripts_tasks | |
11 | */ | |
12 | /** | |
13 | * Create the MCTruth @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 | |
21 | * | |
22 | * @return Newly created and configured task | |
23 | * | |
24 | * @ingroup pwg2_forward_dndeta | |
25 | */ | |
26 | AliAnalysisTask* | |
27 | AddTaskMCTruthdNdeta(const char* trig = "INEL", | |
28 | Double_t vzMin = -10, | |
29 | Double_t vzMax = +10, | |
30 | Bool_t useCent = false, | |
31 | const char* scheme = 0, | |
32 | Bool_t cutEdges = false) | |
33 | { | |
56236b95 | 34 | // --- Load libraries ---------------------------------------------- |
35 | gROOT->LoadClass("AliAODForwardMult", "libPWG2forward2"); | |
36 | ||
37 | // --- Get analysis manager ---------------------------------------- | |
9ecab72f | 38 | AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager(); |
39 | ||
40 | // --- Make our object --------------------------------------------- | |
41 | AliMCTruthdNdetaTask* task = new AliMCTruthdNdetaTask("MCTruth"); | |
42 | // Set the vertex range to use | |
43 | task->SetVertexRange(vzMin, vzMax); | |
44 | // Set the trigger mask to use (INEL,INEL>0,NSD) | |
45 | task->SetTriggerMask(trig); | |
46 | // Set the trigger efficiency | |
47 | // task->SetTriggerEff(0.997535); | |
48 | // Whether to cut edges when re-binning | |
49 | task->SetCutEdges(cutEdges); | |
50 | // Whether to correct for empty bins when projecting | |
51 | task->SetCorrEmpty(true); | |
52 | // Whether to use TH2::ProjectionX | |
53 | task->SetUseROOTProjectX(false); | |
54 | // Bit mask of | |
55 | // | |
56 | // kNone Normalise to accepted events | |
57 | // kEventLevel Normalise to all events in selected range | |
58 | // kAltEventLevel Normalise to all events in selected range | |
59 | // kBackground Also correct for background triggers | |
60 | // kShape Correct shape | |
61 | // | |
62 | // kNone, kEventLevel, and kAltEventLevel are mutually exclusive. | |
63 | // If neither kEventLevel, nor kAltEventLevel is specified, then | |
64 | // kNone is assumed. kBackground (when implemented) only makes | |
65 | // sense with kEventLevel and kAltEventLevel. Furthermore, there | |
66 | // are some constants that encode the common cases | |
67 | // | |
68 | // kFull = kEventLevel | kBackground | kShape | |
69 | // kAltFull = kAltEventLevel | kBackground | kShape | |
70 | // | |
71 | // Default is kFull | |
72 | task->SetNormalizationScheme(AliBasedNdetaTask::kFull); | |
73 | if (scheme) task->SetNormalizationScheme(scheme); | |
74 | // Set the centrality bins to use. These are mutually exclusive. | |
75 | // Note, that a bin specified as a-b, covers the interval from a, | |
76 | // inclusive to b exclusive. An upper bound of 100 is treated | |
77 | // especially, and the upper bound is inclusive in that case . | |
78 | if (useCent) { | |
79 | Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; | |
80 | task->SetCentralityAxis(11, bins); | |
81 | } | |
82 | mgr->AddTask(task); | |
83 | ||
84 | // --- create containers for input/output -------------------------- | |
85 | AliAnalysisDataContainer *sums = | |
86 | mgr->CreateContainer("MCTruthSums", TList::Class(), | |
87 | AliAnalysisManager::kOutputContainer, | |
88 | AliAnalysisManager::GetCommonFileName()); | |
89 | AliAnalysisDataContainer *output = | |
90 | mgr->CreateContainer("MCTruthResults", TList::Class(), | |
91 | AliAnalysisManager::kParamContainer, | |
92 | AliAnalysisManager::GetCommonFileName()); | |
93 | ||
94 | // --- connect input/output ---------------------------------------- | |
95 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
96 | mgr->ConnectOutput(task, 1, sums); | |
97 | mgr->ConnectOutput(task, 2, output); | |
98 | ||
99 | return task; | |
100 | } | |
101 | ||
102 | ||
103 | //________________________________________________________________________ | |
104 | // | |
105 | // EOF | |
106 | // |