]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity fixed
authorgvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Dec 2011 15:54:43 +0000 (15:54 +0000)
committergvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Dec 2011 15:54:43 +0000 (15:54 +0000)
HMPID/AliHMPIDDigit.h
HMPID/AliHMPIDHit.h
HMPID/AliHMPIDRecoParam.cxx
HMPID/AliHMPIDRecoParamV1.cxx
HMPID/AliHMPIDReconHTA.cxx

index 6b7f300b4e28dbd6edb55eed11892902c415fe2f..3beda52d89f1d188be4352a6b6a8ccce5b99bf1e 100644 (file)
@@ -23,11 +23,45 @@ class AliHMPIDDigit :public AliDigit //TObject-AliDigit-AliHMPIDDigit
 public:
     
 //ctor&dtor    
-  AliHMPIDDigit(                          ):AliDigit( ),fPad(AliHMPIDParam::Abs(-1,-1,-1,-1)),fQ(-1)  {}                         //default ctor
-  AliHMPIDDigit(Int_t pad,Int_t q,Int_t *t):AliDigit(t),fPad(pad             ),fQ(q )  {if(fQ>4095)fQ=4095;}                     //digit ctor
-  AliHMPIDDigit(Int_t pad,Int_t q         ):AliDigit( ),fPad(pad             ),fQ(q )  {if(fQ>4095)fQ=4095;}                     //digit ctor
-  AliHMPIDDigit(const AliHMPIDDigit &d    ):AliDigit(d),fPad(d.fPad),fQ(d.fQ)          {}                                        //copy ctor
-  virtual ~AliHMPIDDigit()                                                             {}                         //dtor   
+AliHMPIDDigit():
+    AliDigit( ),
+    fPad(AliHMPIDParam::Abs(-1,-1,-1,-1)),
+    fQ(-1)  
+    {}                                       //default ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+AliHMPIDDigit(Int_t pad,Int_t q,Int_t *t):
+  AliDigit(t),
+  fPad(pad),
+  fQ(q)  
+  {if(fQ>4095) fQ=4095;}                     //digit ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+AliHMPIDDigit(Int_t pad,Int_t q):
+  AliDigit( ),
+  fPad(pad),
+  fQ(q )  
+  {if(fQ>4095) fQ=4095;}                     //digit ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+AliHMPIDDigit& operator=(const AliHMPIDDigit& d)
+{
+  //
+  // Assignment operator
+  //
+  if(this!=&d){
+    AliDigit::operator=(d); 
+    fPad = d.fPad; 
+    fQ   = d.fQ;
+  }
+  return *this;                           
+}                                            
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+AliHMPIDDigit(const AliHMPIDDigit &d):
+  AliDigit(d),
+  fPad(d.fPad),
+  fQ(d.fQ)         
+  {}                                        //copy ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+virtual ~AliHMPIDDigit()  {}                //dtor
+   
 //framework part    
          Bool_t  IsSortable  (                               )const{return kTRUE;}                                                     //provision to use TObject::Sort() 
   inline Int_t   Compare     (const TObject *pObj            )const;                                                                   //provision to use TObject::Sort()
index a87b016b70bb18fcda84131be3949c01f3d698cd..1544cac03b55cf0d34512a2af2a2befab4a67f2d 100644 (file)
 class AliHMPIDHit : public AliHit //   TObject-AliHit-AliHMPIDHit
 {
 public:
-  AliHMPIDHit(                                                                           ):AliHit(     ),fCh(-1),fPid(-1 ),fQ(-1),fLx(0),fLy(0),fT(0) {} //default ctor
-  AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y, Float_t time, const TVector3 &p):AliHit(0,tid),fCh(c ),fPid(pid),fQ(0 ),fLx(x),fLy(y),fT(time) {e=QdcTot(e,time);fX=p.X();fY=p.Y();fZ=p.Z();}
-  AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y, Float_t time                 ):AliHit(     ),fCh(c ),fPid(pid),fQ(0 ),fLx(x),fLy(y),fT(time){e=QdcTot(e,time);fTrack=tid;}//manual ctor 
-  AliHMPIDHit(const AliHMPIDHit &h):AliHit(h),fCh(h.fCh),fPid(h.fPid),fQ(h.fQ),fLx(h.fLx),fLy(h.fLy),fT(h.fT) {}//copy ctor
-  virtual ~AliHMPIDHit()                                                                                                                                 {}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+AliHMPIDHit():
+    AliHit(),
+    fCh(-1),
+    fPid(-1),
+    fQ(-1),
+    fLx(0),
+    fLy(0),
+    fT(0) 
+    {} //default ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y, Float_t time, const TVector3 &p):
+  AliHit(0,tid),
+  fCh(c),
+  fPid(pid),
+  fQ(0 ),
+  fLx(x),
+  fLy(y),
+  fT(time) 
+  {e=QdcTot(e,time);fX=p.X();fY=p.Y();fZ=p.Z();}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y, Float_t time):
+  AliHit(),
+  fCh(c),
+  fPid(pid),
+  fQ(0),
+  fLx(x),
+  fLy(y),
+  fT(time)
+  {e=QdcTot(e,time);fTrack=tid;}//manual ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+AliHMPIDHit& operator=(const AliHMPIDHit& h)
+{
+  //
+  // Assignment operator
+  //
+  if(this!=&h){
+    AliHit::operator=(h);
+    fCh = h.fCh;
+    fPid = h.fPid;
+    fQ = h.fQ;
+    fLx = h.fLx;
+    fLy = h.fLy;
+    fT = h.fT;
+  }
+  return *this;    
+}    
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
+AliHMPIDHit(const AliHMPIDHit &h):
+  AliHit(h),
+  fCh(h.fCh),
+  fPid(h.fPid),
+  fQ(h.fQ),
+  fLx(h.fLx),
+  fLy(h.fLy),
+  fT(h.fT) 
+  {}//copy ctor
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+virtual ~AliHMPIDHit()       {}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   
 //framework part
          void    Print(Option_t *opt="")const;                                                    //from TObject to print current status
          void    Draw (Option_t *opt="");                                                         //from TObject to Draw this hit
