]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
o fix
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 15 Sep 2012 22:02:49 +0000 (22:02 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 15 Sep 2012 22:02:49 +0000 (22:02 +0000)
PWGDQ/dielectron/AliDielectronMC.cxx
PWGDQ/dielectron/AliDielectronMC.h

index f92b6f2c252d891460fec3f7edfd4f69d31731a8..01f7f6a65a5a9aadfdc4f4b812f91b0cac75bf26 100644 (file)
@@ -944,13 +944,14 @@ Bool_t AliDielectronMC::CheckParticleSource(Int_t label, AliDielectronSignalMC::
 }
 
 //________________________________________________________________________________
-Bool_t AliDielectronMC::CheckIsRadiative(Int_t label)
+Bool_t AliDielectronMC::CheckIsRadiative(Int_t label) const
 {
   //
   // Check if the particle has a three body decay, one being a photon
   //
   if(label<0) return kFALSE;
-  
+
+
   if(fAnaType==kAOD) {
     if(!fMcArray) return kFALSE;
     AliAODMCParticle *mother=static_cast<AliAODMCParticle*>(GetMCTrackFromMCEvent(label));
@@ -972,7 +973,25 @@ Bool_t AliDielectronMC::CheckIsRadiative(Int_t label)
 }
 
 //________________________________________________________________________________
-Bool_t AliDielectronMC::IsMCTruth(Int_t label, AliDielectronSignalMC* signalMC, Int_t branch) {
+Bool_t AliDielectronMC::CheckRadiativeDecision(Int_t mLabel, const AliDielectronSignalMC * const signalMC) const
+{
+  //
+  // Check for the decision of the radiative type request
+  //
+  
+  if (!signalMC) return kFALSE;
+  
+  if (signalMC->GetJpsiRadiative()==AliDielectronSignalMC::kAll) return kTRUE;
+  
+  Bool_t isRadiative=CheckIsRadiative(mLabel);
+  if ((signalMC->GetJpsiRadiative()==AliDielectronSignalMC::kIsRadiative) && !isRadiative) return kFALSE;
+  if ((signalMC->GetJpsiRadiative()==AliDielectronSignalMC::kIsNotRadiative) && isRadiative) return kFALSE;
+  
+  return kTRUE;
+}
+
+//________________________________________________________________________________
+Bool_t AliDielectronMC::IsMCTruth(Int_t label, AliDielectronSignalMC* signalMC, Int_t branch) const {
   //
   // Check if the particle corresponds to the MC truth in signalMC in the branch specified
   //
@@ -1006,11 +1025,7 @@ Bool_t AliDielectronMC::IsMCTruth(Int_t label, AliDielectronSignalMC* signalMC,
     if(!CheckParticleSource(mLabel, signalMC->GetMotherSource(branch))) return kFALSE;
 
     //check for radiative deday
-    if (signalMC->GetJpsiRadiative()!=AliDielectronSignalMC::kAll){
-      Bool_t isRadiative=CheckIsRadiative(mLabel);
-      if ((signalMC->GetJpsiRadiative()==AliDielectronSignalMC::kIsRadiative) && !isRadiative) return kFALSE;
-      if ((signalMC->GetJpsiRadiative()==AliDielectronSignalMC::kIsNotRadiative) && isRadiative) return kFALSE;
-    }
+    if (!CheckRadiativeDecision(mLabel, signalMC)) return kFALSE;
   }
   
   // check the grandmother
@@ -1072,9 +1087,10 @@ Bool_t AliDielectronMC::IsMCTruth(const AliDielectronPair* pair, const AliDielec
   if(signalMC->GetMotherPDG(1)!=0 || signalMC->GetMotherSource(1)!=AliDielectronSignalMC::kDontCare) {
     labelM1 = GetMothersLabel(labelD1);
     if(labelD1>-1 && labelM1>-1) mcM1 = GetMCTrackFromMCEvent(labelM1);
-    directTerm = directTerm && (mcM1 || signalMC->GetMotherPDGexclude(1)) 
+    directTerm = directTerm && (mcM1 || signalMC->GetMotherPDGexclude(1))
                  && ComparePDG((mcM1 ? mcM1->PdgCode() : 0),signalMC->GetMotherPDG(1),signalMC->GetMotherPDGexclude(1),signalMC->GetCheckBothChargesMothers(1))
-                 && CheckParticleSource(labelM1, signalMC->GetMotherSource(1));
+                 && CheckParticleSource(labelM1, signalMC->GetMotherSource(1))
+                 && CheckRadiativeDecision(labelM1,signalMC);
   }
   
   Int_t labelM2 = -1;
@@ -1083,7 +1099,8 @@ Bool_t AliDielectronMC::IsMCTruth(const AliDielectronPair* pair, const AliDielec
     if(labelD2>-1 && labelM2>-1) mcM2 = GetMCTrackFromMCEvent(labelM2);
     directTerm = directTerm && (mcM2 || signalMC->GetMotherPDGexclude(2))
                  && ComparePDG((mcM2 ? mcM2->PdgCode() : 0),signalMC->GetMotherPDG(2),signalMC->GetMotherPDGexclude(2),signalMC->GetCheckBothChargesMothers(2))
-                 && CheckParticleSource(labelM2, signalMC->GetMotherSource(2));
+                 && CheckParticleSource(labelM2, signalMC->GetMotherSource(2))
+                 && CheckRadiativeDecision(labelM2,signalMC);
   }
  
   // grand-mothers
@@ -1124,7 +1141,8 @@ Bool_t AliDielectronMC::IsMCTruth(const AliDielectronPair* pair, const AliDielec
     }
     crossTerm = crossTerm && (mcM2 || signalMC->GetMotherPDGexclude(1)) 
                 && ComparePDG((mcM2 ? mcM2->PdgCode() : 0),signalMC->GetMotherPDG(1),signalMC->GetMotherPDGexclude(1),signalMC->GetCheckBothChargesMothers(1))
-                && CheckParticleSource(labelM2, signalMC->GetMotherSource(1));
+                && CheckParticleSource(labelM2, signalMC->GetMotherSource(1))
+                && CheckRadiativeDecision(labelM2,signalMC);
   }
   
   if(signalMC->GetMotherPDG(2)!=0 || signalMC->GetMotherSource(2)!=AliDielectronSignalMC::kDontCare) {
@@ -1134,7 +1152,8 @@ Bool_t AliDielectronMC::IsMCTruth(const AliDielectronPair* pair, const AliDielec
     }
     crossTerm = crossTerm && (mcM1 || signalMC->GetMotherPDGexclude(2)) 
                 && ComparePDG((mcM1 ? mcM1->PdgCode() : 0),signalMC->GetMotherPDG(2),signalMC->GetMotherPDGexclude(2),signalMC->GetCheckBothChargesMothers(2))
-                && CheckParticleSource(labelM1, signalMC->GetMotherSource(2));
+                && CheckParticleSource(labelM1, signalMC->GetMotherSource(2))
+                && CheckRadiativeDecision(labelM1,signalMC);
   }
 
   // grand-mothers
index aa482d0d2dfd26b26b4ec2143e12cc811aa7f50f..77e5744c8f9d1c2ee4b634111c9af9fef753ba1b 100644 (file)
@@ -64,7 +64,7 @@ public:
   Bool_t IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
   Bool_t IsMCMotherToEE(const AliVParticle *particle, Int_t pdgMother);
   Bool_t IsMCTruth(const AliDielectronPair* pair, const AliDielectronSignalMC* signalMC) const;
-  Bool_t IsMCTruth(Int_t ipart, AliDielectronSignalMC* signalMC, Int_t branch);
+  Bool_t IsMCTruth(Int_t ipart, AliDielectronSignalMC* signalMC, Int_t branch) const;
   Int_t GetMothersLabel(Int_t daughterLabel) const;
   Int_t GetPdgFromLabel(Int_t label) const;
 
@@ -120,7 +120,9 @@ private:
   
   Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t pdgExclusion, Bool_t checkBothCharges) const;
   Bool_t CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) const;
-  Bool_t CheckIsRadiative(Int_t label);
+  Bool_t CheckIsRadiative(Int_t label) const;
+  Bool_t CheckRadiativeDecision(Int_t mLabel, const AliDielectronSignalMC * const signalMC) const;
+
 
   ClassDef(AliDielectronMC, 0)
 };