diff --git a/Generators/Pythia8_i/CMakeLists.txt b/Generators/Pythia8_i/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7ef80a3625b496b6ae88ea035a22305cf78bfb80
--- /dev/null
+++ b/Generators/Pythia8_i/CMakeLists.txt
@@ -0,0 +1,64 @@
+################################################################################
+# Package: Pythia8_i
+################################################################################
+
+# Declare the package name:
+atlas_subdir( Pythia8_i )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Control/AthenaKernel
+                          Generators/GeneratorModules
+                          PRIVATE
+                          GaudiKernel
+                          Generators/GeneratorObjects
+                          Tools/PathResolver )
+
+# External dependencies:
+find_package( Boost COMPONENTS filesystem thread system )
+find_package( CLHEP )
+find_package( Lhapdf )
+find_package( Pythia8 )
+
+add_definitions(-DPY8VERSION=\"${PYTHIA8_VERSION}\")
+
+# Remove the --as-needed linker flags:
+atlas_disable_as_needed()
+
+# Component(s) in the package:
+atlas_add_library( Pythia8_iLib
+                   src/Pythia8_i.cxx
+                   src/UserProcessFactory.cxx
+                   src/UserHooksFactory.cxx
+                   src/UserResonanceFactory.cxx
+                   src/UserProcesses/Sigma2qqbar2emu.cxx
+                   src/UserProcesses/Sigma2qqbar2lStarlBar.cxx
+                   src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx
+                   src/UserHooks/WZVetoedShower.cxx
+                   src/UserHooks/QCDVetoedShower.cxx
+                   src/UserHooks/PoWHEGVetoedShower.cxx
+                   src/UserHooks/GravFlat.cxx
+                   src/UserHooks/JetMatchingMadGraphHook.cxx
+                   src/UserHooks/SuppressMPI.cxx
+                   src/UserHooks/EnhanceMPI.cxx
+                   src/UserHooks/ISRVetoedShower.cxx
+                   src/UserHooks/PTRelVetoedShower.cxx
+                   src/UserHooks/WprimeFlat.cxx
+                   src/UserHooks/WprimeWZFlat.cxx
+                   src/UserHooks/main31.cxx
+                   src/UserResonances/ResonanceExcitedCI.cxx
+                   src/UserResonances/ResonanceLQ.cxx
+                   PUBLIC_HEADERS Pythia8_i
+                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${LHAPDF_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${PYTHIA8_INCLUDE_DIRS}
+                   DEFINITIONS ${CLHEP_DEFINITIONS}
+                   LINK_LIBRARIES ${Boost_LIBRARIES} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES} ${PYTHIA8_LIBRARIES} AthenaKernel GeneratorModulesLib
+                   PRIVATE_LINK_LIBRARIES GaudiKernel GeneratorObjects PathResolver )
+
+atlas_add_component( Pythia8_i
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${LHAPDF_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${PYTHIA8_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${LHAPDF_LIBRARIES} ${CLHEP_LIBRARIES} ${PYTHIA8_LIBRARIES} AthenaKernel GeneratorModulesLib GaudiKernel GeneratorObjects PathResolver Pythia8_iLib )
+
+# Install files from the package:
+atlas_install_joboptions( share/*.py )
+
diff --git a/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h b/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h
index bbc7bade10c1b3efab82acb07b584900cc1b0687..6948803b9ba9f4a626b344b811f66bf084b41ca1 100644
--- a/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h
+++ b/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h
@@ -71,7 +71,7 @@ public:
     
   virtual StatusCode genInitialize();
   virtual StatusCode callGenerator();
-  virtual StatusCode fillEvt(GenEvent *evt);
+  virtual StatusCode fillEvt(HepMC::GenEvent *evt);
   virtual StatusCode genFinalize();
 
   double pythiaVersion()const;
@@ -132,14 +132,14 @@ private:
   
   std::string m_userResonances;
   
-  vector<Pythia8::ResonanceWidths*> m_userResonancePtrs;
+  std::vector<Pythia8::ResonanceWidths*> m_userResonancePtrs;
   
   bool m_useLHAPDF;
 
   std::string m_particleDataFile;
   std::string m_outputParticleDataFile;
   
-  vector<string> m_weightIDs;
+  std::vector<string> m_weightIDs;
   bool m_doLHE3Weights;
   
   static int s_allowedTunes(double version);
diff --git a/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h b/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h
index a9cebaaf0eff31747288074a90d41d84ffa0738b..18e1007d117939c7eecaf49e252a764fa2498195 100644
--- a/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h
+++ b/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h
@@ -60,7 +60,7 @@ namespace Pythia8_UserHooks{
     
   private:
     
-    static map<string, const ICreator*> &s_creators();
+    static std::map<string, const ICreator*> &s_creators();
     
   };
 }
diff --git a/Generators/Pythia8_i/cmt/requirements b/Generators/Pythia8_i/cmt/requirements
index 0e0b237d439253e511c9af9cd7f2d4ba7dcec21e..47804cb6e6fd0ac36e691c90dc9f2007c18af8a6 100644
--- a/Generators/Pythia8_i/cmt/requirements
+++ b/Generators/Pythia8_i/cmt/requirements
@@ -15,6 +15,7 @@ private
 use    GaudiInterface      GaudiInterface-*      External
 ###use    AtlasHepMC          AtlasHepMC-*          External
 use    GeneratorObjects    GeneratorObjects-*    Generators
+use    PathResolver        PathResolver-*        Tools
 
 macro_append Pythia8_i_pp_cppflags ' -DPY8VERSION=\"$(Pythia8_version)\" '
 macro_append fflags "" Linux ""
diff --git a/Generators/Pythia8_i/src/Pythia8_i.cxx b/Generators/Pythia8_i/src/Pythia8_i.cxx
index 0607703006d1f19d6b2b101f848a60ae543a1898..87407a4106a3ff9e98cb3bab2e0ccfaf5fe8594f 100644
--- a/Generators/Pythia8_i/src/Pythia8_i.cxx
+++ b/Generators/Pythia8_i/src/Pythia8_i.cxx
@@ -7,6 +7,7 @@
 #include "Pythia8_i/UserHooksFactory.h"
 #include "Pythia8_i/UserResonanceFactory.h"
 
+#include "PathResolver/PathResolver.h"
 #include "GeneratorObjects/McEventCollection.h"
 #include <boost/algorithm/string.hpp>
 #include <boost/lexical_cast.hpp>
@@ -126,7 +127,7 @@ StatusCode Pythia8_i::genInitialize() {
   }
 
   foreach(const string &param, m_userParams){
-    vector<string> splits;
+    std::vector<string> splits;
     boost::split(splits, param, boost::is_any_of("="));
     if(splits.size() != 2){
       ATH_MSG_ERROR("Cannot interpret user param command: " + param);
@@ -139,7 +140,7 @@ StatusCode Pythia8_i::genInitialize() {
   }
 
   foreach(const string &mode, m_userModes){
-    vector<string> splits;
+    std::vector<string> splits;
     boost::split(splits, mode, boost::is_any_of("="));
     if(splits.size() != 2){
       ATH_MSG_ERROR("Cannot interpret user mode command: " + mode);
@@ -239,7 +240,7 @@ StatusCode Pythia8_i::genInitialize() {
 
   if(m_userResonances != ""){
    
-    vector<string> resonanceArgs;
+    std::vector<string> resonanceArgs;
     
     boost::split(resonanceArgs, m_userResonances, boost::is_any_of(":"));
     if(resonanceArgs.size() != 2){
@@ -248,7 +249,7 @@ StatusCode Pythia8_i::genInitialize() {
       ATH_MSG_ERROR("Where name is the name of your UserResonance, and id1,id2,id3 are a comma separated list of PDG IDs to which it is applied");
       canInit = false;
     }
-    vector<string> resonanceIds;
+    std::vector<string> resonanceIds;
     boost::split(resonanceIds, resonanceArgs.back(), boost::is_any_of(","));
     if(resonanceIds.size()==0){
       ATH_MSG_ERROR("You did not specifiy any PDG ids to which your user resonance width should be applied!");
@@ -257,13 +258,13 @@ StatusCode Pythia8_i::genInitialize() {
       canInit=false;
     }
     
-    for(vector<string>::const_iterator sId = resonanceIds.begin();
+    for(std::vector<string>::const_iterator sId = resonanceIds.begin();
         sId != resonanceIds.end(); ++sId){
       int idResIn = boost::lexical_cast<int>(*sId);
       m_userResonancePtrs.push_back(Pythia8_UserResonance::UserResonanceFactory::create(resonanceArgs.front(), idResIn));
     }
     
-    for(vector<Pythia8::ResonanceWidths*>::const_iterator resonance = m_userResonancePtrs.begin();
+    for(std::vector<Pythia8::ResonanceWidths*>::const_iterator resonance = m_userResonancePtrs.begin();
         resonance != m_userResonancePtrs.end(); ++resonance){
       m_pythia.setResonancePtr(*resonance);
     }
@@ -382,7 +383,7 @@ StatusCode Pythia8_i::callGenerator(){
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-StatusCode Pythia8_i::fillEvt(GenEvent *evt){
+StatusCode Pythia8_i::fillEvt(HepMC::GenEvent *evt){
 
   ATH_MSG_DEBUG(">>> Pythia8_i from fillEvt");
 
@@ -421,10 +422,10 @@ StatusCode Pythia8_i::fillEvt(GenEvent *evt){
   // set the event weight
   evt->weights().clear();
   
-  vector<string>::const_iterator id = m_weightIDs.begin();
+  std::vector<string>::const_iterator id = m_weightIDs.begin();
   
   if(m_pythia.info.getWeightsDetailedSize() != 0){
-    for(map<string, Pythia8::LHAwgt>::const_iterator wgt = m_pythia.info.rwgt->wgts.begin();
+    for(std::map<string, Pythia8::LHAwgt>::const_iterator wgt = m_pythia.info.rwgt->wgts.begin();
         wgt != m_pythia.info.rwgt->wgts.end(); ++wgt){
       
       if(m_internal_event_number == 1){
@@ -438,7 +439,7 @@ StatusCode Pythia8_i::fillEvt(GenEvent *evt){
         ++id;
       }
       
-      map<string, Pythia8::LHAweight>::const_iterator weightName = m_pythia.info.init_weights->find(wgt->first);
+      std::map<string, Pythia8::LHAweight>::const_iterator weightName = m_pythia.info.init_weights->find(wgt->first);
       if(weightName != m_pythia.info.init_weights->end()){
         evt->weights()[weightName->second.contents] = mergingWeight * wgt->second.contents;
       }else{
@@ -497,7 +498,7 @@ StatusCode Pythia8_i::genFinalize(){
     std::cout<<"MetaData: weights = ";
     foreach(const string &id, m_weightIDs){
       
-      map<string, Pythia8::LHAweight>::const_iterator weight = m_pythia.info.init_weights->find(id);
+      std::map<string, Pythia8::LHAweight>::const_iterator weight = m_pythia.info.init_weights->find(id);
       
       if(weight != m_pythia.info.init_weights->end()){
         std::cout<<weight->second.contents<<" | ";
@@ -520,7 +521,7 @@ double Pythia8_i::pythiaVersion()const{
 string Pythia8_i::findValue(const string &command, const string &key){
   if(command.find(key) == std::string::npos) return "";
   
-  vector<string> splits;
+  std::vector<string> splits;
   boost::split(splits, command, boost::is_any_of("="));
   if(splits.size() != 2){
     throw Pythia8_i::CommandException(command);
@@ -541,12 +542,12 @@ string Pythia8_i::xmlpath(){
   
   if(cmtpath != 0 && cmtconfig != 0){
     
-    vector<string> cmtpaths;
+    std::vector<string> cmtpaths;
     boost::split(cmtpaths, cmtpath, boost::is_any_of(string(":")));
     
     string installPath = "/InstallArea/" + string(cmtconfig) + "/share/Pythia8/xmldoc";
     
-    for(vector<string>::const_iterator path = cmtpaths.begin();
+    for(std::vector<string>::const_iterator path = cmtpaths.begin();
         path != cmtpaths.end() && foundpath == ""; ++path){
       string testPath = *path + installPath;
       std::ifstream testFile(testPath.c_str());
@@ -554,14 +555,18 @@ string Pythia8_i::xmlpath(){
       testFile.close();
     }
     
+  } else {
+     // If the CMT environment is missing, try to find the xmldoc directory
+     // using PathResolver:
+     foundpath = PathResolverFindCalibDirectory( "Pythia8/xmldoc" );
   }
-  
+
   return foundpath;
 }
 
   ////////////////////////////////////////////////////////////////////////////////
 int Pythia8_i::s_allowedTunes(double version){
-  static map<double, int> allowedTunes;
+  static std::map<double, int> allowedTunes;
   if(allowedTunes.size()==0){
     allowedTunes[0.]    = 0;
     allowedTunes[8.126] = 1;
@@ -577,7 +582,7 @@ int Pythia8_i::s_allowedTunes(double version){
     allowedTunes[8.205] = 32;
   }
   
-  map<double, int>::const_iterator maxTune = allowedTunes.upper_bound(version + 0.0000001);
+  std::map<double, int>::const_iterator maxTune = allowedTunes.upper_bound(version + 0.0000001);
   
   if(maxTune != allowedTunes.begin()) --maxTune;
   
diff --git a/Generators/Pythia8_i/src/UserHooks/main31.cxx b/Generators/Pythia8_i/src/UserHooks/main31.cxx
index f6dafe8acbaf1b76f87c23d97c6ef097584d6935..3abd230437f4f01bc4066080a6b149586e567828 100644
--- a/Generators/Pythia8_i/src/UserHooks/main31.cxx
+++ b/Generators/Pythia8_i/src/UserHooks/main31.cxx
@@ -27,14 +27,14 @@ namespace Pythia8{
     main31() : m_nFinal("Main31:NFinal", 2),
     m_pTHardMode("Main31:pTHard", 2),
     m_pTDefMode("Main31:pTdef", 1),
-    vetoMode(1), vetoCount(3),
-    pTemtMode(0),
-    emittedMode(0),
-    MPIvetoMode(0),
-    pThard(0), pTMPI(0),
-    accepted(0),
-    nAcceptSeq(0),
-    nISRveto(0), nFSRveto(0) {};
+    m_vetoMode(1), m_vetoCount(3),
+    m_pTemtMode(0),
+    m_emittedMode(0),
+    m_MPIvetoMode(0),
+    m_pThard(0), m_pTMPI(0),
+    m_accepted(0),
+    m_nAcceptSeq(0),
+    m_nISRveto(0), m_nFSRveto(0) {};
     ~main31() {}
     
     //--------------------------------------------------------------------------
@@ -271,10 +271,10 @@ namespace Pythia8{
     
     //--------------------------------------------------------------------------
     
-    // Extraction of pThard based on the incoming event.
+    // Extraction of m_pThard based on the incoming event.
     // Assume that all the final-state particles are in a continuous block
     // at the end of the event and the final entry is the POWHEG emission.
-    // If there is no POWHEG emission, then pThard is set to Qfac.
+    // If there is no POWHEG emission, then m_pThard is set to Qfac.
     
     bool canVetoMPIStep()    { return true; }
     int  numberVetoMPIStep() { return 1; }
@@ -303,38 +303,38 @@ namespace Pythia8{
       bool isEmt = (count == m_nFinal(settingsPtr)) ? false : true;
       int  iEmt  = (isEmt) ? e.size() - 1 : -1;
       
-      // If there is no radiation or if pThardMode is 0 then set pThard to QRen.
+      // If there is no radiation or if pThardMode is 0 then set m_pThard to QRen.
       if (!isEmt || m_pTHardMode(settingsPtr) == 0) {
-        pThard = infoPtr->QRen();
+        m_pThard = infoPtr->QRen();
         
         // If pThardMode is 1 then the pT of the POWHEG emission is checked against
         // all other incoming and outgoing partons, with the minimal value taken
       } else if (m_pTHardMode(settingsPtr) == 1) {
-        pThard = pTcalc(e, -1, iEmt, -1, -1, -1);
+        m_pThard = pTcalc(e, -1, iEmt, -1, -1, -1);
         
         // If pThardMode is 2, then the pT of all final-state partons is checked
         // against all other incoming and outgoing partons, with the minimal value
         // taken
       } else if (m_pTHardMode(settingsPtr) == 2) {
-        pThard = pTcalc(e, -1, -1, -1, -1, -1);
+        m_pThard = pTcalc(e, -1, -1, -1, -1, -1);
         
       }
       
       // Find MPI veto pT if necessary
-      if (MPIvetoMode == 1) {
-        pTMPI = (isEmt) ? pTsum / 2. : pT1;
+      if (m_MPIvetoMode == 1) {
+        m_pTMPI = (isEmt) ? pTsum / 2. : pT1;
       }
       
 #ifdef DBGOUTPUT
       cout << "doVetoMPIStep: QRen = " << infoPtr->QRen()
-      << ", pThard = " << pThard << endl << endl;
+      << ", m_pThard = " << m_pThard << endl << endl;
 #endif
       
-//      std::cout<<"vetoScale = "<<pThard<<std::endl;
+//      std::cout<<"vetoScale = "<<m_pThard<<std::endl;
       
       // Initialise other variables
-      accepted   = false;
-      nAcceptSeq = nISRveto = nFSRveto = 0;
+      m_accepted   = false;
+      m_nAcceptSeq = m_nISRveto = m_nFSRveto = 0;
       
       // Do not veto the event
       return false;
@@ -344,13 +344,13 @@ namespace Pythia8{
     
     // ISR veto
     
-    bool canVetoISREmission() { return (vetoMode == 0) ? false : true; }
+    bool canVetoISREmission() { return (m_vetoMode == 0) ? false : true; }
     bool doVetoISREmission(int, const Event &e, int iSys) {
       // Must be radiation from the hard system
       if (iSys != 0) return false;
       
-      // If we already have accepted 'vetoCount' emissions in a row, do nothing
-      if (vetoMode == 1 && nAcceptSeq >= vetoCount) return false;
+      // If we already have m_accepted 'm_vetoCount' emissions in a row, do nothing
+      if (m_vetoMode == 1 && m_nAcceptSeq >= m_vetoCount) return false;
       
       // Pythia radiator after, emitted and recoiler after.
       int iRadAft = -1, iEmt = -1, iRecAft = -1;
@@ -366,30 +366,30 @@ namespace Pythia8{
         exit(1);
       }
       
-      // pTemtMode == 0: pT of emitted w.r.t. radiator
-      // pTemtMode == 1: min(pT of emitted w.r.t. all incoming/outgoing)
-      // pTemtMode == 2: min(pT of all outgoing w.r.t. all incoming/outgoing)
-      int xSR      = (pTemtMode == 0) ? 0       : -1;
-      int i        = (pTemtMode == 0) ? iRadAft : -1;
-      int j        = (pTemtMode != 2) ? iEmt    : -1;
+      // m_pTemtMode == 0: pT of emitted w.r.t. radiator
+      // m_pTemtMode == 1: min(pT of emitted w.r.t. all incoming/outgoing)
+      // m_pTemtMode == 2: min(pT of all outgoing w.r.t. all incoming/outgoing)
+      int xSR      = (m_pTemtMode == 0) ? 0       : -1;
+      int i        = (m_pTemtMode == 0) ? iRadAft : -1;
+      int j        = (m_pTemtMode != 2) ? iEmt    : -1;
       int k        = -1;
-      int r        = (pTemtMode == 0) ? iRecAft : -1;
+      int r        = (m_pTemtMode == 0) ? iRecAft : -1;
       double pTemt = pTcalc(e, i, j, k, r, xSR);
       
 #ifdef DBGOUTPUT
       cout << "doVetoISREmission: pTemt = " << pTemt << endl << endl;
 #endif
       
-      // Veto if pTemt > pThard
-      if (pTemt > pThard) {
-        nAcceptSeq = 0;
-        nISRveto++;
+      // Veto if pTemt > m_pThard
+      if (pTemt > m_pThard) {
+        m_nAcceptSeq = 0;
+        m_nISRveto++;
         return true;
       }
       
-      // Else mark that an emission has been accepted and continue
-      nAcceptSeq++;
-      accepted = true;
+      // Else mark that an emission has been m_accepted and continue
+      m_nAcceptSeq++;
+      m_accepted = true;
       return false;
     }
     
@@ -397,13 +397,13 @@ namespace Pythia8{
     
     // FSR veto
     
-    bool canVetoFSREmission() { return (vetoMode == 0) ? false : true; }
+    bool canVetoFSREmission() { return (m_vetoMode == 0) ? false : true; }
     bool doVetoFSREmission(int, const Event &e, int iSys, bool) {
       // Must be radiation from the hard system
       if (iSys != 0) return false;
       
-      // If we already have accepted 'vetoCount' emissions in a row, do nothing
-      if (vetoMode == 1 && nAcceptSeq >= vetoCount) return false;
+      // If we already have m_accepted 'm_vetoCount' emissions in a row, do nothing
+      if (m_vetoMode == 1 && m_nAcceptSeq >= m_vetoCount) return false;
       
       // Pythia radiator (before and after), emitted and recoiler (after)
       int iRecAft = e.size() - 1;
@@ -417,37 +417,37 @@ namespace Pythia8{
         exit(1);
       }
       
-      // Behaviour based on pTemtMode:
+      // Behaviour based on m_pTemtMode:
       //  0 - pT of emitted w.r.t. radiator before
       //  1 - min(pT of emitted w.r.t. all incoming/outgoing)
       //  2 - min(pT of all outgoing w.r.t. all incoming/outgoing)
-      int xSR = (pTemtMode == 0) ? 1       : -1;
-      int i   = (pTemtMode == 0) ? iRadBef : -1;
-      int k   = (pTemtMode == 0) ? iRadAft : -1;
-      int r   = (pTemtMode == 0) ? iRecAft : -1;
+      int xSR = (m_pTemtMode == 0) ? 1       : -1;
+      int i   = (m_pTemtMode == 0) ? iRadBef : -1;
+      int k   = (m_pTemtMode == 0) ? iRadAft : -1;
+      int r   = (m_pTemtMode == 0) ? iRecAft : -1;
       
-      // When pTemtMode is 0 or 1, iEmt has been selected
+      // When m_pTemtMode is 0 or 1, iEmt has been selected
       double pTemt = 0.;
-      if (pTemtMode == 0 || pTemtMode == 1) {
-        // Which parton is emitted, based on emittedMode:
+      if (m_pTemtMode == 0 || m_pTemtMode == 1) {
+        // Which parton is emitted, based on m_emittedMode:
         //  0 - Pythia definition of emitted
         //  1 - Pythia definition of radiated after emission
         //  2 - Random selection of emitted or radiated after emission
         //  3 - Try both emitted and radiated after emission
         int j = iRadAft;
-        if (emittedMode == 0 || (emittedMode == 2 && rndmPtr->flat() < 0.5)) j++;
+        if (m_emittedMode == 0 || (m_emittedMode == 2 && rndmPtr->flat() < 0.5)) j++;
         
         for (int jLoop = 0; jLoop < 2; jLoop++) {
           if      (jLoop == 0) pTemt = pTcalc(e, i, j, k, r, xSR);
           else if (jLoop == 1) pTemt = min(pTemt, pTcalc(e, i, j, k, r, xSR));
           
-          // For emittedMode == 3, have tried iRadAft, now try iEmt
-          if (emittedMode != 3) break;
+          // For m_emittedMode == 3, have tried iRadAft, now try iEmt
+          if (m_emittedMode != 3) break;
           if (k != -1) swap(j, k); else j = iEmt;
         }
         
-        // If pTemtMode is 2, then try all final-state partons as emitted
-      } else if (pTemtMode == 2) {
+        // If m_pTemtMode is 2, then try all final-state partons as emitted
+      } else if (m_pTemtMode == 2) {
         pTemt = pTcalc(e, i, -1, k, r, xSR);
         
       }
@@ -456,16 +456,16 @@ namespace Pythia8{
       cout << "doVetoFSREmission: pTemt = " << pTemt << endl << endl;
 #endif
       
-      // Veto if pTemt > pThard
-      if (pTemt > pThard) {
-        nAcceptSeq = 0;
-        nFSRveto++;
+      // Veto if pTemt > m_pThard
+      if (pTemt > m_pThard) {
+        m_nAcceptSeq = 0;
+        m_nFSRveto++;
         return true;
       }
       
-      // Else mark that an emission has been accepted and continue
-      nAcceptSeq++;
-      accepted = true;
+      // Else mark that an emission has been m_accepted and continue
+      m_nAcceptSeq++;
+      m_accepted = true;
       return false;
     }
     
@@ -473,13 +473,13 @@ namespace Pythia8{
     
     // MPI veto
     
-    bool canVetoMPIEmission() { return (MPIvetoMode == 0) ? false : true; }
+    bool canVetoMPIEmission() { return (m_MPIvetoMode == 0) ? false : true; }
     bool doVetoMPIEmission(int, const Event &e) {
-      if (MPIvetoMode == 1) {
-        if (e[e.size() - 1].pT() > pTMPI) {
+      if (m_MPIvetoMode == 1) {
+        if (e[e.size() - 1].pT() > m_pTMPI) {
 #ifdef DBGOUTPUT
           cout << "doVetoMPIEmission: pTnow = " << e[e.size() - 1].pT()
-          << ", pTMPI = " << pTMPI << endl << endl;
+          << ", m_pTMPI = " << m_pTMPI << endl << endl;
 #endif
           return true;
         }
@@ -491,8 +491,8 @@ namespace Pythia8{
     
     // Functions to return information
     
-    int    getNISRveto() { return nISRveto; }
-    int    getNFSRveto() { return nFSRveto; }
+    int    getNISRveto() { return m_nISRveto; }
+    int    getNFSRveto() { return m_nFSRveto; }
     
   private:
     
@@ -500,14 +500,14 @@ namespace Pythia8{
     Pythia8_UserHooks::UserSetting<int> m_pTHardMode;
     Pythia8_UserHooks::UserSetting<int> m_pTDefMode;
     
-    int  vetoMode, vetoCount, pTemtMode,
-    emittedMode, MPIvetoMode;
-    double pThard, pTMPI;
-    bool   accepted;
-    // The number of accepted emissions (in a row)
-    int nAcceptSeq;
+    int  m_vetoMode, m_vetoCount, m_pTemtMode,
+    m_emittedMode, m_MPIvetoMode;
+    double m_pThard, m_pTMPI;
+    bool   m_accepted;
+    // The number of m_accepted emissions (in a row)
+    int m_nAcceptSeq;
     // Statistics on vetos
-    unsigned long int nISRveto, nFSRveto;
+    unsigned long int m_nISRveto, m_nFSRveto;
     
   };
 }
diff --git a/Generators/Pythia8_i/src/UserHooksFactory.cxx b/Generators/Pythia8_i/src/UserHooksFactory.cxx
index 1bddd3c8c27a4c8cd01185cec346cf1aa4793d62..6fef4bac8d73ed802b58a88ac98f0023e7909d2b 100644
--- a/Generators/Pythia8_i/src/UserHooksFactory.cxx
+++ b/Generators/Pythia8_i/src/UserHooksFactory.cxx
@@ -9,7 +9,7 @@
 namespace Pythia8_UserHooks{
  
   UserHooks *UserHooksFactory::create(const string &name){
-    map<string, const ICreator*>::const_iterator it = s_creators().find(name);
+    std::map<string, const ICreator*>::const_iterator it = s_creators().find(name);
     if(it == s_creators().end()){
       //eek!
       throw std::runtime_error("Pythia 8 UserHooksFactory: cannot create user hook " + name);
@@ -18,8 +18,8 @@ namespace Pythia8_UserHooks{
   }
  
   ///static function to instantiate map of string name Vs. creator object on first use
-  map<string, const UserHooksFactory::ICreator*> &UserHooksFactory::s_creators(){
-    static map<string, const UserHooksFactory::ICreator*> creators;
+  std::map<string, const UserHooksFactory::ICreator*> &UserHooksFactory::s_creators(){
+    static std::map<string, const UserHooksFactory::ICreator*> creators;
     return creators;
   }
   
diff --git a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx
index f9fb4b72e4deda984cb8e34f2e86914d65039051..c23d6288e5c156343a197f7d43b6759bf9bb78ba 100644
--- a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx
+++ b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx
@@ -36,9 +36,9 @@ namespace Pythia8 {
   public:
     //Constructor.
     Sigma2qqbar2emu()
-    : lambdaCoup(0.), sigmaTemp(0.), m_stop(0.),
-    lambdaSqddbar(0.), lambdaSqdsbar(0.), lambdaSqsdbar(0.), lambdaSqssbar(0.),
-    Nc(0), myRand(0) 
+    : m_lambdaCoup(0.), m_sigmaTemp(0.), m_stop(0.),
+    m_lambdaSqddbar(0.), m_lambdaSqdsbar(0.), m_lambdaSqsdbar(0.), m_lambdaSqssbar(0.),
+    m_Nc(0), m_myRand(0) 
     {}
     
     
@@ -46,14 +46,14 @@ namespace Pythia8 {
     void initProc() {
       
       // Store parameters.
-      lambdaCoup = 0.2;
-      Nc = 3;
+      m_lambdaCoup = 0.2;
+      m_Nc = 3;
       m_stop = particleDataPtr->m0(1000006);   //95.5;
-      lambdaSqddbar = 0.065;
-      lambdaSqdsbar = 3.8e-5;
-      lambdaSqsdbar = 3.8e-5;
-      lambdaSqssbar = 0.065;
-      myRand = new Rndm(1234567);
+      m_lambdaSqddbar = 0.065;
+      m_lambdaSqdsbar = 3.8e-5;
+      m_lambdaSqsdbar = 3.8e-5;
+      m_lambdaSqssbar = 0.065;
+      m_myRand = new Rndm(1234567);
       
       return;
     } 
@@ -64,7 +64,7 @@ namespace Pythia8 {
     void sigmaKin() {
       
       // The 2 out front is for e- mu+ plus e+ mu -
-      sigmaTemp = 2./((float)Nc * 64. * M_PI);
+      m_sigmaTemp = 2./((float)m_Nc * 64. * M_PI);
       
       return;
     }
@@ -75,11 +75,11 @@ namespace Pythia8 {
     double sigmaHat() {
       
       double lambdaSq = 0.;
-      if((id1 == 1 && id2 == -1) || (id1 == -1 && id2 == 1)) lambdaSq = lambdaSqddbar;
-      else if((id1 == 1 && id2 == -3) || (id1 == -3 && id2 == 1)) lambdaSq = lambdaSqdsbar;
-      else if((id1 == 3 && id2 == -1) || (id1 == -1 && id2 == 3)) lambdaSq = lambdaSqsdbar;
-      else if((id1 == 3 && id2 == -3) || (id1 == -3 && id2 == 3)) lambdaSq = lambdaSqssbar;
-      double sigma = pow2(lambdaSq)*sigmaTemp*tH2/(sH2*pow2(tH-pow2(m_stop)));
+      if((id1 == 1 && id2 == -1) || (id1 == -1 && id2 == 1)) lambdaSq = m_lambdaSqddbar;
+      else if((id1 == 1 && id2 == -3) || (id1 == -3 && id2 == 1)) lambdaSq = m_lambdaSqdsbar;
+      else if((id1 == 3 && id2 == -1) || (id1 == -1 && id2 == 3)) lambdaSq = m_lambdaSqsdbar;
+      else if((id1 == 3 && id2 == -3) || (id1 == -3 && id2 == 3)) lambdaSq = m_lambdaSqssbar;
+      double sigma = pow2(lambdaSq)*m_sigmaTemp*tH2/(sH2*pow2(tH-pow2(m_stop)));
       return sigma;
     }
     
@@ -90,7 +90,7 @@ namespace Pythia8 {
     void setIdColAcol() {
       
       // Flavours.
-      double x = myRand->flat();
+      double x = m_myRand->flat();
       if(x < 0.5) setId( id1, id2, 11, -13);
       else setId( id1, id2, -11, 13);
       
@@ -118,10 +118,10 @@ namespace Pythia8 {
   private:
     
     // Parameters set at initialization or for current kinematics.
-    double lambdaCoup, sigmaTemp, m_stop;
-    double lambdaSqddbar, lambdaSqdsbar, lambdaSqsdbar, lambdaSqssbar;
-    int Nc;
-    Rndm* myRand;
+    double m_lambdaCoup, m_sigmaTemp, m_stop;
+    double m_lambdaSqddbar, m_lambdaSqdsbar, m_lambdaSqsdbar, m_lambdaSqssbar;
+    int m_Nc;
+    Rndm* m_myRand;
   
   };
 }