]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliCalmodule.cxx
08-mar-2003 NvE Compiler option /GR introduced for MSVC++ in mklibs.bat to explicitly...
[u/mrichter/AliRoot.git] / RALICE / AliCalmodule.cxx
index b58078a8dbf08acfd454a397ab0dfd7cd1631e75..528dd8de75511b45aacb9949c0e7bc1ad560b230 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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;
@@ -45,7 +46,17 @@ 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;
+ fDead=m.fDead;
+ fGain=m.fGain;
+}
+///////////////////////////////////////////////////////////////////////////
+AliCalmodule::AliCalmodule(Int_t row,Int_t col,Float_t sig) : AliSignal()
 {
 // Module constructor with initialisation of module data
  fRow=row;
@@ -147,3 +158,18 @@ Float_t AliCalmodule::GetGain()
  return fGain;
 }
 ///////////////////////////////////////////////////////////////////////////
+AliCalmodule* AliCalmodule::MakeCopy(AliCalmodule& m)
+{
+// 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;
+}
+///////////////////////////////////////////////////////////////////////////