AliPhysics  vAN-20150827 (3e81cbb)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskNucleiYield.C
Go to the documentation of this file.
1 
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <Rtypes.h>
12 #include <TString.h>
14 #include "AliAnalysisManager.h"
15 #include "AliAnalysisDataContainer.h"
16 #include "AliPID.h"
17 #endif
18 
20  AliPID::EParticleType part = AliPID::kDeuteron,
21  Int_t pdgCode = 1000010020,
22  TString suffix = "") {
23 
24  // Get the current analysis manager
25  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
26  if (!mgr) {
27  Error("AddTaskNucleiYield", "No analysis manager found.");
28  return 0x0;
29  }
30 
31  // Check the analysis type using the event handlers connected to the analysis manager.
32  if (!mgr->GetInputEventHandler()) {
33  ::Error("AddTaskNucleiYield", "This task requires an input event handler");
34  return 0x0;
35  }
36 
37  // Common variables
38  Float_t tritonCentBins[4] = {0.,10.,30.,50.};
39  Float_t deuteronPtBins[27] = {
40  0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f,1.1f,1.2f,1.4f,
41  1.6f,1.8f,2.0f,2.2f,2.4f,2.6f,2.8f,3.0f,3.2f,3.4f,
42  3.6f,3.8f,4.0f,4.2f,4.4f,5.0f,6.0f
43  };
44  Float_t deutBBpar[5] = {4.69637f,7.51827f,0.0183746f,2.60f,2.7f};
45  Float_t sigmaBBpar = 0.1f;
46 
47  TString tskname = "deuterons";
48  tskname.Append(Form("%s",suffix.Data()));
50  deu->SetParticleType(AliPID::kDeuteron);
51  deu->SetCustomTPCpid(deutBBpar, sigmaBBpar);
52  deu->SetPDG(pdgCode);
53  deu->SetIsMC(isMC);
54  deu->SetCentBins(3, tritonCentBins);
55  deu->SetPtBins(26,deuteronPtBins);
56  deu->SetDCABins(80,-0.5,0.5);
57  mgr->AddTask(deu);
58  TString output = "AnalysisResults.root";
59  AliAnalysisDataContainer *deuCont = mgr->CreateContainer(Form("mpuccio_%s",tskname.Data()),
60  TList::Class(),
61  AliAnalysisManager::kOutputContainer,
62  output.Data());
63  mgr->ConnectInput (deu, 0, mgr->GetCommonInputContainer());
64  mgr->ConnectOutput (deu, 1, deuCont);
65  return deu;
66 }
void SetPtBins(Int_t nbins, Float_t *bins)
void SetParticleType(AliPID::EParticleType part)
Bool_t isMC
void SetCustomTPCpid(Float_t *par, Float_t sigma)
void SetCentBins(Int_t nbins, Float_t *bins)
AliAnalysisTaskNucleiYield * AddTaskNucleiYield(Bool_t isMC=kFALSE, AliPID::EParticleType part=AliPID::kDeuteron, Int_t pdgCode=1000010020, TString suffix="")
This task fills histograms required to perform the analysis on the light nuclei yield.
void SetDCABins(Int_t nbins, Float_t min, Float_t max)