AliPhysics  1811c8f (1811c8f)
AddTaskOmegac2eleOmegafromAODtracks.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) RDHFCutsOmegac2eleOmegaanal->SetStandardCutsPP2010();
33  else RDHFCutsOmegac2eleOmegaanal = (AliRDHFCutsOmegactoeleOmegafromAODtracks*)filecuts->Get("eleOmegaAnalysisCuts");
34  RDHFCutsOmegac2eleOmegaanal->SetName("eleOmegaAnalysisCuts");
35  RDHFCutsOmegac2eleOmegaanal->SetMinPtCandidate(-1.);
36  RDHFCutsOmegac2eleOmegaanal->SetMaxPtCandidate(10000.);
37  if (!RDHFCutsOmegac2eleOmegaanal) {
38  cout << "Specific AliRDHFCutsOmegac2eleOmegaanal not found\n";
39  return;
40  }
41 
42 
43  //CREATE THE TASK
44 
45  printf("CREATE TASK\n");
46  AliAnalysisTaskSEOmegac2eleOmegafromAODtracks *task = new AliAnalysisTaskSEOmegac2eleOmegafromAODtracks("AliAnalysisTaskSEOmegac2eleOmegafromAODtracks",RDHFCutsOmegac2eleOmegaanal,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(500);//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_Omegac2eleOmega_";
85  outputfile += nTour;
86 
87  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
88 
89  // ----- output data -----
90  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("Omegachist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
91  mgr->ConnectOutput(task,1,coutput1);
92  AliAnalysisDataContainer *coutputLc2 = mgr->CreateContainer(Form("Omegac2eleOmegaCuts%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // cuts
93  mgr->ConnectOutput(task,2,coutputLc2);
94 
95  AliAnalysisDataContainer *coutputLc3 = mgr->CreateContainer(Form("eleOmegaHisto%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
96  mgr->ConnectOutput(task,3,coutputLc3);
97 
98  AliAnalysisDataContainer *coutputLc4 = mgr->CreateContainer(Form("eleOmegavariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
99  mgr->ConnectOutput(task,4,coutputLc4);
100  AliAnalysisDataContainer *coutputLc5 = mgr->CreateContainer(Form("eleOmega_elevariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
101  mgr->ConnectOutput(task,5,coutputLc5);
102  AliAnalysisDataContainer *coutputLc6 = mgr->CreateContainer(Form("eleOmega_cascvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
103  mgr->ConnectOutput(task,6,coutputLc6);
104  AliAnalysisDataContainer *coutputLc7 = mgr->CreateContainer(Form("eleOmega_mcvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // variables tree
105  mgr->ConnectOutput(task,7,coutputLc7);
106  AliAnalysisDataContainer *coutputLc8 = mgr->CreateContainer(Form("eleOmegaCounter%1d",nTour),AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //counter
107  mgr->ConnectOutput(task,8,coutputLc8);
108 
109  return task;
110 
111 }
double Double_t
Definition: External.C:58
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:221
AliAnalysisTaskSEOmegac2eleOmegafromAODtracks * AddTaskOmegac2eleOmegafromAODtracks(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)
int Int_t
Definition: External.C:63
virtual void SetStandardCutsPP2010()
Definition: AliRDHFCuts.h:46
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:220
bool Bool_t
Definition: External.C:53