bug fix / Coverity 20826
authorfreidt <freidt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Dec 2012 09:11:12 +0000 (09:11 +0000)
committerfreidt <freidt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Dec 2012 09:11:12 +0000 (09:11 +0000)
PWGUD/DIFFRACTIVE/example/AliAnalysisTaskCDex.cxx
PWGUD/DIFFRACTIVE/xsAndTwoProng/AliCDMesonTracks.cxx

index 32ad0f6..0976a95 100644 (file)
@@ -266,22 +266,22 @@ Bool_t AliAnalysisTaskCDex::CheckInput()
                //return kFALSE;
        }
 
-       if(fDoAOD && fabs(fAODEvent->GetMagneticField())<1){
+       if(fDoAOD && fAODEvent && fabs(fAODEvent->GetMagneticField())<1){
                printf("AliAnalysisTaskex - strange Bfield! %f\n",
                       fAODEvent->GetMagneticField());
                return kFALSE;
        }
-       else if((!fDoAOD) && fabs(fESDEvent->GetMagneticField())<1){
+       else if((!fDoAOD) && fESDEvent && fabs(fESDEvent->GetMagneticField())<1){
                printf("AliAnalysisTaskex - strange Bfield! %f\n",
                       fESDEvent->GetMagneticField());
                return kFALSE;
        }
 
        Int_t tmprun = 0;
-       if (fDoAOD) {
+       if (fDoAOD && fAODEvent) {
                tmprun = fAODEvent->GetRunNumber();
        }
-       else {
+       else if (fESDEvent) {
                tmprun = fESDEvent->GetRunNumber();
        }
 
index ae6e74b..8f61252 100644 (file)
@@ -442,7 +442,7 @@ void AliCDMesonTracks::GetRemainingTracklets()
                        if (!mult->GetTrackletTrackIDs(iTracklet, 0, id1, id2)) {
                                float_t eta = mult->GetEta(iTracklet);
 
-                               if ((eta < -0.9) || (eta < 0.9)) {
+                               if ((eta < -0.9) || (eta > 0.9)) {
                                        ++fNtrackletsForward;
                                }
                                else {