AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AddTaskLc2eleLambdafromAODtracks.C
Go to the documentation of this file.
2  Bool_t theMCon=kFALSE,
3  Bool_t ispp= kFALSE,
4  Bool_t writeVariableTree=kFALSE,
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) RDHFCutsLc2eleLambdaanal->SetStandardCutsPP2010();
33  else RDHFCutsLc2eleLambdaanal = (AliRDHFCutsLctoeleLambdafromAODtracks*)filecuts->Get("eleLambdaAnalysisCuts");
34  RDHFCutsLc2eleLambdaanal->SetName("eleLambdaAnalysisCuts");
35  RDHFCutsLc2eleLambdaanal->SetMinPtCandidate(-1.);
36  RDHFCutsLc2eleLambdaanal->SetMaxPtCandidate(10000.);
37  if (!RDHFCutsLc2eleLambdaanal) {
38  cout << "Specific AliRDHFCutsLc2eleLambdaanal not found\n";
39  return;
40  }
41 
42  //CREATE THE TASK
43 
44  printf("CREATE TASK\n");
45  AliAnalysisTaskSELc2eleLambdafromAODtracks *task = new AliAnalysisTaskSELc2eleLambdafromAODtracks("AliAnalysisTaskSELc2eleLambdafromAODtracks",RDHFCutsLc2eleLambdaanal,writeVariableTree);
46  task->SetMC(theMCon);
47  if(ispp)
48  task->SetUseCentralityV0M(kFALSE);
49  else
50  task->SetUseCentralityV0M(kTRUE);
51  task->SetDebugLevel(1);
52  task->SetReconstructPrimVert(reconstructPrimVert);
53  task->SetWriteEachVariableTree(writeEachVariableTree);
54  task->SetWriteMCVariableTree(writeMCVariableTree);
55  if(domixing)
57  else
58  task->SetEventMixingOff();
59 
60  //PVz Binning for pool PP or PbPb
61  Double_t pvzbinlimits[] = {-12,-10,-8,-6,-4,-2,0,2,4,6,8,10,12};
62  Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
63  //Cent Binning for pool pPb
64  Double_t cent_mult_binlimitspPb[] = { 0,10,20,30,40,50,60,70,80,90,100};
65  Int_t cent_mult_bin_numbpPb = sizeof(cent_mult_binlimitspPb)/sizeof(Double_t) - 1;
66  Double_t cent_mult_binlimitspp[] = { 0,100};
67  Int_t cent_mult_bin_numbpp = sizeof(cent_mult_binlimitspp)/sizeof(Double_t) - 1;
68 
69  task->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);
70  if(ispp){
71  task->SetPoolCentBinLimits(cent_mult_bin_numbpp,cent_mult_binlimitspp);
72  task->SetNumberOfEventsForMixing(1000);//pp
73  }else{
74  task->SetPoolCentBinLimits(cent_mult_bin_numbpPb,cent_mult_binlimitspPb);
75  task->SetNumberOfEventsForMixing(30);//pPb
76  }
77 
78  mgr->AddTask(task);
79 
80  // Create and connect containers for input/output
81  TString outputfile = AliAnalysisManager::GetCommonFileName();
82  outputfile += ":PWG3_D2H_Lc2eleLambda_";
83  outputfile += nTour;
84 
85  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
86 
87  // ----- output data -----
88  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("Lchist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
89  mgr->ConnectOutput(task,1,coutput1);
90  AliAnalysisDataContainer *coutputLc2 = mgr->CreateContainer(Form("Lc2eleLambdaCuts%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // cuts
91  mgr->ConnectOutput(task,2,coutputLc2);
92 
93  AliAnalysisDataContainer *coutputLc3 = mgr->CreateContainer(Form("eleLambdaHisto%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
94  mgr->ConnectOutput(task,3,coutputLc3);
95 
96  AliAnalysisDataContainer *coutputLc4 = mgr->CreateContainer(Form("eleLambdavariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
97  mgr->ConnectOutput(task,4,coutputLc4);
98  AliAnalysisDataContainer *coutputLc5 = mgr->CreateContainer(Form("eleLambda_elevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
99  mgr->ConnectOutput(task,5,coutputLc5);
100  AliAnalysisDataContainer *coutputLc6 = mgr->CreateContainer(Form("eleLambda_v0variables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
101  mgr->ConnectOutput(task,6,coutputLc6);
102  AliAnalysisDataContainer *coutputLc7 = mgr->CreateContainer(Form("eleLambda_mcvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
103  mgr->ConnectOutput(task,7,coutputLc7);
104  AliAnalysisDataContainer *coutputLc8 = mgr->CreateContainer(Form("eleLambdaCounter%1d",nTour),AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //counter
105  mgr->ConnectOutput(task,8,coutputLc8);
106  AliAnalysisDataContainer *coutputLc9 = mgr->CreateContainer(Form("eleLambda_mcelevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
107  mgr->ConnectOutput(task,9,coutputLc9);
108  AliAnalysisDataContainer *coutputLc10 = mgr->CreateContainer(Form("eleLambda_mcv0variables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
109  mgr->ConnectOutput(task,10,coutputLc10);
110  AliAnalysisDataContainer *coutputLc11 = mgr->CreateContainer(Form("eleLambda_mcgenpairvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
111  mgr->ConnectOutput(task,11,coutputLc11);
112 
113  return task;
114 
115 }
AliAnalysisTaskSELc2eleLambdafromAODtracks * AddTaskLc2eleLambdafromAODtracks(TString finname="", Bool_t theMCon=kFALSE, Bool_t ispp=kFALSE, Bool_t writeVariableTree=kFALSE, Bool_t domixing=kFALSE, Bool_t reconstructPrimVert=kFALSE, Bool_t writeEachVariableTree=kFALSE, Bool_t writeMCVariableTree=kFALSE, Int_t nTour=0)
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:216
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
virtual void SetStandardCutsPP2010()
Definition: AliRDHFCuts.h:46
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:215