]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskMCTruthdNdeta.C
dN/deta task now configurable through external script.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskMCTruthdNdeta.C
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 pwglf_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  * @param trigEff   Trigger efficiency 
22  * @param trigEff0  Trigger efficiency for 0-bin
23  * @param corrEmpty Correct for empty bins 
24  * 
25  * @return Newly created and configured task
26  *
27  * @ingroup pwglf_forward_dndeta
28  */
29 AliAnalysisTask*
30 AddTaskMCTruthdNdeta(const char* config    = "dNdetaConfig.C",
31                      const char* trig      = "INEL", 
32                      Double_t    vzMin     = -10, 
33                      Double_t    vzMax     = +10, 
34                      const char* cent      = "",
35                      const char* scheme    = 0,
36                      Double_t    trigEff   = 1, 
37                      Double_t    trigEff0  = 1,
38                      Bool_t      satOnly   = false)
39 {
40   // --- Load libraries ----------------------------------------------
41   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
42
43   // --- Get analysis manager ----------------------------------------
44   AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
45
46   // --- Make our object ---------------------------------------------
47   AliMCTruthdNdetaTask* task = new AliMCTruthdNdetaTask("MCTruth");
48   // Set the vertex range to use 
49   task->SetIpZRange(vzMin, vzMax);
50   // Set the trigger mask to use (INEL,INEL>0,NSD)
51   task->SetTriggerMask(trig);
52   // Set the trigger efficiency 
53   task->SetTriggerEff(trigEff); // 0.997535);
54   task->SetTriggerEff0(trigEff0);
55   // Bit mask of 
56   // 
57   //    kNone           Normalise to accepted events 
58   //    kEventLevel     Normalise to all events in selected range 
59   //    kAltEventLevel  Normalise to all events in selected range 
60   //    kBackground     Also correct for background triggers 
61   //    kShape          Correct shape 
62   // 
63   // kNone, kEventLevel, and kAltEventLevel are mutually exclusive.
64   // If neither kEventLevel, nor kAltEventLevel is specified, then
65   // kNone is assumed.  kBackground (when implemented) only makes
66   // sense with kEventLevel and kAltEventLevel.  Furthermore, there
67   // are some constants that encode the common cases
68   //     
69   //    kFull    = kEventLevel |  kBackground | kShape 
70   //    kAltFull = kAltEventLevel |  kBackground | kShape 
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     if (task->SetCentralityMethod(cent)) {
81       Short_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
82       task->SetCentralityAxis(11, bins);
83     }
84   }
85   // Set satellite vertex flag
86   task->SetSatelliteVertices(satOnly);
87
88   // Set-up task using a script 
89   task->Configure(config);
90   
91   // Connect to manager 
92   task->Connect(0,0);
93
94   return task;
95 }
96
97   
98 //________________________________________________________________________
99 //
100 // EOF
101 //