Replacing some cout << by AliWarning and AliError to reduce output; small bug fix...
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Feb 2006 13:08:22 +0000 (13:08 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Feb 2006 13:08:22 +0000 (13:08 +0000)
MUON/AliMUONClusterFinderAZ.cxx
MUON/AliMUONTrackK.cxx

index 46497cb0061ec8190f63aad86e131b1150342ac6..0d2699f6facfc95054917224a6bdcee028084f3d 100644 (file)
@@ -233,7 +233,7 @@ next:
     */
     for (Int_t i=0; i<nMax; i++) {
       if (nMax > 1) FindCluster(localMax, maxPos[i]);
-      if (!MainLoop(iSimple)) cout << " MainLoop failed " << endl;
+      if (!MainLoop(iSimple)) AliWarning(Form(" MainLoop failed "));
       if (i < nMax-1) {
        for (Int_t j=0; j<fnPads[0]+fnPads[1]; j++) {
          if (fPadIJ[1][j] == 0) continue; // pad charge was not modified
@@ -603,7 +603,10 @@ Bool_t AliMUONClusterFinderAZ::CheckPrecluster(Int_t *nShown)
     beg++;
   } // while
   npad = fnPads[0] + fnPads[1];
-  if (npad > 500) { cout << " ***** Too large cluster. Give up. " << npad << endl; return kFALSE; }
+  if (npad > 500) { 
+    AliWarning(Form(" *** Too large cluster. Give up. %d ", npad));
+    return kFALSE; 
+  }
   // Back up charge value
   for (Int_t j = 0; j < npad; j++) fXyq[6][j] = fXyq[2][j];
 
@@ -816,9 +819,8 @@ void AliMUONClusterFinderAZ::AdjustPixel(Float_t wxmin, Float_t wymin)
     if (fDebug) cout << " Different " << pixPtr->Size(0) << " " << wxy[0] << " "
                     << pixPtr->Size(1) << " " << wxy[1] <<endl;
     
-    //if (n2[0] > 2 || n2[1] > 2) { cout << n2[0] << " " << n2[1] << endl; AliFatal("Too large pixel.");}
     if (n2[0] > 2 || n2[1] > 2) { 
-      cout << n2[0] << " " << n2[1] << endl; 
+      //cout << n2[0] << " " << n2[1] << endl; 
       if (n2[0] > 2 && n1[0] < 999) n1[0]--;
       if (n2[1] > 2 && n1[1] < 999) n1[1]--;
     }
@@ -1559,7 +1561,7 @@ TObject* AliMUONClusterFinderAZ::BinToPix(TH2D *mlem, Int_t jc, Int_t ic)
     if (pixPtr->Charge() < 0.5) continue;
     if (TMath::Abs(pixPtr->Coord(0)-xc)<1.e-4 && TMath::Abs(pixPtr->Coord(1)-yc)<1.e-4) return (TObject*) pixPtr;
   }
-  AliWarning(Form(" Something wrong ??? %f %f %f %f", xc, yc));
+  AliError(Form(" Something wrong ??? %f %f ", xc, yc));
   return NULL;
 }
 
@@ -2550,6 +2552,7 @@ void AliMUONClusterFinderAZ::AddVirtualPad()
     if (maxpad[0][0] < 0) iPad = 1;
 
     for (iPad=0; iPad<2; iPad++) {
+      if (maxpad[cath][iPad] < 0) continue;
       if (iPad && !iAddX && !iAddY) break;
       if (iPad && fXyq[2][maxpad[cath][1]] / sigmax[cath] < 0.5) break;
 
index 5de66d95562e4d113e8e21220d6b343421f0892b..88b6b8563273411af1a5fc9d0780b10f509892dd 100644 (file)
@@ -695,10 +695,7 @@ void AliMUONTrackK::ParPropagation(Double_t zEnd)
       distance = zEnd - vGeant3New[2];
       step /= 2;
       nTries ++;
-      if (nTries > fgkTriesMax) {
-       cout << " ***** ParPropagation: too many tries " << nTries << endl;
-       AliFatal("Too many tries.");
-      }
+      if (nTries > fgkTriesMax) AliError(Form(" Too many tries: %d", nTries));
     } while (distance*iFB < 0);
 
     GetFromGeantParam(vGeant3New,iFB);
@@ -868,7 +865,7 @@ Bool_t AliMUONTrackK::FindPoint(Int_t ichamb, Double_t zEnd, Int_t currIndx, Int
         if (TMath::Abs(hit->GetZ()-zEnd) > 0.05) {
          // adjust position: for multiple hits in the chamber
          // (mostly (only?) for GEANT hits)
-         cout << " ******* adjust " << zEnd << " " << hit->GetZ() << endl;
+         AliWarning(Form(" *** adjust %f %f ", zEnd, hit->GetZ()));
          zEnd = hit->GetZ();
          *fTrackPar = *fTrackParNew;
          ParPropagation(zEnd);
@@ -979,9 +976,7 @@ Bool_t AliMUONTrackK::FindPoint(Int_t ichamb, Double_t zEnd, Int_t currIndx, Int
                  if (TMath::Abs(hit->GetZ()-(*trackK->fSteps)[i]) > 0.1) {
                  //if (TMath::Abs(hit->GetZ()-(trackK->fSteps)[i]) > 0.1) {
                    RemoveMatrices(trackK);
-                   cout << " *** Position adjustment 1 " << hit->GetZ() << " " 
-                         << (*trackK->fSteps)[i] << endl;
-                   AliFatal(" Position adjustment 1.");
+                   AliError(Form(" *** Position adjustment 1: %f %f", hit->GetZ(), (*trackK->fSteps)[i]));
                  }
                  else break;
                }
@@ -1202,7 +1197,7 @@ void AliMUONTrackK::SetTrackQuality(Int_t iChi2)
   // Computes "track quality" from Chi2 (if iChi2==0) or vice versa
 
   if (fChi2 > 500) {
-    cout << " ***** Too high Chi2: " << fChi2 << endl;
+    AliWarning(Form(" *** Too high Chi2: %f ", fChi2));
     fChi2 = 500;
   }
   if (iChi2 == 0) fChi2 = fNTrackHits + (500.-fChi2)/501;
@@ -1336,7 +1331,7 @@ void AliMUONTrackK::Branson(void)
   (*fTrackPar)(4,0) = TMath::Cos((*fTrackPar)(3,0))*trackParam.GetInverseBendingMomentum();
   fPosition = trackParam.GetZ();
   //delete trackParam;
-  cout << 1/(*fTrackPar)(4,0) << " " << fPosition << " " << (*fTrackPar)(0,0) << endl;
+  if (fgDebug > 0) cout << 1/(*fTrackPar)(4,0) << " " << fPosition << " " << (*fTrackPar)(0,0) << endl;
 
   // Get covariance matrix
   *fCovariance = *fWeight;
@@ -2009,8 +2004,8 @@ L33:
     if (chi2(0,0) > chi2max) chi2max = chi2(0,0); 
     fChi2 += chi2(0,0);
     if (chi2(0,0) < 0) { 
-      chi2.Print(); cout << " chi2 < 0 " << i << " " << iLast << endl;
-      //AliFatal("chi2 < 0.");
+      //chi2.Print(); 
+      AliError(Form(" *** chi2 < 0: %d %d ", i, iLast));
     }
     // Save smoothed parameters
     TMatrixD *par = new TMatrixD(parSmooth);