Int_t label = TMath::Abs(track->GetLabel()); \r
if (label >= mcStackSize) continue;\r
particle = stack->Particle(label);\r
+ if (!particle) continue;\r
if(particle && particle->GetPDG() && particle->GetPDG()->Charge()!=0.)\r
{\r
particleMother = GetMother(particle,stack);\r
// TPC track\r
//\r
Int_t labelTPC = TMath::Abs(track->GetTPCLabel()); \r
+ if (labelTPC >= mcStackSize) continue;\r
particleTPC = stack->Particle(labelTPC);\r
+ if (!particleTPC) continue;\r
if(particleTPC && particleTPC->GetPDG() && particleTPC->GetPDG()->Charge()!=0.)\r
{\r
particleMotherTPC = GetMother(particleTPC,stack);\r
//\r
TParticle *part=0;\r
TClonesArray *trefs=0;\r
- Int_t status = mcEvent->GetParticleAndTR(TMath::Abs(track->GetTPCLabel()), part, trefs);\r
+ Int_t status = mcEvent->GetParticleAndTR(TMath::Abs(labelTPC), part, trefs);\r
\r
if(status>0 && part && trefs && part->GetPDG() && part->GetPDG()->Charge()!=0.) \r
{\r
// ITS track\r
//\r
Int_t labelITS = TMath::Abs(track->GetITSLabel()); \r
+ if (labelITS >= mcStackSize) continue;\r
particleITS = stack->Particle(labelITS);\r
+ if (!particleITS) continue;\r
if(particleITS && particleITS->GetPDG() && particleITS->GetPDG()->Charge()!=0.)\r
{\r
particleMotherITS = GetMother(particleITS,stack);\r
\r
Int_t motherLabel = TMath::Abs(particle->GetMother(0)); \r
TParticle* mother = NULL; \r
+ Int_t mcStackSize=stack->GetNtrack();\r
+ if (motherLabel>=mcStackSize) return NULL;\r
mother = stack->Particle(motherLabel); \r
\r
return mother;\r
Bool_t isFromConversion = kFALSE;\r
\r
if(stack) {\r
+ Int_t mcStackSize=stack->GetNtrack();\r
+ if (label>=mcStackSize) return kFALSE;\r
TParticle* particle = stack->Particle(label);\r
+ if (!particle) return kFALSE;\r
\r
if(particle && particle->GetPDG() && particle->GetPDG()->Charge()!=0) \r
{\r
Bool_t isPrim = stack->IsPhysicalPrimary(label);\r
\r
Int_t motherLabel = TMath::Abs(particle->GetMother(0)); \r
+ if (motherLabel>=mcStackSize) return kFALSE;\r
TParticle* mother = stack->Particle(motherLabel); \r
if(mother) {\r
Int_t motherPdg = mother->GetPdgCode();\r
Bool_t isFromMaterial = kFALSE;\r
\r
if(stack) {\r
+ Int_t mcStackSize=stack->GetNtrack();\r
+ if (label>=mcStackSize) return kFALSE;\r
TParticle* particle = stack->Particle(label);\r
+ if (!particle) return kFALSE;\r
\r
if(particle && particle->GetPDG() && particle->GetPDG()->Charge()!=0) \r
{\r
Bool_t isPrim = stack->IsPhysicalPrimary(label);\r
\r
Int_t motherLabel = TMath::Abs(particle->GetMother(0)); \r
+ if (motherLabel>=mcStackSize) return kFALSE;\r
TParticle* mother = stack->Particle(motherLabel); \r
if(mother) {\r
if(!isPrim && mech==13) { \r
Bool_t isFromStrangeness = kFALSE;\r
\r
if(stack) {\r
+ Int_t mcStackSize=stack->GetNtrack();\r
+ if (label>=mcStackSize) return kFALSE;\r
TParticle* particle = stack->Particle(label);\r
+ if (!particle) return kFALSE;\r
\r
if(particle && particle->GetPDG() && particle->GetPDG()->Charge()!=0) \r
{\r
Bool_t isPrim = stack->IsPhysicalPrimary(label);\r
\r
Int_t motherLabel = TMath::Abs(particle->GetMother(0)); \r
+ if (motherLabel>=mcStackSize) return kFALSE;\r
TParticle* mother = stack->Particle(motherLabel); \r
if(mother) {\r
Int_t motherPdg = mother->GetPdgCode();\r