}
//________________________________________________________________________________
-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));
}
//________________________________________________________________________________
-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
//
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
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;
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
}
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) {
}
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
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;
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)
};