]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliCFVertexingHFCascade.cxx
fix to the proper NSD
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliCFVertexingHFCascade.cxx
index 4b574022ec52f5dca6cd1bdaa0ae012731631f6b..57e5492d2cf25e90a2490151f6c721c4f3cf1006 100644 (file)
@@ -13,8 +13,6 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
-
 //-----------------------------------------------------------------------
 // Class for HF corrections as a function of many variables and steps
 // For D* and other cascades
@@ -43,6 +41,16 @@ ClassImp(AliCFVertexingHFCascade)
   // standard constructor
 
   SetNProngs(3);
+  fPtAccCut=new Float_t[fProngs];
+  fEtaAccCut=new Float_t[fProngs];
+  // element 0 in the cut arrays corresponds to the soft pion!!!!!!!! Careful when setting the values...
+  fPtAccCut[0]=0.;
+  fEtaAccCut[0]=0.;
+  for(Int_t iP=1; iP<fProngs; iP++){
+         fPtAccCut[iP]=0.1;
+         fEtaAccCut[iP]=0.9;
+  }
+
 }
 
 
@@ -88,7 +96,11 @@ Bool_t AliCFVertexingHFCascade::SetRecoCandidateParam(AliAODRecoDecayHF *recoCan
  
   Int_t mcLabel =  dstarD0pi->MatchToMC(413,421,pdgDgDStartoD0pi,pdgDgD0toKpi,fmcArray); 
   
-  if (mcLabel < 0) return bSignAssoc;
+  if (mcLabel == -1) return bSignAssoc;
+
+  if ((fRecoCandidate->NumberOfFakeDaughters()>0)&&(fFakeSelection==1)) return bSignAssoc;
+  if ((fRecoCandidate->NumberOfFakeDaughters()==0)&&(fFakeSelection==2)) return bSignAssoc;
+  
   SetMCLabel(mcLabel);
   fmcPartCandidate = dynamic_cast<AliAODMCParticle*>(fmcArray->At(fmcLabel)); 
 
@@ -387,6 +399,127 @@ Bool_t AliCFVertexingHFCascade::EvaluateIfD0toKpi(AliAODMCParticle* neutralDaugh
 
 }
 
+//___________________________________________________________
+
+void AliCFVertexingHFCascade::SetPtAccCut(Float_t* ptAccCut)
+{
+       //
+       // setting the pt cut to be used in the Acceptance steps (MC+Reco)
+       //
+
+       AliInfo("The 3rd element of the pt cut array will correspond to the cut applied to the soft pion - please check that it is correct");
+       if (fProngs>0){
+               for (Int_t iP=0; iP<fProngs; iP++){
+                       fPtAccCut[iP]=ptAccCut[iP];
+               }
+       }
+       return;
+}              
+
+
+
+//___________________________________________________________
+
+void AliCFVertexingHFCascade::SetEtaAccCut(Float_t* etaAccCut)
+{
+       //
+       // setting the eta cut to be used in the Acceptance steps (MC+Reco)
+       //
+
+       AliInfo("The 3rd element of the eta cut array will correspond to the cut applied to the soft pion - please check that it is correct");
+       if (fProngs>0){
+               for (Int_t iP=0; iP<fProngs; iP++){
+                       fEtaAccCut[iP]=etaAccCut[iP];
+               }
+       }
+       return;
+}      
+//___________________________________________________________
+
+void AliCFVertexingHFCascade::SetAccCut(Float_t* ptAccCut, Float_t* etaAccCut)
+{
+       //
+       // setting the pt and eta cut to be used in the Acceptance steps (MC+Reco)
+       //
+
+       AliInfo("The 3rd element of the pt and cut array will correspond to the cut applied to the soft pion - please check that they are correct");
+       if (fProngs>0){
+               for (Int_t iP=0; iP<fProngs; iP++){
+                       fPtAccCut[iP]=ptAccCut[iP];
+                       fEtaAccCut[iP]=etaAccCut[iP];
+               }
+       }
+       return;
+}              
+
+//___________________________________________________________
 
+void AliCFVertexingHFCascade::SetAccCut()
+{
+       //
+       // setting the pt and eta cut to be used in the Acceptance steps (MC+Reco)
+       //
+  
+  AliAODMCParticle* mcPartDaughter = dynamic_cast<AliAODMCParticle*>(fmcArray->At(fLabelArray[2]));  // should be the soft pion...  
+  if(!mcPartDaughter) return;
+  Int_t mother =  mcPartDaughter->GetMother();
+  AliAODMCParticle* mcMother = dynamic_cast<AliAODMCParticle*>(fmcArray->At(mother)); 
+  if(!mcMother) return;
+
+  if (TMath::Abs(mcPartDaughter->GetPdgCode())!= 211 || TMath::Abs(mcMother->GetPdgCode())!=413){
+    AliFatal("Apparently the soft pion is not in the third position, causing a crash!!");
+  }             
+  if (fProngs>0){
+    for (Int_t iP=0; iP<fProngs-1; iP++){
+      fPtAccCut[iP]=0.1;
+      fEtaAccCut[iP]=0.9;
+    }
+    fPtAccCut[2]=0.06;  // soft pion
+    fEtaAccCut[2]=0.9;  // soft pion
+  }
+  return;
+}              
 
+//_____________________________________________________________
+Double_t AliCFVertexingHFCascade::GetEtaProng(Int_t iProng) const 
+{
+       //
+       // getting eta of the prong - overload the mother class method
+       //
 
+ if (fRecoCandidate){
+   
+   AliAODRecoCascadeHF* dstarD0pi = (AliAODRecoCascadeHF*)fRecoCandidate;
+
+   Double_t etaProng =-9999;
+    if(iProng==0) etaProng =dstarD0pi->Get2Prong()->EtaProng(0);
+    if(iProng==1) etaProng =dstarD0pi->Get2Prong()->EtaProng(1);
+    if(iProng==2) etaProng =dstarD0pi->EtaProng(1);
+    
+    return etaProng;
+    
+  }
+  return 999999;    
+}
+//_____________________________________________________________
+Double_t AliCFVertexingHFCascade::GetPtProng(Int_t iProng) const 
+{
+       //
+       // getting pt of the prong
+       //
+  
+  if (fRecoCandidate){
+
+    AliAODRecoCascadeHF* dstarD0pi = (AliAODRecoCascadeHF*)fRecoCandidate;
+    Double_t ptProng= -9999;
+    if(iProng==0) ptProng =dstarD0pi->Get2Prong()->PtProng(0);
+    if(iProng==1) ptProng =dstarD0pi->Get2Prong()->PtProng(1);
+    if(iProng==2) ptProng =dstarD0pi->PtProng(1);
+    
+    // Double_t ptProng = fRecoCandidate->PtProng(iProng);  
+    return ptProng;
+    
+  }
+  return 999999;  
+  
+}