]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFArray.cxx
remove VV inheritance from STEER
[u/mrichter/AliRoot.git] / TOF / AliTOFArray.cxx
index f2a699a9e2b8b30eb4546d804ac277efd7f47c77..215a5e0f533097530e5254815f8854940e133fd5 100644 (file)
@@ -47,7 +47,14 @@ AliTOFArray::AliTOFArray(const AliTOFArray & source):
        //
 
        this->fSize= source.fSize;
-       this->fArray= source.fArray;
+       fArray = new TArrayF*[fSize];
+       for (Int_t ich = 0; ich<fSize; ich ++){
+               fArray[ich] = new TArrayF();
+               fArray[ich]->Set(source.fArray[ich]->GetSize());
+               for (Int_t j = 0; j < fArray[ich]->GetSize(); j++){
+                       fArray[ich]->AddAt(fArray[ich]->GetAt(j),j);
+               }
+       }
 }
 
 //-------------------------------------------------------------------
@@ -57,8 +64,18 @@ AliTOFArray& AliTOFArray::operator=(const AliTOFArray & source) {
        // assignment operator
        //
 
-       this->fSize= source.fSize;
-       this->fArray= source.fArray;
+       if (this != &source){
+               this->fSize= source.fSize;
+               delete [] fArray;
+               fArray = new TArrayF*[fSize];
+               for (Int_t ich = 0; ich<fSize; ich ++){
+                       fArray[ich] = new TArrayF();
+                       fArray[ich]->Set(source.fArray[ich]->GetSize());
+                       for (Int_t j = 0; j < fArray[ich]->GetSize(); j++){
+                               fArray[ich]->AddAt(fArray[ich]->GetAt(j),j);
+                       }
+               }
+       }
        return *this;
 }
 
@@ -242,7 +259,7 @@ Long64_t AliTOFArray::Merge(TCollection *list){
        Int_t count = 0; // object counter
        while ((tofArray=(AliTOFArray*)next())) {
                //              printf("Count = %d \n",count);
-               if (!tofArray) continue;
+               //if (!tofArray) continue; // dead_code x coverity
                if (tofArray->GetSize() != fSize){
                        printf("Merging with current entry in list not possible, AliTOFArray in the list has size different from the current one\n");
                        continue;