static method to set the xmldoc path added
authormorsch <andreas.morsch@cern.ch>
Mon, 17 Nov 2014 16:10:56 +0000 (17:10 +0100)
committermorsch <andreas.morsch@cern.ch>
Tue, 18 Nov 2014 11:04:39 +0000 (12:04 +0100)
PYTHIA8/AliTPythia8.cxx
PYTHIA8/AliTPythia8.h

index 421c3e6..91b9de2 100644 (file)
@@ -86,6 +86,7 @@
 ClassImp(AliTPythia8)
 
 AliTPythia8*  AliTPythia8::fgInstance = 0;
+char*         AliTPythia8::fgXmldocPath = 0;
 
 //___________________________________________________________________________
 AliTPythia8::AliTPythia8():
@@ -100,7 +101,11 @@ AliTPythia8::AliTPythia8():
    delete fParticles; // was allocated as TObjArray in TGenerator
     
    fParticles = new TClonesArray("TParticle",50);
-   fPythia    = new Pythia8::Pythia();
+   if (fgXmldocPath != 0) {
+     fPythia    = new Pythia8::Pythia(fgXmldocPath);
+   } else {
+     fPythia    = new Pythia8::Pythia();
+   }
 }
 
 //___________________________________________________________________________
index 4afdde6..49637e2 100644 (file)
@@ -73,6 +73,7 @@ public:
    AliTPythia8(const char *xmlDir);
    virtual ~AliTPythia8();
    static AliTPythia8     *Instance();
+   static void             SetXmldocPath(char* path) {fgXmldocPath = path;}
    Pythia8::Pythia        *Pythia8() {return fPythia;}
 
    // Interface
@@ -92,8 +93,10 @@ protected:
    AliTPythia8(const AliTPythia8&);
    AliTPythia8 operator=(const AliTPythia8&);
    static  AliTPythia8     *fgInstance;             //! singleton instance
+   static  char            *fgXmldocPath;           //! path to xmldoc
    Pythia8::Pythia         *fPythia;                //! The pythia8 instance
    Int_t                    fNumberOfParticles;     //! Number of particles
+   
 private:
    void                    AddParticlesToPdgDataBase() const;
    ClassDef(AliTPythia8, 1)   // Interface class of Pythia8