]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterFinderVS.cxx
Formatting changes.
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderVS.cxx
index 8c53637276b6c9c8d924f2b581c465968873ba4c..ba50e7dcf0856a4aabcbb98296ebb62fee9a7923 100644 (file)
 
 /* $Id$ */
 
-#include <TMinuit.h> 
-#include <TF1.h>
-#include <TMinuit.h> 
-#include <Riostream.h>
+// -------------------------------
+// Class AliMUONClusterFinderVS
+// -------------------------------
+// Class for clustering and reconstruction of space points
+// (Not used by default)
 
 #include "AliMUONClusterFinderVS.h"
-#include "AliMpPlaneType.h"
-#include "AliMpVSegmentation.h"
 #include "AliMUONDigit.h"
 #include "AliMUONRawCluster.h"
 #include "AliMUONGeometrySegmentation.h"
 #include "AliMUONMathieson.h"
 #include "AliMUONClusterInput.h"
 #include "AliMUONDigitMapA1.h"
+
 #include "AliLog.h"
 
+#include <TMinuit.h> 
+#include <TF1.h>
+#include <TMinuit.h> 
+#include <Riostream.h>
+
+
 //_____________________________________________________________________
 // This function is minimized in the double-Mathieson fit
 void fcnS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
@@ -38,17 +44,28 @@ void fcnS1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
 void fcnCombiS1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
 void fcnCombiS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
 
+/// \cond CLASSIMP
 ClassImp(AliMUONClusterFinderVS)
+/// \endcond
 
 AliMUONClusterFinderVS::AliMUONClusterFinderVS()
-  : TObject()
+  : TObject(),
+    fInput(AliMUONClusterInput::Instance()),
+    fDeclusterFlag(0),
+    fClusterSize(0),
+    fNperMax(0),
+    fGhostChi2Cut(1e6),
+    fNPeaks(0),
+    fNRawClusters(0),
+    fRawClusters(0x0),
+    fZPlane(0.),
+    fSector(0),
+    fFitStat(0)
 {
-// Default constructor
-    fInput=AliMUONClusterInput::Instance();
+/// Default constructor
     fDigitMap[0] = 0;
     fDigitMap[1] = 0;
     fTrack[0]=fTrack[1]=-1;
-    fGhostChi2Cut = 1e6; // nothing done by default
     fSeg2[0]    = 0;
     fSeg2[1]    = 0;
 
@@ -58,11 +75,12 @@ AliMUONClusterFinderVS::AliMUONClusterFinderVS()
       }
     } 
     fRawClusters = new TClonesArray("AliMUONRawCluster",1000);
-    fNRawClusters = 0;
 }
  //____________________________________________________________________________
 AliMUONClusterFinderVS::~AliMUONClusterFinderVS()
 {
+/// Destructor
+
   // Reset tracks information
    fNRawClusters = 0;
    if (fRawClusters) {
@@ -71,29 +89,23 @@ AliMUONClusterFinderVS::~AliMUONClusterFinderVS()
    }
 }
 
-AliMUONClusterFinderVS::AliMUONClusterFinderVS(const AliMUONClusterFinderVS & clusterFinder):TObject(clusterFinder)
-{
-// Protected copy constructor
-
-  AliFatal("Not implemented.");
-}
 //____________________________________________________________________________
 void AliMUONClusterFinderVS::ResetRawClusters()
 {
-  // Reset tracks information
+/// Reset tracks information
   fNRawClusters = 0;
   if (fRawClusters) fRawClusters->Clear();
 }
 //____________________________________________________________________________
 void AliMUONClusterFinderVS::Decluster(AliMUONRawCluster *cluster)
 {
-// Decluster by local maxima
+/// Decluster by local maxima
     SplitByLocalMaxima(cluster);
 }
 //____________________________________________________________________________
 void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
 {
-  // Split complex cluster by local maxima 
+/// Split complex cluster by local maxima 
     Int_t cath, i;
 
     fInput->SetCluster(c);
@@ -948,7 +960,7 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
 
 void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* /*c*/)
 {
-// Find all local maxima of a cluster
+/// Find all local maxima of a cluster
     AliDebug(1,"\n Find Local maxima  !");
     
     AliMUONDigit* digt;
@@ -1152,9 +1164,8 @@ void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* /*c*/)
 
 void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t flag, Int_t cath) 
 {
-  //
-  //  Completes cluster information starting from list of digits
-  //
+///  Completes cluster information starting from list of digits
+
   AliMUONDigit* dig;
   Float_t x, y, z;
   Int_t  ix, iy;
@@ -1240,9 +1251,8 @@ void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t flag, Int_
 
 void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t cath) 
 {
-  //
-  //  Completes cluster information starting from list of digits
-  //
+///  Completes cluster information starting from list of digits
+
   static Float_t dr0;
   
   AliMUONDigit* dig;
@@ -1289,15 +1299,10 @@ void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t cath)
     c->SetX(cath,fSeg2[cath]->GetAnod(fInput->DetElemId(), c->GetX(cath)));
 }
 
