]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity warnings
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Feb 2011 15:42:11 +0000 (15:42 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Feb 2011 15:42:11 +0000 (15:42 +0000)
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSQASSDDataMakerRec.h
ITS/AliITSreconstruction.cxx
ITS/AliITSsDigitize.cxx
ITS/AliITStrackerMI.cxx

index 1c283f13c173a09afed58474191d1b7e3b2007f4..3bcff3c798d574374be14a178603fbadc0449113 100644 (file)
@@ -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;
index 389232a866f8028b533e638f2c712cd114d82ae7..621bad11ae2eb17b35ed2b7ffc91cb5f4acefdc3 100644 (file)
@@ -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,
index aee2a3fcfa81d146684f1e4a3000b5b6f4a4abea..9f29f51602e93c370adfd402ddff2156d5fe832b 100644 (file)
@@ -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{
index 8bdad8adf951cb41b81fe0c1d594802aaf63bd29..282b6aa618ca3afae878f2fb87c6a6adc84aec7d 100644 (file)
@@ -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{
index 72031256b6f87ffd3498507e5f9126f9fcbbf6eb..b81eccd8a15b2c4a197f271267de51d80fec92ea 100644 (file)
@@ -1509,8 +1509,10 @@ fNMaxSigmaCl(3)
       fBy20[j1][1]=0;
     }
   }
-  for(Int_t i=0;i<AliITSRecoParam::fgkMaxClusterPerLayer;i++)fClusters[i]=NULL;
-
+  for(Int_t i=0;i<AliITSRecoParam::fgkMaxClusterPerLayer;i++){
+    fClusters[i]=NULL;
+    fClusterIndex[i]=0;
+  }
 }
 //------------------------------------------------------------------------
 AliITStrackerMI::AliITSlayer::
@@ -1597,7 +1599,10 @@ fNMaxSigmaCl(3) {
       fBy20[j1][1]=0;
     }
   }
-  for(Int_t i=0;i<AliITSRecoParam::fgkMaxClusterPerLayer;i++)fClusters[i]=NULL;
+  for(Int_t i=0;i<AliITSRecoParam::fgkMaxClusterPerLayer;i++){
+    fClusters[i]=NULL;
+    fClusterIndex[i]=0;
+  }
 }
 /*
 //------------------------------------------------------------------------