]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONRawCluster.cxx
Removing non-working HP for the GRP configuration for the test setup.
[u/mrichter/AliRoot.git] / MUON / AliMUONRawCluster.cxx
index 967264ca7ee245431039992ec88b2d0f0a672680..49feed2f4f7354b56eca1e53d94809e771f7096c 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 <TArrayF.h>
+#include <TString.h>
 
 #include "AliMUONRawCluster.h"
 
+/// \cond CLASSIMP
 ClassImp(AliMUONRawCluster)
+/// \endcond
 
 
+//____________________________________________________
 AliMUONRawCluster::AliMUONRawCluster() 
-  : TObject()
+  : AliMUONVCluster(),
+    fClusterType(0),
+    fGhost(0),
+    fDetElemId(0)   
 {
 /// Constructor
     fTracks[0]=fTracks[1]=fTracks[2]=-1; 
@@ -50,11 +61,31 @@ AliMUONRawCluster::AliMUONRawCluster()
        }
     }
     fNcluster[0]=fNcluster[1]=-1;
-    fGhost=0;
-    fDetElemId = 0;
-    fErrXY[0] = 0.144;
-    fErrXY[1] = 0.01;
+    fErrXY[0] = FLT_MAX;
+    fErrXY[1] = FLT_MAX;
+}
+
+//____________________________________________________
+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
 {
@@ -68,14 +99,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)
 {
@@ -169,6 +213,31 @@ Int_t AliMUONRawCluster::PhysicsContribution() const
     return 0;
   }
 }
+
+//____________________________________________________
+void AliMUONRawCluster::Print(Option_t* opt) const
+{
+  ///
+  /// Printing Raw Cluster (Rec Point) information 
+  /// "full" option for printing all the information about the raw cluster
+  ///
+  TString sopt(opt);
+  sopt.ToUpper();
+  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)
 {
@@ -183,7 +252,7 @@ void AliMUONRawCluster::DumpIndex(void)
     }
 }
 //____________________________________________________
-Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
+Int_t AliMUONRawCluster::AddCharge(Int_t i, Float_t Q)
 {
 /// Adding Q to the fQ value
   if (i==0 || i==1) {
@@ -223,7 +292,7 @@ Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
   else return 0;
 }
 //____________________________________________________
-Int_t AliMUONRawCluster::GetCharge(Int_t i) const
+Float_t AliMUONRawCluster::GetCharge(Int_t i) const
 {
 /// Getting the charge of the cluster
   if (i==0 || i==1) return fQ[i];
@@ -258,7 +327,7 @@ Int_t AliMUONRawCluster::GetTrack(Int_t i) const
   else  return 99999;
 }
 //____________________________________________________
-Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const 
+Float_t AliMUONRawCluster::GetPeakSignal(Int_t i) const 
 {
 /// Getting cluster peaksignal
   if (i==0 || i==1 ) return fPeakSignal[i];
@@ -298,7 +367,7 @@ Float_t AliMUONRawCluster::GetChi2(Int_t i) const
   else  return 99999.;
 }
 //____________________________________________________
-Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
+Int_t AliMUONRawCluster::SetCharge(Int_t i, Float_t Q)
 {
 /// Setting Charge of the cluster
   if (i==0 || i==1) {
@@ -348,7 +417,7 @@ Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
   else return 0;
 }
 //____________________________________________________
-Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
+Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Float_t peaksignal)
 {
 /// Setting PeakSignal of the cluster
   if (i==0 || i==1 ) {
@@ -402,3 +471,4 @@ Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
   else return 0;
 }
 
+