]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONRawCluster.cxx
Adding more bins in QA (Alis)
[u/mrichter/AliRoot.git] / MUON / AliMUONRawCluster.cxx
index b2a613b009c0b0f7de5145c06e93caa9e7cf35ae..fe2281def29d9fdd7fb4f2d453beacbc403218a4 100644 (file)
 
 /* $Id$ */
 
-// -------------------------
+//-----------------------------------------------------------------------------
 // Class AliMUONRawCluster
 // -------------------------
 // Class for the MUON RecPoint
 // It contains the properties of the physics cluters found in the tracking chambers
 // RawCluster contains also the information from the both cathode of the chambers.
+//-----------------------------------------------------------------------------
 
 
 #include "Riostream.h"
 
 #include "AliMUONRawCluster.h"
 
+using std::endl;
+using std::cout;
+using std::setw;
 /// \cond CLASSIMP
 ClassImp(AliMUONRawCluster)
 /// \endcond
 
+
 //____________________________________________________
 AliMUONRawCluster::AliMUONRawCluster() 
-  : TObject(),
+  : AliMUONVCluster(),
     fClusterType(0),
     fGhost(0),
     fDetElemId(0)   
@@ -47,6 +52,7 @@ AliMUONRawCluster::AliMUONRawCluster()
        fQ[j]=0;
        fX[j]=0;
        fY[j]=0;
+      fZ[j]=0;
        fMultiplicity[j]=0;
        fPeakSignal[j]=-1;
        fChi2[j]=-1;
@@ -59,8 +65,8 @@ AliMUONRawCluster::AliMUONRawCluster()
        }
     }
     fNcluster[0]=fNcluster[1]=-1;
-    fErrXY[0] = 0.144;
-    fErrXY[1] = 0.01;
+    fErrXY[0] = FLT_MAX;
+    fErrXY[1] = FLT_MAX;
 }
 
 //____________________________________________________
@@ -69,6 +75,21 @@ AliMUONRawCluster::~AliMUONRawCluster()
 /// Destructor
 }
 
+//____________________________________________________
+void AliMUONRawCluster::SetDigitsId(Int_t nDigits, const UInt_t *digitsId)
+{
+  /// Set the array of digit Id
+  /// if digitsId is not given the array is filled with id=0
+  
+  fMultiplicity[0] = (nDigits < 50) ? nDigits : 50;
+  
+  if (fMultiplicity[0] == 0) return;
+  if (digitsId == 0)
+    for (Int_t i=0; i<fMultiplicity[0]; i++) fIndexMap[i][0] = 0;
+  else
+    for (Int_t i=0; i<fMultiplicity[0]; i++) fIndexMap[i][0] = (Int_t) digitsId[i];
+}
+
 //____________________________________________________
 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
 {
@@ -82,14 +103,27 @@ Int_t AliMUONRawCluster::Compare(const TObject *obj) const
          else if (r<ro) return -1;
          else return 0;
   */
+  /*
          AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
         Float_t y=fY[0];
          Float_t yo=raw->fY[0];
          if (y>yo) return 1;
          else if (y<yo) return -1;
          else return 0;
-
+   */
+  
+  const AliMUONRawCluster* raw = static_cast<const AliMUONRawCluster*>(obj);
+  if ( GetCharge() > raw->GetCharge() ) 
+  {
+    return 1;
+  }
+  else if ( GetCharge() < raw->GetCharge() ) 
+  {
+    return -1;
+  }
+  return 0;
 }
+
 //____________________________________________________
 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
 {
@@ -194,21 +228,20 @@ void AliMUONRawCluster::Print(Option_t* opt) const
   TString sopt(opt);
   sopt.ToUpper();
  
-  if ( sopt.Contains("FULL") ) { 
-    cout << "<AliMUONRawCluster>: DetEle="        << setw(4)  << GetDetElemId() << 
-       ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() <<  "," << setw(8) << setprecision(5) << GetZ() << 
-      ") cm, Chi2=" << setw(8) << setprecision(3) << GetChi2() << 
-      ", Q=" << setw(4) << GetCharge() <<
-      ", Hit=" << setw(4)  << GetTrack(0) <<
-      ", Track1=" <<  setw(4)  << GetTrack(1) <<
-      ", Track2=" <<  setw(4)  << GetTrack(2) <<endl;
-  }
-  else {
-    cout << "<AliMUONRawCluster>: DetEle="        << setw(4)  << GetDetElemId() <<
-      ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() <<  "," << setw(8) << setprecision(5) << GetZ() 
-        << endl;
+  cout << Form("<AliMUONRawCluster>: DetEle=%4d (x,y,z)=(%7.4f,%7.4f,%7.4f) cm"
+               " Chi2=%7.2f Q=%7.2f",
+               GetDetElemId(),GetX(),GetY(),GetZ(),GetChi2(),
+               GetCharge());
+               
+  if ( sopt.Contains("FULL") )
+  {
+    cout << ", Hit=" << setw(4)  << GetTrack(0) <<
+    ", Track1=" <<  setw(4)  << GetTrack(1) <<
+    ", Track2=" <<  setw(4)  << GetTrack(2);
   }
+  cout << endl;
 }
+
 //____________________________________________________
 void AliMUONRawCluster::DumpIndex(void)
 {
@@ -442,3 +475,4 @@ Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
   else return 0;
 }
 
+