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