]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliCalcluster.cxx
Extracting PHOS and EMCAL trackers from the correspondig reconstructors (Yu.Belikov)
[u/mrichter/AliRoot.git] / RALICE / AliCalcluster.cxx
index a5b7e9c7478dc11c6012b1983871a68cdc6b902b..393df685a0a33d54eccf8aa9d00bf2af7fbe39f5 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliCalcluster.h"
+#include "Riostream.h"
  
 ClassImp(AliCalcluster) // Class implementation to enable ROOT I/O
  
-AliCalcluster::AliCalcluster()
+AliCalcluster::AliCalcluster() : AliSignal()
 {
-// Default constructer, all data is set to 0
- fCenter=0;
+// Default constructor, all data is set to 0
+ fRow=0;
+ fCol=0;
  fNmods=0;
  fRowdisp=0.;
  fColdisp=0.;
  fNvetos=0;
  fVetos=0;
- SetName("AliCalcluster [sig, sig11, sig33, sig55, ...]");
+ SetName("AliCalcluster [sig, sig11, sig33, sig55,...]");
 }
 ///////////////////////////////////////////////////////////////////////////
 AliCalcluster::~AliCalcluster()
@@ -71,7 +73,27 @@ AliCalcluster::~AliCalcluster()
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-AliCalcluster::AliCalcluster(AliCalmodule& m)
+AliCalcluster::AliCalcluster(const AliCalcluster& c) : AliSignal(c)
+{
+// Copy constructor
+ fRow=c.fRow;
+ fCol=c.fCol;
+ fNmods=c.fNmods;
+ fRowdisp=c.fRowdisp;
+ fColdisp=c.fColdisp;
+ fNvetos=c.fNvetos;
+
+ fVetos=new TObjArray();
+ fVetos->SetOwner();
+
+ for (Int_t i=1; i<=fNvetos; i++)
+ {
+  AliSignal* sx=c.GetVetoSignal(i);
+  fVetos->Add(new AliSignal(*sx));
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+AliCalcluster::AliCalcluster(AliCalmodule& m) : AliSignal()
 {
 // Cluster constructor with module m as center.
 // Module data is only entered for a module which contains a signal,
@@ -88,9 +110,11 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
 
  if (sig>0. && m.GetDeadValue()==0)
  {
-  fCenter=&m;
+  fRow=m.GetRow();
+  fCol=m.GetColumn();
   r=m.GetPosition();
   SetPosition(r);
+  sig=m.GetSignal(1,1); // Use the gain etc... corrected module signal
   SetSignal(sig);
   fNmods=1;
   fRowdisp=0.;
@@ -101,7 +125,8 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
  }
  else
  {
-  fCenter=0;
+  fRow=0;
+  fCol=0;
   SetPosition(r);
   fNmods=0;
   fRowdisp=0.;
@@ -109,42 +134,28 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
   fNvetos=0;
   fVetos=0;
  }
- SetName("AliCalcluster [sig, sig11, sig33, sig55, ...]");
+ SetName("AliCalcluster [sig, sig11, sig33, sig55,...]");
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliCalcluster::GetRow()
+Int_t AliCalcluster::GetRow() const
 {
 // Provide the row number of the cluster center
- if (fCenter)
- {
-  return fCenter->GetRow();
- }
- else
- {
-  return 0;
- }
+ return fRow;
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliCalcluster::GetColumn()
+Int_t AliCalcluster::GetColumn() const
 {
 // Provide the column number of the cluster center
- if (fCenter)
- {
-  return fCenter->GetColumn();
- }
- else
- {
-  return 0;
- }
+ return fCol;
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliCalcluster::GetNmodules()
+Int_t AliCalcluster::GetNmodules() const
 {
 // Provide the number of modules in the cluster
  return fNmods;
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliCalcluster::GetRowDispersion()
+Float_t AliCalcluster::GetRowDispersion() const
 {
 // Provide the normalised row dispersion of the cluster.
  Float_t sig=GetSignal();
@@ -158,7 +169,7 @@ Float_t AliCalcluster::GetRowDispersion()
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliCalcluster::GetColumnDispersion()
+Float_t AliCalcluster::GetColumnDispersion() const
 {
 // Provide the normalised column dispersion of the cluster
  Float_t sig=GetSignal();
@@ -189,10 +200,11 @@ void AliCalcluster::Start(AliCalmodule& m)
 
  if (m.GetClusteredSignal()>0. && m.GetDeadValue()==0)
  {
-  fCenter=&m;
+  fRow=m.GetRow();
+  fCol=m.GetColumn();
   r=m.GetPosition();
   SetPosition(r);
-  SetSignal(m.GetSignal());
+  SetSignal(m.GetSignal(1,1)); // Use the gain etc... corrected module signal
   fNmods=1;
   fRowdisp=0.;
   fColdisp=0.;
@@ -200,7 +212,8 @@ void AliCalcluster::Start(AliCalmodule& m)
  }
  else
  {
-  fCenter=0;
+  fRow=0;
+  fCol=0;
   SetPosition(r);
   fNmods=0;
   fRowdisp=0.;
@@ -217,10 +230,10 @@ void AliCalcluster::Add(AliCalmodule& m)
 
  if (fNmods)
  {
-  Float_t sigm=m.GetClusteredSignal();
-  if (sigm>0. && m.GetDeadValue()==0) // only add unused modules
+  if (m.GetClusteredSignal()>0. && m.GetDeadValue()==0) // only add unused modules
   {
+   Float_t sigm=m.GetSignal(1,1); // Use the gain etc... corrected module signal
+
    Int_t drow=int(fabs(double(GetRow()-m.GetRow())));       // row distance to center
    Int_t dcol=int(fabs(double(GetColumn()-m.GetColumn()))); // column distance to center 
 
@@ -291,17 +304,13 @@ void AliCalcluster::AddVetoSignal(AliSignal& s,Int_t extr)
  } 
 
  Int_t nvalues=s.GetNvalues();
- AliSignal* sx=new AliSignal(nvalues+3); // Additional value added
+ AliSignal* sx=new AliSignal(s); // Additional values will be added
  TString name=s.GetName();
  name.Append(" + additional chi2, ndf and CL values");
  sx->SetName(name);
 
  Double_t vecc[3],vecv[3];
- if (!extr)
- {
-  sx->SetPosition((Ali3Vector&)s);
- }
- else
+ if (extr)
  {
   // Extrapolate the veto hit position
   Double_t scale=1;
@@ -312,15 +321,6 @@ void AliCalcluster::AddVetoSignal(AliSignal& s,Int_t extr)
   sx->SetPosition(r);
  }
 
- Double_t sig,err;
- for (Int_t i=1; i<=nvalues; i++)
- {
-  sig=s.GetSignal(i);
-  err=s.GetSignalError(i);
-  sx->SetSignal(sig,i);
-  sx->SetSignalError(err,i);
- }
-
  // Calculate the confidence level of association
  GetPosition(vecc,"car");
  sx->GetPosition(vecv,"car"); 
@@ -347,13 +347,13 @@ void AliCalcluster::AddVetoSignal(AliSignal& s,Int_t extr)
  fNvetos++;
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliCalcluster::GetNvetos()
+Int_t AliCalcluster::GetNvetos() const
 {
 // Provide the number of veto signals associated to the cluster
  return fNvetos;
 }
 ///////////////////////////////////////////////////////////////////////////
-AliSignal* AliCalcluster::GetVetoSignal(Int_t i)
+AliSignal* AliCalcluster::GetVetoSignal(Int_t i) const
 {
 // Provide access to the i-th veto signal of this cluster.
 // Note : The first hit corresponds to i=1.
@@ -377,7 +377,7 @@ AliSignal* AliCalcluster::GetVetoSignal(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliCalcluster::GetVetoLevel()
+Float_t AliCalcluster::GetVetoLevel() const
 {
 // Provide the confidence level of best associated veto signal.
  Float_t cl=0;
@@ -400,7 +400,7 @@ Float_t AliCalcluster::GetVetoLevel()
  return clmax;
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliCalcluster::HasVetoHit(Double_t cl)
+Int_t AliCalcluster::HasVetoHit(Double_t cl) const
 {
 // Investigate if cluster has an associated veto hit with conf. level > cl.
 // Returns 1 if there is such an associated veto hit, otherwise returns 0.