AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskXic2eleXifromAODtracks.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) RDHFCutsXic2eleXianal->SetStandardCutsPP2010();
33  else RDHFCutsXic2eleXianal = (AliRDHFCutsXictoeleXifromAODtracks*)filecuts->Get("eleXiAnalysisCuts");
34  RDHFCutsXic2eleXianal->SetName("eleXiAnalysisCuts");
35  RDHFCutsXic2eleXianal->SetMinPtCandidate(-1.);
36  RDHFCutsXic2eleXianal->SetMaxPtCandidate(10000.);
37  if (!RDHFCutsXic2eleXianal) {
38  cout << "Specific AliRDHFCutsXic2eleXianal not found\n";
39  return;
40  }
41 
42 
43  //CREATE THE TASK
44 
45  printf("CREATE TASK\n");
46  AliAnalysisTaskSEXic2eleXifromAODtracks *task = new AliAnalysisTaskSEXic2eleXifromAODtracks("AliAnalysisTaskSEXic2eleXifromAODtracks",RDHFCutsXic2eleXianal,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  Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
64 
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  task->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);
72  if(ispp){
73  task->SetPoolCentBinLimits(cent_mult_bin_numbpp,cent_mult_binlimitspp);
74  task->SetNumberOfEventsForMixing(1000);//pp
75  }else{
76  task->SetPoolCentBinLimits(cent_mult_bin_numbpPb,cent_mult_binlimitspPb);
77  task->SetNumberOfEventsForMixing(35);//pPb
78  }
79 
80  mgr->AddTask(task);
81 
82  // Create and connect containers for input/output
83  TString outputfile = AliAnalysisManager::GetCommonFileName();
84  outputfile += ":PWG3_D2H_Xic2eleXi_";
85  outputfile += nTour;
86 
87  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
88 
89  // ----- output data -----
90  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("Xichist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
91  mgr->ConnectOutput(task,1,coutput1);
92  AliAnalysisDataContainer *coutputLc2 = mgr->CreateContainer(Form("Xic2eleXiCuts%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // cuts
93  mgr->ConnectOutput(task,2,coutputLc2);
94 
95  AliAnalysisDataContainer *coutputLc3 = mgr->CreateContainer(Form("eleXiHisto%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
96  mgr->ConnectOutput(task,3,coutputLc3);
97 
98  AliAnalysisDataContainer *coutputLc4 = mgr->CreateContainer(Form("eleXivariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
99  mgr->ConnectOutput(task,4,coutputLc4);
100  AliAnalysisDataContainer *coutputLc5 = mgr->CreateContainer(Form("eleXi_elevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
101  mgr->ConnectOutput(task,5,coutputLc5);
102  AliAnalysisDataContainer *coutputLc6 = mgr->CreateContainer(Form("eleXi_cascvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
103  mgr->ConnectOutput(task,6,coutputLc6);
104  AliAnalysisDataContainer *coutputLc7 = mgr->CreateContainer(Form("eleXi_mcvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
105  mgr->ConnectOutput(task,7,coutputLc7);
106  AliAnalysisDataContainer *coutputLc8 = mgr->CreateContainer(Form("eleXiCounter%1d",nTour),AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //counter
107  mgr->ConnectOutput(task,8,coutputLc8);
108  AliAnalysisDataContainer *coutputLc9 = mgr->CreateContainer(Form("eleXi_mcelevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
109  mgr->ConnectOutput(task,9,coutputLc9);
110  AliAnalysisDataContainer *coutputLc10 = mgr->CreateContainer(Form("eleXi_mccascvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
111  mgr->ConnectOutput(task,10,coutputLc10);
112 
113  return task;
114 
115 }
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:216
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
AliAnalysisTaskSEXic2eleXifromAODtracks * AddTaskXic2eleXifromAODtracks(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)
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