AliPhysics  cdeda5a (cdeda5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskXic2eleXifromAODtracks.C
Go to the documentation of this file.
2  Bool_t theMCon=kFALSE,
3  Int_t iscoltype= 0,
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  TString estimatorFilename="",
10  Int_t nTour=0
11  )
12 
13 {
14 
15  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
16  if (!mgr) {
17  ::Error("AddTaskLc2V0YW", "No analysis manager to connect to.");
18  return NULL;
19  }
20 
21  Bool_t stdcuts=kFALSE;
22  TFile* filecuts;
23  if( finname.EqualTo("") ) {
24  stdcuts=kTRUE;
25  } else {
26  filecuts=TFile::Open(finname.Data());
27  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
28  AliFatal("Input file not found : check your cut object");
29  }
30  }
31 
33  if (stdcuts) RDHFCutsXic2eleXianal->SetStandardCutsPP2010();
34  else RDHFCutsXic2eleXianal = (AliRDHFCutsXictoeleXifromAODtracks*)filecuts->Get("eleXiAnalysisCuts");
35  RDHFCutsXic2eleXianal->SetName("eleXiAnalysisCuts");
36  RDHFCutsXic2eleXianal->SetMinPtCandidate(-1.);
37  RDHFCutsXic2eleXianal->SetMaxPtCandidate(10000.);
38  if (!RDHFCutsXic2eleXianal) {
39  cout << "Specific AliRDHFCutsXic2eleXianal not found\n";
40  return;
41  }
42 
43 
44  //CREATE THE TASK
45 
46  printf("CREATE TASK\n");
47  AliAnalysisTaskSEXic2eleXifromAODtracks *task = new AliAnalysisTaskSEXic2eleXifromAODtracks("AliAnalysisTaskSEXic2eleXifromAODtracks",RDHFCutsXic2eleXianal,writeVariableTree);
48  task->SetMC(theMCon);
49  if(iscoltype==0){
50  task->SetUseCentralityV0M(kFALSE);
51  task->SetUseCentralitySPDTracklet(kFALSE);
52  }else{
53  task->SetUseCentralityV0M(kTRUE);
54  task->SetUseEventPlane(4);
55  }
56  task->SetDebugLevel(1);
57  task->SetReconstructPrimVert(reconstructPrimVert);
58  task->SetWriteEachVariableTree(writeEachVariableTree);
59  task->SetWriteMCVariableTree(writeMCVariableTree);
60  if(domixing)
62  else
63  task->SetEventMixingOff();
64 
65  //PVz Binning for pool PP or PbPb
66  Double_t pvzbinlimits[] = {-12,-10,-8,-6,-4,-2,0,2,4,6,8,10,12};
67  Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
68 
69  //Cent Binning for pool pPb
70  Double_t cent_mult_binlimitspPb[] = { 0,10,20,30,40,50,60,70,80,90,100};
71  Int_t cent_mult_bin_numbpPb = sizeof(cent_mult_binlimitspPb)/sizeof(Double_t) - 1;
72  Double_t cent_mult_binlimitspp[] = { 0,100};
73  Int_t cent_mult_bin_numbpp = sizeof(cent_mult_binlimitspp)/sizeof(Double_t) - 1;
74  Double_t cent_mult_binlimitsPbPb[] = { 0,2.5,5,7.5,10,20,30,40,50,60,70,80,90,100};
75  Int_t cent_mult_bin_numbPbPb = sizeof(cent_mult_binlimitsPbPb)/sizeof(Double_t) - 1;
76 
77  task->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);
78  if(iscoltype==0){
79  task->SetPoolCentBinLimits(cent_mult_bin_numbpp,cent_mult_binlimitspp);
80  task->SetNumberOfEventsForMixing(10);//pp
81  }else if(iscoltype==0){
82  task->SetPoolCentBinLimits(cent_mult_bin_numbpPb,cent_mult_binlimitspPb);
83  task->SetNumberOfEventsForMixing(10);//pPb
84  }else{
85  task->SetPoolCentBinLimits(cent_mult_bin_numbPbPb,cent_mult_binlimitsPbPb);
86  task->SetNumberOfEventsForMixing(10);//PbPb
87  }
88 
89  if(iscoltype==0 || iscoltype==1){
90  Int_t nrpbin = 1.;
91  Double_t rpbinlimits[2] = {-3.2,3.2};
92  task->SetPoolRPBinLimits(nrpbin,rpbinlimits);
93  }else{
94  Int_t nrpbin = 8;
95  Double_t rpbinlimits[9];
96  Double_t steprp = TMath::Pi()/(Double_t)nrpbin;
97  for(Int_t ir=0;ir<9;ir++){
98  rpbinlimits[ir] = -1.*TMath::Pi()/2. + steprp * (Double_t) ir;
99  }
100  task->SetPoolRPBinLimits(nrpbin,rpbinlimits);
101  }
102 
103  //multiplicity study
104  if(iscoltype==0){
105  if(estimatorFilename.EqualTo("") ) {
106  printf("Estimator file not provided, multiplcity corrected histograms will not be filled\n");
107  } else{
108  TFile* fileEstimator=TFile::Open(estimatorFilename.Data());
109  if(!fileEstimator) {
110  AliFatal("File with multiplicity estimator not found\n");
111  return;
112  }
113  task->SetReferenceMultiplcity(9.26);
114  const Char_t* profilebasename="SPDmult10";
115  const Char_t* periodNames[4] = {"LHC10b", "LHC10c", "LHC10d", "LHC10e"};
116  TProfile* multEstimatorAvg[4];
117  for(Int_t ip=0; ip<4; ip++) {
118  multEstimatorAvg[ip] = (TProfile*)(fileEstimator->Get(Form("%s_%s",profilebasename,periodNames[ip]))->Clone(Form("%s_%s_clone",profilebasename,periodNames[ip])));
119  if (!multEstimatorAvg[ip]) {
120  AliFatal(Form("Multiplicity estimator for %s not found! Please check your estimator file",periodNames[ip]));
121  return;
122  }
123  }
124  task->SetMultiplVsZProfileLHC10b(multEstimatorAvg[0]);
125  task->SetMultiplVsZProfileLHC10c(multEstimatorAvg[1]);
126  task->SetMultiplVsZProfileLHC10d(multEstimatorAvg[2]);
127  task->SetMultiplVsZProfileLHC10e(multEstimatorAvg[3]);
128  }
129  }
130 
131  mgr->AddTask(task);
132 
133  // Create and connect containers for input/output
134  TString outputfile = AliAnalysisManager::GetCommonFileName();
135  outputfile += ":PWG3_D2H_Xic2eleXi_";
136  outputfile += nTour;
137 
138  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
139 
140  // ----- output data -----
141  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("Xichist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
142  mgr->ConnectOutput(task,1,coutput1);
143  AliAnalysisDataContainer *coutputLc2 = mgr->CreateContainer(Form("Xic2eleXiCuts%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // cuts
144  mgr->ConnectOutput(task,2,coutputLc2);
145 
146  AliAnalysisDataContainer *coutputLc3 = mgr->CreateContainer(Form("eleXiHisto%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
147  mgr->ConnectOutput(task,3,coutputLc3);
148 
149  AliAnalysisDataContainer *coutputLc4 = mgr->CreateContainer(Form("eleXivariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
150  mgr->ConnectOutput(task,4,coutputLc4);
151  AliAnalysisDataContainer *coutputLc5 = mgr->CreateContainer(Form("eleXi_elevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
152  mgr->ConnectOutput(task,5,coutputLc5);
153  AliAnalysisDataContainer *coutputLc6 = mgr->CreateContainer(Form("eleXi_cascvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
154  mgr->ConnectOutput(task,6,coutputLc6);
155  AliAnalysisDataContainer *coutputLc7 = mgr->CreateContainer(Form("eleXi_mcvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
156  mgr->ConnectOutput(task,7,coutputLc7);
157  AliAnalysisDataContainer *coutputLc8 = mgr->CreateContainer(Form("eleXiCounter%1d",nTour),AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //counter
158  mgr->ConnectOutput(task,8,coutputLc8);
159  AliAnalysisDataContainer *coutputLc9 = mgr->CreateContainer(Form("eleXi_mcelevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
160  mgr->ConnectOutput(task,9,coutputLc9);
161  AliAnalysisDataContainer *coutputLc10 = mgr->CreateContainer(Form("eleXi_mccascvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
162  mgr->ConnectOutput(task,10,coutputLc10);
163  //AliAnalysisDataContainer *coutputLc11 = mgr->CreateContainer(Form("eleXi_mcgenpairvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
164  //mgr->ConnectOutput(task,11,coutputLc11);
165  AliAnalysisDataContainer *coutputLc11 = mgr->CreateContainer(Form("eleXi_singlevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
166  mgr->ConnectOutput(task,11,coutputLc11);
167  AliAnalysisDataContainer *coutputLc12 = mgr->CreateContainer(Form("eleXi_correlationvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
168  mgr->ConnectOutput(task,12,coutputLc12);
169 
170  return task;
171 
172 }
void SetPoolRPBinLimits(Int_t Nrpbins, const Double_t *RPBins)
double Double_t
Definition: External.C:58
char Char_t
Definition: External.C:18
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:217
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
int Int_t
Definition: External.C:63
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
AliAnalysisTaskSEXic2eleXifromAODtracks * AddTaskXic2eleXifromAODtracks(TString finname="", Bool_t theMCon=kFALSE, Int_t iscoltype=0, Bool_t writeVariableTree=kTRUE, Bool_t domixing=kFALSE, Bool_t reconstructPrimVert=kFALSE, Bool_t writeEachVariableTree=kFALSE, Bool_t writeMCVariableTree=kFALSE, TString estimatorFilename="", Int_t nTour=0)
virtual void SetStandardCutsPP2010()
Definition: AliRDHFCuts.h:46
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:216
bool Bool_t
Definition: External.C:53