]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
-small fix for pdg code of grandmothers
authorjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Nov 2013 14:11:43 +0000 (14:11 +0000)
committerjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Nov 2013 14:11:43 +0000 (14:11 +0000)
PWGDQ/dielectron/AliDielectronVarManager.h

index c213f57428ee85caf4d0c2f9135a083f75ee8f3e..6b00cb507e5a707bddd44860f2ab6dc2b56bafa4 100644 (file)
@@ -618,7 +618,8 @@ inline void AliDielectronVarManager::FillVarESDtrack(const AliESDtrack *particle
       values[AliDielectronVarManager::kPdgCode]           =mc->GetMCTrack(particle)->PdgCode();
       values[AliDielectronVarManager::kHasCocktailMother] =mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
       values[AliDielectronVarManager::kPdgCodeMother]     =mc->GetMotherPDG(particle);
-      values[AliDielectronVarManager::kPdgCodeGrandMother]=mc->GetPdgFromLabel(mc->GetMothersLabel(trkLbl));
+      AliMCParticle *motherMC=mc->GetMCTrackMother(particle); //mother
+      if(motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=mc->GetMotherPDG(motherMC);
     }
     values[AliDielectronVarManager::kNumberOfDaughters]=mc->NumberOfDaughters(particle);
   } //if(mc->HasMC())
@@ -937,7 +938,8 @@ inline void AliDielectronVarManager::FillVarAODTrack(const AliAODTrack *particle
       values[AliDielectronVarManager::kPdgCode]           =mc->GetMCTrack(particle)->PdgCode();
       values[AliDielectronVarManager::kHasCocktailMother] =mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
       values[AliDielectronVarManager::kPdgCodeMother]     =mc->GetMotherPDG(particle);
-      values[AliDielectronVarManager::kPdgCodeGrandMother]=mc->GetPdgFromLabel(mc->GetMothersLabel(trkLbl));
+      AliAODMCParticle *motherMC=mc->GetMCTrackMother(particle); //mother
+      if(motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=mc->GetMotherPDG(motherMC);
     }
     values[AliDielectronVarManager::kNumberOfDaughters]=mc->NumberOfDaughters(particle);
   } //if(mc->HasMC())
@@ -1004,7 +1006,9 @@ inline void AliDielectronVarManager::FillVarMCParticle(const AliMCParticle *part
   values[AliDielectronVarManager::kPdgCode]           = particle->PdgCode();
   values[AliDielectronVarManager::kHasCocktailMother] = mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
   values[AliDielectronVarManager::kPdgCodeMother]     = mc->GetMotherPDG(particle);
-  values[AliDielectronVarManager::kPdgCodeGrandMother]= mc->GetPdgFromLabel(mc->GetMothersLabel(trkLbl));
+  AliMCParticle *motherMC=mc->GetMCTrackMother(particle); //mother
+  if(motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=mc->GetMotherPDG(motherMC);
+
 
   values[AliDielectronVarManager::kIsJpsiPrimary] = mc->IsJpsiPrimary(particle);
   values[AliDielectronVarManager::kNumberOfDaughters]=mc->NumberOfDaughters(particle);
@@ -1165,7 +1169,9 @@ inline void AliDielectronVarManager::FillVarAODMCParticle(const AliAODMCParticle
   values[AliDielectronVarManager::kPdgCode]           = particle->PdgCode();
   values[AliDielectronVarManager::kHasCocktailMother] = mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
   values[AliDielectronVarManager::kPdgCodeMother]     = mc->GetMotherPDG(particle);
-  values[AliDielectronVarManager::kPdgCodeGrandMother]= mc->GetPdgFromLabel(mc->GetMothersLabel(trkLbl));
+  AliAODMCParticle *motherMC=mc->GetMCTrackMother(particle); //mother
+  if(motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=mc->GetMotherPDG(motherMC);
+
 
   values[AliDielectronVarManager::kIsJpsiPrimary] = mc->IsJpsiPrimary(particle);
   values[AliDielectronVarManager::kNumberOfDaughters]=mc->NumberOfDaughters(particle);