}
Int_t size=0;
- Int_t n=0;
- if (c.fAttributes)
- {
- size=c.fAttributes->GetSize();
- n=c.fAttributes->GetEntries();
- }
+ if (c.fAttributes) size=c.fAttributes->GetSize();
if (size)
{
fAttributes=new TObjArray(size);
fAttributes->SetOwner();
- for (Int_t ia=0; ia<n; ia++)
+ for (Int_t ia=0; ia<size; ia++)
{
AliAttribObj* a=(AliAttribObj*)(c.fAttributes->At(ia));
- if (a) fAttributes->Add(new AliAttribObj(*a));
+ if (a) fAttributes->AddAt(new AliAttribObj(*a),ia);
}
}
+ Int_t n=0;
n=c.GetNclusters();
if (n)
{
return fSwap;
}
///////////////////////////////////////////////////////////////////////////
+AliCalorimeter* AliCalorimeter::MakeCopy(AliCalorimeter& c)
+{
+// 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 AliEvent when adding objects in case the
+// container owns the objects.
+
+ AliCalorimeter* cal=new AliCalorimeter(c);
+ return cal;
+}
+///////////////////////////////////////////////////////////////////////////
AliCalorimeter(Int_t nrow,Int_t ncol); // Create a calorimeter matrix
virtual ~AliCalorimeter(); // Destructor
AliCalorimeter(AliCalorimeter& c); // Copy constructor
+ virtual AliCalorimeter* MakeCopy(AliCalorimeter& c); // Make a deep copy and provide pointer of the copy
Int_t GetNrows(); // Return number of rows of the matrix
Int_t GetNcolumns(); // Return number of columns of the matrix
void SetSignal(Int_t row,Int_t col,Float_t s); // Set signal for a certain module
AliObjMatrix* fPositions; //! The matrix of module position pointers
TString fName; // Name of the calorimeter system
- ClassDef(AliCalorimeter,4) // Description of a modular calorimeter system.
+ ClassDef(AliCalorimeter,5) // Description of a modular calorimeter system.
};
#endif
all the derived classes (e.g. AliPosition, AliSignal, AliTrack, etc...).
Therefore the Load() memberfunction has been removed from AliPositionObj.
03-oct-2003 NvE Typos fixed in AliCalorimeter.cxx.
+ Also memberfunction MakeCopy introduced in class AliCalorimeter.