]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibChamberStatus.cxx
Fix Coverity defects
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibChamberStatus.cxx
index e85ef0bf95ff09443cfb955fb0e386d8be8e0e93..a4dd2e4caeee01a85f4cd7f60702916037b7282a 100644 (file)
@@ -275,10 +275,12 @@ void AliTRDCalibChamberStatus::ProcessEvent(AliRawReader * rawReader, Int_t neve
   Bool_t notEmpty = kFALSE;
     
   AliTRDrawFastStream *rawStream = new AliTRDrawFastStream(rawReader);
+  if (!rawStream) return;
   rawStream->SetNoErrorWarning();
   rawStream->SetSharedPadReadout(kFALSE);
 
   AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager(kTRUE);
+  if (!digitsManager) return;
   digitsManager->CreateArrays();
   
   Int_t det    = 0;
@@ -330,8 +332,8 @@ void AliTRDCalibChamberStatus::ProcessEvent(AliRawReader * rawReader, Int_t neve
 
   if(notEmpty) fCounterEventNotEmpty++;
 
-  if(digitsManager) delete digitsManager;
-  if(rawStream) delete rawStream;
+  delete digitsManager;
+  delete rawStream;
    
 }//_____________________________________________________________________
 void AliTRDCalibChamberStatus::ProcessEvent3(AliRawReader * rawReader, Int_t nevents_physics)
@@ -401,8 +403,8 @@ void AliTRDCalibChamberStatus::ProcessEvent3(AliRawReader * rawReader, Int_t nev
 
   if(notEmpty) fCounterEventNotEmpty++;
 
-  if(digitsManager) delete digitsManager;
-  if(rawStream) delete rawStream;
+  delete digitsManager;
+  delete rawStream;
    
 }
 //_____________________________________________________________________
@@ -686,7 +688,7 @@ TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, I
   Double_t col0    = padPlane0->GetCol0();
 
   char  name[1000];
-  sprintf(name,"%s DCS status sm %d pl %d",GetTitle(),sm,pl);
+  snprintf(name,1000,"%s DCS status sm %d pl %d",GetTitle(),sm,pl);
   TH2F * his = new TH2F( name, name, 88,-TMath::Abs(row0),TMath::Abs(row0)
                                    ,148,-TMath::Abs(col0),TMath::Abs(col0));
 
@@ -715,7 +717,8 @@ TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, I
        // Take the value
        Int_t mcm = paramfee->GetMCMfromPad(irow,icol);
        Int_t rob = paramfee->GetROBfromPad(irow,icol);
-       Int_t state = calDCSFEEEOR->GetMCMGlobalState(rob,mcm); 
+       if(mcm < 0) AliWarning("Problem with mcm number");
+       Int_t state = calDCSFEEEOR->GetMCMGlobalState(rob,TMath::Abs(mcm)); 
                his->SetBinContent(binz,biny,state);
       }
     }
@@ -776,3 +779,6 @@ TCanvas* AliTRDCalibChamberStatus::PlotHistos2DSmEORStatus(AliTRDCalDCS *calDCS,
   return fC1;
 
 }
+
+
+