]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
corrected (again) the setting of WDecay parent for electrons
authorjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Oct 2009 21:15:02 +0000 (21:15 +0000)
committerjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Oct 2009 21:15:02 +0000 (21:15 +0000)
PWG4/PartCorrBase/AliMCAnalysisUtils.cxx

index fd45729581d34af6dd434ce5a838164d4464f64a..5448a86bd6f83020e623f129d99e1f14e329d8e6 100755 (executable)
@@ -242,11 +242,19 @@ Int_t AliMCAnalysisUtils::CheckOriginInStack(const Int_t label, AliStack* stack)
     
     //Electron check.  Where did that electron come from?
     else if(mPdg == 11){ //electron
+      if(pPdg == 11){
+        Int_t iGrandma = parent->GetFirstMother();
+        if(iGrandma >= 0) {
+          TParticle* gma = (TParticle*)stack->Particle(iGrandma); //get mother
+          Int_t gPdg = TMath::Abs(gma->GetPdgCode());
+
+          if (gPdg == 23) { SetTagBit(tag,kMCZDecay); } //parent is Z-boson
+          else if (gPdg == 24) { SetTagBit(tag,kMCWDecay); } //parent is W-boson
+        }
+      }
       SetTagBit(tag,kMCElectron);      
       if(fDebug > 0) printf("AliMCAnalysisUtils::CheckOriginInStack() - Checking ancestors of electrons");
-      if (pPdg == 23) { SetTagBit(tag,kMCZDecay); } //parent is Z-boson
-      else if (pPdg == 24) { SetTagBit(tag,kMCWDecay); } //parent is W-boson
-      else if (pPdg == 111) { SetTagBit(tag,kMCPi0Decay); } //Pi0 Dalitz decay
+      if (pPdg == 111) { SetTagBit(tag,kMCPi0Decay); } //Pi0 Dalitz decay
       else if (pPdg == 221) { SetTagBit(tag,kMCEtaDecay); } //Eta Dalitz decay
       else if((499 < pPdg && pPdg < 600)||(4999 < pPdg && pPdg < 6000)) { SetTagBit(tag,kMCEFromB); } //b-->e decay
       else if((399 < pPdg && pPdg < 500)||(3999 < pPdg && pPdg < 5000)) { //check charm decay
@@ -390,11 +398,19 @@ Int_t AliMCAnalysisUtils::CheckOriginInAOD(const Int_t label, TClonesArray *mcpa
     
     //Electron check.  Where did that electron come from?
     else if(mPdg == 11){ //electron
+      if(pPdg == 11){
+        Int_t iGrandma = parent->GetMother();
+        if(iGrandma >= 0) {
+          AliAODMCParticle* gma = (AliAODMCParticle*)mcparticles->At(iGrandma);
+          Int_t gPdg = TMath::Abs(gma->GetPdgCode());
+
+          if (gPdg == 23) { SetTagBit(tag,kMCZDecay); } //parent is Z-boson
+          else if (gPdg == 24) { SetTagBit(tag,kMCWDecay); } //parent is W-boson
+        }
+      }
       SetTagBit(tag,kMCElectron);      
       if(fDebug > 0) printf("AliMCAnalysisUtils::CheckOriginInAOD() - Checking ancestors of electrons");
-      if      (pPdg == 23) { SetTagBit(tag,kMCZDecay); } //parent is Z-boson
-      else if (pPdg == 24) { SetTagBit(tag,kMCWDecay); } //parent is W-boson
-      else if (pPdg == 111) { SetTagBit(tag,kMCPi0Decay); } //Pi0 Dalitz decay
+      if (pPdg == 111) { SetTagBit(tag,kMCPi0Decay); } //Pi0 Dalitz decay
       else if (pPdg == 221) { SetTagBit(tag,kMCEtaDecay); } //Eta Dalitz decay
       else if((499 < pPdg && pPdg < 600)||(4999 < pPdg && pPdg < 6000)) { SetTagBit(tag,kMCEFromB);} //b-hadron decay
       else if((399 < pPdg && pPdg < 500)||(3999 < pPdg && pPdg < 5000)) { //c-hadron decay check