]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EPOS/TEpos.cxx
removed warning
[u/mrichter/AliRoot.git] / EPOS / TEpos.cxx
index 38567013ab18e03db0247d4e2f370a75a29827d5..b894541c2f4d01e9fc2e0d98bec6e735f27c3404 100644 (file)
@@ -1,18 +1,18 @@
-/*
- *###################################################################
- *#        EPOS 1.67     K. WERNER, T. PIEROG, S. PORTEBOEUF.       #
- *#                      Contact: werner@subatech.in2p3.fr          #
- *###################################################################
- *
- * TEpos.cxx
- * 
- * Wraper class for interfacing EPOS model, derived from ROOT's TGenerator.
- * It generates temporary input file for the model, providing user with
- * ability to add his/hers own lines to the input.
- * Output is read directly from common blocks.
- *
- *      Author: Piotr Ostrowski, postrow@if.pw.edu.pl
- */
+//
+//###################################################################
+//#        EPOS 1.67     K. WERNER, T. PIEROG, S. PORTEBOEUF.       #
+//#                      Contact: werner@subatech.in2p3.fr          #
+//###################################################################
+//
+// TEpos.cxx
+// 
+// Wraper class for interfacing EPOS model, derived from ROOT's TGenerator.
+// It generates temporary input file for the model, providing user with
+// ability to add his/hers own lines to the input.
+// Output is read directly from common blocks.
+//
+//      Author: Piotr Ostrowski, postrow@if.pw.edu.pl
+//
 
 
 #include <TClonesArray.h>
@@ -75,14 +75,37 @@ TEpos::~TEpos() {
        delete fIdConverter;
 }
 
-TEpos& TEpos::operator=(const TEpos&) {
-       if (!fIdConverter) {
-               fIdConverter = new AliGenEposIsajetToPdgConverter();
-       }
-       return *this;
+TEpos& TEpos::operator=(const TEpos& epos) {
+  //operator=
+  if (this != &epos) {
+    if (fIdConverter) {
+       delete 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() {
+  // Generates input file and prepares EPOS to read from it.
        Int_t nopeno = 0;
        GenerateInputFile();
        aaset(0);
@@ -115,6 +138,7 @@ void TEpos::GenerateEvent() {
 }
 
 Int_t TEpos::ImportParticles(TClonesArray *particles, Option_t *) {
+  //Fills provided ClonesArray with generated particles
        particles->Clear();
        if (!cevt.nevt) return 0;
        Int_t numpart = cptl.nptl;
@@ -141,6 +165,7 @@ Int_t TEpos::ImportParticles(TClonesArray *particles, Option_t *) {
 }
 
 TObjArray*  TEpos::ImportParticles(Option_t *) {
+  //Creates new particle array
        fParticles->Clear();
        if (!cevt.nevt) return NULL;
        Int_t numpart = cptl.nptl;
@@ -176,15 +201,16 @@ void TEpos::AddExtraInputLine(const char *line) {
 }
 
 void TEpos::GenerateInputFile() {
+  // Generate input file in EPOS format
        ofstream file(GetInputFileName(), ios_base::out | ios_base::trunc);
        char epo[256];
        char *epoEnv = getenv("EPO");
        if (epoEnv) {
-               strcpy(epo, epoEnv);
+               strncpy(epo, epoEnv, 255);
        } else {
-               strcpy(epo, getenv("ALICE_ROOT"));
+               strncpy(epo, getenv("ALICE_ROOT"), 255);
        }
-       strcat(epo, "/EPOS/epos167");
+       strncat(epo, "/EPOS/epos167", 255);
 
        file << "fname pathnx " << epo << "/" << endl;
        file << "fname histo none" << endl;