index 6b6a9db5c8dfe9584217a94c776c2247471fca6b..b30965b9cdcd863454f35c5f9cb9d5622a74f2cb 100644 (file)
@@ -60,12 +60,14 @@ AliHMPIDRecoParam& AliHMPIDRecoParam::operator=(const AliHMPIDRecoParam &p)
 //
 // assign. operator
 //
-  AliDetectorRecoParam::operator=(p);
-  this->fHmpRecoMode= p.fHmpRecoMode;
-  this->fHmpFixedDistCut=p.fHmpFixedDistCut;
-  for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) this->fHmpUserCut[iCh] = p.fHmpUserCut[iCh];   
-  this->fHmpTrackMatchingDist=p.fHmpTrackMatchingDist;
-  for(Int_t iPol=0;iPol<5;iPol++) this->fHmpTrackMatchingDistParas[iPol]=p.fHmpTrackMatchingDistParas[iPol];
+  if(this!=&p){
+    AliDetectorRecoParam::operator=(p);
+    this->fHmpRecoMode= p.fHmpRecoMode;
+    this->fHmpFixedDistCut=p.fHmpFixedDistCut;
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) this->fHmpUserCut[iCh] = p.fHmpUserCut[iCh];   
+    this->fHmpTrackMatchingDist=p.fHmpTrackMatchingDist;
+    for(Int_t iPol=0;iPol<5;iPol++) this->fHmpTrackMatchingDistParas[iPol]=p.fHmpTrackMatchingDistParas[iPol];
+  }
   return *this;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 51e4061400e099efc62212013c1c1fef1cb2e5b3..0fed53aacfd441d916247972525d80b83aed964f 100644 (file)
@@ -59,13 +59,14 @@ AliHMPIDRecoParamV1& AliHMPIDRecoParamV1::operator=(const AliHMPIDRecoParamV1 &p
 {
 //
 // assign. operator
-//
-  AliDetectorRecoParam::operator=(p);
-  this->fHmpRecoMode= p.fHmpRecoMode;
-  this->fHmpFixedDistCut=p.fHmpFixedDistCut;
-  for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) this->fHmpUserCut[iCh] = p.fHmpUserCut[iCh];   
-  this->fHmpTrackMatchingDist=p.fHmpTrackMatchingDist;
-  for(Int_t iPol=0;iPol<5;iPol++) this->fHmpTrackMatchingDistParas[iPol]=p.fHmpTrackMatchingDistParas[iPol];
+  if(this!=&p){
+    AliDetectorRecoParam::operator=(p);
+    this->fHmpRecoMode= p.fHmpRecoMode;
+    this->fHmpFixedDistCut=p.fHmpFixedDistCut;
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) this->fHmpUserCut[iCh] = p.fHmpUserCut[iCh];   
+    this->fHmpTrackMatchingDist=p.fHmpTrackMatchingDist;
+    for(Int_t iPol=0;iPol<5;iPol++) this->fHmpTrackMatchingDistParas[iPol]=p.fHmpTrackMatchingDistParas[iPol];
+  }
   return *this;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 6ba7dc1b751edcf12045265f4ab4fd892974016c..804ae722231c2d66c4fb377ddcffc4a3138f16f6 100644 (file)
@@ -255,9 +255,10 @@ Bool_t AliHMPIDReconHTA::FindShape(Double_t &thTrkRec,Double_t &phiTrkRec,Double
     dMean2+=dist[indphi[i]]*dist[indphi[i]];
     np++;
   }
-  
-  dMean  /=(Double_t)np;
-  dMean2 /=(Double_t)np;
+  if(np>0){    
+   dMean  /=(Double_t)np;
+   dMean2 /=(Double_t)np;}
   Double_t rms = TMath::Sqrt(dMean2 - dMean*dMean);
   
   for(Int_t i=0;i<fNClu;i++) {
@@ -755,8 +756,10 @@ Double_t AliHMPIDReconHTA::FindSimmPhi()
   
   //_____calc. met min quadr using effective distance _________________________________________________
   
-  coeff2ord = xy-xrotsumm*yrotsumm/np;    
-  coeff1ord = yrotsumm*yrotsumm/np - xrotsumm*xrotsumm/np - yy + xx;
+  if(np>0){ 
+    coeff2ord = xy-xrotsumm*yrotsumm/np;    
+    coeff1ord = yrotsumm*yrotsumm/np - xrotsumm*xrotsumm/np - yy + xx;
+  }
   coeff0ord = -coeff2ord;
   
   AliDebug(1,Form(" a = %f b = %f c = %f",coeff2ord,coeff1ord,coeff0ord));
@@ -767,8 +770,9 @@ Double_t AliHMPIDReconHTA::FindSimmPhi()
   
   r2(coeff,m1,m2);
   
-  n1=(yrotsumm-m1*xrotsumm)/np;                         
-  n2=(yrotsumm-m2*xrotsumm)/np;
+  if(np>0){ 
+    n1=(yrotsumm-m1*xrotsumm)/np;                         
+    n2=(yrotsumm-m2*xrotsumm)/np;}
   // 2 solutions.................
   
   // negative angles solved...