Nicer settings for Nch weights
authorzconesa <zconesa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Sep 2012 22:19:45 +0000 (22:19 +0000)
committerzconesa <zconesa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Sep 2012 22:19:45 +0000 (22:19 +0000)
PWGHF/vertexingHF/macros/AddTaskCFVertexingHF.C

index 93f0c96..6dd0c77 100644 (file)
@@ -47,7 +47,7 @@ const Float_t multmax_50_102 = 102;
 
 //----------------------------------------------------
 
-AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.root", TString cutObjectName="D0toKpiCutsStandard", TString suffix="", Int_t configuration = AliCFTaskVertexingHF::kSnail, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 421, Char_t isSign = 2, Bool_t useWeight=kFALSE, Bool_t useFlatPtWeight=kFALSE, Bool_t useZWeight=kFALSE, const char* nchCorrFile="", Bool_t useNchWeight=kFALSE)
+AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.root", TString cutObjectName="D0toKpiCutsStandard", TString suffix="", Int_t configuration = AliCFTaskVertexingHF::kSnail, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 421, Char_t isSign = 2, Bool_t useWeight=kFALSE, Bool_t useFlatPtWeight=kFALSE, Bool_t useZWeight=kFALSE, Bool_t useNchWeight=kFALSE)
 {
        printf("Adding CF task using cuts from file %s\n",cutFile);
        if (configuration == AliCFTaskVertexingHF::kSnail){
@@ -112,16 +112,6 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.
        ptmax_16_24 =  24.0 ;
 
 
-       //
-       // Nch correction settings if needed
-       //
-       TFile* fileNchCorr = TFile::Open(nchCorrFile);
-       if( (useNchWeight && !fileNchCorr) || (fileNchCorr && !fileNchCorr->IsOpen()) ){ 
-         AliError("No Nch correction applied");
-         return 0x0;
-       }
-
-
        //CONTAINER DEFINITION
        Info("AliCFTaskVertexingHF","SETUP CONTAINER");
        const Double_t phimax = 2*TMath::Pi();
@@ -587,13 +577,11 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.
        }
 
        if(useNchWeight){
-         TDirectoryFile *dir1 = (TDirectoryFile*)fileNchCorr->Get("PWG3_D2H_DMult_DplusLoose");
-         TList* list1=(TList*)dir1->Get("coutputDplusLoose");
-         TH1F *hMult=(TH1F*)list1->FindObject("hGenPrimaryParticlesInelGt0");
-         if(hMult) {
-           task->SetMCNchHisto(hMult);
+         TH1F *hNchPrimaries = (TH1F*)fileCuts->Get("hGenPrimaryParticlesInelGt0");
+         if(hNchPrimaries) {
            task->SetUseNchWeight(kTRUE);
-         } else { 
+           task->SetMCNchHisto(hNchPrimaries);
+         } else {
            AliFatal("Histogram for multiplicity weights not found");
            return 0x0;
          }