* provided "as is" without express or implied warranty. *
**************************************************************************/
+/* $Id$ */
+
//-----------------------------------------------------------------------
// Class for DStar corrections:
//
//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();
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