AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskLambdac.C
Go to the documentation of this file.
1 AliAnalysisTaskSE *AddTaskLambdac(TString finname,Bool_t storeNtuple,Bool_t readMC,Bool_t MCPid,Bool_t realPid,Bool_t resPid,Bool_t useKF,
2  Bool_t fillVarHists=kFALSE, Bool_t priorsHists=kFALSE, Bool_t multiplicityHists=kFALSE, Int_t syst=0, Int_t bit=0, TString postname="")
3 {
4  //==============================================================================
5  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6  if (!mgr) {
7  ::Error("AddTaskLambdac", "No analysis manager to connect to.");
8  return NULL;
9  }
10 
11 
12  Bool_t stdcuts=kFALSE;
13  TFile* filecuts;
14  if( finname.EqualTo("") ) {
15  stdcuts=kTRUE;
16  } else {
17  filecuts=TFile::Open(finname.Data());
18  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
19  AliFatal("Input file not found : check your cut object");
20  }
21  }
23  // syst = 0 : pp, syst = 1: PbPb, syst = 2 : pPb
24  if(stdcuts) {
25  if(syst==0) prodcuts->SetStandardCutsPP2010();
26  if(syst==1) prodcuts->SetStandardCutsPbPb2011();
27  if(syst==2) prodcuts->SetStandardCutsPPb2013();
28  }
29  else prodcuts = (AliRDHFCutsLctopKpi*)filecuts->Get("LctopKpiProdCuts");
30  prodcuts->SetName("LctopKpiProdCuts");
31  prodcuts->SetMinPtCandidate(-1.);
32  prodcuts->SetMaxPtCandidate(10000.);
33 
34  AliRDHFCutsLctopKpi *analysiscuts = new AliRDHFCutsLctopKpi();
35  if(stdcuts) {
36  if(syst==0) analysiscuts->SetStandardCutsPP2010();
37  if(syst==1) analysiscuts->SetStandardCutsPbPb2011();
38  if(syst==2) analysiscuts->SetStandardCutsPPb2013();
39  }
40  else analysiscuts = (AliRDHFCutsLctopKpi*)filecuts->Get("LctopKpiAnalysisCuts");
41  analysiscuts->SetName("LctopKpiAnalysisCuts");
42  analysiscuts->SetMinPtCandidate(-1.);
43  analysiscuts->SetMaxPtCandidate(10000.);
44 
45  // Aanalysis task
46  AliAnalysisTaskSELambdac *lambdacTask = new AliAnalysisTaskSELambdac("LambdacAnalysis",storeNtuple,analysiscuts,prodcuts);
47  lambdacTask->SetReadMC(readMC);
48  if(MCPid) lambdacTask->SetMCPid();
49  if(resPid) lambdacTask->SetResonantPid();
50  if(realPid) lambdacTask->SetRealPid();
51  lambdacTask->SetFillVarHists(fillVarHists);
52  lambdacTask->SetPriorsHists(priorsHists);
53  lambdacTask->SetMultiplicityHists(multiplicityHists);
54  lambdacTask->SetAnalysis(kTRUE);
55 
56  //bit:0 nocut, 1:LcCut, 2:LcPID, 3: Both
57  lambdacTask->SetUseFilterBitCut(bit==1||bit==3?1:0);
58  lambdacTask->SetUseFilterBitPID(bit>1?1:0);
59 
60  lambdacTask->SetDebugLevel(0);
61  if(useKF) {
62  lambdacTask->SetUseKF();
63  Float_t cuts[10]={0.1,0.1,1.5,0.5,0.1,1.5,0.5,0.1,1.5,0.5};
64  lambdacTask->SetCutsKF(cuts);
65  }
66  mgr->AddTask(lambdacTask);
67 
68  //
69  // Create containers for input/output
70  TString outputfile = AliAnalysisManager::GetCommonFileName();
71  outputfile += ":PWG3_D2H_InvMassLambdac";
72 
73  TString finDirname="pp";
74  TString inname = "cinputLc";
75  TString outname = "coutputLc";
76  TString cutsname = "coutputLcCuts";
77  TString normname = "coutputLcNorm";
78  TString ntuplename = "coutputLc2";
79  TString nev2 = "coutputNev";
80  TString outname2 = "coutputLambdacMC";
81  TString aPrioriname = "coutputAPriori";
82  TString multiplicityname = "coutputMultiplicity";
83  inname += finDirname.Data();
84  outname += finDirname.Data();
85  cutsname += finDirname.Data();
86  normname += finDirname.Data();
87  ntuplename += finDirname.Data();
88  nev2 += finDirname.Data();
89  outname2 += finDirname.Data();
90  aPrioriname += finDirname.Data();
91  multiplicityname += finDirname.Data();
92 
93  inname += postname.Data();
94  outname += postname.Data();
95  cutsname += postname.Data();
96  normname += postname.Data();
97  ntuplename += postname.Data();
98  nev2 += postname.Data();
99  outname2 += postname.Data();
100  aPrioriname += postname.Data();
101  multiplicityname += postname.Data();
102 
103 
104  AliAnalysisDataContainer *cinputLambdac = mgr->CreateContainer(inname,TChain::Class(),
105  AliAnalysisManager::kInputContainer);
106  mgr->ConnectInput(lambdacTask,0,mgr->GetCommonInputContainer());
107 
108  AliAnalysisDataContainer *coutputLambdacCuts = mgr->CreateContainer(cutsname,TList::Class(),
109  AliAnalysisManager::kOutputContainer,outputfile.Data());
110  mgr->ConnectOutput(lambdacTask,2,coutputLambdacCuts);
111 
112  AliAnalysisDataContainer *coutputLambdac = mgr->CreateContainer(outname,TList::Class(),
113  AliAnalysisManager::kOutputContainer,outputfile.Data());
114  mgr->ConnectOutput(lambdacTask,1,coutputLambdac);
115 
116  AliAnalysisDataContainer *coutputLambdacMC = mgr->CreateContainer(outname2,TList::Class(),
117  AliAnalysisManager::kOutputContainer,outputfile.Data());
118  mgr->ConnectOutput(lambdacTask,3,coutputLambdacMC);
119 
120  AliAnalysisDataContainer *coutputLambdacNev = mgr->CreateContainer(nev2,TH1F::Class(),
121  AliAnalysisManager::kOutputContainer,outputfile.Data());
122  mgr->ConnectOutput(lambdacTask,4,coutputLambdacNev);
123 
124  AliAnalysisDataContainer *coutputAPriori = mgr->CreateContainer(aPrioriname,TList::Class(),
125  AliAnalysisManager::kOutputContainer,outputfile.Data());
126  mgr->ConnectOutput(lambdacTask,5,coutputAPriori);
127  AliAnalysisDataContainer *coutputMultiplicity = mgr->CreateContainer(multiplicityname,TList::Class(),
128  AliAnalysisManager::kOutputContainer,outputfile.Data());
129  mgr->ConnectOutput(lambdacTask,6,coutputMultiplicity);
130 
131  AliAnalysisDataContainer *coutputLambdacNorm = mgr->CreateContainer(normname,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
132 
133  mgr->ConnectOutput(lambdacTask,7,coutputLambdacNorm);
134 
135  if (storeNtuple) {
136  AliAnalysisDataContainer *coutputLambdac2 = mgr->CreateContainer(ntuplename,TNtuple::Class(),
137  AliAnalysisManager::kOutputContainer,"InvMassLambdac_nt1.root");
138  coutputLambdac2->SetSpecialOutput();
139  mgr->ConnectOutput(lambdacTask,7,coutputLambdac2);
140  }
141 
142 
143  return lambdacTask;
144 }
void SetMultiplicityHists(Bool_t setter)
virtual void SetStandardCutsPbPb2011()
void SetFillVarHists(Bool_t setter)
void SetReadMC(Bool_t readMC=kTRUE)
virtual void SetStandardCutsPPb2013()
virtual void SetStandardCutsPP2010()
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:216
void SetCutsKF(Float_t cutsKF[2])
int Int_t
Definition: External.C:63
void SetPriorsHists(Bool_t setter)
float Float_t
Definition: External.C:68
AliAnalysisTaskSE * AddTaskLambdac(TString finname, Bool_t storeNtuple, Bool_t readMC, Bool_t MCPid, Bool_t realPid, Bool_t resPid, Bool_t useKF, Bool_t fillVarHists=kFALSE, Bool_t priorsHists=kFALSE, Bool_t multiplicityHists=kFALSE, Int_t syst=0, Int_t bit=0, TString postname="")
Definition: AddTaskLambdac.C:1
void SetUseKF(Bool_t useKF=kTRUE)
void SetUseFilterBitPID(Bool_t setter)
void SetUseFilterBitCut(Bool_t setter)
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:215
bool Bool_t
Definition: External.C:53
void SetAnalysis(Bool_t analysis=kTRUE)