]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGHF/vertexingHF/AliCFTaskVertexingHF.cxx
Fix for D0 filtering (A.Dainese)
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliCFTaskVertexingHF.cxx
index d9712b70449eb3398398fc748ed02a557ece79d6..f846e739f6a63f22ff4d264428415d588d506878 100644 (file)
@@ -649,7 +649,7 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
   cfVtxHF->SetCentralityValue(centValue);  
        
   // number of tracklets - multiplicity estimator
-  Double_t multiplicity = (Double_t)(aodEvent->GetTracklets()->GetNumberOfTracklets()); // casted to double because the CF is filled with doubles
+  Double_t multiplicity = (Double_t)(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aodEvent,-1.,1.)); // casted to double because the CF is filled with doubles
   cfVtxHF->SetMultiplicity(multiplicity);
        
   for (Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) { 
@@ -1219,11 +1219,14 @@ void AliCFTaskVertexingHF::UserCreateOutputObjects()
   if (fCuts->GetIsUsePID() && fDecayChannel==22) {
          
     fCuts->GetPidHF()->SetPidResponse(localPIDResponse);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0pos()->SetPidResponse(localPIDResponse);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0neg()->SetPidResponse(localPIDResponse);
     fCuts->GetPidHF()->SetOldPid(kFALSE);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0pos()->SetOldPid(kFALSE);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0neg()->SetOldPid(kFALSE);
+    AliRDHFCutsLctoV0* lcv0Cuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
+    if(lcv0Cuts){
+      lcv0Cuts->GetPidV0pos()->SetPidResponse(localPIDResponse);
+      lcv0Cuts->GetPidV0neg()->SetPidResponse(localPIDResponse);
+      lcv0Cuts->GetPidV0pos()->SetOldPid(kFALSE);
+      lcv0Cuts->GetPidV0neg()->SetOldPid(kFALSE);
+    }
   }
 
   //slot #1