]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDCluster.cxx
coverity fixes
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDCluster.cxx
index 3e4351b6e25b5046f7347d91cb1e5d287022d772..26a55503cc3ca6c0bc6dd6a70e15bbfa1c261552 100644 (file)
@@ -39,7 +39,7 @@ void AliHMPIDCluster::SetClusterParams(Double_t xL,Double_t yL,Int_t iCh  )
   //get L->T cs matrix for a given chamber
   const TGeoHMatrix *t2l= AliGeomManager::GetTracking2LocalMatrix(volId);
 
-  if(fParam->GetInstType())               //if there is no geometry we cannot retrieve the volId (only for monitoring)
+  if(!fParam->GetInstType())               //if there is no geometry we cannot retrieve the volId (only for monitoring)
   {
     new(this) AliCluster3D(); return;
   }
@@ -239,7 +239,7 @@ void AliHMPIDCluster::Print(Option_t* opt)const
   }
   Double_t ratio=0;
   if(Q()>0&&QRaw()>0) ratio = Q()/QRaw()*100;
-  Printf("%sCLU: ch=%i                 (%7.3f,%7.3f) Q=%8.3f Qraw=%8.3f(%3.0f%%) Size=%2i DimBox=%i LocMax=%i Chi2=%7.3f   %s",
+  Printf("%sCLU: ch=%i  (%7.3f,%7.3f) Q=%8.3f Qraw=%8.3f(%3.0f%%) Size=%2i DimBox=%i LocMax=%i Chi2=%7.3f   %s",
          opt,Ch(),X(),Y(),Q(),QRaw(),ratio,Size(),fBox,fNlocMax,fChi2,status);
   if(fDigs) fDigs->Print();    
 }//Print()
@@ -262,11 +262,20 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Int_t *pSigmaCut, Bool_t isTr
   
   Int_t rawSize = Size();                                                                //get current raw cluster size
   
-  if(rawSize>100 || isTryUnfold==kFALSE || Size()==1) {                                  //No deconv if: 1 - big cluster (also avoid no zero suppression!)
-    fSt = (isTryUnfold)? kSi1: kNot;                                                     //              2 - flag is set to FALSE
+  if(rawSize>100) {
+    fSt = kBig;
+  } else if(isTryUnfold==kFALSE) {
+    fSt = kNot;
+  } else if(rawSize==1) {
+    fSt = kSi1;
+  }
+  
+  if(rawSize>100 || isTryUnfold==kFALSE || rawSize==1) {                                 //No deconv if: 1 - big cluster (also avoid no zero suppression!)
+                                                                                         //              2 - flag is set to FALSE
     if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh);                             //              3 - size = 1
     new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);  //add this raw cluster 
     return 1;
+    
   } 
   
 //Phase 0. Initialise Fitter  
@@ -274,6 +283,9 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Int_t *pSigmaCut, Bool_t isTr
   Int_t ierflg = 0;
   TVirtualFitter *fitter = TVirtualFitter::Fitter(this,3*6);                            //initialize Fitter
 
+  delete fitter;                                                                        //temporary solution to avoid the inteference with previous instances
+  fitter = TVirtualFitter::Fitter(this,3*6);                                            //initialize Fitter
+
   arglist[0] = -1;
   ierflg = fitter->ExecuteCommand("SET PRI", arglist, 1);                               // no printout
   ierflg = fitter->ExecuteCommand("SET NOW", arglist, 0);                               //no warning messages