]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C
adding planes
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskCentraldNdeta.C
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  * 
10  * @ingroup pwg2_forward_scripts_tasks
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 
21  * 
22  * @return Newly created and configured task
23  *
24  * @ingroup pwg2_forward_dndeta
25  */
26 AliAnalysisTask*
27 AddTaskCentraldNdeta(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 {
34   // --- Analysis manager --------------------------------------------
35   AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
36
37   // --- Make our object ---------------------------------------------
38   AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central");
39   // Set the vertex range to use 
40   task->SetVertexRange(vzMin, vzMax);
41   // Set the trigger mask to use (INEL,INEL>0,NSD)
42   task->SetTriggerMask(trig);
43   // Whether to cut edges when re-binning 
44   task->SetCutEdges(cutEdges);
45   // Bit mask of 
46   // 
47   //    kNone               Normalise to accepted events 
48   //    kEventLevel         Normalise to all events in selected range 
49   //    kBackground         Also correct for background triggers 
50   //    kTriggerEfficiency  Correct for trigger efficiency 
51   //    kShape              Correct shape 
52   // 
53   // kNone and kEventLevel are mutually exclusive.  If kEventLevel is
54   // not specified, then kNone is assumed.  kBackground only makes
55   // sense with kEventLevel. Furthermore, there
56   // are some constants that encode the common cases
57   //     
58   //    kFull    = kEventLevel |  kBackground | kShape | kTriggerEfficiency
59   // 
60   // Default is kFull
61   task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
62   if (scheme) task->SetNormalizationScheme(scheme);
63   // Set the centrality bins to use.  These are mutually exclusive.
64   // Note, that a bin specified as a-b, covers the interval from a,
65   // inclusive to b exclusive.  An upper bound of 100 is treated
66   // especially, and the upper bound is inclusive in that case .
67   if (useCent) {
68     Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
69     task->SetCentralityAxis(11, bins);
70   }
71   mgr->AddTask(task);
72
73   // --- create containers for input/output --------------------------
74   AliAnalysisDataContainer *sums = 
75     mgr->CreateContainer("CentralSums", TList::Class(), 
76                          AliAnalysisManager::kOutputContainer, 
77                          AliAnalysisManager::GetCommonFileName());
78   AliAnalysisDataContainer *output = 
79     mgr->CreateContainer("CentralResults", TList::Class(), 
80                          AliAnalysisManager::kParamContainer, 
81                          AliAnalysisManager::GetCommonFileName());
82   
83   // --- connect input/output ----------------------------------------
84   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
85   mgr->ConnectOutput(task, 1, sums);
86   mgr->ConnectOutput(task, 2, output);
87   
88   return task;
89 }
90
91   
92 //________________________________________________________________________
93 //
94 // EOF
95 //