+//________________________________________________________________________________
+Bool_t AliDielectronMC::IsSecondaryFromWeakDecay(Int_t label) const {
+ //
+ // Check if the particle with label "label" is a physical secondary from weak decay according to the
+ // definition in AliStack::IsSecondaryFromWeakDecay(Int_t label)
+ //
+ if(label<0) return kFALSE;
+ if(fAnaType==kAOD) {
+ if(!fMcArray) return kFALSE;
+ return (static_cast<AliAODMCParticle*>(GetMCTrackFromMCEvent(label)))->IsSecondaryFromWeakDecay();
+ } else if(fAnaType==kESD) {
+ if (!fMCEvent) return kFALSE;
+ return fStack->IsSecondaryFromWeakDecay(label);
+ }
+ return kFALSE;
+}
+
+//________________________________________________________________________________
+Bool_t AliDielectronMC::IsSecondaryFromMaterial(Int_t label) const {
+ //
+ // Check if the particle with label "label" is a physical secondary from weak decay according to the
+ // definition in AliStack::IsSecondaryFromMaterial(Int_t label)
+ //
+ if(label<0) return kFALSE;
+ if(fAnaType==kAOD) {
+ if(!fMcArray) return kFALSE;
+ return (static_cast<AliAODMCParticle*>(GetMCTrackFromMCEvent(label)))->IsSecondaryFromMaterial();
+ } else if(fAnaType==kESD) {
+ if (!fMCEvent) return kFALSE;
+ return fStack->IsSecondaryFromMaterial(label);
+ }
+ return kFALSE;
+}
+
+
+//________________________________________________________________________________
+Bool_t AliDielectronMC::CheckGEANTProcess(Int_t label, TMCProcess process) const {
+ //
+ // Check the GEANT process for the particle
+ // NOTE: for tracks the absolute label should be passed
+ //
+ if(label<0) return kFALSE;
+ if(fAnaType==kAOD) {
+ if(!fMcArray) return kFALSE;
+ UInt_t processID = static_cast<AliAODMCParticle*>(GetMCTrackFromMCEvent(label))->GetMCProcessCode();
+ // printf("process: id %d --> %s \n",processID,TMCProcessName[processID]);
+ return (process==processID);
+ } else if(fAnaType==kESD) {
+ if (!fMCEvent) return kFALSE;
+ AliError(Form("return of GEANT process not implemented for ESD "));
+ return kFALSE;
+ }
+ return kFALSE;
+
+}