]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliCalmodule.cxx
Using the same optimization in the compiler and in the linker
[u/mrichter/AliRoot.git] / RALICE / AliCalmodule.cxx
index 12fd89222e41d61f03103879b63c6456e693b28d..423089b52128db1fa66db12e7b2ac3d39eacebf4 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.2  1999/09/29 09:24:28  fca
-Introduction of the Copyright and cvs Log
-
-*/
+// $Id$
 
 ///////////////////////////////////////////////////////////////////////////
 // Class AliCalmodule
@@ -28,22 +23,20 @@ Introduction of the Copyright and cvs Log
 // Note : row and col start counting at 1.
 //
 //--- Author: Nick van Eijndhoven 13-jun-1997 UU-SAP Utrecht
-//- Modified: NvE 31-oct-1999 UU-SAP Utrecht
+//- Modified: NvE $Date$ UU-SAP Utrecht
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliCalmodule.h"
+#include "Riostream.h"
  
 ClassImp(AliCalmodule) // Class implementation to enable ROOT I/O
  
-AliCalmodule::AliCalmodule()
+AliCalmodule::AliCalmodule() : AliSignal()
 {
 // Default constructor, all module data is set to 0
  fRow=0;
  fCol=0;
  fSigc=0;
- fEdge=0;
- fDead=0;
- fGain=1;
 }
 ///////////////////////////////////////////////////////////////////////////
 AliCalmodule::~AliCalmodule()
@@ -51,16 +44,21 @@ AliCalmodule::~AliCalmodule()
 // Default destructor
 }
 ///////////////////////////////////////////////////////////////////////////
-AliCalmodule::AliCalmodule(Int_t row,Int_t col,Float_t sig)
+AliCalmodule::AliCalmodule(AliCalmodule& m) : AliSignal(m)
+{
+// Copy constructor
+ fRow=m.fRow;
+ fCol=m.fCol;
+ fSigc=m.fSigc;
+}
+///////////////////////////////////////////////////////////////////////////
+AliCalmodule::AliCalmodule(Int_t row,Int_t col,Float_t sig) : AliSignal()
 {
 // Module constructor with initialisation of module data
  fRow=row;
  fCol=col;
  AliSignal::SetSignal(sig);
  fSigc=sig;
- fEdge=0;
- fDead=0;
- fGain=1;
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliCalmodule::SetRow(Int_t i)
@@ -99,50 +97,6 @@ void AliCalmodule::SetClusteredSignal(Float_t sig)
  fSigc=sig;
 }
 ///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetEdgeOn()
-{
-// Indicate the module as edge module
- fEdge=1;
-}
-///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetEdgeOff()
-{
-// Indicate the module as non-edge module
- fEdge=0;
-}
-///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::EdgeUp()
-{
-// Increase the edge value by 1
-// This simplifies treatment of edge modules around temp. dead modules
- fEdge+=1;
-}
-///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::EdgeDown()
-{
-// Decrease the edge value by 1
-// This simplifies treatment of edge modules around temp. dead modules
- if (fEdge > 0) fEdge-=1;
-}
-///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetDead()
-{
-// Indicate the module as dead
- fDead=1;
-}
-///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetAlive()
-{
-// Indicate the module as dead
- fDead=0;
-}
-///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetGain(Float_t gain)
-{
-// Set the gain value of the readout system
- fGain=gain;
-}
-///////////////////////////////////////////////////////////////////////////
 Int_t AliCalmodule::GetRow()
 {
 // Provide the row number of the module
@@ -157,8 +111,9 @@ Int_t AliCalmodule::GetColumn()
 ///////////////////////////////////////////////////////////////////////////
 Float_t AliCalmodule::GetClusteredSignal()
 {
-// Provide the signal of the module after clustering
- if (!fDead)
+// Provide the signal of the module after clustering.
+ Int_t dead=GetDeadValue();
+ if (!dead)
  {
   return fSigc;
  }
@@ -168,21 +123,18 @@ Float_t AliCalmodule::GetClusteredSignal()
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliCalmodule::GetEdgeValue()
-{
-// Provide the value of the edge indicator (1=edge 0=no-edge)
- return fEdge;
-}
-///////////////////////////////////////////////////////////////////////////
-Int_t AliCalmodule::GetDeadValue()
+AliCalmodule* AliCalmodule::MakeCopy(AliCalmodule& m)
 {
-// Provide the value of the dead indicator (1=dead 0=alive)
- return fDead;
-}
-///////////////////////////////////////////////////////////////////////////
-Float_t AliCalmodule::GetGain()
-{
-// Provide the gain value of the readout system
- return fGain;
+// Make a deep copy of the input object and provide the pointer to the copy.
+// This memberfunction enables automatic creation of new objects of the
+// correct type depending on the argument type, a feature which may be very useful
+// for containers like AliCalorimeter when adding objects in case the
+// container owns the objects. This feature allows e.g. AliCalorimeter
+// to store either AliCalmodule objects or objects derived from AliCalmodule
+// via tha AddSignal memberfunction, provided these derived classes also have
+// a proper MakeCopy memberfunction. 
+
+ AliCalmodule* cal=new AliCalmodule(m);
+ return cal;
 }
 ///////////////////////////////////////////////////////////////////////////