]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskCentraldNdeta.C
Merge branch 'feature-movesplit'
[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 pwglf_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  * @param trigEff   Trigger efficiency 
23  * @param trigEff0  Trigger efficiency for 0-bin
24  * @param corrEmpty Correct for empty bins 
25  * 
26  * @return Newly created and configured task
27  *
28  * @ingroup pwglf_forward_dndeta
29  */
30 AliAnalysisTask*
31 AddTaskCentraldNdeta(const char* config    = "dNdetaConfig.C",
32                      const char* trig      = "INEL", 
33                      Double_t    vzMin     = -10, 
34                      Double_t    vzMax     = +10, 
35                      const char* cent      = "",
36                      const char* scheme    = 0,
37                      Double_t    trigEff   = 1, 
38                      Double_t    trigEff0  = 1,
39                      Bool_t      satVtx    = false)
40 {
41   // --- Load libraries ----------------------------------------------
42   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
43
44   // --- Analysis manager --------------------------------------------
45   AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
46
47   // --- Check that we have an AOD input handler ---------------------
48   UShort_t aodInput = 0;
49   if (!(aodInput = AliForwardUtil::CheckForAOD())) 
50     Fatal("","Cannot proceed without and AOD handler");
51   if (aodInput == 2 &&
52       !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask")) 
53     Fatal("","The relevant task wasn't added to the train");
54
55   // --- Make our object ---------------------------------------------
56   AliCentraldNdetaTask* task = new AliCentraldNdetaTask("Central");
57   
58   // Set the vertex range to use 
59   task->SetIpZRange(vzMin, vzMax);
60   // Set the trigger mask to use (INEL,INEL>0,NSD)
61   task->SetTriggerMask(trig);
62   task->SetTriggerEff(trigEff); // 0.997535);
63   task->SetTriggerEff0(trigEff0); 
64
65   // Bit mask of 
66   // 
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   // 
72   // kNone and kEventLevel are mutually exclusive.  If kEventLevel is
73   // not specified, then kNone is assumed.  kBackground only makes
74   // sense with kEventLevel. Furthermore, there
75   // are some constants that encode the common cases
76   //     
77   //    kFull    = kEventLevel |  kBackground | kTriggerEfficiency
78   // 
79   // Default is kFull
80   task->SetNormalizationScheme(AliBasedNdetaTask::kFull);
81   if (scheme) task->SetNormalizationScheme(scheme);
82   // Set the centrality bins to use.  These are mutually exclusive.
83   // Note, that a bin specified as a-b, covers the interval from a,
84   // inclusive to b exclusive.  An upper bound of 100 is treated
85   // especially, and the upper bound is inclusive in that case .
86   if (cent) {
87     if (task->SetCentralityMethod(cent)) {
88       Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100 };
89       task->SetCentralityAxis(10, bins);
90     }
91   }
92
93   // Set-up task using a script 
94   task->Configure(config);
95
96   // Connect to manager 
97   task->Connect(0,0);
98
99   return task;
100 }
101
102   
103 //________________________________________________________________________
104 //
105 // EOF
106 //