-void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONRawCluster &c){
-
-
-//
-//  Find a super cluster on both cathodes
-//
-//
-//  Add i,j as element of the cluster
-//
+void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONRawCluster &c)
+{
+///  Find a super cluster on both cathodes
+///  Add i,j as element of the cluster
     
     Int_t idx = fDigitMap[cath]->GetHitIndex(i,j);
     AliMUONDigit* dig = (AliMUONDigit*) fDigitMap[cath]->GetHit(i,j);
@@ -1428,31 +1433,25 @@ void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONR
 
 void AliMUONClusterFinderVS::FindRawClusters()
 {
-  //
-  // MUON cluster finder from digits -- finds neighbours on both cathodes and 
-  // fills the tree with raw clusters
-  //
+/// MUON cluster finder from digits -- finds neighbours on both cathodes and 
+/// fills the tree with raw clusters
 
     ResetRawClusters();
 //  Return if no input datad available
     if (!fInput->NDigits(0) && !fInput->NDigits(1)) return;
 
-    AliMpPlaneType plane1, plane2;
-
     fSeg2[0] = fInput->Segmentation2(0);
     fSeg2[1] = fInput->Segmentation2(1);
     
-    if ( fSeg2[0]->GetDirection(fInput->DetElemId()) ==  kDirY || 
-        fSeg2[0]->GetDirection(fInput->DetElemId()) ==  kDirUndefined ) {
-      plane1 = kBendingPlane;
-      plane2 = kNonBendingPlane;
-    } else {
-      plane2 = kBendingPlane;
-      plane1 = kNonBendingPlane;
-    }
+    Int_t detElemId = fInput->DetElemId();
     
-    fDigitMap[0]  = new AliMUONDigitMapA1(fInput->DetElemId(), plane1);
-    fDigitMap[1]  = new AliMUONDigitMapA1(fInput->DetElemId(), plane2);
+    Int_t npx0  = fSeg2[0]->Npx(detElemId)+1;
+    Int_t npy0  = fSeg2[0]->Npy(detElemId)+1;
+    fDigitMap[0]  = new AliMUONDigitMapA1(detElemId, npx0, npy0);
+
+    Int_t npx1  = fSeg2[0]->Npx(detElemId)+1;
+    Int_t npy1  = fSeg2[0]->Npy(detElemId)+1;
+    fDigitMap[1]  = new AliMUONDigitMapA1(detElemId, npx1, npy1);
     
     AliMUONDigit *dig;
 
@@ -1548,8 +1547,8 @@ void AliMUONClusterFinderVS::FindRawClusters()
 
 Float_t AliMUONClusterFinderVS::SingleMathiesonFit(AliMUONRawCluster *c, Int_t cath)
 {
-// Performs a single Mathieson fit on one cathode
-// 
+/// Performs a single Mathieson fit on one cathode
+
     Double_t arglist[20];
     Int_t ierflag=0;
     AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
@@ -1611,8 +1610,8 @@ Float_t AliMUONClusterFinderVS::SingleMathiesonFit(AliMUONRawCluster *c, Int_t c
 
 Float_t AliMUONClusterFinderVS::CombiSingleMathiesonFit(AliMUONRawCluster * /*c*/)
 {
-// Perform combined Mathieson fit on both cathode planes
-//
+/// Perform combined Mathieson fit on both cathode planes
+
     Double_t arglist[20];
     Int_t ierflag=0;
     AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
@@ -1705,8 +1704,7 @@ Float_t AliMUONClusterFinderVS::CombiSingleMathiesonFit(AliMUONRawCluster * /*c*
 
 Bool_t AliMUONClusterFinderVS::DoubleMathiesonFit(AliMUONRawCluster * /*c*/, Int_t cath)
 {
-// Performs a double Mathieson fit on one cathode
-// 
+/// Performs a double Mathieson fit on one cathode 
 
 //
 //  Initialise global variables for fit
@@ -1786,9 +1784,8 @@ Bool_t AliMUONClusterFinderVS::DoubleMathiesonFit(AliMUONRawCluster * /*c*/, Int
 
 Float_t AliMUONClusterFinderVS::CombiDoubleMathiesonFit(AliMUONRawCluster * /*c*/)
 {
-//
-// Perform combined double Mathieson fit on both cathode planes
-//
+/// Perform combined double Mathieson fit on both cathode planes
+
     Double_t arglist[20];
     Int_t ierflag=0;
     AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
@@ -1943,9 +1940,8 @@ Float_t AliMUONClusterFinderVS::CombiDoubleMathiesonFit(AliMUONRawCluster * /*c*
 
 void AliMUONClusterFinderVS::Split(AliMUONRawCluster* c)
 {
-//
-// One cluster for each maximum
-//
+/// One cluster for each maximum
+
     Int_t i, j, cath;
     AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
     for (j=0; j<2; j++) {
@@ -1992,9 +1988,8 @@ void AliMUONClusterFinderVS::Split(AliMUONRawCluster* c)
 }
 void AliMUONClusterFinderVS::AddRawCluster(AliMUONRawCluster& c)
 {
-  //
-  // Add a raw cluster copy to the list
-  //
+/// Add a raw cluster copy to the list
+
   //     AliMUON *pMUON=(AliMUON*)gAlice->GetModule("MUON");
   //     pMUON->GetMUONData()->AddRawCluster(fInput->Chamber(),c); 
   //     fNRawClusters++;