}
// few checks
- fHistNPPElectronFirstMother->Fill(pdgMom->PdgCode());
+ if(pdgMom) fHistNPPElectronFirstMother->Fill(pdgMom->PdgCode());
fHistNPPElectronFirstMotherXY->Fill(part->Vx(),part->Vy());
fHistNPPElectronNDaughters->Fill(nPartDaughters);
//if (IsInAcceptance(part,pdg,extParam))
if (IsInAcceptance(aliPart))
{
- fHistNPPElectronFirstMotherAcc->Fill(pdgMom->PdgCode());
+ if(pdgMom) fHistNPPElectronFirstMotherAcc->Fill(pdgMom->PdgCode());
fHistNPPElectronFirstMotherXYAcc->Fill(part->Vx(),part->Vy());
fHistNPPElectronNDaughtersAcc->Fill(nPartDaughters);
AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*>(ev);
AliESDEvent *realEvent = dynamic_cast<AliESDEvent*>(ev2);
-
+ if(!mcEvent || !realEvent){//Marcelo - should use AliError
+ Printf("ERROR: Event does not exist");
+ return 0;
+ }
fCentBin= -1;
if(fDataSet==20100){//If this is Pb+Pb
AliCentrality *centrality = realEvent->GetCentrality();
fNPPElectronRectotET += et;
// few checks
- fHistNPPElectronFirstMotherRec->Fill(pdgMom->PdgCode());
+ if(pdgMom) fHistNPPElectronFirstMotherRec->Fill(pdgMom->PdgCode());
fHistNPPElectronFirstMotherXYRec->Fill(part->Vx(),part->Vy());
fHistNPPElectronNDaughtersRec->Fill(nPartDaughters);