small fix on the charge selection for the generated particles
authorlmilano <lmilano@cern.ch>
Fri, 17 Jan 2014 16:11:00 +0000 (17:11 +0100)
committerlmilano <lmilano@cern.ch>
Fri, 17 Jan 2014 16:11:00 +0000 (17:11 +0100)
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAllChAOD.cxx

index cb4fddec56f245e71b7c1300ce9291959a1c367b..cb03377c0a77450936d86a3e2977334fa961b3b8 100644 (file)
@@ -195,7 +195,7 @@ void AliAnalysisTaskSpectraAllChAOD::UserExec(Option_t *)
        {
          AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(iMC);
          if(!partMC->Charge()) continue;//Skip neutrals
-         if(fCharge != 0 && partMC->Charge() != fCharge) continue;//if fCharge != 0 only select fCharge
+         if(fCharge != 0 && partMC->Charge()*fCharge < 0.) continue;//if fCharge != 0 only select fCharge
          
          if(partMC->Eta() < fTrackCuts->GetEtaMin() || partMC->Eta() > fTrackCuts->GetEtaMax())continue;//ETA CUT ON GENERATED!!!!!!!!!!!!!!!!!!!!!!!!!!