Fix for coverity 18265
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 21 Jan 2012 11:12:25 +0000 (11:12 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 21 Jan 2012 11:12:25 +0000 (11:12 +0000)
EPOS/TEpos.cxx

index b0381d0..ef84630 100644 (file)
@@ -77,22 +77,30 @@ TEpos::~TEpos() {
 
 TEpos& TEpos::operator=(const TEpos& epos) {
   //operator=
-       if (this != &epos) {
-           if (!fIdConverter) fIdConverter = new AliGenEposIsajetToPdgConverter();
-           fLaproj = epos.fLaproj;
-           fMaproj = epos.fMaproj;
-           fLatarg = epos.fLatarg;
-           fMatarg = epos.fMatarg;
-           fBminim = epos.fBminim;
-           fBmaxim = epos.fBmaxim;
-           fPhimin = epos.fPhimin;
-           fPhimax = epos.fPhimax;
-           fEcms   = epos.fEcms;
-           fSplitting = epos.fSplitting;
-//         fNoDecays = epos.fNoDecays;
-//         fExtraInputLines = epos.dExtraInputLines;
-       }
-       return *this;
+  if (this != &epos) {
+    if (fIdConverter) {
+      fIdConverter = new AliGenEposIsajetToPdgConverter(*epos.fIdConverter);
+    } else{
+      fIdConverter = 0;
+    }
+    fLaproj = epos.fLaproj;
+    fMaproj = epos.fMaproj;
+    fLatarg = epos.fLatarg;
+    fMatarg = epos.fMatarg;
+    fBminim = epos.fBminim;
+    fBmaxim = epos.fBmaxim;
+    fPhimin = epos.fPhimin;
+    fPhimax = epos.fPhimax;
+    fEcms   = epos.fEcms;
+    fSplitting = epos.fSplitting;
+    for(UInt_t i = 0; i < epos.fNoDecays.size(); ++i) {
+      fNoDecays.push_back(epos.fNoDecays[i]);
+    }
+    for(UInt_t i = 0; i < epos.fExtraInputLines.size(); ++i) {
+      fExtraInputLines.push_back(epos.fExtraInputLines[i]);
+    }
+  }
+  return *this;
 }
 
 void TEpos::Initialize() {