]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliCFTaskForDStarAnalysis.cxx
introduce the option to analyze with PROOF, plus cosmetics
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliCFTaskForDStarAnalysis.cxx
index 0101cd28a9edb6a3e34036e923ec4e612c10a0f1..be306c8a544ca09910fcb69b5f4b00ca22df78c6 100644 (file)
@@ -13,6 +13,8 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //-----------------------------------------------------------------------
 //   Class for DStar corrections: 
 //   
@@ -249,8 +251,17 @@ void AliCFTaskForDStarAnalysis::UserExec(Option_t *)
       
       //D0
       AliAODMCParticle* mcPartDaughter0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(daughter0));
+      if (!mcPartDaughter0) {
+       AliError("Could not find Monte-Carlo in AOD");
+       return;
+      }
+  
       // Soft Pion
       AliAODMCParticle* mcPartDaughter1 = dynamic_cast<AliAODMCParticle*>(mcArray->At(daughter1));
+      if (!mcPartDaughter1) {
+       AliError("Could not find Monte-Carlo in AOD");
+       return;
+      }
       
       // Acceptance variables for the soft pion
       Double_t eta1 = mcPartDaughter1->Eta();
@@ -273,7 +284,8 @@ void AliCFTaskForDStarAnalysis::UserExec(Option_t *)
       AliAODMCParticle* mcD0PartDaughter1 = dynamic_cast<AliAODMCParticle*>(mcArray->At(daughD01));
       
       if (!mcD0PartDaughter0 || !mcD0PartDaughter1) {
-       AliWarning("At least one D0 Daughter Particle not found in tree, but it should be, this check was already done..."); 
+       AliWarning("At least one D0 Daughter Particle not found in tree, but it should be, this check was already done...");
+       return; 
       }
       
       // D0 daughters - needed for acceptance