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