AliPhysics  fde8a9f (fde8a9f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskLc2pK0sfromAODtracks.C
Go to the documentation of this file.
2  Bool_t theMCon=kFALSE,
3  Bool_t ispp= kFALSE,
4  Bool_t writeVariableTree=kTRUE,
5  Bool_t domixing=kFALSE,
6  Bool_t reconstructPrimVert=kFALSE,
7  Bool_t writeEachVariableTree=kFALSE,
8  Bool_t writeMCVariableTree=kFALSE,
9  Int_t nTour=0
10  )
11 
12 {
13 
14  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
15  if (!mgr) {
16  ::Error("AddTaskLc2V0YW", "No analysis manager to connect to.");
17  return NULL;
18  }
19 
20  Bool_t stdcuts=kFALSE;
21  TFile* filecuts;
22  if( finname.EqualTo("") ) {
23  stdcuts=kTRUE;
24  } else {
25  filecuts=TFile::Open(finname.Data());
26  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
27  AliFatal("Input file not found : check your cut object");
28  }
29  }
30 
32  if (stdcuts) RDHFCutsLc2pK0sanal->SetStandardCutsPP2010();
33  else RDHFCutsLc2pK0sanal = (AliRDHFCutsLctopK0sfromAODtracks*)filecuts->Get("LcAnalysisCuts");
34  RDHFCutsLc2pK0sanal->SetName("LcAnalysisCuts");
35  RDHFCutsLc2pK0sanal->SetMinPtCandidate(-1.);
36  RDHFCutsLc2pK0sanal->SetMaxPtCandidate(10000.);
37  if (!RDHFCutsLc2pK0sanal) {
38  cout << "Specific AliRDHFCutsLc2pK0sanal not found\n";
39  return;
40  }
41 
42 
43  //CREATE THE TASK
44 
45  printf("CREATE TASK\n");
46  AliAnalysisTaskSELc2pK0sfromAODtracks *task = new AliAnalysisTaskSELc2pK0sfromAODtracks("AliAnalysisTaskSELc2pK0sfromAODtracks",RDHFCutsLc2pK0sanal,writeVariableTree);
47  task->SetMC(theMCon);
48  if(ispp)
49  task->SetUseCentralityV0M(kFALSE);
50  else
51  task->SetUseCentralityV0M(kTRUE);
52  task->SetDebugLevel(1);
53  task->SetReconstructPrimVert(reconstructPrimVert);
54  //task->SetWriteEachVariableTree(writeEachVariableTree);
55  //task->SetWriteMCVariableTree(writeMCVariableTree);
56  if(domixing)
58  else
59  task->SetEventMixingOff();
60 
61  //PVz Binning for pool PP or PbPb
62  //Double_t pvzbinlimits[] = {-12,-10,-8,-6,-4,-2,0,2,4,6,8,10,12};
63  Double_t pvzbinlimits[] = {-12,-10.,-6.,-2.,2.,6.,10.,12};
64  Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
65  //Cent Binning for pool pPb
66  Double_t cent_mult_binlimitspPb[] = { 0,10,20,30,40,50,60,70,80,90,100};
67  Int_t cent_mult_bin_numbpPb = sizeof(cent_mult_binlimitspPb)/sizeof(Double_t) - 1;
68  Double_t cent_mult_binlimitspp[] = { 0,100};
69  Int_t cent_mult_bin_numbpp = sizeof(cent_mult_binlimitspp)/sizeof(Double_t) - 1;
70 
71  //rp Binning for pool PP
72  Double_t prpbinlimits[2];
73  for(Int_t i=0;i<2;i++){
74  prpbinlimits[i] = -0.5*3.141593+ 3.141593/1.*(Double_t)i;
75  }
76  Int_t prpbinnumb = sizeof(prpbinlimits)/sizeof(Double_t) - 1;
77 
78  task->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);
79  if(ispp){
80  task->SetPoolCentBinLimits(cent_mult_bin_numbpp,cent_mult_binlimitspp);
81  task->SetNumberOfEventsForMixing(1000);//pp
82  }else{
83  task->SetPoolCentBinLimits(cent_mult_bin_numbpPb,cent_mult_binlimitspPb);
84  task->SetNumberOfEventsForMixing(30);//pPb
85  }
86  task->SetPoolRPBinLimits(prpbinnumb,prpbinlimits);
87 
88  mgr->AddTask(task);
89 
90  // Create and connect containers for input/output
91  TString outputfile = AliAnalysisManager::GetCommonFileName();
92  outputfile += ":PWG3_D2H_Lc2pK0s_";
93  outputfile += nTour;
94 
95  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
96 
97  // ----- output data -----
98  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("Lc2pK0shist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
99  mgr->ConnectOutput(task,1,coutput1);
100  AliAnalysisDataContainer *coutputLc2 = mgr->CreateContainer(Form("Lc2pK0sCuts%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // cuts
101  mgr->ConnectOutput(task,2,coutputLc2);
102  AliAnalysisDataContainer *coutputLc3 = mgr->CreateContainer(Form("LcAll%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
103  mgr->ConnectOutput(task,3,coutputLc3);
104  AliAnalysisDataContainer *coutputLc4 = mgr->CreateContainer(Form("Lc2pK0svariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
105  mgr->ConnectOutput(task,4,coutputLc4);
106  AliAnalysisDataContainer *coutputLc5 = mgr->CreateContainer(Form("LcProtonvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
107  mgr->ConnectOutput(task,5,coutputLc5);
108  AliAnalysisDataContainer *coutputLc6 = mgr->CreateContainer(Form("LcV0variables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
109  mgr->ConnectOutput(task,6,coutputLc6);
110  AliAnalysisDataContainer *coutputLc7 = mgr->CreateContainer(Form("LcMCvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
111  mgr->ConnectOutput(task,7,coutputLc7);
112  AliAnalysisDataContainer *coutputLc8 = mgr->CreateContainer(Form("LcCounter%1d",nTour),AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //counter
113  mgr->ConnectOutput(task,8,coutputLc8);
114  AliAnalysisDataContainer *coutputLc9 = mgr->CreateContainer(Form("LcMCProtonvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
115  mgr->ConnectOutput(task,9,coutputLc9);
116  AliAnalysisDataContainer *coutputLc10 = mgr->CreateContainer(Form("LcMCV0variables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
117  mgr->ConnectOutput(task,10,coutputLc10);
118 
119  return task;
120 
121 }
double Double_t
Definition: External.C:58
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
void SetPoolRPBinLimits(Int_t Nrpbins, const Double_t *rpbins)
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:218
int Int_t
Definition: External.C:63
AliAnalysisTaskSELc2pK0sfromAODtracks * AddTaskLc2pK0sfromAODtracks(TString finname="", Bool_t theMCon=kFALSE, Bool_t ispp=kFALSE, Bool_t writeVariableTree=kTRUE, Bool_t domixing=kFALSE, Bool_t reconstructPrimVert=kFALSE, Bool_t writeEachVariableTree=kFALSE, Bool_t writeMCVariableTree=kFALSE, Int_t nTour=0)
virtual void SetStandardCutsPP2010()
Definition: AliRDHFCuts.h:46
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:217
bool Bool_t
Definition: External.C:53
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)