//----------------------------------------------------
-AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(TString suffixName="", const char* cutFile = "./DplustoKpipiCuts.root", Int_t configuration = AliCFTaskVertexingHF::kCheetah, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 411, Char_t isSign = 2)
+AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(TString suffixName="", const char* cutFile = "./DplustoKpipiCuts.root", Int_t configuration = AliCFTaskVertexingHF::kCheetah, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 411, Char_t isSign = 2, TString multFile="", Bool_t useNchWeight=kFALSE)
//AliCFContainer *AddTaskCFVertexingHF3Prong(const char* cutFile = "./DplustoKpipiCuts.root", Int_t configuration = AliCFTaskVertexingHF::kSnail, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 411, Char_t isSign = 2)
{
printf("Addig CF task using cuts from file %s\n",cutFile);
return 0x0;
}
AliRDHFCutsDplustoKpipi *cutsDplustoKpipi = (AliRDHFCutsDplustoKpipi*)fileCuts->Get("AnalysisCuts");
+ TH1F *hMult=0x0;
+ if(multFile.EqualTo("") ) {
+ printf("Will not be corrected with weights \n");
+ }else{
+ TFile *fileMult = TFile::Open(multFile.Data());
+ TDirectoryFile *dir1 = (TDirectoryFile*)fileMult->Get("PWG3_D2H_DMult_DplusLoose");
+ TList* list1=(TList*)dir1->Get("coutputDplusLoose");
+ hMult=(TH1F*)list1->FindObject("hGenPrimaryParticlesInelGt0");
+ }
// check that the fKeepD0fromB flag is set to true when the fKeepD0fromBOnly flag is true
// for now the binning is the same than for all D's
task->SetFakeSelection(0);
task->SetRejectCandidateIfNotFromQuark(kTRUE); // put to false if you want to keep HIJING D0!!
task->SetUseMCVertex(kFALSE); // put to true if you want to do studies on pp
+ task->SetUseNchWeight(useNchWeight); //correction with mult weight
+ if(useNchWeight){
+ if(hMult) task->SetMCNchHisto(hMult);
+ else{
+ AliFatal("Histogram for multiplicity weights not found");
+ return 0x0;
+ }
if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2);
if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1);