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 cb4fdde..cb03377 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!!!!!!!!!!!!!!!!!!!!!!!!!!