From 8d3a46262cae2fb4ee0d2ce62e8ba7614cb4c3d4 Mon Sep 17 00:00:00 2001 From: cblume Date: Wed, 13 Oct 2010 15:50:48 +0000 Subject: [PATCH] Coverity stuff once more ... --- TRD/AliTRDqaBlackEvents.cxx | 98 ++++++++++++++++++++++++++++++++++--- TRD/AliTRDqaRecPoints.cxx | 4 ++ TRD/AliTRDtestBeam.cxx | 28 +++++++++++ 3 files changed, 124 insertions(+), 6 deletions(-) diff --git a/TRD/AliTRDqaBlackEvents.cxx b/TRD/AliTRDqaBlackEvents.cxx index cdabcf61b67..91d35eda781 100644 --- a/TRD/AliTRDqaBlackEvents.cxx +++ b/TRD/AliTRDqaBlackEvents.cxx @@ -27,7 +27,6 @@ #include "TH1D.h" #include "TH2D.h" #include "TH2S.h" -//#include "TH3F.h" #include "TF1.h" #include "TFile.h" #include "TCanvas.h" @@ -77,14 +76,57 @@ AliTRDqaBlackEvents::AliTRDqaBlackEvents() ,fMinNoise(0.5) ,fMaxNoise(2) ,fFitType(0) - // ,fRefFileName("") { // // Constructor // to create the histograms call Init() // + for (Int_t i = 0; i < kDET; i++) { + fPed[i] = 0x0; + fNoise[i] = 0x0; + fChPP[i] = 0x0; + fNPointDist[i] = 0x0; + fChPed[i] = 0x0; + fChNoise[i] = 0x0; + fNPoint[i] = 0x0; + fData[i] = 0x0; + fSignal[i] = 0x0; + fnEntriesRM[i] = 0x0; + fnEntriesRMDist[i] = 0x0; + fChPedRes[i] = 0x0; + fChNoiseRes[i] = 0x0; + fErrorLocHC[i] = 0x0; + fErrorLocMCM[i] = 0x0; + fErrorLocADC[i] = 0x0; + } + for (Int_t i = 0; i < 3; i++) { + fGraphPP[i] = 0x0; + fSMLink[i] = 0x0; + fGrLink[i] = 0x0; + fppThresh[i] = 0; + fnPP[i] = 0; + fnLink[i] = 0; + } + for (Int_t i = 0; i < 2; i++) { + fnErrorHC[i] = 0; + fnErrorMCM[i] = 0; + fnErrorADC[i] = 0; + } + for (Int_t i = 0; i < kSM; i++) { + fSmNoiseRms[i] = 0x0; + fSmNoiseFit[i] = 0x0; + fSmPP[i] = 0x0; + } + for (Int_t i = 0; i < kSM+1; i++) { + fNumberADC[i] = 0x0; + fnADCinSM[i] = 0; + } + for (Int_t i = 0; i < 1000; i++) { + fEvNoDist[i] = 0; + } strncpy(fRefFileName,"",256); + } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -121,14 +163,57 @@ AliTRDqaBlackEvents::AliTRDqaBlackEvents(const AliTRDqaBlackEvents &qa) ,fMinNoise(0.5) ,fMaxNoise(2) ,fFitType(0) - //,fRefFileName("") { // // Copy constructor // to create the histograms call Init() // - strcpy(fRefFileName, ""); + for (Int_t i = 0; i < kDET; i++) { + fPed[i] = 0x0; + fNoise[i] = 0x0; + fChPP[i] = 0x0; + fNPointDist[i] = 0x0; + fChPed[i] = 0x0; + fChNoise[i] = 0x0; + fNPoint[i] = 0x0; + fData[i] = 0x0; + fSignal[i] = 0x0; + fnEntriesRM[i] = 0x0; + fnEntriesRMDist[i] = 0x0; + fChPedRes[i] = 0x0; + fChNoiseRes[i] = 0x0; + fErrorLocHC[i] = 0x0; + fErrorLocMCM[i] = 0x0; + fErrorLocADC[i] = 0x0; + } + for (Int_t i = 0; i < 3; i++) { + fGraphPP[i] = 0x0; + fSMLink[i] = 0x0; + fGrLink[i] = 0x0; + fppThresh[i] = 0; + fnPP[i] = 0; + fnLink[i] = 0; + } + for (Int_t i = 0; i < 2; i++) { + fnErrorHC[i] = 0; + fnErrorMCM[i] = 0; + fnErrorADC[i] = 0; + } + for (Int_t i = 0; i < kSM; i++) { + fSmNoiseRms[i] = 0x0; + fSmNoiseFit[i] = 0x0; + fSmPP[i] = 0x0; + } + for (Int_t i = 0; i < kSM+1; i++) { + fNumberADC[i] = 0x0; + fnADCinSM[i] = 0; + } + for (Int_t i = 0; i < 1000; i++) { + fEvNoDist[i] = 0; + } + strncpy(fRefFileName,"",256); + } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -284,7 +369,8 @@ void AliTRDqaBlackEvents::Reset() void AliTRDqaBlackEvents::SetRefFile(const char *filename) { - strcpy(fRefFileName, filename); + strncpy(fRefFileName,filename,256); + } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -666,7 +752,7 @@ void AliTRDqaBlackEvents::Process(const char *filename) // char fn[256]; - strcpy(fn, filename); + strncpy(fn,filename,256); //AliInfo(Form("FILENAME = %s (%s)\n", filename, fn)); diff --git a/TRD/AliTRDqaRecPoints.cxx b/TRD/AliTRDqaRecPoints.cxx index a7f42b65681..cd71df2007b 100644 --- a/TRD/AliTRDqaRecPoints.cxx +++ b/TRD/AliTRDqaRecPoints.cxx @@ -78,6 +78,10 @@ AliTRDqaRecPoints::AliTRDqaRecPoints(const AliTRDqaRecPoints &/*qa*/) : // Copy constructor // + for (Int_t i = 0; i < 540; i++) { + fRefHist[i] = 0x0; + } + } //____________________________________________________________________________ diff --git a/TRD/AliTRDtestBeam.cxx b/TRD/AliTRDtestBeam.cxx index 92b7ca20cfe..bad14ab740d 100644 --- a/TRD/AliTRDtestBeam.cxx +++ b/TRD/AliTRDtestBeam.cxx @@ -125,6 +125,20 @@ AliTRDtestBeam::AliTRDtestBeam(const char *filename) : fEventHeader = new Char_t[fgkEventHeadSize]; fEventData = new Char_t[fLimit]; + for (Int_t i = 0; i < 1270; i++) { + fSi1Address[i] = 0; + fSi2Address[i] = 0; + fSi1Charge[i] = 0; + fSi2Charge[i] = 0; + } + + for (Int_t j = 0; j < 2; j++) { + fX[j] = 0.0; + fY[j] = 0.0; + fQx[j] = 0.0; + fQy[j] = 0.0; + } + } //____________________________________________________________________________ @@ -151,6 +165,20 @@ AliTRDtestBeam::AliTRDtestBeam(const AliTRDtestBeam &tb) // Copy constructor // + for (Int_t i = 0; i < 1270; i++) { + fSi1Address[i] = 0; + fSi2Address[i] = 0; + fSi1Charge[i] = 0; + fSi2Charge[i] = 0; + } + + for (Int_t j = 0; j < 2; j++) { + fX[j] = 0.0; + fY[j] = 0.0; + fQx[j] = 0.0; + fQy[j] = 0.0; + } + } //____________________________________________________________________________ -- 2.43.0