diff --git a/Generators/HepMCWeightSvc/src/HepMCWeightSvc.cxx b/Generators/HepMCWeightSvc/src/HepMCWeightSvc.cxx
index 1e667e3ba81f2078d50a98bf5427c6101447ee07..41ab570322e8d8c2e727c1a7eecc998277db5608 100644
--- a/Generators/HepMCWeightSvc/src/HepMCWeightSvc.cxx
+++ b/Generators/HepMCWeightSvc/src/HepMCWeightSvc.cxx
@@ -70,8 +70,13 @@ HepMCWeightSvc::setWeightNames (const WeightMap& weightNames,
   // Store as strings ... when read back in we use a gaudi parser to parse the list
   myAttributes.extend("HepMCWeightNames","string");
   myAttributes.extend("HepMCWeightSvcVersion","int");
+
+#ifdef HEPMC3
+  myAttributes["HepMCWeightSvcVersion"].data<int>() = 3;
+#else
   myAttributes["HepMCWeightSvcVersion"].data<int>() = 2;
-      
+#endif
+
   std::string stringToStore = Gaudi::Utils::toString( weightNames );
 
   myAttributes["HepMCWeightNames"].data<std::string>() = stringToStore;