Updates for proper treatment of fQuality flag in centrality selection and for usage...
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / macros / AddTaskHFQA.C
index e2057cd..83865fc 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskSEHFQA* AddTaskHFQA(AliAnalysisTaskSEHFQA::DecChannel ch,TString filecutsname="D0toKpiCuts.root"){
+AliAnalysisTaskSEHFQA* AddTaskHFQA(AliAnalysisTaskSEHFQA::DecChannel ch,TString filecutsname="D0toKpiCuts.root",Bool_t readMC=kFALSE, Bool_t simplemode=kFALSE){
   //
   // Test macro for the AliAnalysisTaskSE for HF mesons quality assurance
   //Author: C.Bianchin chiara.bianchin@pd.infn.it
@@ -16,9 +16,11 @@ AliAnalysisTaskSEHFQA* AddTaskHFQA(AliAnalysisTaskSEHFQA::DecChannel ch,TString
     stdcuts=kTRUE;
   }
 
+  Bool_t onoff[3]={kTRUE,kTRUE,kTRUE};
+
   AliRDHFCuts *analysiscuts=0x0;
 
-  TString filename="",out1name="nEntriesQA",out2name="outputPid",out3name="outputTrack",out4name="cuts",inname="input",suffix="",cutsobjname="";
+  TString filename="",out1name="nEntriesQA",out2name="outputPid",out3name="outputTrack",out4name="cuts",out5name="countersCentrality",out6name="outputCentrCheck",inname="input",suffix="",cutsobjname="",centr="";
   filename = AliAnalysisManager::GetCommonFileName();
   filename += ":PWG3_D2H_QA";
 
@@ -84,14 +86,31 @@ AliAnalysisTaskSEHFQA* AddTaskHFQA(AliAnalysisTaskSEHFQA::DecChannel ch,TString
   out2name+=suffix;
   out3name+=suffix;
   out4name=cutsobjname;
+  out5name+=suffix;
+  out6name+=suffix;
 
   if(!analysiscuts && filecutsname!="none"){
     cout<<"Specific AliRDHFCuts not found"<<endl;
     return;
   }
+
+  centr=Form("%.0f%.0f",analysiscuts->GetMinCentrality(),analysiscuts->GetMaxCentrality());
+  inname+=centr;
+  out1name+=centr;
+  out2name+=centr;
+  out3name+=centr;
+  out4name+=centr;
+  out5name+=centr;
+  out6name+=centr;
+
  
   AliAnalysisTaskSEHFQA* taskQA=new AliAnalysisTaskSEHFQA(Form("QA%s",suffix.Data()),ch,analysiscuts);
 
+  taskQA->SetReadMC(readMC);
+  taskQA->SetSimpleMode(simplemode); // set to kTRUE to go faster in PbPb
+  taskQA->SetTrackOn(onoff[0]);
+  taskQA->SetPIDOn(onoff[1]);
+  taskQA->SetCentralityOn(onoff[2]);
   mgr->AddTask(taskQA);
 
   //
@@ -103,13 +122,20 @@ AliAnalysisTaskSEHFQA* AddTaskHFQA(AliAnalysisTaskSEHFQA::DecChannel ch,TString
   mgr->ConnectOutput(taskQA,1,coutput1);
 
   AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(out2name,TList::Class(),AliAnalysisManager::kOutputContainer, filename.Data()); //PID
-  mgr->ConnectOutput(taskQA,2,coutput2);
+  if(onoff[1]) mgr->ConnectOutput(taskQA,2,coutput2);
 
   AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(out3name,TList::Class(),AliAnalysisManager::kOutputContainer, filename.Data()); //quality of tracks
-  mgr->ConnectOutput(taskQA,3,coutput3);
+  if(onoff[0]) mgr->ConnectOutput(taskQA,3,coutput3);
 
   AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(out4name,AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, filename.Data()); //cuts
   mgr->ConnectOutput(taskQA,4,coutput4);
 
+  AliAnalysisDataContainer *coutput5 = mgr->CreateContainer(out5name,TList::Class(),AliAnalysisManager::kOutputContainer, filename.Data()); //quality of centrality
+  if(onoff[2]) mgr->ConnectOutput(taskQA,5,coutput5);
+
+  AliAnalysisDataContainer *coutput6 = mgr->CreateContainer(out6name,TList::Class(),AliAnalysisManager::kOutputContainer, filename.Data()); //quality of centrality
+  if(onoff[2]) mgr->ConnectOutput(taskQA,6,coutput6);
+
  return taskQA;
 }
+