From e8c2bf0d48a3c0cb5fd1431513e266d643904df1 Mon Sep 17 00:00:00 2001 From: masera Date: Wed, 2 Feb 2011 15:42:11 +0000 Subject: [PATCH] Coverity warnings --- ITS/AliITSQASSDDataMakerRec.cxx | 54 +++++++++++++++++---------------- ITS/AliITSQASSDDataMakerRec.h | 5 +-- ITS/AliITSreconstruction.cxx | 34 +++++---------------- ITS/AliITSsDigitize.cxx | 11 +++++-- ITS/AliITStrackerMI.cxx | 11 +++++-- 5 files changed, 55 insertions(+), 60 deletions(-) diff --git a/ITS/AliITSQASSDDataMakerRec.cxx b/ITS/AliITSQASSDDataMakerRec.cxx index 1c283f13c17..3bcff3c798d 100644 --- a/ITS/AliITSQASSDDataMakerRec.cxx +++ b/ITS/AliITSQASSDDataMakerRec.cxx @@ -138,7 +138,7 @@ fCDBManager(0) { } } } - +/* //____________________________________________________________________________ AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm) : TObject(), @@ -169,7 +169,7 @@ AliITSQASSDDataMakerRec& AliITSQASSDDataMakerRec::operator = (const AliITSQASSDD new(this) AliITSQASSDDataMakerRec(qac); return *this; } - +*/ //__________________________________________________________________ AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() { // destructor @@ -600,7 +600,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() { fHistSSDOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,100.0); Char_t fLabel[3]; for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){ - sprintf(fLabel,"%d",iBin); + snprintf(fLabel,2,"%d",iBin); fHistSSDOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel); } fHistSSDOccupancyLayer5->SetStats(kFALSE); @@ -1127,9 +1127,9 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() { //((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[specie]+fSSDRawsOffset-fSSDRawsDAOffset+3))->Reset(); AliCDBEntry *entryBadChannelsSSD = fCDBManager->Get("ITS/Calib/BadChannelsSSD"); - if(!entryBadChannelsSSD) - AliError("OCDB entry for the bad channel list is not valid!"); - AliITSBadChannelsSSDv2 *badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject(); + if(!entryBadChannelsSSD)AliError("OCDB entry for the bad channel list is not valid!"); + AliITSBadChannelsSSDv2 *badchannelsSSD = NULL; + if(entryBadChannelsSSD)badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject(); if(!badchannelsSSD) AliError("Bad channel list object is not a valid AliITSBadChannelsSSD object!"); @@ -1147,25 +1147,26 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() { nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0; Int_t badChannel = 0; - for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) { - badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j)); - if(badChannel != 0) { - if(layer == 5) - nPSideChannelsLayer5 += 1; - if(layer == 6) - nPSideChannelsLayer6 += 1; - nBadPSideChannels += 1; - }//badchannel flag != 0 - badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j)); - if(badChannel != 0) { - if(layer == 5) - nNSideChannelsLayer5 += 1; - if(layer == 6) - nNSideChannelsLayer6 += 1; -nBadNSideChannels += 1; - }//badchannel flag != 0 - }//loop over strips - + if(badchannelsSSD){ + for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) { + badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j)); + if(badChannel != 0) { + if(layer == 5) + nPSideChannelsLayer5 += 1; + if(layer == 6) + nPSideChannelsLayer6 += 1; + nBadPSideChannels += 1; + }//badchannel flag != 0 + badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j)); + if(badChannel != 0) { + if(layer == 5) + nNSideChannelsLayer5 += 1; + if(layer == 6) + nNSideChannelsLayer6 += 1; + nBadNSideChannels += 1; + }//badchannel flag != 0 + }//loop over strips + } //cout << "Bad channels P side module " << module << ": " << nBadPSideChannels << endl; //cout << "Bad channels N side module " << module << ": " << nBadNSideChannels << endl; @@ -1546,8 +1547,9 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree) Int_t rv = 0 ; Int_t gLayer = 0, gLadder = 0, gModule = 0; Int_t lLadderLocationY = 0; + TClonesArray *recpoints = NULL; AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); - TClonesArray *recpoints = rpcont->FetchClusters(0,clustersTree); + rpcont->FetchClusters(0,clustersTree); if(!rpcont->GetStatusOK() || !rpcont->IsSSDActive()){ AliError("can't get SSD clusters !"); return rv; diff --git a/ITS/AliITSQASSDDataMakerRec.h b/ITS/AliITSQASSDDataMakerRec.h index 389232a866f..621bad11ae2 100644 --- a/ITS/AliITSQASSDDataMakerRec.h +++ b/ITS/AliITSQASSDDataMakerRec.h @@ -28,8 +28,7 @@ class AliITSQASSDDataMakerRec: public TObject { public: AliITSQASSDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode = kFALSE, Int_t ldc=0); //ctor - AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm); - AliITSQASSDDataMakerRec& operator = (const AliITSQASSDDataMakerRec& qac); + virtual Int_t InitRaws(); virtual Int_t InitDigits(); virtual Int_t InitRecPoints(); @@ -48,6 +47,8 @@ public: void ResetDetector(AliQAv1::TASKINDEX_t task); private: + AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm); + AliITSQASSDDataMakerRec& operator = (const AliITSQASSDDataMakerRec& qac); void GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix); Double_t GetOccupancyModule(TH1 *lHisto, Int_t stripside, diff --git a/ITS/AliITSreconstruction.cxx b/ITS/AliITSreconstruction.cxx index aee2a3fcfa8..9f29f51602e 100644 --- a/ITS/AliITSreconstruction.cxx +++ b/ITS/AliITSreconstruction.cxx @@ -99,30 +99,6 @@ AliITSreconstruction::AliITSreconstruction(const char* filename): } -//______________________________________________________________________ -AliITSreconstruction::AliITSreconstruction(const AliITSreconstruction &rec):TTask(rec), -fInit(rec.fInit), -fEnt(rec.fEnt), -fEnt0(rec.fEnt0), -fDetTypeRec(rec.fDetTypeRec), -fDfArp(rec.fDfArp), -fITSgeom(rec.fITSgeom), -fLoader(rec.fLoader), -fRunLoader(rec.fRunLoader) -{ - // Copy constructor. - - -} - -//______________________________________________________________________ -AliITSreconstruction& AliITSreconstruction::operator=(const AliITSreconstruction& source){ - // Assignment operator. - this->~AliITSreconstruction(); - new(this) AliITSreconstruction(source); - return *this; - -} //______________________________________________________________________ AliITSreconstruction::~AliITSreconstruction(){ @@ -209,8 +185,14 @@ void AliITSreconstruction::Exec(const Option_t *opt){ // none. Option_t *lopt; Int_t evnt; - - if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS")||opt==0){ + Bool_t condition =kFALSE; + if(opt){ + if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS"))condition =kTRUE; + } + else{ + condition = kTRUE; + } + if(condition){ fDet[0] = fDet[1] = fDet[2] = kTRUE; lopt = "All"; }else{ diff --git a/ITS/AliITSsDigitize.cxx b/ITS/AliITSsDigitize.cxx index 8bdad8adf95..282b6aa618c 100644 --- a/ITS/AliITSsDigitize.cxx +++ b/ITS/AliITSsDigitize.cxx @@ -164,9 +164,14 @@ void AliITSsDigitize::Exec(const Option_t *opt){ // Return: // none. Option_t *lopt; -// Int_t nparticles,evnt; - - if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS")||opt==0){ + Bool_t condition =kFALSE; + if(opt){ + if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS"))condition =kTRUE; + } + else{ + condition = kTRUE; + } + if(condition){ fDet[0] = fDet[1] = fDet[2] = kTRUE; lopt = "All"; }else{ diff --git a/ITS/AliITStrackerMI.cxx b/ITS/AliITStrackerMI.cxx index 72031256b6f..b81eccd8a15 100644 --- a/ITS/AliITStrackerMI.cxx +++ b/ITS/AliITStrackerMI.cxx @@ -1509,8 +1509,10 @@ fNMaxSigmaCl(3) fBy20[j1][1]=0; } } - for(Int_t i=0;i