]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterSplitterMLEM.cxx
RAW QA only for calibration events
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterSplitterMLEM.cxx
index 544907729a2c6078428f8a62715b616b67463daa..b2efc607a84c5b899182afacca0e539811b418b1 100644 (file)
 #include "AliMUONCluster.h"
 #include "AliMUONPad.h"
 #include "AliMUONPad.h"
-#include "AliMpStationType.h"
 #include "AliMUONConstants.h"
 #include "AliMpDEManager.h"
 #include "AliMUONMathieson.h"
 
+#include "AliMpEncodePair.h"
+
 #include "AliLog.h"
 
 #include <TClonesArray.h>
@@ -56,9 +57,9 @@ const Double_t AliMUONClusterSplitterMLEM::fgkCouplMin = 1.e-2; // threshold on
 
 //_____________________________________________________________________________
 AliMUONClusterSplitterMLEM::AliMUONClusterSplitterMLEM(Int_t detElemId, 
-                                                       TObjArray* fPixArray) 
+                                                       TObjArray* pixArray) 
 : TObject(),
-fPixArray(fPixArray),
+fPixArray(pixArray),
 fMathieson(0x0),
 fDetElemId(detElemId),
 fNpar(0),
@@ -68,13 +69,13 @@ fDebug(0)
 {
   /// Constructor
   
-  AliMp::StationType stationType = AliMpDEManager::GetStationType(fDetElemId);
+  AliMq::Station12Type stationType = AliMpDEManager::GetStation12Type(fDetElemId);
   
   Float_t kx3 = AliMUONConstants::SqrtKx3();
   Float_t ky3 = AliMUONConstants::SqrtKy3();
   Float_t pitch = AliMUONConstants::Pitch();
   
-  if ( stationType == AliMp::kStation1 )
+  if ( stationType == AliMq::kStation1 )
   {
     kx3 = AliMUONConstants::SqrtKx3St1();
     ky3 = AliMUONConstants::SqrtKy3St1();
@@ -334,9 +335,9 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
   //const Int_t kStatusToTest(1);
   const Int_t kStatusToTest(AliMUONClusterFinderMLEM::GetUseForFitFlag());
   
-  AliMpIntPair nofPads = cluster.NofPads(kStatusToTest);
-  Int_t nInX = nofPads.GetFirst();
-  Int_t nInY = nofPads.GetSecond();
+  Long_t nofPads = cluster.NofPads(kStatusToTest);
+  Int_t nInX = AliMp::PairFirst(nofPads);
+  Int_t nInY = AliMp::PairSecond(nofPads);
 
   if (fDebug) {
     Int_t npadOK = 0;
@@ -352,7 +353,7 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
   Int_t nfitMax = 3; 
   nfitMax = TMath::Min (nfitMax, (npads + 1) / 3);
   if (nfitMax > 1) {
-    if (nInX < 3 && nInY < 3 || nInX == 3 && nInY < 3 || nInX < 3 && nInY == 3) nfitMax = 1; // not enough pads in each direction
+    if (((nInX < 3) && (nInY < 3)) || ((nInX == 3) && (nInY < 3)) || ((nInX < 3) && (nInY == 3))) nfitMax = 1; // not enough pads in each direction
   }
   if (nfit > nfitMax) nfit = nfitMax;
   
@@ -511,8 +512,8 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
         {
          shift[j] = 0;
        }
-       else if (deriv[min][j]*deriv[!min][j] > 0 && TMath::Abs(deriv[min][j]) > TMath::Abs(deriv[!min][j])
-                || TMath::Abs(deriv[0][j]-deriv[1][j]) < 1.e-3 || TMath::Abs(dder[j]) < 1.e-6
+       else if (((deriv[min][j]*deriv[!min][j] > 0) && (TMath::Abs(deriv[min][j]) > TMath::Abs(deriv[!min][j])))
+                || (TMath::Abs(deriv[0][j]-deriv[1][j]) < 1.e-3) || (TMath::Abs(dder[j]) < 1.e-6)
         {
          shift[j] = -TMath::Sign (shift[j], (func2[0]-func2[1]) * (param0[0][j]-param0[1][j]));
          if (min == max) 
@@ -591,7 +592,7 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
        }
       } // for (Int_t j=0; j<fNpar;
         
-      if (estim < 1 && derMax < 2 || nLoop > 150) break; // minimum was found
+      if (((estim < 1) && (derMax < 2)) || nLoop > 150) break; // minimum was found
         
       nLoop++;
         
@@ -631,8 +632,8 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
       
     //if (fNpar > 2) cout << param0[min][fNpar-3] << " " << chi2n * (1+TMath::Min(1-param0[min][fNpar-3],0.25)) << endl;
     //if (chi2n*1.2+1.e-6 > chi2o ) 
-    if (fNpar > 2 && (chi2n > chi2o || iseed == nfit-1 
-                     && chi2n * (1+TMath::Min(1-param0[min][fNpar-3],0.25)) > chi2o)) 
+    if (fNpar > 2 && (chi2n > chi2o || ((iseed == nfit-1) 
+                                       && (chi2n * (1+TMath::Min(1-param0[min][fNpar-3],0.25)) > chi2o)))) 
       { fNpar -= 3; break; }
       
     // Save parameters and errors
@@ -691,7 +692,7 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
   if (fDebug) {
     for (Int_t i=0; i<fNpar; ++i) {
       if (i == 4 || i == 7) {
-       if (i == 7 || i == 4 && fNpar < 7) cout << parOk[i] << endl;
+       if ((i == 7) || ((i == 4) && (fNpar < 7))) cout << parOk[i] << endl;
        else cout << parOk[i] * (1-parOk[7]) << endl;
        continue;
       }