AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskForwardMultDists.C
Go to the documentation of this file.
1 
28 AddTaskForwardMultDists(const char* trig = "V0AND",
29  Double_t vzMin = -4,
30  Double_t vzMax = +4,
31  Bool_t usePhiAcc = true,
32  Bool_t useAsymm = false)
33 {
34  // --- Load libraries ----------------------------------------------
35  gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
36 
37  // --- Analysis manager --------------------------------------------
38  AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
39 
40  // --- Check that we have an AOD input handler ---------------------
41  UShort_t aodInput = 0;
42  if (!(aodInput = AliForwardUtil::CheckForAOD()))
43  Fatal("","Cannot proceed without and AOD handler");
44  if (aodInput == 2 &&
45  !AliForwardUtil::CheckForTask("AliForwardMultiplicityBase"))
46  Fatal("","The relevant task wasn't added to the train");
47 
48 
49  // --- Make our object ---------------------------------------------
50  AliForwardMultDists* task = new AliForwardMultDists("Forward");
51 
52  // Set the vertex range to use
53  task->SetIpZRange(vzMin, vzMax);
54  // Set the trigger mask to use (INEL,INEL>0,NSD)
55  task->SetTriggerMask(trig);
56  // Set whether to use stored phi acceptance
57  task->SetUsePhiAcc(usePhiAcc);
58  // add the task
59  mgr->AddTask(task);
60 
61  // Variable size axis objects
62  // for |eta|<0.5 from CMD
63  AliForwardMultDists::BinSpec b05(-0.5, 0.5, -0.5);
64  b05.Push(21, 1);
65  b05.Push(1, 3);
66  b05.Push(1, 5);
67  b05.Push(3, 5); // <-- Extra
68 
69  // for |eta|<0.5 from ALICE
70  AliForwardMultDists::BinSpec a05(-0.5, 0.5, -0.5);
71  a05.Push(21, 1);
72  a05.Push(3, 2);
73 
74  // For |eta|<1 from CMS
75  AliForwardMultDists::BinSpec b10(-1.0, 1.0, -0.5);
76  b10.Push(35, 1);
77  b10.Push(1, 3);
78  b10.Push(4, 5);
79  b10.Push(2, 5); // <-- Extra
80 
81  // For |eta|<1 from ALICE
82  AliForwardMultDists::BinSpec a10(-1.0, 1.0, -0.5);
83  a10.Push(41, 1);
84  a10.Push(1, 2);
85 
86  // For |eta|<1.3 from ALICE
87  AliForwardMultDists::BinSpec a13(-1.3, 1.3, -0.5);
88  a13.Push(41, 1);
89  a13.Push(7, 2);
90 
91  // For |eta|<1.5 from CMS
92  AliForwardMultDists::BinSpec b15(-1.5, 1.5, -0.5);
93  b15.Push(46, 1);
94  b15.Push(1, 2);
95  b15.Push(1, 3);
96  b15.Push(4, 5);
97  b15.Push(4, 5); // <-- Extra
98 
99  // for |eta|<2.0 from CMS
100  AliForwardMultDists::BinSpec b20(-2.0, 2.0, -0.5);
101  b20.Push(62, 1);
102  b20.Push(2, 2);
103  b20.Push(1, 4);
104  b20.Push(3, 10);
105  b20.Push(2, 10); // <-- Extra
106 
107  // for |eta|<2 from CMS
108  AliForwardMultDists::BinSpec b24(-2.4, 2.4, -0.5);
109  b24.Push(57, 1);
110  b24.Push(1, 2);
111  b24.Push(1, 3);
112  b24.Push(3, 10);
113  b24.Push(4, 10); // <-- Extra
114 
115  // Add bins
116  AliForwardMultDists::BinSpec* bs[] = { &b05, &b10, &b15, &b20, &b24, 0 };
118  while (*pb) {
120  task->AddBin(*b);
121  if (useAsymm) {
122  task->AddBin(b->fEtaMin, 0, b->Axis());
123  task->AddBin(0, b->fEtaMax, b->Axis());
124  }
125  pb++;
126  }
127 
128  // --- create containers for input/output --------------------------
129  AliAnalysisDataContainer *sums =
130  mgr->CreateContainer("ForwardMultSums", TList::Class(),
131  AliAnalysisManager::kOutputContainer,
132  AliAnalysisManager::GetCommonFileName());
133  AliAnalysisDataContainer *output =
134  mgr->CreateContainer("ForwardMultResults", TList::Class(),
135  AliAnalysisManager::kParamContainer,
136  AliAnalysisManager::GetCommonFileName());
137 
138  // --- connect input/output ----------------------------------------
139  mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
140  mgr->ConnectOutput(task, 1, sums);
141  mgr->ConnectOutput(task, 2, output);
142 
143  return task;
144 }
145 
146 
147 //________________________________________________________________________
148 //
149 // EOF
150 //
double Double_t
Definition: External.C:58
void SetTriggerMask(UInt_t mask)
void AddBin(const BinSpec &spec)
void Push(UShort_t n, Double_t d)
static UShort_t CheckForAOD()
void SetUsePhiAcc(Bool_t use)
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53
static Bool_t CheckForTask(const char *clsOrName, Bool_t cls=true)
AliAnalysisTask * AddTaskForwardMultDists(const char *trig="V0AND", Double_t vzMin=-4, Double_t vzMax=+4, Bool_t usePhiAcc=true, Bool_t useAsymm=false)