Possibility use a user-defined function for the pt weights in the Corr Fraemwork...
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / macros / AddTaskCFVertexingHF3Prong.C
index fa8da30..94cb2ba 100644 (file)
@@ -523,11 +523,35 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust
        if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2);
        if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1);           
 
+       TF1* funcWeight = 0x0;
+       if (task->GetUseWeight()) {
+               funcWeight = (TF1*)cutFile->Get("funcWeight");
+               if (funcWeight == 0x0){
+                       Printf("FONLL Weights will be used");
+               }
+               else {
+                       task->SetWeightFunction(funcWeight);
+                       Printf("User-defined Weights will be used. The function being:");
+                       task->GetWeightFunction()->Print();
+               }
+       }
+
        Printf("***************** CONTAINER SETTINGS *****************");
        Printf("decay channel = %d",(Int_t)task->GetDecayChannel());
        Printf("FillFromGenerated = %d",(Int_t)task->GetFillFromGenerated());
        Printf("Dselection = %d",(Int_t)task->GetDselection());
        Printf("UseWeight = %d",(Int_t)task->GetUseWeight());
+       if (task->GetUseWeight()) {
+               funcWeight = (TF1*)cutFile->Get("funcWeight");
+               if (funcWeight == 0x0){
+                       Printf("FONLL Weights will be used");
+               }
+               else {
+                       task->SetWeightFunction(funcWeight);
+                       Printf("User-defined Weights will be used. The function being:");
+                       task->GetWeightFunction()->Print();
+               }
+       }
        Printf("Sign = %d",(Int_t)task->GetSign());
        Printf("Centrality selection = %d",(Int_t)task->GetCentralitySelection());
        Printf("Fake selection = %d",(Int_t)task->GetFakeSelection());