]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliCalcluster.cxx
New PHOSLinkDef containing AliPHOSv0hits class
[u/mrichter/AliRoot.git] / RALICE / AliCalcluster.cxx
index 31362affbdf10ff892757db9d76a19bf59fbb824..46ee98a951881a67d4f0a0d3a6e4f03140e1d217 100644 (file)
 
 /*
 $Log$
+Revision 1.3  1999/11/03 14:23:17  fca
+New version of RALICE introduced
+
+Revision 1.2  1999/09/29 09:24:28  fca
+Introduction of the Copyright and cvs Log
+
 */
 
+///////////////////////////////////////////////////////////////////////////
+// Class AliCalcluster
+// Description of a cluster of calorimeter modules.
+// A matrix geometry is assumed in which a cluster center
+// is identified by (row,col) and contains sig as signal
+// being the signal of the complete cluster.
+// Some info about cluster topology is provided in order
+// to enable EM or hadronic cluster identification.
+//
+//--- Author: Nick van Eijndhoven 13-jun-1997 UU-SAP Utrecht
+//- Modified: NvE 18-jan-2000 UU-SAP Utrecht 
+///////////////////////////////////////////////////////////////////////////
+
 #include "AliCalcluster.h"
  
 ClassImp(AliCalcluster) // Class implementation to enable ROOT I/O
@@ -50,17 +69,21 @@ AliCalcluster::~AliCalcluster()
 AliCalcluster::AliCalcluster(AliCalmodule& m)
 {
 // Cluster constructor with module m as center.
-// Module data is only entered for a module which contains
-// a signal and has not been used in a cluster yet.
-// Modules situated at a detector edge are not allowed to start a cluster.
+// Module data is only entered for a module which contains a signal,
+// has not been used in a cluster yet, and is not declared dead.
+//
+// Note :
+// It is advised NOT to start a cluster with modules situated at a detector edge.
+// This feature is automatically checked when using the built-in clustering
+// of AliCalorimeter.  
 
Float_t pos[3]={0,0,0};
Ali3Vector r;
 
- if ((m.GetClusteredSignal() > 0.) && (m.GetEdgeValue() == 0))
+ if (m.GetClusteredSignal()>0. && m.GetDeadValue()==0)
  {
   fCenter=&m;
-  m.GetPosition(pos,"sph");
-  SetPosition(pos,"sph");
+  r=m.GetPosition();
+  SetPosition(r);
   fSig=m.GetClusteredSignal();
   fNmods=1;
   fSig11=m.GetClusteredSignal();
@@ -75,7 +98,7 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
  else
  {
   fCenter=0;
-  SetPosition(pos,"sph");
+  SetPosition(r);
   fSig=0.;
   fNmods=0;
   fSig11=0.;
@@ -174,18 +197,22 @@ Float_t AliCalcluster::GetColumnDispersion()
 ///////////////////////////////////////////////////////////////////////////
 void AliCalcluster::Start(AliCalmodule& m)
 {
-// Reset cluster data and start with module m
-// A module can only start a cluster when it contains
-// a signal, has not been used in a cluster yet and is not
-// situated at a detector edge
+// Reset cluster data and start with module m.
+// A module can only start a cluster when it contains a signal,
+// has not been used in a cluster yet, and is not declared dead.
+//
+// Note :
+// It is advised NOT to start a cluster with modules situated at a detector edge.
+// This feature is automatically checked when using the built-in clustering
+// of AliCalorimeter.  
 
Float_t pos[3]={0,0,0};
Ali3Vector r;
 
- if ((m.GetClusteredSignal() > 0.) && (m.GetEdgeValue() == 0))
+ if (m.GetClusteredSignal()>0. && m.GetDeadValue()==0)
  {
   fCenter=&m;
-  m.GetPosition(pos,"sph");
-  SetPosition(pos,"sph");
+  r=m.GetPosition();
+  SetPosition(r);
   fSig=m.GetSignal();
   fNmods=1;
   fSig11=m.GetSignal();
@@ -198,7 +225,7 @@ void AliCalcluster::Start(AliCalmodule& m)
  else
  {
   fCenter=0;
-  SetPosition(pos,"sph");
+  SetPosition(r);
   fSig=0.;
   fNmods=0;
   fSig11=0.;
@@ -211,11 +238,12 @@ void AliCalcluster::Start(AliCalmodule& m)
 ///////////////////////////////////////////////////////////////////////////
 void AliCalcluster::Add(AliCalmodule& m)
 {
-// Add module data to the cluster
+// Add module data to the cluster.
+// Dead modules are NOT added to the cluster.
 
  Float_t signal=m.GetClusteredSignal();
  
- if (signal > 0.) // only add unused modules
+ if (signal>0. && m.GetDeadValue()==0) // only add unused modules
  {
   fSig+=signal;
   fNmods+=1;
@@ -231,7 +259,9 @@ void AliCalcluster::Add(AliCalmodule& m)
 ///////////////////////////////////////////////////////////////////////////
 void AliCalcluster::AddVetoSignal(Float_t* r,TString f,Float_t s)
 {
-// Associate an (extrapolated) AliSignal at location r as veto to the cluster
+// Associate an (extrapolated) AliSignal at location r as veto to the cluster.
+// The signal value s indicates the confidence level of hit association
+// and has to be provided by the user.
 // Note : The default signal value (s) is 0
  if (!fVetos)
  {
@@ -239,7 +269,7 @@ void AliCalcluster::AddVetoSignal(Float_t* r,TString f,Float_t s)
   fVetos=new TObjArray();
  } 
 
- fVetos->Add(new AliSignal);
+ fVetos->Add(new AliSignal(1));
  fNvetos++;
 
  ((AliSignal*)fVetos->At(fNvetos-1))->SetPosition(r,f);
@@ -254,8 +284,8 @@ Int_t AliCalcluster::GetNvetos()
 ///////////////////////////////////////////////////////////////////////////
 AliSignal* AliCalcluster::GetVetoSignal(Int_t i)
 {
-// Provide access to the i-th veto signal of this cluster
-// Note : The first hit corresponds to i=1
+// Provide access to the i-th veto signal of this cluster.
+// Note : The first hit corresponds to i=1.
 
  if (i>0 && i<=fNvetos)
  {
@@ -270,3 +300,34 @@ AliSignal* AliCalcluster::GetVetoSignal(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
+Float_t AliCalcluster::GetVetoLevel()
+{
+// Provide the confidence level of best associated veto signal.
+ Float_t cl=0;
+ Float_t clmax=0;
+ if (fVetos)
+ {
+  for (Int_t i=0; i<fNvetos; i++)
+  {
+   cl=((AliSignal*)fVetos->At(i))->GetSignal();
+   if (cl>clmax) clmax=cl;
+  }
+ }
+ return clmax;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t AliCalcluster::HasVetoHit(Double_t cl)
+{
+// 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.
+// Note : This function is faster than GetVetoLevel().
+ if (fVetos)
+ {
+  for (Int_t i=0; i<fNvetos; i++)
+  {
+   if (((AliSignal*)fVetos->At(i))->GetSignal() > cl) return 1;
+  }
+ }
+ return 0;
+}
+///////////////////////////////////////////////////////////////////////////