coverity fix 24381, 24378-80
authorfbock <Friederike.Bock@cern.ch>
Mon, 12 Jan 2015 16:03:44 +0000 (17:03 +0100)
committerfbock <Friederike.Bock@cern.ch>
Mon, 12 Jan 2015 16:03:44 +0000 (17:03 +0100)
PWGGA/GammaConv/AliConvEventCuts.cxx

index 47e8eba..2899f52 100644 (file)
@@ -1323,8 +1323,7 @@ Bool_t AliConvEventCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEv
        if(!fIsHeavyIon)return kTRUE;
 
        if(fCentralityMin == fCentralityMax ) return kTRUE;//0-100%
-       else if(fCentralityMax==0) fCentralityMax=10; //CentralityRange = fCentralityMin-100%
-
+       else if ( fCentralityMax==0) fCentralityMax=10; //CentralityRange = fCentralityMin-10*multfactor
        Double_t centrality=GetCentrality(event);
        if(centrality<0)return kFALSE;
 
@@ -1349,7 +1348,7 @@ Bool_t AliConvEventCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEv
        }
 
        Int_t nprimaryTracks = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data()))->GetNumberOfPrimaryTracks();
-       Int_t PrimaryTracks10[10][2] =
+       Int_t PrimaryTracks10[11][2] =
                {
                        {9999,9999}, //  0
                        {1210, 928}, // 10
@@ -1360,9 +1359,10 @@ Bool_t AliConvEventCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEv
                        { 106, 100}, // 60
                        {  51,  44}, // 70
                        {  21,  18}, // 80
-                       {   0,   0}  // 90
+                       {   0,   0},  // 90
+                       {   0,   0}  // 100 // only max accessible
                };
-       Int_t PrimaryTracks5a[10][2] =
+       Int_t PrimaryTracks5a[11][2] =
                {
                        {9999,9999}, // 0
                        {1485,1168}, // 5
@@ -1373,9 +1373,10 @@ Bool_t AliConvEventCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEv
                        { 536, 435}, // 30
                        { 428, 350}, // 35
                        { 337, 276}, // 40
-                       { 260, 214}  // 45
+                       { 260, 214},  // 45
+                       { 0, 162}  // 50 only max accessible
                };
-       Int_t PrimaryTracks5b[10][2] =
+       Int_t PrimaryTracks5b[11][2] =
                {
                        { 260, 214}, // 45
                        { 197, 162}, // 50
@@ -1386,7 +1387,8 @@ Bool_t AliConvEventCuts::IsCentralitySelected(AliVEvent *event, AliVEvent *fMCEv
                        {  34,  29}, // 75
                        {  21,  18}, // 80
                        {  13,  11}, // 85
-                       {   0,   0}  // 90
+                       {   0,   0},  // 90
+                       {   0,   0}  // 100 only max accessible
                };
        Int_t column = 0;
        if(event->IsA()==AliESDEvent::Class()) column = 0;
@@ -1731,9 +1733,11 @@ void AliConvEventCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderLis
        AliStack *fMCStack = 0x0;
        TClonesArray *fMCStackAOD = 0x0;
        if(MCEvent->IsA()==AliMCEvent::Class()){
-               cHeader = dynamic_cast<AliGenCocktailEventHeader*>(dynamic_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
-               if(cHeader) headerFound = kTRUE;
-               if(dynamic_cast<AliMCEvent*>(MCEvent))fMCStack = dynamic_cast<AliStack*>(dynamic_cast<AliMCEvent*>(MCEvent)->Stack());
+               if(dynamic_cast<AliMCEvent*>(MCEvent)){
+                       cHeader = dynamic_cast<AliGenCocktailEventHeader*>(dynamic_cast<AliMCEvent*>(MCEvent)->GenEventHeader());
+                       if(cHeader) headerFound = kTRUE;
+                       fMCStack = dynamic_cast<AliStack*>(dynamic_cast<AliMCEvent*>(MCEvent)->Stack());
+               }       
        }
        if(MCEvent->IsA()==AliAODEvent::Class()){ // MCEvent is a AODEvent in case of AOD
                cHeaderAOD = dynamic_cast<AliAODMCHeader*>(MCEvent->FindListObject(AliAODMCHeader::StdBranchName()));