diff --git a/Gaudi/cmt/requirements b/Gaudi/cmt/requirements
index af951a1d64d9db3e7525c9cc9da33de4210e05b0..daca50c2f740ae35ea8eac7a07ae71f3794affee 100644
--- a/Gaudi/cmt/requirements
+++ b/Gaudi/cmt/requirements
@@ -1,6 +1,6 @@
 package Gaudi
 
-version v22r0
+version v22r2
 branches doc cmt
 
 use GaudiSys *
diff --git a/Gaudi/cmt/version.cmt b/Gaudi/cmt/version.cmt
index d051926d3c222bc5e3f6ccd33633eb60bd6e5c3f..0f410c083713d4a6ed25d24c800ecb418fd6c1f5 100644
--- a/Gaudi/cmt/version.cmt
+++ b/Gaudi/cmt/version.cmt
@@ -1 +1 @@
-v22r0
+v22r2
diff --git a/Gaudi/doc/release.notes b/Gaudi/doc/release.notes
index 14adcac9232704dcffdead423df02e0858662d69..54b7cdd2b53d8bc5359474988f240594ef418605 100644
--- a/Gaudi/doc/release.notes
+++ b/Gaudi/doc/release.notes
@@ -1,6 +1,8 @@
 Package : Gaudi
 Package manager : Marco Clemencic
 
+================================ Gaudi v22r2 =================================
+================================ Gaudi v22r1 =================================
 ================================ Gaudi v22r0 =================================
 ! 2010-12-17 - Eoin Smith
  - Updated gaudirun.py and python/Gaudi/Main.py for multicore execution
diff --git a/GaudiAlg/cmt/requirements b/GaudiAlg/cmt/requirements
old mode 100755
new mode 100644
index 6a3d4fc889f9cea13f07ccf9f700adf3263b85d6..c6024f29160f8c964ed9cd0463f98f3e7ada0e3c
--- a/GaudiAlg/cmt/requirements
+++ b/GaudiAlg/cmt/requirements
@@ -1,18 +1,18 @@
-# $Id: requirements,v 1.73 2008/11/10 18:48:45 marcocle Exp $ 
+# $Id: requirements,v 1.73 2008/11/10 18:48:45 marcocle Exp $
 # =============================================================================
 package GaudiAlg
-version v13r5
+version v13r7
 
-# ============== structure ====================================================	
+# ============== structure ====================================================
 branches        GaudiAlg src cmt doc
 
 # ============== dependencies =================================================
-use             GaudiKernel * 
-use             GaudiUtils  * 
+use             GaudiKernel *
+use             GaudiUtils  *
 use		ROOT	    * LCG_Interfaces
 use             AIDA        * LCG_Interfaces -no_auto_imports
 use             Boost       * LCG_Interfaces -no_auto_imports
- 
+
 # ============== own includes =================================================
 apply_pattern install_more_includes more="GaudiAlg"
 # ============== constituents =================================================
@@ -22,13 +22,3 @@ library         GaudiAlg    components/*.cpp -import=AIDA -no_static
 # ============== patterns =====================================================
 apply_pattern   linker_library    library="GaudiAlgLib"
 apply_pattern   component_library library="GaudiAlg"
-
-private
-##############################################################################
-# Intel compiler support
-### Disable some non interesting "remarks" (inspired by CoolKernel)
-# Non permanent
-#  - warning #1125:  function "C::X()" is hidden by "Y::X" -- virtual function override intended?
-#                    (coming from ISequencerTimerTool methods start, stop and name)
-macro_append cppflags '' no-hide-warnings '' target-icc '-wd1125 '
-end_private
diff --git a/GaudiAlg/doc/release.notes b/GaudiAlg/doc/release.notes
index 94cdd1830288642dd3d30c4a3c14ea189dfd0350..e53673eec3e360b700c42509e0ccf48d8e8d8eb4 100644
--- a/GaudiAlg/doc/release.notes
+++ b/GaudiAlg/doc/release.notes
@@ -1,6 +1,24 @@
 Package: GaudiAlg
 Package manager : Marco Clemencic
 
+=============================== GaudiAlg v13r7 ===============================
+! 2011-04-15 - Marco Clemencic
+ - Patch #4814: Move EventNodeKiller algorithm from LHCb to Gaudi.
+   Imported EventNodeKiller.{h,cpp} from
+     svn+ssh://svn.cern.ch/reps/lhcb/LHCb/trunk/Kernel/LHCbAlgs/src
+   Modified the imported files to avoid generating debug messages if they are
+   not going to be printed.
+
+! 2011-03-02 - Patrick Koppenburg
+ - Patch #4711: fixed doxygen comment
+
+=============================== GaudiAlg v13r6 ===============================
+! 2011-02-18 - Marco Clemencic
+ - Fixed icc warnings.
+
+! 2011-02-01 - Marco Clemencic
+ - Fixed a configuration problem with icc on i686.
+
 =============================== GaudiAlg v13r5 ===============================
 ! 2011-01-11 - Marco Clemencic
  - Fixed some ICC remarks.
diff --git a/GaudiAlg/src/components/EventNodeKiller.cpp b/GaudiAlg/src/components/EventNodeKiller.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3f2a77ee0676ec5a8dac947e97ee0b3470181363
--- /dev/null
+++ b/GaudiAlg/src/components/EventNodeKiller.cpp
@@ -0,0 +1,49 @@
+// $Id: EventNodeKiller.cpp,v 1.4 2008-11-13 07:37:33 cattanem Exp $
+// Include files
+
+// from Gaudi
+#include "GaudiKernel/AlgFactory.h"
+
+// local
+#include "EventNodeKiller.h"
+
+//-----------------------------------------------------------------------------
+// Implementation file for class : EventNodeKiller
+//
+// 2005-07-14 : Marco Cattaneo
+//-----------------------------------------------------------------------------
+
+// Declaration of the Algorithm Factory
+DECLARE_ALGORITHM_FACTORY( EventNodeKiller )
+
+
+//=============================================================================
+// Standard constructor, initializes variables
+//=============================================================================
+EventNodeKiller::EventNodeKiller( const std::string& name,
+                                  ISvcLocator* pSvcLocator)
+  : GaudiAlgorithm ( name , pSvcLocator )
+{
+  declareProperty( "Nodes", m_nodes );
+}
+//=============================================================================
+// Destructor
+//=============================================================================
+EventNodeKiller::~EventNodeKiller() {}
+
+//=============================================================================
+// Main execution
+//=============================================================================
+StatusCode EventNodeKiller::execute() {
+
+  if (msgLevel() <= MSG::DEBUG) debug() << "==> Execute" << endmsg;
+
+  std::vector<std::string>::iterator itS;
+  for( itS=m_nodes.begin(); itS != m_nodes.end(); itS++ ) {
+    if (msgLevel() <= MSG::DEBUG) debug() << "Killing node " << *itS << endmsg;
+    eventSvc()->unlinkObject( *itS ).ignore();
+  }
+
+  return StatusCode::SUCCESS;
+}
+//=============================================================================
diff --git a/GaudiAlg/src/components/EventNodeKiller.h b/GaudiAlg/src/components/EventNodeKiller.h
new file mode 100644
index 0000000000000000000000000000000000000000..70ceb48b4fe8cb2f9ab30c2a23546d9d44c5bc77
--- /dev/null
+++ b/GaudiAlg/src/components/EventNodeKiller.h
@@ -0,0 +1,32 @@
+// $Id: EventNodeKiller.h,v 1.1 2005-07-15 16:41:41 cattanem Exp $
+#ifndef EVENTNODEKILLER_H 
+#define EVENTNODEKILLER_H 1
+
+// Include files
+// from Gaudi
+#include "GaudiAlg/GaudiAlgorithm.h"
+#include <vector>
+#include <string>
+
+/** @class EventNodeKiller EventNodeKiller.h
+ *  Algorithm to kill nodes in the event data store. Useful if you want to
+ *  make the application "forget" about the previous history of the input file
+ *
+ *  @author Marco Cattaneo
+ *  @date   2005-07-14
+ */
+class EventNodeKiller : public GaudiAlgorithm {
+public: 
+  /// Standard constructor
+  EventNodeKiller( const std::string& name, ISvcLocator* pSvcLocator );
+
+  virtual ~EventNodeKiller( ); ///< Destructor
+
+  virtual StatusCode execute   ();    ///< Algorithm execution
+
+protected:
+
+private:
+  std::vector<std::string> m_nodes; ///< String property "Nodes"
+};
+#endif // EVENTNODEKILLER_H
diff --git a/GaudiAlg/src/components/SequencerTimerTool.h b/GaudiAlg/src/components/SequencerTimerTool.h
index d917d54673ae9840cd641ae267b5d89a0967a210..e9b6557543579173919889024872075329e0f60f 100644
--- a/GaudiAlg/src/components/SequencerTimerTool.h
+++ b/GaudiAlg/src/components/SequencerTimerTool.h
@@ -1,5 +1,5 @@
 // $Id: SequencerTimerTool.h,v 1.7 2005/07/29 16:49:43 hmd Exp $
-#ifndef SEQUENCERTIMERTOOL_H 
+#ifndef SEQUENCERTIMERTOOL_H
 #define SEQUENCERTIMERTOOL_H 1
 
 // Include files
@@ -17,24 +17,24 @@
  *  The width of the timing table column printing the algorithm name
  *  is 30 by default. That can be changed via
  *  \verbatim
-TimingAuditor().addTool(SequencerTimerTool("TIMER"))
-TimingAuditor().TIMER.ColumnWidth = 50 \endverbatim
+TimingAuditor().addTool(SequencerTimerTool, name = "TIMER")
+TimingAuditor().TIMER.NameSize = 50 \endverbatim
  *
  *  @author Olivier Callot
  *  @date   2004-05-19
  */
 
 class SequencerTimerTool : public GaudiTool, virtual public ISequencerTimerTool{
-public: 
+public:
 
  /// Standard constructor
-  SequencerTimerTool( const std::string& type, 
+  SequencerTimerTool( const std::string& type,
                       const std::string& name,
                       const IInterface* parent);
 
   virtual ~SequencerTimerTool( ); ///< Destructor
 
-  /** initialize method, to compute the normalisation factor **/
+  /** initialize method, to compute the normalization factor **/
   virtual StatusCode initialize();
 
   /** finalize method, to print the time summary table **/
@@ -50,7 +50,7 @@ public:
     std::string space( m_headerSize, ' ' );
     myName += name + space ;
     myName = myName.substr( 0, m_headerSize );
-    
+
     m_timerList.push_back( TimerForSequencer(myName, m_normFactor) );
     return m_timerList.size() -1;
   };
@@ -58,22 +58,25 @@ public:
   /** Increase the indentation of the name **/
   virtual void increaseIndent()    { m_indent += 2; };
 
-  /** Decrease the indentation fo the name **/
-  virtual void decreaseIndent()    { 
-    m_indent -= 2; 
-    if ( 0 > m_indent ) m_indent = 0; 
+  /** Decrease the indentation of the name **/
+  virtual void decreaseIndent()    {
+    m_indent -= 2;
+    if ( 0 > m_indent ) m_indent = 0;
   };
 
+  using ISequencerTimerTool::start;
   /** start the counter, i.e. register the current time **/
   void start( int index )  {   m_timerList[index].start();  };
 
+  using ISequencerTimerTool::stop;
   /** stop the counter, return the elapsed time **/
   double stop( int index )  {   return m_timerList[index].stop();  };
- 
+
   /** returns the last time **/
   double lastTime( int index )  {   return m_timerList[index].lastTime();  };
 
- /** returns the name of the counter **/
+  using ISequencerTimerTool::name;
+  /** returns the name of the counter **/
   std::string name( int index )  {   return m_timerList[index].name();  };
 
   /** returns the index of the counter with that name, or -1 **/
@@ -85,7 +88,7 @@ public:
 protected:
 
 private:
-  int m_shots;       ///< Number of shots for CPU normalisation
+  int m_shots;       ///< Number of shots for CPU normalization
   bool m_normalised; ///< Is the time scaled to a nominal PIII ?
   int m_indent;      ///< Amount of indentation
   std::vector<TimerForSequencer> m_timerList;
diff --git a/GaudiAud/cmt/requirements b/GaudiAud/cmt/requirements
index ba9894df4715511ae0695c911f6fbeb0248dc414..07ecb85c48b747557b255c2860528d398ba0c574 100755
--- a/GaudiAud/cmt/requirements
+++ b/GaudiAud/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiAud
-version v9r3
+version v9r4
 
 branches doc src cmt
 
diff --git a/GaudiAud/doc/release.notes b/GaudiAud/doc/release.notes
index 24f5a8c586ad07a9db1294264dc6e15de5ce2fb1..34cd43a5e6071768b2c5505d2689de2563b1db10 100755
--- a/GaudiAud/doc/release.notes
+++ b/GaudiAud/doc/release.notes
@@ -1,6 +1,21 @@
 Package: GaudiAud
 Package manager : David Quarrie, Marco Clemencic
 
+=============================== GaudiAud v9r4 ================================
+! 2011-04-15 - Marco Clemencic
+ - Synchronized with patch #4820.
+
+! 2011-03-30 - Marco Clemencic
+ - Fixed a bug in the properties of CommonAuditor.
+
+! 2011-03-29 - Marco Clemencic
+ - Fixed a bug in the logic of CommonAuditor::i_auditEventType.
+
+! 2011-03-23 - Marco Clemencic
+ - Fixed bug #79627: ChronoAuditor broken for start/stop event types
+   Moved common code to a common base class CommonAuditor, sharing as much as
+   possible the code among auditor implementations.
+
 =============================== GaudiAud v9r3 ================================
 ! 2010-04-20 - Marco Clemencic
  - Removed ICC warnings and remarks.
@@ -34,7 +49,7 @@ Package manager : David Quarrie, Marco Clemencic
  - Patch #2790: Rename the namespace MSG to Msg
 
 ! 2009-01-30 - Marco Clemencic
- - Replaced all the occurrences of endreq with endmsg. 
+ - Replaced all the occurrences of endreq with endmsg.
 
 ! 2009-01-22 - Marco Clemencic
  - Adapted to the new IInterface functionalities (see GaudiKernel release.notes)
@@ -68,7 +83,7 @@ Package manager : David Quarrie, Marco Clemencic
  - bug #28570.
    Modified AlgContextAuditor to avoid that it passes a null pointer to
    AlgContextSvc. It happens if the AuditorSvc is auditing objects that inherit
-   from INamedInterface, but not from IAlgorithm (e.g. services).  
+   from INamedInterface, but not from IAlgorithm (e.g. services).
 
 ! 2007-11-13 - Marco Clemencic
  - Added a test to expose bug #28570.
@@ -76,7 +91,7 @@ Package manager : David Quarrie, Marco Clemencic
 !==============v8r3==========================================================
 ! 2007-08-06 - Vanya Belyaev
  - patch #1231. Added explicit include IChronoStatSvc.h in MemStatAuditor.cpp
-   
+
 !==============v8r2==========================================================
 ! 2007-05-24 - Vanya Belyaev
  - patch #1171. The enhancement of existing Algorithm Context Service
@@ -99,13 +114,13 @@ Package manager : David Quarrie, Marco Clemencic
 
 !==============v8r1==========================================================
 ! 2007-01-18 - Charles Leggett
- patch #972. 
+ patch #972.
  - add messageCount to IMessageSvc
  - extend Auditor::(sys)afterExecute to pass a const StatusCode&,
    which is the return code of the algorithm
  - new auditor to monitor algorithms, issue message if algorithm
    writes out an ERROR or FATAL, but returns SUCCESS
-	
+
 !==============v8r0==========================================================
 ! 2007-01-12 - Hubert Degaudenzi
  - bug #22799. changed the return value of chronoStart, chronoStop,
@@ -169,7 +184,7 @@ Package manager : David Quarrie, Marco Clemencic
 ! 2002-09-24 - Pere Mato
  - Changes to clean the reference counting and memory deallocation
    detected by the "valgrind" tool. Changed failes: ChronoAuditor.cpp (.h)
- - requirements: use v* 
+ - requirements: use v*
 
 !==============v6r0p1=========================================================
 ! 2002-09-23 - Flr
diff --git a/GaudiAud/src/AlgContextAuditor.cpp b/GaudiAud/src/AlgContextAuditor.cpp
index ce4ae96dcb276cf48e01b8e81406f6478ac5c556..2921225254b23a9bd0454c63a5e00eda6c4c3bef 100644
--- a/GaudiAud/src/AlgContextAuditor.cpp
+++ b/GaudiAud/src/AlgContextAuditor.cpp
@@ -1,42 +1,13 @@
-// $Id: AlgContextAuditor.cpp,v 1.4 2007/11/13 12:53:54 marcocle Exp $
-// ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.4 $
-// ============================================================================
-// $Log: AlgContextAuditor.cpp,v $
-// Revision 1.4  2007/11/13 12:53:54  marcocle
-// Charles Leggett
-//  - bug #28570.
-//    Modified AlgContextAuditor to avoid that it passes a null pointer to
-//    AlgContextSvc. It happens if the AuditorSvc is auditing objects that inherit
-//    from INamedInterface, but not from IAlgorithm (e.g. services).
-//
-// Revision 1.3  2007/05/24 13:49:20  hmd
-// ( Vanya Belyaev) patch #1171. The enhancement of existing Algorithm Context Service
-//    is the primary goal of the proposed patch. The existing
-//    AlgContextSvc is not safe with respect to e.g. Data-On-Demand
-//    service or to operations with subalgorithms. The patched service
-//    essentially implements the queue of executing algorithms, thus the
-//    problems are eliminiated. In addition the enriched interface
-//    provides the access to the whole queue of executing algorithms.
-//
-// ============================================================================
-// Incldue files
-// ============================================================================
-// STD & STL
-// ============================================================================
 #include <cassert>
-// ============================================================================
-// GaudiKernel
-// ============================================================================
+
 #include "GaudiKernel/IAlgContextSvc.h"
 #include "GaudiKernel/IAlgorithm.h"
 #include "GaudiKernel/AudFactory.h"
 #include "GaudiKernel/SmartIF.h"
 #include "GaudiKernel/MsgStream.h"
-// ============================================================================
-// local
-// ============================================================================
+
 #include "AlgContextAuditor.h"
+
 // ============================================================================
 /** @file
  *  Implementation file for class AlgContexAuditor
@@ -49,9 +20,9 @@ namespace
   /** make a safe cast using "smart interface"
    *  @see  INamedInterface
    *  @see  IAlgorithm
-   *  @see   SmartIF
-   *  @see   IInterface::queryInterface
-   *  @param  i pointer to INamedInterface
+   *  @see  SmartIF
+   *  @see  IInterface::queryInterface
+   *  @param  ni pointer to INamedInterface
    *  @return pointer to IAlgorithm
    */
   inline IAlgorithm* toAlg ( IInterface* ni )
@@ -62,7 +33,7 @@ namespace
   }
 }
 // ============================================================================
-// mandatory auditor fatcory, needed for instantiation
+// mandatory auditor factory, needed for instantiation
 // ============================================================================
 DECLARE_AUDITOR_FACTORY(AlgContextAuditor)
 // ============================================================================
diff --git a/GaudiAud/src/AlgContextAuditor.h b/GaudiAud/src/AlgContextAuditor.h
index 19525eaf6ce4a4bb305da2439c52120977d63acf..a7afe316bed3e2667feb6d7cbcfd6a6098e7d3a9 100644
--- a/GaudiAud/src/AlgContextAuditor.h
+++ b/GaudiAud/src/AlgContextAuditor.h
@@ -1,18 +1,3 @@
-// $Id: AlgContextAuditor.h,v 1.4 2007/05/24 13:49:20 hmd Exp $
-// ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.4 $
-// ============================================================================
-// $Log: AlgContextAuditor.h,v $
-// Revision 1.4  2007/05/24 13:49:20  hmd
-// ( Vanya Belyaev) patch #1171. The enhancement of existing Algorithm Context Service
-//    is the primary goal of the proposed patch. The existing
-//    AlgContextSvc is not safe with respect to e.g. Data-On-Demand
-//    service or to operations with subalgorithms. The patched service
-//    essentially implements the queue of executing algorithms, thus the
-//    problems are eliminiated. In addition the enriched interface
-//    provides the access to the whole queue of executing algorithms.
-//
-// ============================================================================
 #ifndef GAUDIAUD_ALGCONTEXTAUDITOR_H
 #define GAUDIAUD_ALGCONTEXTAUDITOR_H
 // ============================================================================
@@ -29,7 +14,7 @@
 class IAlgContextSvc  ;
 // ============================================================================
 /** @class AlgContextAuditor
- *  Description:  Rergister/Unregister the AlgContext of each
+ *  Description:  Register/Unregister the AlgContext of each
  *  algorithm before entering the algorithm and after leaving it
  *  @author M. Shapiro, LBNL
  *  @author modified by Vanya BELYAEV ibelyaev@physics.syr.edu
@@ -53,22 +38,22 @@ public:
   AlgContextAuditor
   ( const std::string& name ,
     ISvcLocator*       pSvc ) ;
-  /// virtual desctrutor
+  /// virtual destructor
   virtual ~AlgContextAuditor    () ;
   /// standard initialization, @see IAuditor
   virtual StatusCode initialize () ;
   /// standard finalization, @see IAuditor
   virtual StatusCode finalize   () ;
 private:
-  // the default constructor is disabled
-  AlgContextAuditor () ; ///< no default constructor
-  // copy constructor is disabled
-  AlgContextAuditor ( const AlgContextAuditor& ) ; ///< no copy constructor
-  // assigenement operator is disabled
-  AlgContextAuditor& operator=( const AlgContextAuditor& ) ; ///< no assignement
+  /// the default constructor is disabled
+  AlgContextAuditor () ;
+  /// copy constructor is disabled
+  AlgContextAuditor ( const AlgContextAuditor& ) ;
+  /// assignment operator is disabled
+  AlgContextAuditor& operator=( const AlgContextAuditor& ) ;
 private:
-  // the pointer to Algorithm Context Service
-  IAlgContextSvc* m_svc ; ///< the pointer to Algorithm Context Service
+  /// the pointer to Algorithm Context Service
+  IAlgContextSvc* m_svc ;
 } ;
 
 // ============================================================================
diff --git a/GaudiAud/src/AlgErrorAuditor.cpp b/GaudiAud/src/AlgErrorAuditor.cpp
index 54dca22c5a93b0e8fe142582494fddd78912e69e..0ac6dc7f77475af3481b28c889dd9b261d2f3348 100644
--- a/GaudiAud/src/AlgErrorAuditor.cpp
+++ b/GaudiAud/src/AlgErrorAuditor.cpp
@@ -1,6 +1,3 @@
-// AlgErrorAuditor:
-//  An auditor that monitors memory usage
-
 #include "AlgErrorAuditor.h"
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/IMessageSvc.h"
diff --git a/GaudiAud/src/ChronoAuditor.cpp b/GaudiAud/src/ChronoAuditor.cpp
index 2f86f3ea98a057e3950567847fc3e1cffcc81d23..d0d761e0eaa54bfdbde46d293f45c58733de11e2 100644
--- a/GaudiAud/src/ChronoAuditor.cpp
+++ b/GaudiAud/src/ChronoAuditor.cpp
@@ -1,5 +1,5 @@
 // ChronoAuditor:
-//  An auditor that monitors memory usage
+// An auditor that monitors time
 
 #ifdef __ICC
 // disable icc warning #654: overloaded virtual function "B::Y" is only partially overridden in class "C"
@@ -8,97 +8,21 @@
 #endif
 
 #include "ChronoAuditor.h"
-#include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/AudFactory.h"
-#include "GaudiKernel/IChronoStatSvc.h"
-#include "GaudiKernel/Chrono.h"
 
 DECLARE_AUDITOR_FACTORY(ChronoAuditor)
 
 ChronoAuditor::ChronoAuditor(const std::string& name, ISvcLocator* pSvcLocator)
-: Auditor(name, pSvcLocator) {
-  service( "ChronoStatSvc", m_chronoSvc, true).ignore();
-  declareProperty("CustomEventTypes",m_types);
+: CommonAuditor(name, pSvcLocator) {
+  m_chronoSvc = serviceLocator()->service("ChronoStatSvc");
 }
 
-ChronoAuditor::~ChronoAuditor(){
-  m_chronoSvc->release();
+void ChronoAuditor::i_before(CustomEventTypeRef evt, const std::string& caller)
+{
+  chronoSvc()->chronoStart(i_id(evt, caller));
 }
 
-void ChronoAuditor::beforeInitialize(INamedInterface* alg) {
-  chronoSvc( )->chronoStart( alg->name() + ":initialize" ) ;
-}
-void ChronoAuditor:: afterInitialize(INamedInterface* alg){
-  chronoSvc( )->chronoStop( alg->name() + ":initialize" ) ;
-}
-
-void ChronoAuditor::beforeReinitialize(INamedInterface* alg) {
-  chronoSvc( )->chronoStart( alg->name() + ":reinitialize" ) ;
-}
-void ChronoAuditor:: afterReinitialize(INamedInterface* alg){
-  chronoSvc( )->chronoStop( alg->name() + ":reinitialize" ) ;
-}
-
-void ChronoAuditor:: beforeExecute(INamedInterface* alg){
-  chronoSvc( )->chronoStart( alg->name() + ":execute" ) ;
-}
-void ChronoAuditor:: afterExecute(INamedInterface* alg, const StatusCode& ) {
-  chronoSvc( )->chronoStop( alg->name() + ":execute" ) ;
-}
-
-void ChronoAuditor::beforeBeginRun(INamedInterface* alg) {
-  chronoSvc( )->chronoStart( alg->name() + ":beginRun" ) ;
-}
-void ChronoAuditor:: afterBeginRun(INamedInterface* alg){
-  chronoSvc( )->chronoStop( alg->name() + ":beginRun" ) ;
-}
-void ChronoAuditor::beforeEndRun(INamedInterface* alg) {
-  chronoSvc( )->chronoStart( alg->name() + ":endRun" ) ;
-}
-void ChronoAuditor:: afterEndRun(INamedInterface* alg){
-  chronoSvc( )->chronoStop( alg->name() + ":endRun" ) ;
-}
-
-
-void ChronoAuditor:: beforeFinalize(INamedInterface* alg) {
-  chronoSvc( )->chronoStart( alg->name() + ":finalize" ) ;
-}
-void ChronoAuditor:: afterFinalize(INamedInterface* alg){
-  chronoSvc( )->chronoStop( alg->name() + ":finalize" ) ;
-}
-
-void
-ChronoAuditor::before(CustomEventTypeRef evt, const std::string& caller) {
-
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
-
-  chronoSvc( )->chronoStart( caller + ":" + evt ) ;
-
-}
-
-void
-ChronoAuditor::after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&) {
-
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
-
-  chronoSvc( )->chronoStop( caller + ":" + evt ) ;
-
+void ChronoAuditor::i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&)
+{
+  chronoSvc()->chronoStop(i_id(evt, caller));
 }
diff --git a/GaudiAud/src/ChronoAuditor.h b/GaudiAud/src/ChronoAuditor.h
index 594f85549dd4d910f628f987c0884d362df584ba..ec928f35d7b24b94cb187bf0599d8b6ffed3a373 100644
--- a/GaudiAud/src/ChronoAuditor.h
+++ b/GaudiAud/src/ChronoAuditor.h
@@ -1,40 +1,34 @@
 #ifndef GAUDIAUD_CHRONOAUDITOR_H
 #define GAUDIAUD_CHRONOAUDITOR_H
 
-#include "GaudiKernel/Auditor.h"
+#include "CommonAuditor.h"
 
-class IChronoStatSvc;
+#include "GaudiKernel/IChronoStatSvc.h"
 
 /** @class ChronoAuditor
     Monitors the cpu time usage of each algorithm
 
     @author David Quarrie
+    @author Marco Clemencic
 */
-class ChronoAuditor : virtual public Auditor {
+class ChronoAuditor : virtual public CommonAuditor {
 public:
   ChronoAuditor(const std::string& name, ISvcLocator* pSvcLocator);
-  virtual ~ChronoAuditor();
-  virtual void beforeInitialize(INamedInterface* alg);
-  virtual void afterInitialize(INamedInterface* alg);
-  virtual void beforeReinitialize(INamedInterface* alg);
-  virtual void afterReinitialize(INamedInterface* alg);
-  virtual void beforeExecute(INamedInterface* alg);
-  virtual void afterExecute(INamedInterface* alg, const StatusCode&);
-  virtual void beforeBeginRun(INamedInterface* alg);
-  virtual void afterBeginRun(INamedInterface *alg);
-  virtual void beforeEndRun(INamedInterface* alg);
-  virtual void afterEndRun(INamedInterface *alg);
-  virtual void beforeFinalize(INamedInterface* alg);
-  virtual void afterFinalize(INamedInterface* alg);
-
-  virtual void before(CustomEventTypeRef evt, const std::string& caller);
-  virtual void after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& );
-
-  IChronoStatSvc* chronoSvc( ) { return m_chronoSvc; }
+
 private:
-  IChronoStatSvc* m_chronoSvc;
-  StringArrayProperty m_types;
+  /// Default (catch-all) "before" Auditor hook
+  virtual void i_before(CustomEventTypeRef evt, const std::string& caller);
+
+  /// Default (catch-all) "after" Auditor hook
+  virtual void i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc);
+
+  /// Compute the id string to be used for the chrono entity.
+  inline std::string i_id(CustomEventTypeRef evt, const std::string& caller) {
+    return caller + ":" + evt;
+  }
 
+  SmartIF<IChronoStatSvc>& chronoSvc() { return m_chronoSvc; }
+  SmartIF<IChronoStatSvc> m_chronoSvc;
 };
 
 #endif
diff --git a/GaudiAud/src/CommonAuditor.cpp b/GaudiAud/src/CommonAuditor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7c8a2c0b4fcc3a54550d50982c689856277aed00
--- /dev/null
+++ b/GaudiAud/src/CommonAuditor.cpp
@@ -0,0 +1,50 @@
+#include "CommonAuditor.h"
+
+CommonAuditor::CommonAuditor(const std::string& name, ISvcLocator *svcloc): Auditor(name, svcloc) {
+  declareProperty("EventTypes", m_types,
+                  "List of event types to audit ([]=all, ['none']=none)");
+  declareProperty("CustomEventTypes", m_customTypes,
+                  "OBSOLETE, use EventTypes instead")->declareUpdateHandler(&CommonAuditor::i_updateCustomTypes, this);
+}
+
+CommonAuditor::~CommonAuditor() {}
+
+void CommonAuditor::i_updateCustomTypes(Property &) {
+  MsgStream log(msgSvc(), name());
+  log << MSG::WARNING << "Property CustomEventTypes is deprecated, use EventTypes instead" << endmsg;
+  m_types.setValue(m_customTypes.value());
+}
+
+void CommonAuditor::before(StandardEventType evt, INamedInterface* caller)
+{
+  if (caller) before(toStr(evt), caller->name());
+}
+void CommonAuditor::before(StandardEventType evt, const std::string& caller)
+{
+  before(toStr(evt), caller);
+}
+void CommonAuditor::before(CustomEventTypeRef evt, INamedInterface* caller)
+{
+  if (caller) before(evt, caller->name());
+}
+void CommonAuditor::before(CustomEventTypeRef evt, const std::string& caller)
+{
+  if (i_auditEventType(evt)) i_before(evt, caller);
+}
+
+void CommonAuditor::after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc)
+{
+  if (caller) after(toStr(evt), caller->name(), sc);
+}
+void CommonAuditor::after(StandardEventType evt, const std::string& caller, const StatusCode& sc)
+{
+  after(toStr(evt), caller, sc);
+}
+void CommonAuditor::after(CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc)
+{
+  if (caller) after(evt, caller->name(), sc);
+}
+void CommonAuditor::after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc)
+{
+  if (i_auditEventType(evt)) i_after(evt, caller, sc);
+}
diff --git a/GaudiAud/src/CommonAuditor.h b/GaudiAud/src/CommonAuditor.h
new file mode 100644
index 0000000000000000000000000000000000000000..f18a715cfc854f013288cb95896486a6b8405ede
--- /dev/null
+++ b/GaudiAud/src/CommonAuditor.h
@@ -0,0 +1,59 @@
+#include "GaudiKernel/Auditor.h"
+
+/// Base class with common functionalities shared by few auditor implementations.
+/// @author Marco Clemencic
+class CommonAuditor: public Auditor {
+public:
+  /** Constructor
+      @param name    The algorithm object's name
+      @param svcloc  A pointer to a service location service */
+  CommonAuditor(const std::string& name, ISvcLocator *svcloc);
+  /// Destructor
+  virtual ~CommonAuditor();
+
+  /// \name "before" Auditor hooks
+  /// The default behavior is to fall back on the version accepting 2 strings,
+  /// which must be implemented in the derived class.
+  //@{
+  virtual void before(StandardEventType evt, const std::string& caller);
+  virtual void before(StandardEventType evt, INamedInterface* caller);
+  virtual void before(CustomEventTypeRef evt, const std::string& caller);
+  virtual void before(CustomEventTypeRef evt, INamedInterface* caller);
+  //@}
+
+  /// \name "after" Auditor hooks
+  /// The default behavior is to fall back on the version accepting 2 strings,
+  /// which must be implemented in the derived class.
+  //@{
+  virtual void after(StandardEventType evt, const std::string& caller, const StatusCode& sc);
+  virtual void after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc);
+  virtual void after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc);
+  virtual void after(CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc);
+  //@}
+
+protected:
+
+  /// catch all "before" method, implemented in the derived class
+  virtual void i_before(CustomEventTypeRef evt, const std::string& caller) = 0;
+  /// catch all "after" method, implemented in the derived class
+  virtual void i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc) = 0;
+
+  /// Check if we are requested to audit the passed event type.
+  inline bool i_auditEventType(const std::string& evt) {
+    // Note: there is no way to extract from a Property type the type returned by
+    // value().
+    const std::vector<std::string> &v = m_types.value();
+    // we need to return true is the list is empty or when the list does't
+    // start by "none" and the list contain the event we got.
+    return (v.size() == 0) || (
+             (v[0] != "none") &&
+             (find(v.begin(), v.end(), evt) != v.end())
+           );
+  }
+
+  StringArrayProperty m_types;
+
+  /// Update handler for the obsolete property CustomEventTypes
+  void i_updateCustomTypes(Property &);
+  StringArrayProperty m_customTypes;
+};
diff --git a/GaudiAud/src/MemStatAuditor.cpp b/GaudiAud/src/MemStatAuditor.cpp
index da3fb13baa1a68f5b9f5323cb1647d3c499b87c6..cd0ebd3f56ca4e1a621217a3524763d04c838486 100644
--- a/GaudiAud/src/MemStatAuditor.cpp
+++ b/GaudiAud/src/MemStatAuditor.cpp
@@ -17,189 +17,39 @@
 DECLARE_AUDITOR_FACTORY(MemStatAuditor)
 
 MemStatAuditor::MemStatAuditor(const std::string& name, ISvcLocator* pSvcLocator) :
-  Auditor(name, pSvcLocator), m_vSize(-1.)
+  MemoryAuditor(name, pSvcLocator), m_vSize(-1.)
 {
-  declareProperty("CustomEventTypes",m_types);
-
   m_stat = serviceLocator()->service("ChronoStatSvc");
 }
 
-MemStatAuditor::~MemStatAuditor(){
-}
-
-void MemStatAuditor::beforeInitialize(INamedInterface*) {
-  //DR not useful
-  //   std::string theString = "Memory usage before ";
-  //   theString += alg->name() ;
-  //   theString += " \tInitialization Method";
-  //   printinfo(theString, alg->name() );
-}
-void MemStatAuditor:: afterInitialize(INamedInterface* ini){
-  std::string theString = "Memory usage has changed after  ";
-  theString += ini->name() ;
-  theString += " \tInitialization Method";
-  printinfo(theString, ini->name() );
-}
-void MemStatAuditor::beforeReinitialize(INamedInterface*) {
-  //DR not useful
-  //   std::string theString = "Memory usage before ";
-  //   theString += alg->name() ;
-  //   theString += " \tReinitialization Method";
-  //   printinfo(theString, alg->name() );
-}
-void MemStatAuditor:: afterReinitialize(INamedInterface* ini){
-  std::string theString = "Memory usage has changed after  ";
-  theString += ini->name() ;
-  theString += " \tReinitialization Method";
-  printinfo(theString, ini->name() );
-}
-void MemStatAuditor:: beforeExecute(INamedInterface*){
-  //DR not useful
-  //   std::string theString = "Memory usage has changed before ";
-  //   theString += alg->name() ;
-  //   theString += " \tBefExecute Method";
-  //   printinfo(theString, alg->name() );
-}
-void MemStatAuditor:: afterExecute(INamedInterface* alg, const StatusCode& ) {
-  std::string theString = "Memory usage has changed after  ";
-  theString += alg->name() ;
-  theString += " \tExecute Method";
-  printinfo(theString, alg->name() );
-
-}
-void MemStatAuditor::beforeBeginRun(INamedInterface*) {
-  //DR not useful
-  //   std::string theString = "Memory usage before ";
-  //   theString += alg->name() ;
-  //   theString += " \tBeginRun Method";
-  //   printinfo(theString, alg->name() );
-}
-void MemStatAuditor:: afterBeginRun(INamedInterface* ini){
-  std::string theString = "Memory usage has changed after  ";
-  theString += ini->name() ;
-  theString += " \tBeginRun Method";
-  printinfo(theString, ini->name() );
-}
-void MemStatAuditor::beforeEndRun(INamedInterface*) {
-  //DR not useful
-  //   std::string theString = "Memory usage before ";
-  //   theString += alg->name() ;
-  //   theString += " \tEndRun Method";
-  //   printinfo(theString, alg->name() );
-}
-void MemStatAuditor:: afterEndRun(INamedInterface* ini){
-  std::string theString = "Memory usage has changed after  ";
-  theString += ini->name() ;
-  theString += " \tEndRun Method";
-  printinfo(theString, ini->name() );
-}
-void MemStatAuditor:: beforeFinalize(INamedInterface*) {
-  //DR not useful
-  //   std::string theString = "Memory usage has changed before ";
-  //   theString += alg->name() ;
-  //   theString += " \tFinalize Method";
-  //   printinfo(theString, alg->name() );
-}
-void MemStatAuditor:: afterFinalize(INamedInterface*){
-  //DR not useful
-  //   std::string theString = "Memory usage has changed after  ";
-  //   theString += alg->name() ;
-  //   theString += " \tFinalize Method";
-  //   printinfo(theString, alg->name() );
-
-}
-
-void
-MemStatAuditor::before(CustomEventTypeRef evt, const std::string& caller) {
-
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
-
-  std::string theString = "Memory usage before ";
-  theString += caller + " with auditor trigger " + evt;
-  printinfo(theString, caller);
-
+void MemStatAuditor::i_before(CustomEventTypeRef /*evt*/, const std::string& /*caller*/) {
+  // It's not interesting to monitor the memory usage before the methods.
 }
 
-void
-MemStatAuditor::after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&) {
+void MemStatAuditor::i_printinfo(const std::string& msg, CustomEventTypeRef evt, const std::string& caller) {
+  // cannot be exactly 0
+  double deltaVSize = 0.00001;
 
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
-
-  std::string theString = "Memory usage has changed after ";
-  theString += caller + " with auditor trigger " + evt;
-  printinfo(theString, caller);
-
-}
-
-StatusCode MemStatAuditor::sysFinalize( )
-{
-  return StatusCode::SUCCESS;
-}
-
-bool MemStatAuditor::printinfo(const std::string& theString, const std::string& tag )
-{
-  bool status(false);
-  ProcStats* p = ProcStats::instance();
   procInfo info;
-  ///cannot be eaxactly 0
-  double deltaVSize =0.00001;
-
-
-  if( p->fetch(info) == true)
-    {
-      MsgStream log(msgSvc(), name());
+  if (getProcInfo(info)) {
+    MsgStream log(msgSvc(), name());
 
-      if (m_vSize>0 && info.vsize >0 ){
-	 deltaVSize=info.vsize-m_vSize;
+    if (info.vsize > 0) {
+      if (m_vSize > 0){
+        deltaVSize = info.vsize - m_vSize;
       }
-
       // store the current VSize to be able to monitor the increment
-      if (info.vsize>0) {
-	 m_vSize=info.vsize;
-      }
-
-      log << MSG::INFO << theString <<
-	" \tvirtual size = " << info.vsize << " MB"  <<
-	" \tresident set size = " << info.rss << " MB" <<
-	" deltaVsize = " << deltaVSize << "  MB " << endmsg;
-      ///
-
-      //      Stat stv( statSvc() , tag+":VMemUsage" , info.vsize );
-      //   Stat str( statSvc() , tag+":RMemUsage" , info.rss   );
-      ///
-      status=true;
+      m_vSize = info.vsize;
     }
+
+    log << MSG::INFO << msg << " " << caller << " " << evt <<
+        " \tvirtual size = " << info.vsize << " MB"  <<
+        " \tresident set size = " << info.rss << " MB" <<
+        " deltaVsize = " << deltaVSize << "  MB" << endmsg;
+  }
   // fill the stat for every call, not just when there is a change
   // only monitor the increment in VSize
-  Stat sts( statSvc() , tag+":VMem" , deltaVSize );
-
-
-  ///
-  return status; //FIXME
+  // Stat stv(statSvc(), caller + ":VMemUsage", info.vsize);
+  // Stat str(statSvc(), caller + ":RMemUsage", info.rss);
+  Stat sts(statSvc(), caller + ":VMem", deltaVSize);
 }
-
-
-
-
-
-
-
-
diff --git a/GaudiAud/src/MemStatAuditor.h b/GaudiAud/src/MemStatAuditor.h
index 7f1ef78acbd78c3af56347edbe3ac978fce2ea91..05e497b104991064dca6850709f2a4aa48d8dbae 100644
--- a/GaudiAud/src/MemStatAuditor.h
+++ b/GaudiAud/src/MemStatAuditor.h
@@ -4,46 +4,29 @@
 /** @class MemStatAuditor MemStatAuditor.h GaudiAud/MemStatAudit.h
 
     Just a minor modification of MemoryAuditor to allow
-    the ouput memory statistics table to be printed
+    the output memory statistics table to be printed
 
     @author  Vanya Belyaev
+    @author  Marco Clemencic
     @date    04/02/2001
 */
+#include "MemoryAuditor.h"
 
-#include "GaudiKernel/Auditor.h"
-
-class IChronoStatSvc;
-
-class MemStatAuditor:public  Auditor {
-
+class MemStatAuditor:public  MemoryAuditor {
 public:
   MemStatAuditor(const std::string& name, ISvcLocator* pSvcLocator);
-  virtual ~MemStatAuditor();
-  virtual void beforeInitialize(INamedInterface* alg);
-  virtual void afterInitialize(INamedInterface* alg);
-  virtual void beforeReinitialize(INamedInterface* alg);
-  virtual void afterReinitialize(INamedInterface* alg);
-  virtual void beforeExecute(INamedInterface* alg);
-  virtual void afterExecute(INamedInterface* alg, const StatusCode &);
-  virtual void beforeBeginRun(INamedInterface* alg);
-  virtual void afterBeginRun(INamedInterface *alg);
-  virtual void beforeEndRun(INamedInterface* alg);
-  virtual void afterEndRun(INamedInterface *alg);
-  virtual void beforeFinalize(INamedInterface* alg);
-  virtual void afterFinalize(INamedInterface* alg);
-
-  virtual void before(CustomEventTypeRef evt, const std::string& caller);
-  virtual void after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& );
-
-  virtual StatusCode sysFinalize( );
 
 private:
+  /// Re-implement i_before to avoid monitoring the memory usage before a function.
+  virtual void i_before(CustomEventTypeRef evt, const std::string& caller);
+
+  virtual void i_printinfo(const std::string& msg, CustomEventTypeRef evt, const std::string& caller);
+
+  SmartIF<IChronoStatSvc>& statSvc() { return m_stat; }
+  SmartIF<IChronoStatSvc> m_stat;
 
-  StringArrayProperty m_types;
-  bool printinfo(const std::string& theString, const std::string& Tag );
-  SmartIF<IChronoStatSvc>&  statSvc() const { return m_stat; }
-  mutable SmartIF<IChronoStatSvc>  m_stat;
-  double m_vSize ; // vsize of the previous call to printinfo
+  /// vsize of the previous call to printinfo
+  double m_vSize ;
 };
 
 #endif  //  GAUDIAUDITOR_MemStatAuditor_H
diff --git a/GaudiAud/src/MemoryAuditor.cpp b/GaudiAud/src/MemoryAuditor.cpp
index 1d273ea849795c2a864324c48e6d64d82bed222c..2aea685cd8ca8905073bf22aaba6fcad44a3c762 100644
--- a/GaudiAud/src/MemoryAuditor.cpp
+++ b/GaudiAud/src/MemoryAuditor.cpp
@@ -8,154 +8,31 @@
 #endif
 
 #include "MemoryAuditor.h"
-#include "ProcStats.h"
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/AudFactory.h"
 
 DECLARE_AUDITOR_FACTORY(MemoryAuditor)
 
-MemoryAuditor::MemoryAuditor(const std::string& name, ISvcLocator* pSvcLocator) :
-  Auditor(name, pSvcLocator)
-{
-  declareProperty("CustomEventTypes",m_types);
-
+MemoryAuditor::MemoryAuditor(const std::string& name, ISvcLocator* pSvcLocator)
+: CommonAuditor(name, pSvcLocator) {
 }
 
-MemoryAuditor::~MemoryAuditor(){
+void MemoryAuditor::i_before(CustomEventTypeRef evt, const std::string& caller) {
+  i_printinfo("Memory usage before", evt, caller);
 }
 
-void MemoryAuditor::beforeInitialize(INamedInterface* alg) {
-  std::string theString = "Memory usage before ";
-  theString += alg->name() ;
-  theString += " Initialization Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: afterInitialize(INamedInterface* alg){
-  std::string theString = "Memory usage has changed after ";
-  theString += alg->name() ;
-  theString += " Initialization Method";
-  printinfo(theString);
-}
-void MemoryAuditor::beforeReinitialize(INamedInterface* alg) {
-  std::string theString = "Memory usage before ";
-  theString += alg->name() ;
-  theString += " Reinitialization Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: afterReinitialize(INamedInterface* alg){
-  std::string theString = "Memory usage has changed after ";
-  theString += alg->name() ;
-  theString += " Reinitialization Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: beforeExecute(INamedInterface* alg){
-  std::string theString = "Memory usage has changed before ";
-  theString += alg->name() ;
-  theString += " Execute Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: afterExecute(INamedInterface* alg, const StatusCode& ) {
-  std::string theString = "Memory usage has changed after ";
-  theString += alg->name() ;
-  theString += " Execute Method";
-  printinfo(theString);
-}
-void MemoryAuditor::beforeBeginRun(INamedInterface* ini) {
-  std::string theString = "Memory usage before ";
-  theString += ini->name() ;
-  theString += " BeginRun Method";
-  printinfo(theString);
+void MemoryAuditor::i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&){
+  i_printinfo("Memory usage has changed after", evt, caller);
 }
-void MemoryAuditor:: afterBeginRun(INamedInterface* ini){
-  std::string theString = "Memory usage has changed after ";
-  theString += ini->name() ;
-  theString += " BeginRun Method";
-  printinfo(theString);
-}
-void MemoryAuditor::beforeEndRun(INamedInterface* ini) {
-  std::string theString = "Memory usage before ";
-  theString += ini->name() ;
-  theString += " EndRun Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: afterEndRun(INamedInterface* ini){
-  std::string theString = "Memory usage has changed after ";
-  theString += ini->name() ;
-  theString += " EndRun Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: beforeFinalize(INamedInterface* alg) {
-  std::string theString = "Memory usage has changed before ";
-  theString += alg->name() ;
-  theString += " Finalize Method";
-  printinfo(theString);
-}
-void MemoryAuditor:: afterFinalize(INamedInterface* alg){
-  std::string theString = "Memory usage has changed after ";
-  theString += alg->name() ;
-  theString += " Finalize Method";
-  printinfo(theString);
-}
-
-void
-MemoryAuditor::before(CustomEventTypeRef evt, const std::string& caller) {
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
 
-  std::string theString = "Memory usage before ";
-  theString += caller + " with auditor trigger " + evt;
-  printinfo(theString);
-
-}
-
-void
-MemoryAuditor::after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&) {
-
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
-
-  std::string theString = "Memory usage has changed after ";
-  theString += caller + " with auditor trigger " + evt;
-  printinfo(theString);
-
-}
-
-
-StatusCode MemoryAuditor::sysFinalize( )
+void MemoryAuditor::i_printinfo(const std::string& msg, CustomEventTypeRef evt, const std::string& caller)
 {
-  return StatusCode::SUCCESS;
-}
-
-bool MemoryAuditor::printinfo(std::string theString)
-{
-   ProcStats* p = ProcStats::instance();
    procInfo info;
-
    // The fetch method returns true if memory usage has changed...
-   if( p->fetch(info) == true) {
+   if(getProcInfo(info)) {
      MsgStream log(msgSvc(), name());
-     log << MSG::INFO << theString <<
+     log << MSG::INFO << msg << " " << caller << " " << evt <<
        " virtual size = " << info.vsize << " MB"  <<
        " resident set size = " << info.rss << " MB" << endmsg;
-     return true;
-    }
-   else {
-      return false;
    }
 }
diff --git a/GaudiAud/src/MemoryAuditor.h b/GaudiAud/src/MemoryAuditor.h
index 1f3204fd47ab8b1bb9e444537d1cc77aede09bd4..b37d2b417d398bd5be08dafe6a85054fdb263391 100644
--- a/GaudiAud/src/MemoryAuditor.h
+++ b/GaudiAud/src/MemoryAuditor.h
@@ -1,41 +1,32 @@
 #ifndef ATLASAUDITOR_MEMORYAUDITOR_H
 #define ATLASAUDITOR_MEMORYAUDITOR_H
 
-// ClassName: MemoryAuditor
-//
-// Description:  Monitors the memory use of each algorithm
-//
-// Author: M. Shapiro, LBNL
-//
-#include "GaudiKernel/Auditor.h"
-
-class MemoryAuditor:public  Auditor {
-
+#include "CommonAuditor.h"
+#include "ProcStats.h"
+
+/// Monitors the memory use of each algorithm
+///
+/// @author M. Shapiro, LBNL
+/// @author Marco Clemencic
+class MemoryAuditor:public CommonAuditor {
 public:
   MemoryAuditor(const std::string& name, ISvcLocator* pSvcLocator);
-  virtual ~MemoryAuditor();
-  virtual void beforeInitialize(INamedInterface* alg);
-  virtual void afterInitialize(INamedInterface* alg);
-  virtual void beforeReinitialize(INamedInterface* alg);
-  virtual void afterReinitialize(INamedInterface* alg);
-  virtual void beforeExecute(INamedInterface* alg);
-  virtual void afterExecute(INamedInterface* alg, const StatusCode& );
-  virtual void beforeBeginRun(INamedInterface* alg);
-  virtual void afterBeginRun(INamedInterface *alg);
-  virtual void beforeEndRun(INamedInterface* alg);
-  virtual void afterEndRun(INamedInterface *alg);
-  virtual void beforeFinalize(INamedInterface* alg);
-  virtual void afterFinalize(INamedInterface* alg);
 
-  virtual void before(CustomEventTypeRef evt, const std::string& caller);
-  virtual void after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& );
+protected:
+  /// Default (catch-all) "before" Auditor hook
+  virtual void i_before(CustomEventTypeRef evt, const std::string& caller);
 
+  /// Default (catch-all) "after" Auditor hook
+  virtual void i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc);
 
-  virtual StatusCode sysFinalize( );
+  /// Report the memory usage.
+  virtual void i_printinfo(const std::string& msg, CustomEventTypeRef evt, const std::string& caller);
 
-private:
-  StringArrayProperty m_types;
-  bool printinfo(std::string theString);
+  /// Get the process informations.
+  /// Returns true if it was possible to retrieve the informations.
+  inline static bool getProcInfo(procInfo &info) {
+    return ProcStats::instance()->fetch(info);
+  }
 };
 
 #endif
diff --git a/GaudiAud/src/NameAuditor.cpp b/GaudiAud/src/NameAuditor.cpp
index 24d1f83ae9f89bfc904c7aac2c17dd48c2be8836..442819dda071b1c6dcff9eab8fd85bd3ffc87d89 100644
--- a/GaudiAud/src/NameAuditor.cpp
+++ b/GaudiAud/src/NameAuditor.cpp
@@ -7,59 +7,22 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/AudFactory.h"
 
-#include <sstream>
-
 DECLARE_AUDITOR_FACTORY(NameAuditor)
 
-NameAuditor::NameAuditor(const std::string& name, ISvcLocator* pSvcLocator) :
-  Auditor(name, pSvcLocator)
-{
-
-  declareProperty("CustomEventTypes", m_types,
-                  "List of custom event types to audit ([]=all, ['none']=none");
-
-}
-
-NameAuditor::~NameAuditor(){
-}
-
-
-void NameAuditor::before(StandardEventType evt, const std::string& caller)
-{
-  std::ostringstream oss;
-  oss << evt;
-  before(oss.str(), caller);
+NameAuditor::NameAuditor(const std::string& name, ISvcLocator* pSvcLocator):
+  CommonAuditor(name, pSvcLocator) {
 }
 
-
-void NameAuditor::after(StandardEventType evt, const std::string& caller, const StatusCode& sc)
+void NameAuditor::i_before(CustomEventTypeRef evt, const std::string& caller)
 {
-  std::ostringstream oss;
-  oss << evt;
-  after(oss.str(), caller, sc);
+  MsgStream log( msgSvc(), name() );
+  log << MSG::INFO << "About to Enter " << caller << " with auditor trigger "
+      << evt << endmsg;
 }
 
-void
-NameAuditor::i_doAudit(const std::string& evt, const std::string& caller, Action action)
+void NameAuditor::i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&)
 {
-  if (m_types.value().size() != 0) {
-    if ( (m_types.value())[0] == "none") {
-      return;
-    }
-
-    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
-	 m_types.value().end() ) {
-      return;
-    }
-  }
-
   MsgStream log( msgSvc(), name() );
-  if ( action==BEFORE ) {
-    log << MSG::INFO << "About to Enter " << caller << " with auditor trigger "
-        << evt << endmsg;
-  }
-  else {
-    log << MSG::INFO << "Just Exited " << caller << " with auditor trigger "
-        << evt << endmsg;
-  }
+  log << MSG::INFO << "Just Exited " << caller << " with auditor trigger "
+      << evt << endmsg;
 }
diff --git a/GaudiAud/src/NameAuditor.h b/GaudiAud/src/NameAuditor.h
index e8b26a5a221e693d65b5e659aad25962c25d89c0..a3fad186687266fcdd19cec3a23589674798fda4 100644
--- a/GaudiAud/src/NameAuditor.h
+++ b/GaudiAud/src/NameAuditor.h
@@ -1,58 +1,22 @@
 #ifndef ATLASAUDITOR_NAMEAUDITOR_H
 #define ATLASAUDITOR_NAMEAUDITOR_H
 
-#include "GaudiKernel/Auditor.h"
-#include "GaudiKernel/Property.h"
+#include "CommonAuditor.h"
 
 /**
  * @brief Prints the name of each algorithm before entering the algorithm and after leaving it
  * @author M. Shapiro, LBNL
- *
+ * @author Marco Clemencic
  */
-class NameAuditor:public  Auditor {
-private:
-  enum Action { BEFORE, AFTER };
-
+class NameAuditor:public CommonAuditor {
 public:
   NameAuditor(const std::string& name, ISvcLocator* pSvcLocator);
-  virtual ~NameAuditor();
-
-  /// \name "before" Auditor hooks
-  //@{
-  virtual void before(StandardEventType evt, const std::string& caller);
-
-  virtual void before(StandardEventType evt, INamedInterface* caller) {
-    if (caller) before(evt, caller->name());
-  }
-  virtual void before(CustomEventTypeRef evt, const std::string& caller) {
-    i_doAudit(evt, caller, BEFORE);
-  }
-  virtual void before(CustomEventTypeRef evt, INamedInterface* caller) {
-    if (caller) before(evt, caller->name());
-  }
-  //@}
-
-  /// \name "after" Auditor hooks
-  //@{
-  virtual void after(StandardEventType evt, const std::string& caller, const StatusCode& sc);
-
-  virtual void after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc) {
-    if (caller) after(evt, caller->name(), sc);
-  }
-  virtual void after(CustomEventTypeRef evt, const std::string& caller, const StatusCode&) {
-    i_doAudit(evt, caller, AFTER);
-  }
-  virtual void after(CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc) {
-    if (caller) after(evt, caller->name(), sc);
-  }
-  //@}
-
-private:
-  /// Implementation of the auditor
-  void i_doAudit(const std::string& evt, const std::string& caller, Action action);
 
 private:
-  StringArrayProperty m_types;   ///< Filter for custom event types
+  /// Print a message on "before".
+  virtual void i_before(CustomEventTypeRef evt, const std::string& caller);
+  /// Print a message on "after".
+  virtual void i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc);
 
 };
 
diff --git a/GaudiAud/src/ProcStats.cpp b/GaudiAud/src/ProcStats.cpp
index a323a5a74221c87c6717cf23200b6bc79771ef46..67ee071d0c67555293bf2f08a7e986687e82165c 100644
--- a/GaudiAud/src/ProcStats.cpp
+++ b/GaudiAud/src/ProcStats.cpp
@@ -1,4 +1,3 @@
-// $Id: ProcStats.cpp,v 1.4 2006/09/13 14:31:12 hmd Exp $
 // Class: ProcStats
 // Purpose:  To keep statistics on memory use
 // Warning:  Only Linux implementation at the present time...
@@ -25,42 +24,209 @@ using std::cerr;
 using std::cout;
 using std::endl;
 
+/* Format of the Linux proc/stat (man 5 proc, kernel 2.6.35):
+ pid %d      The process ID.
+
+ comm %s     The  filename  of the executable, in parentheses.  This is visible
+             whether or not the executable is swapped out.
+
+ state %c    One character from the string "RSDZTW" where R is  running,  S  is
+             sleeping in an interruptible wait, D is waiting in uninterruptible
+             disk sleep, Z is zombie, T is traced or stopped (on a signal), and
+             W is paging.
+
+ ppid %d     The PID of the parent.
+
+ pgrp %d     The process group ID of the process.
+
+ session %d  The session ID of the process.
+
+ tty_nr %d   The controlling terminal of the process.  (The minor device number
+             is contained in the combination of bits 31 to 20 and 7 to  0;  the
+             major device number is in bits 15 t0 8.)
+
+ tpgid %d    The ID of the foreground process group of the controlling terminal
+             of the process.
+
+ flags %u (%lu before Linux 2.6.22)
+             The kernel flags word of the process.  For bit meanings,  see  the
+             PF_*  defines  in  <linux/sched.h>.   Details depend on the kernel
+             version.
+
+ minflt %lu  The number of minor faults the process has  made  which  have  not
+             required loading a memory page from disk.
+
+ cminflt %lu The  number of minor faults that the process's waited-for children
+             have made.
+
+ majflt %lu  The number of  major  faults  the  process  has  made  which  have
+             required loading a memory page from disk.
+
+ cmajflt %lu The  number of major faults that the process's waited-for children
+             have made.
+
+ utime %lu   Amount of time that this process has been scheduled in user  mode,
+             measured  in  clock  ticks  (divide by sysconf(_SC_CLK_TCK).  This
+             includes guest time, guest_time (time spent running a virtual CPU,
+             see  below),  so that applications that are not aware of the guest
+             time field do not lose that time from their calculations.
+
+ stime %lu   Amount of time that this process  has  been  scheduled  in  kernel
+             mode, measured in clock ticks (divide by sysconf(_SC_CLK_TCK).
+
+ cutime %ld  Amount  of  time that this process's waited-for children have been
+             scheduled in  user  mode,  measured  in  clock  ticks  (divide  by
+             sysconf(_SC_CLK_TCK).   (See  also times(2).)  This includes guest
+             time, cguest_time (time spent running a virtual CPU, see below).
+
+ cstime %ld  Amount of time that this process's waited-for children  have  been
+             scheduled  in  kernel  mode,  measured  in  clock ticks (divide by
+             sysconf(_SC_CLK_TCK).
+
+ priority %ld
+             (Explanation for Linux 2.6)  For  processes  running  a  real-time
+             scheduling  policy (policy below; see sched_setscheduler(2)), this
+             is the negated scheduling priority, minus one; that is,  a  number
+             in  the  range -2 to -100, corresponding to real-time priorities 1
+             to 99.  For processes running  under  a  non-real-time  scheduling
+             policy, this is the raw nice value (setpriority(2)) as represented
+             in the kernel.  The kernel stores nice values as  numbers  in  the
+             range 0 (high) to 39 (low), corresponding to the user-visible nice
+             range of -20 to 19.
+
+             Before Linux 2.6, this was a scaled value based on  the  scheduler
+             weighting given to this process.
+
+ nice %ld    The  nice value (see setpriority(2)), a value in the range 19 (low
+             priority) to -20 (high priority).
+
+ num_threads %ld
+             Number of threads in this process (since Linux 2.6).  Before  ker‐
+             nel  2.6,  this  field was hard coded to 0 as a placeholder for an
+             earlier removed field.
+
+ itrealvalue %ld
+             The time in jiffies before the next SIGALRM is sent to the process
+             due  to  an interval timer.  Since kernel 2.6.17, this field is no
+             longer maintained, and is hard coded as 0.
+
+ starttime %llu (was %lu before Linux 2.6)
+             The time in jiffies the process started after system boot.
+
+ vsize %lu   Virtual memory size in bytes.
+
+ rss %ld     Resident Set Size: number of pages the process has in real memory.
+             This  is  just  the pages which count towards text, data, or stack
+             space.  This does not include pages which have  not  been  demand-
+             loaded in, or which are swapped out.
+
+ rsslim %lu  Current  soft  limit  in  bytes on the rss of the process; see the
+             description of RLIMIT_RSS in getpriority(2).
+
+ startcode %lu
+             The address above which program text can run.
+
+ endcode %lu The address below which program text can run.
+
+ startstack %lu
+             The address of the start (i.e., bottom) of the stack.
+
+ kstkesp %lu The current value of ESP (stack pointer), as found in  the  kernel
+             stack page for the process.
+
+ kstkeip %lu The current EIP (instruction pointer).
+
+ signal %lu  The  bitmap  of  pending  signals,  displayed as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ blocked %lu The  bitmap  of  blocked  signals,  displayed as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ sigignore %lu
+             The  bitmap  of  ignored  signals,  displayed as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ sigcatch %lu
+             The  bitmap  of  caught  signals,  displayed  as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ wchan %lu   This  is the "channel" in which the process is waiting.  It is the
+             address of a system call, and can be looked up in  a  namelist  if
+             you   need   a   textual   name.    (If  you  have  an  up-to-date
+             /etc/psdatabase, then try ps -l to see the WCHAN field in action.)
+
+ nswap %lu   Number of pages swapped (not maintained).
+
+ cnswap %lu  Cumulative nswap for child processes (not maintained).
+
+ exit_signal %d (since Linux 2.1.22)
+             Signal to be sent to parent when we die.
+
+ processor %d (since Linux 2.2.8)
+             CPU number last executed on.
+
+ rt_priority %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
+             Real-time scheduling priority, a number in the range 1 to  99  for
+             processes  scheduled under a real-time policy, or 0, for non-real-
+             time processes (see sched_setscheduler(2)).
+
+ policy %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
+             Scheduling policy (see sched_setscheduler(2)).  Decode  using  the
+             SCHED_* constants in linux/sched.h.
+
+ delayacct_blkio_ticks %llu (since Linux 2.6.18)
+             Aggregated  block  I/O  delays, measured in clock ticks (centisec‐
+             onds).
+
+ guest_time %lu (since Linux 2.6.24)
+             Guest time of the process (time spent running a virtual CPU for  a
+             guest  operating  system),  measured  in  clock  ticks  (divide by
+             sysconf(_SC_CLK_TCK).
+
+ cguest_time %ld (since Linux 2.6.24)
+             Guest time of the process's  children,  measured  in  clock  ticks
+             (divide by sysconf(_SC_CLK_TCK).
+*/
 struct linux_proc {
-  int pid; // %d
-  char comm[400]; // %s
-  char state; // %c
-  int ppid; // %d
-  int pgrp; // %d
-  int session; // %d
-  int tty; // %d
-  int tpgid; // %d
-  unsigned int flags; // %u
-  unsigned int minflt; // %u
-  unsigned int cminflt; // %u
-  unsigned int majflt; // %u
-  unsigned int cmajflt; // %u
-  int utime; // %d
-  int stime; // %d
-  int cutime; // %d
-  int cstime; // %d
-  int counter; // %d
-  int priority; // %d
-  unsigned int timeout; // %u
-  unsigned int itrealvalue; // %u
-  int starttime; // %d
-  unsigned int vsize; // %u
-  unsigned int rss; // %u
-  unsigned int rlim; // %u
-  unsigned int startcode; // %u
-  unsigned int endcode; // %u
-  unsigned int startstack; // %u
-  unsigned int kstkesp; // %u
-  unsigned int kstkeip; // %u
-  int signal; // %d
-  int blocked; // %d
-  int sigignore; // %d
-  int sigcatch; // %d
-  unsigned int wchan; // %u
+  int pid;
+  char comm[400];
+  char state;
+  int ppid;
+  int pgrp;
+  int session;
+  int tty;
+  int tpgid;
+  unsigned long flags;
+  unsigned long minflt;
+  unsigned long cminflt;
+  unsigned long majflt;
+  unsigned long cmajflt;
+  unsigned long utime;
+  unsigned long stime;
+  long cutime;
+  long cstime;
+  long priority;
+  long nice;
+  long num_threads;
+  long itrealvalue;
+  unsigned long long starttime;
+  unsigned long vsize;
+  long rss;
+  unsigned long rlim;
+  unsigned long startcode;
+  unsigned long endcode;
+  unsigned long startstack;
+  unsigned long kstkesp;
+  unsigned long kstkeip;
+  unsigned long signal;
+  unsigned long blocked;
+  unsigned long sigignore;
+  unsigned long sigcatch;
+  unsigned long wchan;
 };
 #endif // __linux
 
@@ -84,7 +250,7 @@ ProcStats::ProcStats():valid(false)
 {
 #ifdef __linux
   pg_size = sysconf(_SC_PAGESIZE); // getpagesize();
-  std::ostringstream ost; 
+  std::ostringstream ost;
 
   ost << "/proc/" << getpid() << "/stat";
   fname = ost.str();
@@ -126,43 +292,44 @@ bool ProcStats::fetch(procInfo& f)
     buf[cnt]='\0';
 
     sscanf(buf,
-      "%d %s %c %d %d %d %d %d %u %u %u %u %u %d %d %d %d %d %d %u %u %d %u %u %u %u %u %u %u %u %d %d %d %d %u",
-      &pinfo.pid, // %d
-      pinfo.comm, // %s
-      &pinfo.state, // %c
-      &pinfo.ppid, // %d
-      &pinfo.pgrp, // %d
-      &pinfo.session, // %d
-      &pinfo.tty, // %d
-      &pinfo.tpgid, // %d
-      &pinfo.flags, // %u
-      &pinfo.minflt, // %u
-      &pinfo.cminflt, // %u
-      &pinfo.majflt, // %u
-      &pinfo.cmajflt, // %u
-      &pinfo.utime, // %d
-      &pinfo.stime, // %d
-      &pinfo.cutime, // %d
-      &pinfo.cstime, // %d
-      &pinfo.counter, // %d
-      &pinfo.priority, // %d
-      &pinfo.timeout, // %u
-      &pinfo.itrealvalue, // %u
-      &pinfo.starttime, // %d
-      &pinfo.vsize, // %u
-      &pinfo.rss, // %u
-      &pinfo.rlim, // %u
-      &pinfo.startcode, // %u
-      &pinfo.endcode, // %u
-      &pinfo.startstack, // %u
-      &pinfo.kstkesp, // %u
-      &pinfo.kstkeip, // %u
-      &pinfo.signal, // %d
-      &pinfo.blocked, // %d
-      &pinfo.sigignore, // %d
-      &pinfo.sigcatch, // %d
-      &pinfo.wchan // %u
-      );
+        //1  2  3  4  5  6  7  8  9  10  1   2   3   4   5   6   7   8   9   20  1   2   3   4   5   6   7   8   9   30  1   2   3   4   5
+        "%d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %llu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu",
+        &pinfo.pid,
+        pinfo.comm,
+        &pinfo.state,
+        &pinfo.ppid,
+        &pinfo.pgrp,
+        &pinfo.session,
+        &pinfo.tty,
+        &pinfo.tpgid,
+        &pinfo.flags,
+        &pinfo.minflt,
+        &pinfo.cminflt,
+        &pinfo.majflt,
+        &pinfo.cmajflt,
+        &pinfo.utime,
+        &pinfo.stime,
+        &pinfo.cutime,
+        &pinfo.cstime,
+        &pinfo.priority,
+        &pinfo.nice,
+        &pinfo.num_threads,
+        &pinfo.itrealvalue,
+        &pinfo.starttime,
+        &pinfo.vsize,
+        &pinfo.rss,
+        &pinfo.rlim,
+        &pinfo.startcode,
+        &pinfo.endcode,
+        &pinfo.startstack,
+        &pinfo.kstkesp,
+        &pinfo.kstkeip,
+        &pinfo.signal,
+        &pinfo.blocked,
+        &pinfo.sigignore,
+        &pinfo.sigcatch,
+        &pinfo.wchan
+        );
 
       // resident set size in pages
     pr_size = (double)pinfo.vsize;
diff --git a/GaudiExamples/cmt/requirements b/GaudiExamples/cmt/requirements
index 2dce4d5cc31551d6e0e7cea80bc83fcb47145de7..98fd26af6b67c66f566fc3301ed5665eaad5c2d4 100644
--- a/GaudiExamples/cmt/requirements
+++ b/GaudiExamples/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiExamples
-version v22r0
+version v22r2
 
 use ROOT         * LCG_Interfaces
 use Reflex       * LCG_Interfaces -no_auto_imports
diff --git a/GaudiExamples/doc/release.notes b/GaudiExamples/doc/release.notes
index 450d45baae8e2fcec3a15346cdcf970a0eae7bb2..553ddb2b5c5780c2a88904433750f34672797964 100644
--- a/GaudiExamples/doc/release.notes
+++ b/GaudiExamples/doc/release.notes
@@ -1,6 +1,21 @@
 Package GaudiExamples
 Package manager : Marco Clemencic
 
+============================ GaudiExamples v22r2 =============================
+! 2011-04-08 - Marco Clemencic
+ - Updated IncidentSvc test after the introduction of the new incidents
+   BeginProcessing and EndProcessing.
+
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+
+! 2011-03-16 - Marco Clemencic
+ - Updated reference files after patch #4727
+
+============================ GaudiExamples v22r1 =============================
 ============================ GaudiExamples v22r0 =============================
 ! 2011-01-20 - Marco Clemencic
  - Added a test for bug #74981.
diff --git a/GaudiExamples/home/HistoEx2.pyref.i686-dbg b/GaudiExamples/home/HistoEx2.pyref.i686-dbg
new file mode 100644
index 0000000000000000000000000000000000000000..f44a26fa33a626bb5aee18b0b79896081d7da264
--- /dev/null
+++ b/GaudiExamples/home/HistoEx2.pyref.i686-dbg
@@ -0,0 +1,334 @@
+
+*******************************************************************************
+*                                                                             *
+* Simple example which illustrate the usage of useful algorithm  base class   *
+* HistoAlgo (python version of C++ GaudiHistoAlg) for 'easy' histogramming.   *
+*                                                                             *
+* This example illustrates the usage of 1D and 2D profile histograms          *
+*                                                                             *
+*******************************************************************************
+Vanya BELYAEV ibelyaev@physics.syr.edu
+ApplicationMgr    SUCCESS
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr $Revision: 1.77 $
+                                          running on lxplus439.cern.ch on Tue Feb 22 11:48:16 2011
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+ApplicationMgr       INFO Successfully loaded modules : GaudiAlg, RootHistCnv
+HistogramPersis...   INFO  'CnvServices':[ 'HbookHistSvc' , 'RootHistSvc' ]
+RootHistSvc          INFO Writing ROOT histograms to: histo1.root
+HistogramPersis...   INFO Added successfully Conversion service:RootHistSvc
+DetectorDataSvc      INFO Detector description not requested to be loaded
+EventLoopMgr      WARNING Unable to locate service "EventSelector"
+EventLoopMgr      WARNING No events will be processed from external input.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr       INFO Application Manager Started successfully
+RndmGenSvc.Engine    INFO Generator engine type:CLHEP::RanluxEngine
+RndmGenSvc.Engine    INFO Current Seed:1234567 Luxury:3
+RndmGenSvc           INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngine>
+ Alg='HistoEx', ID=' 3D histo ' , Histo= ID= 3D histo                  " 3D histo "                                     Ents/All=20000/20000<X>/sX=4.5/2.8723,<Y>/sY=4.5/2.8723,<Z>/sZ=4.5/2.8723
+ Alg='HistoEx', ID=' 2D histo ' , Histo=Histogram 2D " 2D histo " 20 xbins [0.000000,20.000000], 20 ybins [0.000000,20.000000]
+ Alg='HistoEx', ID=' 1D histo ' , Histo=Histogram 1D " 1D histo " 20 bins [0.000000,20.000000]
+
+ Histo TES   : "HistoEx/ 1D histo "
+ Histo Title : " 1D histo "
+
+ Mean        :         4.5 +- 0.2031
+ Rms         :      2.8723 +- 0.09994
+ Skewness    :     0.52751 +- 0.1706
+ Kurtosis    :     -1.0415 +- 0.3337
+
+ Entries     :
+ |    All    |  In Range | Underflow |  Overflow | #Equivalent |   Integral  |    Total    |
+ |    200    |    200    |     0     |     0     |     200     |     200     |     200     |
+
+ Annotation
+ | Title                     :  1D histo                                     |
+ | title                     :  1D histo                                     |
+ | id                        :  1D histo                                     |
+
+
+         25   ++----+----+----+----+
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+              |**********.    .    |
+              |IIIIIIIIII.    .    |
+       16.7   +IIIIIIIIII..........+
+              |IIIIIIIIII.    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+       8.33   ++...................+
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+   2.22e-16   ++----+----+----+----+
+            U
+            N                        O
+            D                        V
+            E                        E
+            R                        R
+            F                        F
+            L                        L
+            O            1    1    2 O
+            W 00    5    0    5    0 W
+
+
+
+
+ Alg='HistoEx1', ID=' 3D histo ' , Histo= ID= 3D histo                  " 3D histo "                                     Ents/All=20000/20000<X>/sX=4.5/2.8723,<Y>/sY=4.5/2.8723,<Z>/sZ=4.5/2.8723
+ Alg='HistoEx1', ID=' 2D histo ' , Histo=Histogram 2D " 2D histo " 20 xbins [0.000000,20.000000], 20 ybins [0.000000,20.000000]
+ Alg='HistoEx1', ID=' 1D histo ' , Histo=Histogram 1D " 1D histo " 20 bins [0.000000,20.000000]
+
+ Histo TES   : "HistoEx1/ 1D histo "
+ Histo Title : " 1D histo "
+
+ Mean        :         4.5 +- 0.2031
+ Rms         :      2.8723 +- 0.09994
+ Skewness    :     0.52751 +- 0.1706
+ Kurtosis    :     -1.0415 +- 0.3337
+
+ Entries     :
+ |    All    |  In Range | Underflow |  Overflow | #Equivalent |   Integral  |    Total    |
+ |    200    |    200    |     0     |     0     |     200     |     33.2    |     33.2    |
+
+ Annotation
+ | Title                     :  1D histo                                     |
+ | title                     :  1D histo                                     |
+ | id                        :  1D histo                                     |
+
+
+        4.5   ++----+----+----+----+
+              ||    .    .    .    |
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+       3.38   +IIIIIIIIII..........+
+              |**********.    .    |
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+              |IIIIIIIIII.    .    |
+       2.25   ++...................+
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+       1.12   ++...................+
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+              ||    .    .    .    |
+          0 *-++----+----**********->*
+            U
+            N                        O
+            D                        V
+            E                        E
+            R                        R
+            F                        F
+            L                        L
+            O            1    1    2 O
+            W 00    5    0    5    0 W
+
+
+
+
+ Alg='HistoEx2', ID=' x vs y    (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0xa058dbc>
+
+ Histo TES   : "HistoEx2/ x vs y    (profile)"
+ Histo Title : " x vs y    (profile)"
+
+ Mean        :  -0.0052704
+ Rms         :      0.8777
+
+ Entries     :
+ |    All    |  In Range | Underflow |  Overflow |   Integral  |    Total    |
+ |   200000  |   200000  |    4608   |    4544   |   -0.54562  |   -1083.8   |
+
+ Annotation
+ | Title                     :  x vs y    (profile)                          |
+ | title                     :  x vs y    (profile)                          |
+ | Name                      :  x vs y    (profile)                          |
+ | id                        :  x vs y    (profile)                          |
+
+
+        1.5   +----+----+----+----+----+----+----+----+----+----++
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+        0.5   +........................+.........................+
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .   I.|
+          0 *-+*************************************************I->*
+              |  I I    .    .    .    |    .    .    .    .  I *|
+       -0.5   +........................+.........................+
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+       -1.5   +........................+.........................+
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+       -2.5   +----+----+----+----+----+----+----+----+----+----++
+            U
+            N                                                      O
+            D                                                      V
+            E                                                      E
+            R      -    -    -    -    -                           R
+            F      1    1    0    0    0    0    0    1    1    1  F
+            L      .    .    .    .    .    .    .    .    .    .  L
+            O -    6    2    8    4    0    3    7    1    5    9  O
+            W 2    8    8    8    8    8    2    2    2    2    22 W
+
+
+
+
+ Alg='HistoEx2', ID=' x vs y+3x ' , Histo=Histogram 2D " x vs y+3x " 50 xbins [-2.000000,2.000000], 50 ybins [-4.000000,4.000000]
+ Alg='HistoEx2', ID=' x vs y+3x (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0xa059e74>
+
+ Histo TES   : "HistoEx2/ x vs y+3x (profile)"
+ Histo Title : " x vs y+3x (profile)"
+
+ Mean        :  -0.0052704
+ Rms         :      0.8777
+
+ Entries     :
+ |    All    |  In Range | Underflow |  Overflow |   Integral  |    Total    |
+ |   200000  |   200000  |    4608   |    4544   |   -0.54771  |   -4660.5   |
+
+ Annotation
+ | Title                     :  x vs y+3x (profile)                          |
+ | title                     :  x vs y+3x (profile)                          |
+ | Name                      :  x vs y+3x (profile)                          |
+ | id                        :  x vs y+3x (profile)                          |
+
+
+         15   +----+----+----+----+----+----+----+----+----+----++
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .  ***|
+              |    .    .    .    .    |    .    .    .    ***I .|
+              |    .    .    .    .    |    .    .    . ***.    .|
+              |    .    .    .    .    |    .    .   ***I  .    .| *
+          5   +........................+..........***............+
+              |    .    .    .    .    |    .  ***    .    .    .|
+              |    .    .    .    .    |    ***  .    .    .    .|
+              |    .    .    .    .    | ***.    .    .    .    .|
+          0  -+----+----+----+----+---I**---+----+----+----+----+->
+              |    .    .    .    . ***|    .    .    .    .    .|
+              |    .    .    .   ***   |    .    .    .    .    .|
+         -5   +...............***......+.........................+
+              |    .    . I***    .    |    .    .    .    .    .|
+            * |    .    ***  .    .    |    .    .    .    .    .|
+              |    . ***.    .    .    |    .    .    .    .    .|
+              |   ***   .    .    .    |    .    .    .    .    .|
+              |*** .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+        -15   +----+----+----+----+----+----+----+----+----+----++
+            U
+            N                                                      O
+            D                                                      V
+            E                                                      E
+            R      -    -    -    -    -                           R
+            F      1    1    0    0    0    0    0    1    1    1  F
+            L      .    .    .    .    .    .    .    .    .    .  L
+            O -    6    2    8    4    0    3    7    1    5    9  O
+            W 2    8    8    8    8    8    2    2    2    2    22 W
+
+
+
+
+ Alg='HistoEx2', ID=' x vs y-3x ' , Histo=Histogram 2D " x vs y-3x " 50 xbins [-2.000000,2.000000], 50 ybins [-4.000000,4.000000]
+ Alg='HistoEx2', ID=' x vs y    ' , Histo=Histogram 2D " x vs y    " 50 xbins [-2.000000,2.000000], 50 ybins [-4.000000,4.000000]
+ Alg='HistoEx2', ID=' x vs y-3x (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0xa05ae9c>
+
+ Histo TES   : "HistoEx2/ x vs y-3x (profile)"
+ Histo Title : " x vs y-3x (profile)"
+
+ Mean        :  -0.0052704
+ Rms         :      0.8777
+
+ Entries     :
+ |    All    |  In Range | Underflow |  Overflow |   Integral  |    Total    |
+ |   200000  |   200000  |    4608   |    4544   |   -0.54353  |    2492.9   |
+
+ Annotation
+ | Title                     :  x vs y-3x (profile)                          |
+ | title                     :  x vs y-3x (profile)                          |
+ | Name                      :  x vs y-3x (profile)                          |
+ | id                        :  x vs y-3x (profile)                          |
+
+
+         15   +----+----+----+----+----+----+----+----+----+----++
+              |    .    .    .    .    |    .    .    .    .    .|
+              |    .    .    .    .    |    .    .    .    .    .|
+              |*** .    .    .    .    |    .    .    .    .    .|
+              |  I***   .    .    .    |    .    .    .    .    .|
+              |    . ***.    .    .    |    .    .    .    .    .|
+            * |    .    ***  .    .    |    .    .    .    .    .|
+          5   +............**I.........+.........................+
+              |    .    .    **** .    |    .    .    .    .    .|
+              |    .    .    .  I**I   |    .    .    .    .    .|
+              |    .    .    .    .****|    .    .    .    .    .|
+          0  -+----+----+----+----+---I***--+----+----+----+----+->
+              |    .    .    .    .    |  ***    .    .    .    .|
+              |    .    .    .    .    |    I**I .    .    .    .|
+         -5   +........................+.......***I..............+
+              |    .    .    .    .    |    .    .***I.    .    .|
+              |    .    .    .    .    |    .    .   ***   .    .| *
+              |    .    .    .    .    |    .    .    . ***.    .|
+              |    .    .    .    .    |    .    .    .    ***  .|
+              |    .    .    .    .    |    .    .    .    .  ***|
+              |    .    .    .    .    |    .    .    .    .    .|
+        -15   +----+----+----+----+----+----+----+----+----+----++
+            U
+            N                                                      O
+            D                                                      V
+            E                                                      E
+            R      -    -    -    -    -                           R
+            F      1    1    0    0    0    0    0    1    1    1  F
+            L      .    .    .    .    .    .    .    .    .    .  L
+            O -    6    2    8    4    0    3    7    1    5    9  O
+            W 2    8    8    8    8    8    2    2    2    2    22 W
+
+
+
+
+ApplicationMgr       INFO Application Manager Stopped successfully
+HistoEx           SUCCESS Booked 3 Histogram(s) : 1D=1 2D=1 3D=1
+HistoEx           SUCCESS List of booked 1D histograms in directory         "HistoEx" :-
+ | ID                        |   Title                                       |    #    |     Mean   |    RMS     |  Skewness  |  Kurtosis  |
+ |  1D histo                 | " 1D histo "                                  |   200   |        4.5 | 2.8723     |    0.52751 |    -1.0415 |
+HistoEx           SUCCESS List of booked 2D histograms in directory         "HistoEx" :-
+ ID= 2D histo                  " 2D histo "                                     Ents/All= 2000/2000 <X>/sX=4.5/2.8723,<Y>/sY=4.5/2.8723
+HistoEx           SUCCESS List of booked 3D histograms in directory         "HistoEx" :-
+ ID= 3D histo                  " 3D histo "                                     Ents/All=20000/20000<X>/sX=4.5/2.8723,<Y>/sY=4.5/2.8723,<Z>/sZ=4.5/2.8723
+HistoEx1          SUCCESS Booked 3 Histogram(s) : 1D=1 2D=1 3D=1
+HistoEx1          SUCCESS List of booked 1D histograms in directory         "HistoEx1" :-
+ | ID                        |   Title                                       |    #    |     Mean   |    RMS     |  Skewness  |  Kurtosis  |
+ |  1D histo                 | " 1D histo "                                  |   200   |        4.5 | 2.8723     |    0.52751 |    -1.0415 |
+HistoEx1          SUCCESS List of booked 2D histograms in directory         "HistoEx1" :-
+ ID= 2D histo                  " 2D histo "                                     Ents/All= 2000/2000 <X>/sX=4.5/2.8723,<Y>/sY=4.5/2.8723
+HistoEx1          SUCCESS List of booked 3D histograms in directory         "HistoEx1" :-
+ ID= 3D histo                  " 3D histo "                                     Ents/All=20000/20000<X>/sX=4.5/2.8723,<Y>/sY=4.5/2.8723,<Z>/sZ=4.5/2.8723
+HistoEx2          SUCCESS Booked 6 Histogram(s) : 2D=3 1DProf=3
+HistoEx2          SUCCESS List of booked 2D histograms in directory         "HistoEx2" :-
+ ID= x vs y                    " x vs y    "                                    Ents/All=200000/200000<X>/sX=-0.0052187/0.87769,<Y>/sY=-0.0052098/0.99916
+ ID= x vs y+3x                 " x vs y+3x "                                    Ents/All=190894/200000<X>/sX=-0.00098056/0.69603,<Y>/sY=-0.0079536/2.0724
+ ID= x vs y-3x                 " x vs y-3x "                                    Ents/All=190896/200000<X>/sX=-0.0018744/0.6958,<Y>/sY=-0.00026366/2.0675
+HistoEx2          SUCCESS List of booked 1D profile histograms in directory "HistoEx2" :-
+ ID= x vs y    (profile)       " x vs y    (profile)"                           Ents/All=190848/200000<X>/sX=-0.0052704/0.8777
+ ID= x vs y+3x (profile)       " x vs y+3x (profile)"                           Ents/All=190848/200000<X>/sX=-0.0052704/0.8777
+ ID= x vs y-3x (profile)       " x vs y-3x (profile)"                           Ents/All=190848/200000<X>/sX=-0.0052704/0.8777
+EventLoopMgr         INFO Histograms converted successfully according to request.
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/GaudiExamples/home/HistoEx2.pyref.i686 b/GaudiExamples/home/HistoEx2.pyref.i686-opt
similarity index 100%
rename from GaudiExamples/home/HistoEx2.pyref.i686
rename to GaudiExamples/home/HistoEx2.pyref.i686-opt
diff --git a/GaudiExamples/home/History.ref b/GaudiExamples/home/History.ref
index 757debf9d9898dc4142a0c93b880ef20d3ed3526..0d10c913a12c4ff6dffb0a9aa7311b62a0515ecf 100644
--- a/GaudiExamples/home/History.ref
+++ b/GaudiExamples/home/History.ref
@@ -29,7 +29,7 @@ ApplicationMgr      DEBUG Getting my own properties
 ApplicationMgr    SUCCESS
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr $Revision: 1.77 $
-                                          running on lxplus258.cern.ch on Thu Jan  6 13:00:56 2011
+                                          running on lxplus416.cern.ch on Wed Mar 16 14:08:11 2011
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 ServiceManager      DEBUG Initializing service StatusCodeSvc
@@ -57,7 +57,6 @@ HistogramPersis...  DEBUG Service base class initialized successfully
 HistogramDataSvc  VERBOSE ServiceLocatorHelper::service: found service HistogramPersistencySvc
 ServiceManager      DEBUG Initializing service HistorySvc
 HistorySvc          DEBUG Service base class initialized successfully
-HistorySvc          DEBUG Initializing HistorySvc
 AlgContextSvc       DEBUG Service base class initialized successfully
 AlgContextSvc     VERBOSE ServiceLocatorHelper::service: found service IncidentSvc
 IncidentSvc         DEBUG Adding [BeginEvent] listener 'AlgContextSvc' with priority 0
@@ -83,23 +82,9 @@ ApplicationMgr       INFO Application Manager Started successfully
 IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
 IncidentSvc       VERBOSE Calling 'HistorySvc' for incident [BeginEvent]
 HistorySvc        VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc
-HistorySvc          DEBUG Registering algorithm: History
-HistorySvc           INFO Registered 1 Algorithms
+HistorySvc           INFO Registered 1 Algorithms
 HistorySvc           INFO Registered 0 AlgTools
-HistorySvc          DEBUG Registering Service: StatusCodeSvc
-HistorySvc          DEBUG Registering Service: MessageSvc
-HistorySvc          DEBUG Registering Service: JobOptionsSvc
-HistorySvc          DEBUG Registering Service: AppMgrRunable
-HistorySvc          DEBUG Registering Service: IncidentSvc
-HistorySvc          DEBUG Registering Service: EventPersistencySvc
-HistorySvc          DEBUG Registering Service: EventDataSvc
-HistorySvc          DEBUG Registering Service: HistogramPersistencySvc
-HistorySvc          DEBUG Registering Service: HistogramDataSvc
-HistorySvc          DEBUG Registering Service: AlgContextSvc
-HistorySvc          DEBUG Registering Service: ToolSvc
-HistorySvc          DEBUG Registering Service: EventLoopMgr
-HistorySvc          DEBUG Registering Service: HistorySvc
-HistorySvc           INFO Registered 13 Services
+HistorySvc           INFO Registered 13 Services
 IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
 IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
 ServiceManager      DEBUG Stopping service HistorySvc
diff --git a/GaudiExamples/home/History.ref.dbg b/GaudiExamples/home/History.ref.dbg
new file mode 100644
index 0000000000000000000000000000000000000000..757debf9d9898dc4142a0c93b880ef20d3ed3526
--- /dev/null
+++ b/GaudiExamples/home/History.ref.dbg
@@ -0,0 +1,154 @@
+JobOptionsSvc        INFO
+//GP:================================================================================
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/History.opts" (0,0)
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Common.opts" (5,10)
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Services.opts" (7,10)
+AuditorSvc.Auditors =  [ "ChronoAuditor" ] ;                            //GP: (1,1)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Services.opts" (24,1)
+ApplicationMgr.StatusCodeCheck = 1;                                     //GP: (7,10)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Common.opts" (16,1)
+ApplicationMgr.TopAlg =  [ "History" ] ;                                //GP: (5,10)
+ApplicationMgr.ActivateHistory = 1;                                     //GP: (5,10)
+MessageSvc.OutputLevel = 1;                                             //GP: (5,10)
+MessageSvc.useColors = 1;                                               //GP: (5,10)
+MessageSvc.setVerbose +=  [ "HistorySvc" ] ;                            //GP: (5,10)
+MessageSvc.setDebug +=  [ "FastHistorySvc" ] ;                          //GP: (5,10)
+MessageSvc.setDebug +=  [ "StatusCodeSvc" , "IncidentSvc" ] ;           //GP: (5,10)
+HistorySvc.Dump = 0;                                                    //GP: (5,10)
+HistorySvc.OutputFile = "history.dat";                                  //GP: (5,10)
+HistorySvc.OutputLevel = 0;                                             //GP: (5,10)
+FastHistorySvc.Dump = 1;                                                //GP: (5,10)
+FastHistorySvc.OutputFile = "history.dat";                              //GP: (5,10)
+ApplicationMgr.EvtMax = 2;                                              //GP: (5,10)
+ApplicationMgr.EvtSel = "NONE";                                         //GP: (5,10)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/History.opts" (43,1)
+//GP:================================================================================
+
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/History.opts
+ApplicationMgr      DEBUG Getting my own properties
+ApplicationMgr    SUCCESS
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr $Revision: 1.77 $
+                                          running on lxplus258.cern.ch on Thu Jan  6 13:00:56 2011
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+ServiceManager      DEBUG Initializing service StatusCodeSvc
+StatusCodeSvc       DEBUG Service base class initialized successfully
+StatusCodeSvc        INFO initialize
+ServiceManager      DEBUG Initializing service AppMgrRunable
+AppMgrRunable       DEBUG Service base class initialized successfully
+ServiceManager      DEBUG Initializing service EventLoopMgr
+EventLoopMgr        DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [AbortEvent] listener '<unknown>' with priority 0
+EventLoopMgr        DEBUG Creating Top Algorithm History with name History
+History           VERBOSE ServiceLocatorHelper::service: found service HistorySvc
+History              INFO got historySvc: HistorySvc
+EventDataSvc        DEBUG Service base class initialized successfully
+EventDataSvc      VERBOSE ServiceLocatorHelper::service: found service IncidentSvc
+EventPersistenc...  DEBUG Service base class initialized successfully
+EventLoopMgr      WARNING Unable to locate service "EventSelector" 
+EventLoopMgr      WARNING No events will be processed from external input.
+HistogramDataSvc    DEBUG Service base class initialized successfully
+HistogramDataSvc  VERBOSE ServiceLocatorHelper::service: found service IncidentSvc
+HistogramPersis...   INFO  'CnvServices':[ 'HbookHistSvc' , 'RootHistSvc' ]
+HistogramPersis...  DEBUG Service base class initialized successfully
+HistogramPersis...WARNING Histograms saving not required.
+HistogramDataSvc  VERBOSE ServiceLocatorHelper::service: found service HistogramPersistencySvc
+ServiceManager      DEBUG Initializing service HistorySvc
+HistorySvc          DEBUG Service base class initialized successfully
+HistorySvc          DEBUG Initializing HistorySvc
+AlgContextSvc       DEBUG Service base class initialized successfully
+AlgContextSvc     VERBOSE ServiceLocatorHelper::service: found service IncidentSvc
+IncidentSvc         DEBUG Adding [BeginEvent] listener 'AlgContextSvc' with priority 0
+IncidentSvc         DEBUG Adding [EndEvent] listener 'AlgContextSvc' with priority 0
+HistorySvc        VERBOSE ServiceLocatorHelper::service: found service AlgContextSvc
+HistorySvc        VERBOSE ServiceLocatorHelper::service: found service IncidentSvc
+ToolSvc             DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [BeginEvent] listener 'HistorySvc' with priority -9223372036854775808
+ApplicationMgr       INFO Application Manager Initialized successfully
+ServiceManager      DEBUG Starting service StatusCodeSvc
+ServiceManager      DEBUG Starting service AppMgrRunable
+ServiceManager      DEBUG Starting service IncidentSvc
+ServiceManager      DEBUG Starting service EventPersistencySvc
+ServiceManager      DEBUG Starting service EventDataSvc
+ServiceManager      DEBUG Starting service HistogramPersistencySvc
+ServiceManager      DEBUG Starting service HistogramDataSvc
+ServiceManager      DEBUG Starting service AlgContextSvc
+ServiceManager      DEBUG Starting service ToolSvc
+ToolSvc             DEBUG START transition for AlgTools
+ServiceManager      DEBUG Starting service EventLoopMgr
+ServiceManager      DEBUG Starting service HistorySvc
+ApplicationMgr       INFO Application Manager Started successfully
+IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
+IncidentSvc       VERBOSE Calling 'HistorySvc' for incident [BeginEvent]
+HistorySvc        VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc
+HistorySvc          DEBUG Registering algorithm: History
+HistorySvc           INFO Registered 1 Algorithms
+HistorySvc           INFO Registered 0 AlgTools
+HistorySvc          DEBUG Registering Service: StatusCodeSvc
+HistorySvc          DEBUG Registering Service: MessageSvc
+HistorySvc          DEBUG Registering Service: JobOptionsSvc
+HistorySvc          DEBUG Registering Service: AppMgrRunable
+HistorySvc          DEBUG Registering Service: IncidentSvc
+HistorySvc          DEBUG Registering Service: EventPersistencySvc
+HistorySvc          DEBUG Registering Service: EventDataSvc
+HistorySvc          DEBUG Registering Service: HistogramPersistencySvc
+HistorySvc          DEBUG Registering Service: HistogramDataSvc
+HistorySvc          DEBUG Registering Service: AlgContextSvc
+HistorySvc          DEBUG Registering Service: ToolSvc
+HistorySvc          DEBUG Registering Service: EventLoopMgr
+HistorySvc          DEBUG Registering Service: HistorySvc
+HistorySvc           INFO Registered 13 Services
+IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
+IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
+ServiceManager      DEBUG Stopping service HistorySvc
+ServiceManager      DEBUG Stopping service EventLoopMgr
+IncidentSvc       VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
+ServiceManager      DEBUG Stopping service ToolSvc
+ToolSvc             DEBUG STOP transition for AlgTools
+ServiceManager      DEBUG Stopping service AlgContextSvc
+ServiceManager      DEBUG Stopping service HistogramDataSvc
+ServiceManager      DEBUG Stopping service HistogramPersistencySvc
+ServiceManager      DEBUG Stopping service EventDataSvc
+ServiceManager      DEBUG Stopping service EventPersistencySvc
+ServiceManager      DEBUG Stopping service IncidentSvc
+ServiceManager      DEBUG Stopping service AppMgrRunable
+ServiceManager      DEBUG Stopping service StatusCodeSvc
+ApplicationMgr       INFO Application Manager Stopped successfully
+ServiceManager      DEBUG Finalizing service HistorySvc
+HistorySvc           INFO Service finalised successfully
+ServiceManager      DEBUG Finalizing service EventLoopMgr
+IncidentSvc         DEBUG Removing [AbortEvent] listener '<unknown>'
+EventLoopMgr         INFO Histograms converted successfully according to request.
+ServiceManager      DEBUG Finalizing service ToolSvc
+ToolSvc              INFO Removing all tools created by ToolSvc
+ToolSvc             DEBUG   Tool List : 
+ToolSvc             DEBUG Deleting 0 finalized tools
+ServiceManager      DEBUG Finalizing service AlgContextSvc
+IncidentSvc         DEBUG Removing [BeginEvent] listener 'AlgContextSvc'
+IncidentSvc         DEBUG Removing [EndEvent] listener 'AlgContextSvc'
+ServiceManager      DEBUG Finalizing service EventDataSvc
+ServiceManager      DEBUG Finalizing service EventPersistencySvc
+ServiceManager      DEBUG Finalizing service IncidentSvc
+IncidentSvc         DEBUG Incident  timing: Mean(+-rms)/Min/Max:0(+-0)/0/0[ms] Total:0[s]
+ServiceManager      DEBUG Finalizing service AppMgrRunable
+ServiceManager      DEBUG Finalizing service HistogramDataSvc
+ServiceManager      DEBUG Finalizing service HistogramPersistencySvc
+ServiceManager      DEBUG Finalizing service StatusCodeSvc
+ServiceManager      DEBUG Service reference count check:
+ServiceManager      DEBUG ---- StatusCodeSvc (refCount = 3)
+ServiceManager      DEBUG ---- MessageSvc (refCount = 15)
+ServiceManager      DEBUG ---- JobOptionsSvc (refCount = 4)
+ServiceManager      DEBUG ---- HistogramPersistencySvc (refCount = 3)
+ServiceManager      DEBUG ---- HistogramDataSvc (refCount = 4)
+ServiceManager      DEBUG ---- AppMgrRunable (refCount = 4)
+ServiceManager      DEBUG ---- IncidentSvc (refCount = 4)
+ServiceManager      DEBUG ---- EventPersistencySvc (refCount = 3)
+ServiceManager      DEBUG ---- EventDataSvc (refCount = 4)
+ServiceManager      DEBUG ---- AlgContextSvc (refCount = 4)
+ServiceManager      DEBUG ---- ToolSvc (refCount = 4)
+ServiceManager      DEBUG ---- EventLoopMgr (refCount = 4)
+ServiceManager      DEBUG ---- HistorySvc (refCount = 4)
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/GaudiExamples/home/IncidentSvc.ref b/GaudiExamples/home/IncidentSvc.ref
index d525b3d9178cfe77496da38a43d3a8cb13c90f96..a3bdb2c28e482b47e4a940fdbcc43e276e067484 100644
--- a/GaudiExamples/home/IncidentSvc.ref
+++ b/GaudiExamples/home/IncidentSvc.ref
@@ -1,25 +1,25 @@
 JobOptionsSvc        INFO
 //GP:================================================================================
-//GP: include "../options/IncidentSvc.opts"                                   (0,0)
-//GP: include "../options/Common.opts"                                        (4,10)
-//GP: include "../options/Services.opts"                                      (7,10)
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/IncidentSvc.opts" (0,0)
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Common.opts" (4,10)
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Services.opts" (7,10)
 AuditorSvc.Auditors =  [ "ChronoAuditor" ] ;                            //GP: (1,1)
-//GP: end  "../options/Services.opts"                                         (24,1)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Services.opts" (24,1)
 ApplicationMgr.StatusCodeCheck = 1;                                     //GP: (7,10)
-//GP: end  "../options/Common.opts"                                           (16,1)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/Common.opts" (16,1)
 ApplicationMgr.TopAlg =  [ "IncidentListenerTestAlg" ] ;                //GP: (4,10)
 MessageSvc.OutputLevel = 3;                                             //GP: (4,10)
 ApplicationMgr.EvtMax = 5;                                              //GP: (4,10)
 ApplicationMgr.EvtSel = "NONE";                                         //GP: (4,10)
 ApplicationMgr.HistogramPersistency = "NONE";                           //GP: (4,10)
-//GP: end  "../options/IncidentSvc.opts"                                      (20,1)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/IncidentSvc.opts" (20,1)
 //GP:================================================================================
 
-JobOptionsSvc        INFO Job options successfully read in from ../options/IncidentSvc.opts
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/IncidentSvc.opts
 ApplicationMgr    SUCCESS
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr $Revision: 1.6 $
-                                          running on pclhcb55.cern.ch on Fri Jun  6 14:45:53 2008
+                                                   Welcome to ApplicationMgr $Revision: 1.77 $
+                                          running on lxplus416.cern.ch on Fri Apr  8 18:18:11 2011
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 StatusCodeSvc        INFO initialize
@@ -32,47 +32,57 @@ ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr       INFO Application Manager Started successfully
 EventBoundary        INFO Handling incident 'BeginEvent'
 Generic Listener     INFO Handling incident 'BeginEvent'
+Generic Listener     INFO Handling incident 'BeginProcessing'
 IncidentListene...   INFO Firing incident
 Listener 0           INFO Handling incident 'TestIncident'
 Listener 1           INFO Handling incident 'TestIncident'
 Listener 2           INFO Handling incident 'TestIncident'
 Listener 3           INFO Handling incident 'TestIncident'
 Generic Listener     INFO Handling incident 'TestIncident'
+Generic Listener     INFO Handling incident 'EndProcessing'
 EventBoundary        INFO Handling incident 'EndEvent'
 Generic Listener     INFO Handling incident 'EndEvent'
 EventBoundary        INFO Handling incident 'BeginEvent'
 Generic Listener     INFO Handling incident 'BeginEvent'
+Generic Listener     INFO Handling incident 'BeginProcessing'
 IncidentListene...   INFO Firing incident
 Listener 0           INFO Handling incident 'TestIncident'
 Listener 1           INFO Handling incident 'TestIncident'
 Listener 2           INFO Handling incident 'TestIncident'
 Generic Listener     INFO Handling incident 'TestIncident'
+Generic Listener     INFO Handling incident 'EndProcessing'
 EventBoundary        INFO Handling incident 'EndEvent'
 Generic Listener     INFO Handling incident 'EndEvent'
 EventBoundary        INFO Handling incident 'BeginEvent'
 Generic Listener     INFO Handling incident 'BeginEvent'
+Generic Listener     INFO Handling incident 'BeginProcessing'
 IncidentListene...   INFO Firing incident
 Listener 0           INFO Handling incident 'TestIncident'
 Listener 1           INFO Handling incident 'TestIncident'
 Listener 1           INFO deregistering
 Listener 2           INFO Handling incident 'TestIncident'
 Generic Listener     INFO Handling incident 'TestIncident'
+Generic Listener     INFO Handling incident 'EndProcessing'
 EventBoundary        INFO Handling incident 'EndEvent'
 Generic Listener     INFO Handling incident 'EndEvent'
 EventBoundary        INFO Handling incident 'BeginEvent'
 Generic Listener     INFO Handling incident 'BeginEvent'
+Generic Listener     INFO Handling incident 'BeginProcessing'
 IncidentListene...   INFO Firing incident
 Listener 0           INFO Handling incident 'TestIncident'
 Listener 2           INFO Handling incident 'TestIncident'
 Generic Listener     INFO Handling incident 'TestIncident'
+Generic Listener     INFO Handling incident 'EndProcessing'
 EventBoundary        INFO Handling incident 'EndEvent'
 Generic Listener     INFO Handling incident 'EndEvent'
 EventBoundary        INFO Handling incident 'BeginEvent'
 Generic Listener     INFO Handling incident 'BeginEvent'
+Generic Listener     INFO Handling incident 'BeginProcessing'
 IncidentListene...   INFO Firing incident
 Listener 0           INFO Handling incident 'TestIncident'
 Listener 2           INFO Handling incident 'TestIncident'
 Generic Listener     INFO Handling incident 'TestIncident'
+Generic Listener     INFO Handling incident 'EndProcessing'
 EventBoundary        INFO Handling incident 'EndEvent'
 Generic Listener     INFO Handling incident 'EndEvent'
 ApplicationMgr       INFO Application Manager Stopped successfully
diff --git a/GaudiExamples/home/THistRead.ref b/GaudiExamples/home/THistRead.ref
index 2fc04fdd71dde9aec51be68c77cbff046669b05d..adfe8e5bd981d659956f6e94b5c5957540e6dc9f 100644
--- a/GaudiExamples/home/THistRead.ref
+++ b/GaudiExamples/home/THistRead.ref
@@ -21,7 +21,7 @@ JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/use
 ApplicationMgr    SUCCESS
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr $Revision: 1.77 $
-                                          running on pclhcb55 on Fri Jun 25 09:45:03 2010
+                                          running on lxplus416.cern.ch on Wed Mar 16 14:20:13 2011
 ====================================================================================================================================
 ApplicationMgr    VERBOSE declareMultiSvcType: declared service EvtDataSvc/EventDataSvc
 ApplicationMgr    VERBOSE declareMultiSvcType: declared service DetDataSvc/DetectorDataSvc
@@ -79,65 +79,18 @@ HistogramPersis...   INFO  'CnvServices':[ 'HbookHistSvc' , 'RootHistSvc' ]
 HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr       INFO Application Manager Started successfully
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
-THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
-THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
 ApplicationMgr       INFO Application Manager Stopped successfully
 EventLoopMgr         INFO Histograms converted successfully according to request.
 THistSvc            DEBUG THistSvc::finalize
-THistSvc            DEBUG uid: "/read1/xxx/1Dgauss"  temp: 0  dir: tuple2.rt:/xxx
-THistSvc            DEBUG uid: "/read2/2Dgauss"  temp: 0  dir: tuple3.rt:/
-THistSvc            DEBUG uid: "/read2/3Dgauss"  temp: 0  dir: tuple3.rt:/
-THistSvc            DEBUG uid: "/read2/profile"  temp: 0  dir: tuple3.rt:/
-THistSvc            DEBUG uid: "/read2/trees/stuff/treename"  temp: 0  dir: tuple3.rt:/trees/stuff
 THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT 
 THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple2.rt"
 THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple3.rt"
 THistSvc             INFO Listing contents of ROOT files: 
-THistSvc            DEBUG finalizing stream/file read1:tuple2.rt
 THistSvc             INFO ==> File: tuple2.rt  stream: read1
 TFile: name=tuple2.rt, title=upd, option=READ
 TH1.Print Name  = 1Dgauss, Entries= 20000, Total sum= 19984
           Title = 1D Gaussian
           NbinsX= 100, xmin= -50, xmax=50
-THistSvc            DEBUG finalizing stream/file read2:tuple3.rt
 THistSvc             INFO ==> File: tuple3.rt  stream: read2
 TFile: name=tuple3.rt, title=rec, option=READ
 TH1.Print Name  = 2Dgauss, Entries= 20000, Total sum= 19978
diff --git a/GaudiExamples/home/THistRead.ref.dbg b/GaudiExamples/home/THistRead.ref.dbg
new file mode 100644
index 0000000000000000000000000000000000000000..2fc04fdd71dde9aec51be68c77cbff046669b05d
--- /dev/null
+++ b/GaudiExamples/home/THistRead.ref.dbg
@@ -0,0 +1,170 @@
+JobOptionsSvc        INFO
+//GP:================================================================================
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/THistRead.opts" (0,0)
+AuditorSvc.Auditors =  [ "ChronoAuditor" ] ;                            //GP: (1,1)
+ApplicationMgr.TopAlg =  [ "THistRead" ] ;                              //GP: (1,1)
+MessageSvc.OutputLevel = 3;                                             //GP: (1,1)
+MessageSvc.UseColors = 1;                                               //GP: (1,1)
+THistSvc.OutputLevel = 2;                                               //GP: (1,1)
+ApplicationMgr.OutputLevel = 1;                                         //GP: (1,1)
+ServiceManager.OutputLevel = 2;                                         //GP: (1,1)
+StatusCodeSvc.OutputLevel = 1;                                          //GP: (1,1)
+THistSvc.Input =  [ "read1 DATAFILE='tuple2.rt' TYP='ROOT' OPT='READ'" ] ;//GP: (1,1)
+THistSvc.Input +=  [ "read2 DATAFILE='tuple3.rt' TYP='ROOT' OPT='READ'" ] ;//GP: (1,1)
+THistSvc.PrintAll = 1;                                                  //GP: (1,1)
+ApplicationMgr.EvtMax = 20;                                             //GP: (1,1)
+ApplicationMgr.EvtSel = "NONE";                                         //GP: (1,1)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/THistRead.opts" (35,1)
+//GP:================================================================================
+
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/THistRead.opts
+ApplicationMgr    SUCCESS
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr $Revision: 1.77 $
+                                          running on pclhcb55 on Fri Jun 25 09:45:03 2010
+====================================================================================================================================
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service EvtDataSvc/EventDataSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service DetDataSvc/DetectorDataSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service HistogramSvc/HistogramDataSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service HbookCnv::PersSvc/HbookHistSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service RootHistCnv::PersSvc/RootHistSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service EvtPersistencySvc/EventPersistencySvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service DetPersistencySvc/DetectorPersistencySvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service HistogramPersistencySvc/HistogramPersistencySvc
+ApplicationMgr      DEBUG Loading declared DLL's
+ApplicationMgr    VERBOSE addMultiSvc: added service EventLoopMgr/EventLoopMgr
+ApplicationMgr       INFO Application Manager Configured successfully
+THistSvc            DEBUG Opening TFile "tuple2.rt"  stream: "read1"  mode: "O" comp level: 1
+THistSvc            DEBUG Opening TFile "tuple3.rt"  stream: "read2"  mode: "O" comp level: 1
+THistSvc            DEBUG Service base class initialized successfully
+THistSvc            DEBUG Read in TH1F  "1Dgauss" from file tuple2.rt
+TH1.Print Name  = 1Dgauss, Entries= 20000, Total sum= 19984
+THistSvc            DEBUG Registering TH1F title: "1D Gaussian"  id: "/read1/xxx/1Dgauss"  dir: tuple2.rt:/xxx  file: tuple2.rt
+THistRead            INFO 1Dgauss: 20000
+THistSvc            DEBUG Read in TH2F  "2Dgauss" from file tuple3.rt
+TH1.Print Name  = 2Dgauss, Entries= 20000, Total sum= 19978
+THistSvc            DEBUG Registering TH2F title: "2D Gaussian"  id: "/read2/2Dgauss"  dir: tuple3.rt:/  file: tuple3.rt
+THistRead            INFO 2Dgauss: 20000
+THistSvc            DEBUG Read in TH3F  "3Dgauss" from file tuple3.rt
+TH1.Print Name  = 3Dgauss, Entries= 20000, Total sum= 19944
+THistSvc            DEBUG Registering TH3F title: "3D Gaussian"  id: "/read2/3Dgauss"  dir: tuple3.rt:/  file: tuple3.rt
+THistRead            INFO 3Dgauss: 20000
+THistSvc            DEBUG Read in TProfile  "profile" from file tuple3.rt
+TH1.Print Name  = profile, Entries= 0, Total sum= 0
+THistSvc            DEBUG Registering TProfile title: "profile"  id: "/read2/profile"  dir: tuple3.rt:/  file: tuple3.rt
+THistRead            INFO profile: 0
+THistSvc            DEBUG Read in TTree  "treename" from file tuple3.rt
+******************************************************************************
+*Tree    :treename  : tree title                                             *
+*Entries :     1000 : Total =           14021 bytes  File  Size =       2333 *
+*        :          : Tree compression factor =   6.63                       *
+******************************************************************************
+*Br    0 :branch1   : point1/I                                               *
+*Entries :     1000 : Total  Size=       4557 bytes  File Size  =       1521 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=   2.68     *
+*............................................................................*
+*Br    1 :branch2   : point2/I                                               *
+*Entries :     1000 : Total  Size=       4557 bytes  File Size  =        164 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=  24.87     *
+*............................................................................*
+*Br    2 :branch3   : point3/I                                               *
+*Entries :     1000 : Total  Size=       4557 bytes  File Size  =        160 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=  25.49     *
+*............................................................................*
+THistSvc            DEBUG Registering TTree title: "tree title"  id: "/read2/trees/stuff/treename"  dir: tuple3.rt:/trees/stuff  file: tuple3.rt
+THistRead            INFO treename: 1000
+EventLoopMgr      WARNING Unable to locate service "EventSelector" 
+EventLoopMgr      WARNING No events will be processed from external input.
+HistogramPersis...   INFO  'CnvServices':[ 'HbookHistSvc' , 'RootHistSvc' ]
+HistogramPersis...WARNING Histograms saving not required.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr       INFO Application Manager Started successfully
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+THistSvc            DEBUG stream: read1  name: tuple2.rt  size: 4161
+THistSvc            DEBUG stream: read2  name: tuple3.rt  size: 88695
+ApplicationMgr       INFO Application Manager Stopped successfully
+EventLoopMgr         INFO Histograms converted successfully according to request.
+THistSvc            DEBUG THistSvc::finalize
+THistSvc            DEBUG uid: "/read1/xxx/1Dgauss"  temp: 0  dir: tuple2.rt:/xxx
+THistSvc            DEBUG uid: "/read2/2Dgauss"  temp: 0  dir: tuple3.rt:/
+THistSvc            DEBUG uid: "/read2/3Dgauss"  temp: 0  dir: tuple3.rt:/
+THistSvc            DEBUG uid: "/read2/profile"  temp: 0  dir: tuple3.rt:/
+THistSvc            DEBUG uid: "/read2/trees/stuff/treename"  temp: 0  dir: tuple3.rt:/trees/stuff
+THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT 
+THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple2.rt"
+THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple3.rt"
+THistSvc             INFO Listing contents of ROOT files: 
+THistSvc            DEBUG finalizing stream/file read1:tuple2.rt
+THistSvc             INFO ==> File: tuple2.rt  stream: read1
+TFile: name=tuple2.rt, title=upd, option=READ
+TH1.Print Name  = 1Dgauss, Entries= 20000, Total sum= 19984
+          Title = 1D Gaussian
+          NbinsX= 100, xmin= -50, xmax=50
+THistSvc            DEBUG finalizing stream/file read2:tuple3.rt
+THistSvc             INFO ==> File: tuple3.rt  stream: read2
+TFile: name=tuple3.rt, title=rec, option=READ
+TH1.Print Name  = 2Dgauss, Entries= 20000, Total sum= 19978
+          Title = 2D Gaussian
+          NbinsX= 100, xmin= -50, xmax=50, NbinsY= 100, ymin= -50, ymax=50
+TH1.Print Name  = 3Dgauss, Entries= 20000, Total sum= 19944
+          Title = 3D Gaussian
+          NbinsX= 100, xmin= -50, xmax=50, NbinsY= 100, ymin= -50, ymax=50, NbinsZ= 100, zmin= -50, zmax=50
+TH1.Print Name  = profile, Entries= 0, Total sum= 0
+          Title = profile
+          NbinsX= 100, xmin= -50, xmax=-50
+******************************************************************************
+*Tree    :treename  : tree title                                             *
+*Entries :     1000 : Total =           14021 bytes  File  Size =       2333 *
+*        :          : Tree compression factor =   6.63                       *
+******************************************************************************
+*Br    0 :branch1   : point1/I                                               *
+*Entries :     1000 : Total  Size=       4557 bytes  File Size  =       1521 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=   2.68     *
+*............................................................................*
+*Br    1 :branch2   : point2/I                                               *
+*Entries :     1000 : Total  Size=       4557 bytes  File Size  =        164 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=  24.87     *
+*............................................................................*
+*Br    2 :branch3   : point3/I                                               *
+*Entries :     1000 : Total  Size=       4557 bytes  File Size  =        160 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=  25.49     *
+*............................................................................*
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/GaudiExamples/home/THistWrite.ref b/GaudiExamples/home/THistWrite.ref
index 7fab78c479ea32edc42507afac5231c8a2f38aa5..36d7dff314eb8b166d6a2215178315ac4d963420 100644
--- a/GaudiExamples/home/THistWrite.ref
+++ b/GaudiExamples/home/THistWrite.ref
@@ -21,7 +21,7 @@ JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/use
 ApplicationMgr    SUCCESS
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr $Revision: 1.77 $
-                                          running on pclhcb55 on Fri Jun 25 09:23:43 2010
+                                          running on lxplus416.cern.ch on Wed Mar 16 14:08:49 2011
 ====================================================================================================================================
 ApplicationMgr    VERBOSE declareMultiSvcType: declared service EvtDataSvc/EventDataSvc
 ApplicationMgr    VERBOSE declareMultiSvcType: declared service DetDataSvc/DetectorDataSvc
@@ -58,63 +58,14 @@ ApplicationMgr       INFO Application Manager Started successfully
 RndmGenSvc.Engine    INFO Generator engine type:CLHEP::RanluxEngine
 RndmGenSvc.Engine    INFO Current Seed:1234567 Luxury:3
 RndmGenSvc           INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngine>
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
-THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
-THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
 ApplicationMgr       INFO Application Manager Stopped successfully
 THistWrite           INFO Finalizing...
 EventLoopMgr         INFO Histograms converted successfully according to request.
 THistSvc            DEBUG THistSvc::finalize
-THistSvc            DEBUG uid: "/new/Tree2"  temp: 1  dir: root:/
-THistSvc            DEBUG uid: "/rec/gauss2d"  temp: 0  dir: tuple3.rt:/
-THistSvc            DEBUG uid: "/rec/gauss3d"  temp: 0  dir: tuple3.rt:/
-THistSvc            DEBUG uid: "/rec/prof"  temp: 0  dir: tuple3.rt:/
-THistSvc            DEBUG uid: "/rec/trees/stuff/tree1"  temp: 0  dir: tuple3.rt:/trees/stuff
-THistSvc            DEBUG uid: "/temp/TempHist1"  temp: 1  dir: root:/
-THistSvc            DEBUG uid: "/temp/other/TempHist1a"  temp: 1  dir: root:/other
-THistSvc            DEBUG uid: "/upd/xxx/gauss1d"  temp: 0  dir: tuple2.rt:/xxx
 THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT 
 THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple2.rt"
 THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple3.rt"
 THistSvc             INFO Listing contents of ROOT files: 
-THistSvc            DEBUG finalizing stream/file rec:tuple3.rt
 THistSvc             INFO ==> File: tuple3.rt  stream: rec
 TFile: name=tuple3.rt, title=rec, option=CREATE
 TH1.Print Name  = 2Dgauss, Entries= 20000, Total sum= 19978
@@ -143,7 +94,6 @@ TH1.Print Name  = profile, Entries= 0, Total sum= 0
 *Entries :     1000 : Total  Size=       4565 bytes  File Size  =        160 *
 *Baskets :        1 : Basket Size=      32000 bytes  Compression=  25.49     *
 *............................................................................*
-THistSvc            DEBUG finalizing stream/file upd:tuple2.rt
 THistSvc             INFO ==> File: tuple2.rt  stream: upd
 TFile: name=tuple2.rt, title=upd, option=UPDATE
 TH1.Print Name  = 1Dgauss, Entries= 20000, Total sum= 19984
diff --git a/GaudiExamples/home/THistWrite.ref.dbg b/GaudiExamples/home/THistWrite.ref.dbg
new file mode 100644
index 0000000000000000000000000000000000000000..7fab78c479ea32edc42507afac5231c8a2f38aa5
--- /dev/null
+++ b/GaudiExamples/home/THistWrite.ref.dbg
@@ -0,0 +1,153 @@
+JobOptionsSvc        INFO
+//GP:================================================================================
+//GP: include "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/THistWrite.opts" (0,0)
+AuditorSvc.Auditors =  [ "ChronoAuditor" ] ;                            //GP: (1,1)
+ApplicationMgr.TopAlg =  [ "THistWrite" ] ;                             //GP: (1,1)
+MessageSvc.OutputLevel = 3;                                             //GP: (1,1)
+MessageSvc.UseColors = 1;                                               //GP: (1,1)
+THistSvc.OutputLevel = 2;                                               //GP: (1,1)
+ApplicationMgr.OutputLevel = 1;                                         //GP: (1,1)
+ServiceManager.OutputLevel = 2;                                         //GP: (1,1)
+StatusCodeSvc.OutputLevel = 1;                                          //GP: (1,1)
+THistSvc.Output +=  [ "upd DATAFILE='tuple2.rt' TYP='ROOT' OPT='UPDATE'" ] ;//GP: (1,1)
+THistSvc.Output +=  [ "rec DATAFILE='tuple3.rt' TYP='ROOT' OPT='RECREATE'" ] ;//GP: (1,1)
+THistSvc.PrintAll = 1;                                                  //GP: (1,1)
+ApplicationMgr.EvtMax = 20;                                             //GP: (1,1)
+ApplicationMgr.EvtSel = "NONE";                                         //GP: (1,1)
+//GP: end  "/afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/THistWrite.opts" (37,1)
+//GP:================================================================================
+
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/m/marcocle/scratch0/workspace/Gaudi/GaudiExamples/options/THistWrite.opts
+ApplicationMgr    SUCCESS
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr $Revision: 1.77 $
+                                          running on pclhcb55 on Fri Jun 25 09:23:43 2010
+====================================================================================================================================
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service EvtDataSvc/EventDataSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service DetDataSvc/DetectorDataSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service HistogramSvc/HistogramDataSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service HbookCnv::PersSvc/HbookHistSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service RootHistCnv::PersSvc/RootHistSvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service EvtPersistencySvc/EventPersistencySvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service DetPersistencySvc/DetectorPersistencySvc
+ApplicationMgr    VERBOSE declareMultiSvcType: declared service HistogramPersistencySvc/HistogramPersistencySvc
+ApplicationMgr      DEBUG Loading declared DLL's
+ApplicationMgr    VERBOSE addMultiSvc: added service EventLoopMgr/EventLoopMgr
+ApplicationMgr       INFO Application Manager Configured successfully
+THistSvc            DEBUG Opening TFile "tuple2.rt"  stream: "upd"  mode: "A" comp level: 1
+THistSvc            DEBUG Opening TFile "tuple3.rt"  stream: "rec"  mode: "R" comp level: 1
+THistSvc            DEBUG Service base class initialized successfully
+THistSvc            DEBUG Historgram with id "TempHist1" is temporary
+THistSvc            DEBUG Registering TH1F title: "Temporary Tree 1"  id: "/temp/TempHist1"  dir: root:/  file: none
+THistSvc            DEBUG Historgram with id "other/TempHist1a" is temporary
+THistSvc            DEBUG Registering TH1F title: "Temporary Tree 1a"  id: "/temp/other/TempHist1a"  dir: root:/other  file: none
+THistSvc          WARNING no stream "new" associated with id: "/new/Tree2"
+THistSvc            DEBUG Historgram with id "/new/Tree2" is temporary
+THistSvc            DEBUG Registering TH1F title: "Tree 2"  id: "/new/Tree2"  dir: root:/  file: none
+THistSvc            DEBUG Registering TH1F title: "1D Gaussian"  id: "/upd/xxx/gauss1d"  dir: tuple2.rt:/xxx  file: tuple2.rt
+THistSvc            DEBUG Registering TH2F title: "2D Gaussian"  id: "/rec/gauss2d"  dir: tuple3.rt:/  file: tuple3.rt
+THistSvc            DEBUG Registering TH3F title: "3D Gaussian"  id: "/rec/gauss3d"  dir: tuple3.rt:/  file: tuple3.rt
+THistSvc            DEBUG Registering TProfile title: "profile"  id: "/rec/prof"  dir: tuple3.rt:/  file: tuple3.rt
+THistSvc            DEBUG Registering TTree title: "tree title"  id: "/rec/trees/stuff/tree1"  dir: tuple3.rt:/trees/stuff  file: tuple3.rt
+EventLoopMgr      WARNING Unable to locate service "EventSelector" 
+EventLoopMgr      WARNING No events will be processed from external input.
+HistogramPersis...   INFO  'CnvServices':[ 'HbookHistSvc' , 'RootHistSvc' ]
+HistogramPersis...WARNING Histograms saving not required.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr       INFO Application Manager Started successfully
+RndmGenSvc.Engine    INFO Generator engine type:CLHEP::RanluxEngine
+RndmGenSvc.Engine    INFO Current Seed:1234567 Luxury:3
+RndmGenSvc           INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngine>
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+THistSvc            DEBUG stream: rec  name: tuple3.rt  size: 438
+THistSvc            DEBUG stream: upd  name: tuple2.rt  size: 325
+ApplicationMgr       INFO Application Manager Stopped successfully
+THistWrite           INFO Finalizing...
+EventLoopMgr         INFO Histograms converted successfully according to request.
+THistSvc            DEBUG THistSvc::finalize
+THistSvc            DEBUG uid: "/new/Tree2"  temp: 1  dir: root:/
+THistSvc            DEBUG uid: "/rec/gauss2d"  temp: 0  dir: tuple3.rt:/
+THistSvc            DEBUG uid: "/rec/gauss3d"  temp: 0  dir: tuple3.rt:/
+THistSvc            DEBUG uid: "/rec/prof"  temp: 0  dir: tuple3.rt:/
+THistSvc            DEBUG uid: "/rec/trees/stuff/tree1"  temp: 0  dir: tuple3.rt:/trees/stuff
+THistSvc            DEBUG uid: "/temp/TempHist1"  temp: 1  dir: root:/
+THistSvc            DEBUG uid: "/temp/other/TempHist1a"  temp: 1  dir: root:/other
+THistSvc            DEBUG uid: "/upd/xxx/gauss1d"  temp: 0  dir: tuple2.rt:/xxx
+THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT 
+THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple2.rt"
+THistSvc            DEBUG THistSvc::write()::List of Files connected in ROOT: "tuple3.rt"
+THistSvc             INFO Listing contents of ROOT files: 
+THistSvc            DEBUG finalizing stream/file rec:tuple3.rt
+THistSvc             INFO ==> File: tuple3.rt  stream: rec
+TFile: name=tuple3.rt, title=rec, option=CREATE
+TH1.Print Name  = 2Dgauss, Entries= 20000, Total sum= 19978
+          Title = 2D Gaussian
+          NbinsX= 100, xmin= -50, xmax=50, NbinsY= 100, ymin= -50, ymax=50
+TH1.Print Name  = 3Dgauss, Entries= 20000, Total sum= 19944
+          Title = 3D Gaussian
+          NbinsX= 100, xmin= -50, xmax=50, NbinsY= 100, ymin= -50, ymax=50, NbinsZ= 100, zmin= -50, zmax=50
+TH1.Print Name  = profile, Entries= 0, Total sum= 0
+          Title = profile
+          NbinsX= 100, xmin= -50, xmax=-50
+******************************************************************************
+*Tree    :treename  : tree title                                             *
+*Entries :     1000 : Total =           14045 bytes  File  Size =       2333 *
+*        :          : Tree compression factor =   6.63                       *
+******************************************************************************
+*Br    0 :branch1   : point1/I                                               *
+*Entries :     1000 : Total  Size=       4565 bytes  File Size  =       1521 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=   2.68     *
+*............................................................................*
+*Br    1 :branch2   : point2/I                                               *
+*Entries :     1000 : Total  Size=       4565 bytes  File Size  =        164 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=  24.87     *
+*............................................................................*
+*Br    2 :branch3   : point3/I                                               *
+*Entries :     1000 : Total  Size=       4565 bytes  File Size  =        160 *
+*Baskets :        1 : Basket Size=      32000 bytes  Compression=  25.49     *
+*............................................................................*
+THistSvc            DEBUG finalizing stream/file upd:tuple2.rt
+THistSvc             INFO ==> File: tuple2.rt  stream: upd
+TFile: name=tuple2.rt, title=upd, option=UPDATE
+TH1.Print Name  = 1Dgauss, Entries= 20000, Total sum= 19984
+          Title = 1D Gaussian
+          NbinsX= 100, xmin= -50, xmax=50
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
diff --git a/GaudiExamples/src/AlgTools/MyGaudiAlgorithm.cpp b/GaudiExamples/src/AlgTools/MyGaudiAlgorithm.cpp
index 256de249bf3843a08ded15c726fe6937ecc38b87..3da494f36a59110915d12a88bbfadd9b9e6bf4d8 100644
--- a/GaudiExamples/src/AlgTools/MyGaudiAlgorithm.cpp
+++ b/GaudiExamples/src/AlgTools/MyGaudiAlgorithm.cpp
@@ -10,16 +10,14 @@
 #include "IMyTool.h"
 #include "MyGaudiAlgorithm.h"
 
-
 // Static Factory declaration
-
 DECLARE_ALGORITHM_FACTORY(MyGaudiAlgorithm)
 
 // Constructor
 //------------------------------------------------------------------------------
 MyGaudiAlgorithm::MyGaudiAlgorithm(const std::string& name, ISvcLocator* ploc)
   : GaudiAlgorithm(name, ploc)
-  , m_myPrivToolHandle("MyTool/PrivToolHandle",this)
+  , m_myPrivToolHandle("MyTool/PrivToolHandle", this)
   , m_myPubToolHandle("MyTool/PubToolHandle") {
   //------------------------------------------------------------------------------
   declareProperty("ToolWithName", m_privateToolType = "MyTool",
diff --git a/GaudiExamples/src/ExtendedProperties/BoostArrayProperties.cpp b/GaudiExamples/src/ExtendedProperties/BoostArrayProperties.cpp
index b52767cdbfbe6517fca817cb230f40188e481fb1..cbb3dbe08a93278dd5bfc72015900d736f8531ed 100644
--- a/GaudiExamples/src/ExtendedProperties/BoostArrayProperties.cpp
+++ b/GaudiExamples/src/ExtendedProperties/BoostArrayProperties.cpp
@@ -1,6 +1,6 @@
 // $Id: $
 // ============================================================================
-// Include files 
+// Include files
 // ============================================================================
 // GaudiKernel
 // ============================================================================
@@ -10,15 +10,15 @@
 // ============================================================================
 #include "GaudiKernel/AlgFactory.h"
 // ============================================================================
-// GaudiAlg 
+// GaudiAlg
 // ============================================================================
 #include "GaudiAlg/GaudiAlgorithm.h"
 // ============================================================================
-// Boots 
+// Boots
 // ============================================================================
 #include "boost/array.hpp"
 // ============================================================================
-/** @file 
+/** @file
  *  Simple example/test for "array"-properties
  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
  *  @date 2009-09-15
@@ -27,15 +27,15 @@
 namespace Gaudi
 {
   // ==========================================================================
-  namespace Examples 
+  namespace Examples
   {
     // ========================================================================
-    class BoostArrayProperties : public GaudiAlgorithm 
+    class BoostArrayProperties : public GaudiAlgorithm
     {
       // ======================================================================
-      /// the friend factory for instantiation 
+      /// the friend factory for instantiation
       friend class AlgFactory<Gaudi::Examples::BoostArrayProperties> ;
-      // ======================================================================      
+      // ======================================================================
     public:
       // ======================================================================
       /// execute it!
@@ -43,53 +43,53 @@ namespace Gaudi
       // ======================================================================
     protected:
       // ======================================================================
-      /** Standard constructor 
-       *  
+      /** Standard constructor
+       *
        */
-      BoostArrayProperties ( const std::string& name ,    // algorithm instance name 
-                             ISvcLocator*       pSvc )    //         service locator 
-        : GaudiAlgorithm ( name , pSvc ) 
+      BoostArrayProperties ( const std::string& name ,    // algorithm instance name
+                             ISvcLocator*       pSvc )    //         service locator
+        : GaudiAlgorithm ( name , pSvc )
       {
         //
-        std::fill_n( m_doubles.begin() , m_doubles.size() , -1 )      ;
-        std::fill_n( m_strings.begin() , m_strings.size() , "bla-bla" ) ;
+        std::fill( m_doubles.begin() , m_doubles.end() , -1 )      ;
+        std::fill( m_strings.begin() , m_strings.end() , "bla-bla" ) ;
         //
         declareProperty ( "Doubles" , m_doubles , "Boost-array of doubles" ) ;
         declareProperty ( "Strings" , m_strings , "Boost-array of strings" ) ;
-      } 
-      /// virtual destructor 
+      }
+      /// virtual destructor
       virtual ~BoostArrayProperties() {}
       // ======================================================================
     private:
       // ======================================================================
-      /// the default constructor is disabled 
-      BoostArrayProperties () ;          // the default constructor is disabled 
-      /// copy constructor is disabled 
-      BoostArrayProperties ( const BoostArrayProperties& ) ; 
+      /// the default constructor is disabled
+      BoostArrayProperties () ;          // the default constructor is disabled
+      /// copy constructor is disabled
+      BoostArrayProperties ( const BoostArrayProperties& ) ;
       /// assignment operator is disabled
-      BoostArrayProperties& operator=( const BoostArrayProperties& ) ; 
+      BoostArrayProperties& operator=( const BoostArrayProperties& ) ;
       // ======================================================================
     private:
       // ======================================================================
-      /// array  of doubles 
-      boost::array<double,5>       m_doubles ;             // array  of doubles 
-      /// array of strings 
-      boost::array<std::string,4>  m_strings ;              // array of strings 
+      /// array  of doubles
+      boost::array<double,5>       m_doubles ;             // array  of doubles
+      /// array of strings
+      boost::array<std::string,4>  m_strings ;              // array of strings
       // ======================================================================
     } ;
     // ========================================================================
-  } //                                         end of namespace Gaudi::Examples 
+  } //                                         end of namespace Gaudi::Examples
   // ==========================================================================
-} //                                                     end of namespace Gaudi 
+} //                                                     end of namespace Gaudi
 // ============================================================================
 // execute it!
 // ============================================================================
-StatusCode Gaudi::Examples::BoostArrayProperties::execute () 
+StatusCode Gaudi::Examples::BoostArrayProperties::execute ()
 {
   propsPrint () ;
   //
   info() << " Doubles : " << Gaudi::Utils::toString ( m_doubles ) << endmsg ;
-  info() << " Strings : " << Gaudi::Utils::toString ( m_strings ) << endmsg ;  
+  info() << " Strings : " << Gaudi::Utils::toString ( m_strings ) << endmsg ;
   //
   return StatusCode::SUCCESS ;
 }
@@ -98,5 +98,5 @@ StatusCode Gaudi::Examples::BoostArrayProperties::execute ()
 // ============================================================================
 DECLARE_NAMESPACE_ALGORITHM_FACTORY( Gaudi::Examples , BoostArrayProperties )
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
diff --git a/GaudiExamples/src/Selections/SelCreate.cpp b/GaudiExamples/src/Selections/SelCreate.cpp
index af87901537325cb80f8038e4006bb672ddb72096..9889df8ce5bef904d3dcae21b0d3234e7c14cfd8 100644
--- a/GaudiExamples/src/Selections/SelCreate.cpp
+++ b/GaudiExamples/src/Selections/SelCreate.cpp
@@ -19,7 +19,12 @@
 #ifdef __ICC
 // disable icc remark #2259: non-pointer conversion from "double" to "float" may lose significant bits
 #pragma warning(disable:2259)
+#elif defined(WIN32)
+// disable warning
+//   C4244: 'argument' : conversion from 'double' to 'float', possible loss of data
+#pragma warning(disable:4244)
 #endif
+
 namespace Gaudi
 {
   namespace Examples
diff --git a/GaudiGSL/cmt/requirements b/GaudiGSL/cmt/requirements
index f3f572f8a83a3eeb102cffffe1d6d860b35b9571..0832b9fb23f7df65792e9d4c61822b2b2bf5dc57 100644
--- a/GaudiGSL/cmt/requirements
+++ b/GaudiGSL/cmt/requirements
@@ -6,7 +6,7 @@
 # Maintainer : Vanya Belyaev Ivan.Belyaev@itep.ru
 # =============================================================================
 package           GaudiGSL
-version           v7r8
+version           v7r10
 
 # =============== package structure ===========================================
 branches          cmt doc src dict GaudiGSL GaudiMath
@@ -27,7 +27,7 @@ apply_pattern     linker_library    library=GaudiGSLLib
 library           GaudiGSL    -import=AIDA -no_static ../src/Components/*.cpp
 apply_pattern     component_library library=GaudiGSL
 # =============== constitutuents: 3) LCG dictonary ============================
-apply_pattern     lcg_dictionary dictionary=GaudiGSLMath              \
+apply_pattern     reflex_dictionary dictionary=GaudiGSLMath           \
                   headerfiles=$(GAUDIGSLROOT)/dict/GaudiGSLMath.h     \
                   selectionfile=$(GAUDIGSLROOT)/dict/GaudiGSLMath.xml \
                   options="--split --reflex"
diff --git a/GaudiGSL/dict/GaudiGSLMath.xml b/GaudiGSL/dict/GaudiGSLMath.xml
index 86dfc0afff9e7785f0ebb0f37e111fe799cabd12..674fd777c2d12d50934cd47751e641a7656d1a98 100644
--- a/GaudiGSL/dict/GaudiGSLMath.xml
+++ b/GaudiGSL/dict/GaudiGSLMath.xml
@@ -1,8 +1,19 @@
 <lcgdict>
+  <selection>
   <class pattern="GaudiMath::*"       />
   <class pattern="Genfun::GaudiMath*" />
   <class pattern="Genfun::A*"         />
   <class pattern="IGsl*"              />
   <class pattern="Gsl*"               />
   <class pattern="Gsl*"               />
-</lcgdict>
\ No newline at end of file
+  </selection>
+
+  <exclusion>
+    <!-- These are typedef to vector<double> and cause problems. -->
+    <class pattern="Genfun::GaudiMathImplementation::Numerical*Integral::Points"/>
+    <class pattern="Genfun::GaudiMathImplementation::*::Data1D" />
+    <!-- There are causing troubles on Windows (VC9) -->
+    <class pattern="gsl_interp*"/>
+    <class name="gsl_spline"/>
+  </exclusion>
+</lcgdict>
diff --git a/GaudiGSL/doc/release.notes b/GaudiGSL/doc/release.notes
index 08703379037941a727fa732276846bf442e37f27..ffb1c7215563eacf9594070a93bbc3ca25fffc10 100644
--- a/GaudiGSL/doc/release.notes
+++ b/GaudiGSL/doc/release.notes
@@ -3,6 +3,26 @@
 ! Responsible : Vanya Belyaev Ivan.Belyaev@itep.ru
 ! =============================================================================
 
+=============================== GaudiGSL v7r10 ===============================
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+
+! 2011-02-28 - Marco Clemencic
+ - Excluded few classes that are causing troubles on Windows.
+   (see ROOT bug #78837)
+
+=============================== GaudiGSL v7r9 ================================
+! 2011-02-13 - Marco Clemencic
+ - Exclude few classes from the dictionary because they are typedefs to
+   vector<double> and cause problems (duplicated dictionaries warnings).
+
+! 2011-02-08 - Charles Leggett
+ - Fixed bug #77948: GaudiGSL/requirements calls for lcg_dictionary
+   replace lcg_dictionary pattern with reflex_dictionary
+
 =============================== GaudiGSL v7r8 ================================
 ! 2011-01-17 - Brett Viren, Marco Clemencic
  - Fixed bug #75996: Support for CLHEP 2.0
diff --git a/GaudiGSL/src/Components/FuncMinimum.cpp b/GaudiGSL/src/Components/FuncMinimum.cpp
index afb91ca67be5d4da643babf6d2ad63fd4a550feb..f7a0b2d33ab559ddb82318e35b22e78ac68efc13 100644
--- a/GaudiGSL/src/Components/FuncMinimum.cpp
+++ b/GaudiGSL/src/Components/FuncMinimum.cpp
@@ -16,6 +16,8 @@
 #include "gsl/gsl_blas.h"
 #include "gsl/gsl_errno.h"
 
+#include <sstream>
+
 // local
 #include "FuncMinimum.h"
 
@@ -30,9 +32,6 @@ using namespace CLHEP;
  *  @date 2002-09-14
  */
 
-// Declaration of the Tool Factory
-DECLARE_TOOL_FACTORY(FuncMinimum)
-
 // ============================================================================
 // ============================================================================
 FuncMinimum::FuncMinimumMisc::FuncMinimumMisc
@@ -254,13 +253,12 @@ StatusCode FuncMinimum::minimum (const IFuncMinimum::GenFunc&   func  ,
 
   /// Find minimum of our function
   StatusCode sc = minimum (func, arg) ;
-  char buffer[100];
-  sprintf(buffer, "%lu", sc.getCode());
 
   if (sc.isFailure())
     {
-      return Error ("MINIMUM IS NOT FOUND. StatusCode =  '"
-                    + std::string(buffer) + "'", sc);
+      std::ostringstream buffer;
+      buffer << "MINIMUM IS NOT FOUND. StatusCode =  '" << sc.getCode() << '\'';
+      return Error (buffer.str(), sc);
     }
   else
     {
@@ -298,7 +296,7 @@ StatusCode  FuncMinimum::initialize()
 
   if ( sc.isFailure() )
     {
-      return Error ("Could not initiliaze base class GaudiTool", sc);
+      return Error ("Could not initialize base class GaudiTool", sc);
     }
 
   /// The algorithm for multidimensional minimization
@@ -335,7 +333,7 @@ StatusCode  FuncMinimum::initialize()
     }
   else
     {
-      return Error(" Unknown algorith type '"
+      return Error(" Unknown algorithm type '"
                    + std::string(m_algType) + "'");
     }
 
@@ -350,7 +348,7 @@ StatusCode FuncMinimum::finalize   ()
 
   if ( sc.isFailure() )
     {
-      return Error("Could not finaliaze base class GaudiTool", sc);
+      return Error("Could not finalize base class GaudiTool", sc);
     }
   return StatusCode::SUCCESS;
 }
@@ -359,3 +357,6 @@ FuncMinimum::~FuncMinimum( ) ///< Destructor
 
 {}
 //=============================================================================
+
+// Declaration of the Tool Factory
+DECLARE_TOOL_FACTORY(FuncMinimum)
diff --git a/GaudiGSL/src/Components/GslErrorException.cpp b/GaudiGSL/src/Components/GslErrorException.cpp
index bebc0ce35d43317f2c9cdc2849bd5a1327039bcc..1e33b6b1e5db08e6125de1681f19e5ff1761075a 100644
--- a/GaudiGSL/src/Components/GslErrorException.cpp
+++ b/GaudiGSL/src/Components/GslErrorException.cpp
@@ -8,6 +8,7 @@
 #include "GaudiKernel/GaudiException.h"
 // STD & STL
 #include <algorithm>
+#include <sstream>
 // local
 #include "GslErrorException.h"
 
@@ -28,8 +29,6 @@
  *  @see     IFactory
  */
 // ============================================================================
-DECLARE_TOOL_FACTORY(GslErrorException)
-// ============================================================================
 
 // ============================================================================
 /** Standard constructor
@@ -72,24 +71,17 @@ StatusCode GslErrorException::handle
                                    m_ignore.end   () ,
                                    error.code        ) ) { return sc ; }
   //
-  std::string message( " GSL ErrorCode=" );
-  static char s_aux[512];
-  message +=
-    std::string( s_aux  , s_aux  + sprintf( s_aux , "%d" , error.code  ) );
-  message += ": '"   ;
-  message += error.reason  ;
-  message += "' in the file '" ;
-  message += error.file    ;
-  message += "' at the line "  ;
-  message +=
-    std::string( s_aux  , s_aux  + sprintf( s_aux , "%d" , error.line ) );
-  message += "'"     ;
-  throw GaudiException( message , "*GLS Error*" , StatusCode::FAILURE );
+  std::ostringstream message;
+  message << " GSL ErrorCode="
+          << error.code << ": '" << error.reason << "' in the file '"
+          << error.file << "' at the line " << error.line;
+  throw GaudiException( message.str() , "*GLS Error*" , StatusCode::FAILURE );
   ///
   return StatusCode::SUCCESS ;
 }
 // ============================================================================
 
+DECLARE_TOOL_FACTORY(GslErrorException)
 
 // ============================================================================
 // The END
diff --git a/GaudiGSL/src/Lib/Adapter.cpp b/GaudiGSL/src/Lib/Adapter.cpp
index e440f31191eed2171130c89f1825cbab0b83e8da..6f724a6c6d750ebaf3aea68aea4885dc778fcf0a 100644
--- a/GaudiGSL/src/Lib/Adapter.cpp
+++ b/GaudiGSL/src/Lib/Adapter.cpp
@@ -1,54 +1,55 @@
 // $Id: Adapter.cpp,v 1.2 2004/03/28 18:50:36 mato Exp $
-// Include files 
+// Include files
 // ============================================================================
 // GaudiMath
 // ============================================================================
 #include "GaudiMath/GaudiMath.h"
 // ============================================================================
-// AIDA 
+// AIDA
 // ============================================================================
 #include "AIDA/IFunction.h"
 // ============================================================================
+#include <cstring>
 
-namespace Genfun 
+namespace Genfun
 {
   namespace GaudiMathImplementation
   {
-    
+
     FUNCTION_OBJECT_IMP( AdapterIFunction )
-    
-    AdapterIFunction::AdapterIFunction ( const AIDA::IFunction& fun) 
+
+    AdapterIFunction::AdapterIFunction ( const AIDA::IFunction& fun)
       : AbsFunction ( )
       , m_fun ( &fun  )
       , m_dim ( fun.dimension() )
-      , m_arg ( fun.dimension() , 0 ) 
+      , m_arg ( fun.dimension() , 0 )
     {}
-    
+
     AdapterIFunction:: AdapterIFunction ( const AdapterIFunction& right )
-      : AbsFunction (  ) 
+      : AbsFunction (  )
       , m_fun ( right.m_fun )
       , m_dim ( right.m_dim )
-      , m_arg ( right.m_arg ) 
+      , m_arg ( right.m_arg )
     {}
 
     AdapterIFunction::~AdapterIFunction(){}
-    
+
     double AdapterIFunction::operator() ( double x ) const
     {
       for ( size_t i = 0; i < m_dim; ++i ) { m_arg[i] = 0.0 ; }
       m_arg[0] = x ;
       return m_fun -> value ( m_arg ) ;
     }
-    
+
     double AdapterIFunction::operator() ( const Genfun::Argument& x ) const
     {
       for ( size_t i = 0; i < m_dim; ++i ) { m_arg[i] = x[i] ; }
       return m_fun -> value ( m_arg ) ;
     }
-    
-    Genfun::Derivative AdapterIFunction::partial( unsigned int i  ) const 
+
+    Genfun::Derivative AdapterIFunction::partial( unsigned int i  ) const
     {
-      if ( i >= m_dim ) 
+      if ( i >= m_dim )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0 , m_dim  ) ;
         return Genfun::FunctionNoop( &aux ) ;
@@ -56,40 +57,40 @@ namespace Genfun
       const AbsFunction& aux = GaudiMath::Derivative( *this , i ) ;
       return Genfun::FunctionNoop ( &aux ) ;
     }
-    
+
     FUNCTION_OBJECT_IMP( Adapter2DoubleFunction )
-    
-    Adapter2DoubleFunction::Adapter2DoubleFunction 
+
+    Adapter2DoubleFunction::Adapter2DoubleFunction
     ( Adapter2DoubleFunction::Function  func )
       : AbsFunction (       )
       , m_func      ( func  )
     {}
-    
-    Adapter2DoubleFunction:: Adapter2DoubleFunction 
+
+    Adapter2DoubleFunction:: Adapter2DoubleFunction
     ( const Adapter2DoubleFunction& right )
       : AbsFunction (              )
       , m_func    ( right.m_func )
     {}
 
     Adapter2DoubleFunction::~Adapter2DoubleFunction(){}
-    
-    double Adapter2DoubleFunction::operator() 
-      (       double    x ) const 
+
+    double Adapter2DoubleFunction::operator()
+      (       double    x ) const
     { return m_func ( x , 0 ) ; }
-    
-    double Adapter2DoubleFunction::operator() 
+
+    double Adapter2DoubleFunction::operator()
       ( const Genfun::Argument& x ) const
     { return m_func ( x[0] , x[1] ) ; }
-     
-    double Adapter2DoubleFunction::operator() 
-      ( const double x , 
-        const double y ) const 
+
+    double Adapter2DoubleFunction::operator()
+      ( const double x ,
+        const double y ) const
     { return m_func ( x , y ) ; }
-    
-    /// Derivatives 
-    Genfun::Derivative Adapter2DoubleFunction::partial( unsigned int i  ) const 
+
+    /// Derivatives
+    Genfun::Derivative Adapter2DoubleFunction::partial( unsigned int i  ) const
     {
-      if ( i >= 2  ) 
+      if ( i >= 2  )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0 , 2 ) ;
         return Genfun::FunctionNoop( &aux ) ;
@@ -99,39 +100,39 @@ namespace Genfun
     }
 
     FUNCTION_OBJECT_IMP( Adapter3DoubleFunction )
-    
-    Adapter3DoubleFunction::Adapter3DoubleFunction 
+
+    Adapter3DoubleFunction::Adapter3DoubleFunction
     ( Adapter3DoubleFunction::Function  func )
       : AbsFunction (       )
       , m_func      ( func  )
     {}
-    
-    Adapter3DoubleFunction:: Adapter3DoubleFunction 
+
+    Adapter3DoubleFunction:: Adapter3DoubleFunction
     ( const Adapter3DoubleFunction& right )
       : AbsFunction (              )
       , m_func      ( right.m_func )
     {}
-    
+
     Adapter3DoubleFunction::~Adapter3DoubleFunction(){}
 
-    double Adapter3DoubleFunction::operator() 
-      (       double    x ) const 
+    double Adapter3DoubleFunction::operator()
+      (       double    x ) const
     { return m_func ( x , 0 , 0 ) ; }
-    
-    double Adapter3DoubleFunction::operator() 
-      ( const Genfun::Argument& x ) const 
+
+    double Adapter3DoubleFunction::operator()
+      ( const Genfun::Argument& x ) const
     { return m_func ( x[0] , x[1] , x[2] ) ; }
-    
-    double Adapter3DoubleFunction::operator() 
-      ( const double x , 
-        const double y , 
-        const double z ) const 
+
+    double Adapter3DoubleFunction::operator()
+      ( const double x ,
+        const double y ,
+        const double z ) const
     { return m_func ( x , y , z ) ; }
-    
-    /// Derivatives 
-    Genfun::Derivative Adapter3DoubleFunction::partial( unsigned int i  ) const 
+
+    /// Derivatives
+    Genfun::Derivative Adapter3DoubleFunction::partial( unsigned int i  ) const
     {
-      if ( i >= 3  ) 
+      if ( i >= 3  )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0 , 3 ) ;
         return Genfun::FunctionNoop( &aux ) ;
@@ -139,75 +140,75 @@ namespace Genfun
       const AbsFunction& aux = GaudiMath::Derivative( *this , i ) ;
       return Genfun::FunctionNoop ( &aux ) ;
     }
-    
+
     // ========================================================================
     /// from CLHGEP/GenericFunctions
     // ========================================================================
     FUNCTION_OBJECT_IMP( SimpleFunction )
     // ========================================================================
-    
+
     // =======================================================================
-    /** constructor from the trivial function 
-     *  @param func pointer to trivial function 
+    /** constructor from the trivial function
+     *  @param func pointer to trivial function
      */
     // ========================================================================
-    SimpleFunction::SimpleFunction 
+    SimpleFunction::SimpleFunction
     ( SimpleFunction::Function1 func )
-      : AbsFunction () 
+      : AbsFunction ()
       , m_case      ( SimpleFunction::TrivialArg )
-      , m_DIM       ( 1    ) 
-      , m_func1     ( func ) 
-      , m_func2     ( 0    ) 
-      , m_arg2      ( 0    ) 
-      , m_func3     ( 0    ) 
-      , m_arg3      (      ) 
+      , m_DIM       ( 1    )
+      , m_func1     ( func )
+      , m_func2     ( 0    )
+      , m_arg2      ( 0    )
+      , m_func3     ( 0    )
+      , m_arg3      (      )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from the simple function with array-like argument 
-     *  @param func pointer to trivial function 
-     *  @param dim  dimension of the argument 
+    /** constructor from the simple function with array-like argument
+     *  @param func pointer to trivial function
+     *  @param dim  dimension of the argument
      */
     // ========================================================================
-    SimpleFunction::SimpleFunction 
-    ( SimpleFunction::Function2 func , 
+    SimpleFunction::SimpleFunction
+    ( SimpleFunction::Function2 func ,
       const size_t              dim  )
       : AbsFunction ()
       , m_case      ( SimpleFunction::ArrayArg  )
-      , m_DIM       ( dim  ) 
+      , m_DIM       ( dim  )
       , m_func1     ( 0    )
-      , m_func2     ( func ) 
+      , m_func2     ( func )
       , m_arg2      ( 0    )
-      , m_func3     ( 0    ) 
+      , m_func3     ( 0    )
       , m_arg3      (      )
     {
       m_arg2 = new double[dim];
     }
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from the simple function with array-like argument 
-     *  @param func pointer to trivial function 
-     *  @param dim  dimension of the argument 
+    /** constructor from the simple function with array-like argument
+     *  @param func pointer to trivial function
+     *  @param dim  dimension of the argument
      */
     // ========================================================================
-    SimpleFunction::SimpleFunction 
-    ( SimpleFunction::Function3 func , 
+    SimpleFunction::SimpleFunction
+    ( SimpleFunction::Function3 func ,
       const size_t              dim  )
       : AbsFunction ()
       , m_case      ( SimpleFunction::VectorArg  )
-      , m_DIM       ( dim  ) 
+      , m_DIM       ( dim  )
       , m_func1     ( 0    )
-      , m_func2     ( 0    ) 
+      , m_func2     ( 0    )
       , m_arg2      ( 0    )
-      , m_func3     ( func ) 
+      , m_func3     ( func )
       , m_arg3      ( dim  , 0 )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
     SimpleFunction::SimpleFunction
     ( const SimpleFunction& right )
@@ -220,44 +221,43 @@ namespace Genfun
       , m_func3     ( right.m_func3 )
       , m_arg3      ( right.m_arg3  )
     {
-      if (  0 != right.m_arg2 ) 
+      if (  0 != right.m_arg2 )
       {
-        m_arg2 = new double[m_DIM] ;
-        std::copy( right.m_arg2 , right.m_arg2 + m_DIM , m_arg2 );
-      } 
+        std::memcpy(m_arg2, right.m_arg2, m_DIM);
+      }
     }
     // ========================================================================
-    
+
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
     SimpleFunction::~SimpleFunction()
     { if( 0 != m_arg2 ) { delete m_arg2 ; m_arg2 = 0 ;} }
     // ========================================================================
-    
+
     // ========================================================================
-    /// Derivatives 
+    /// Derivatives
     // ========================================================================
-    Genfun::Derivative SimpleFunction::partial( unsigned int i ) const 
+    Genfun::Derivative SimpleFunction::partial( unsigned int i ) const
     {
-      if ( i >= m_DIM ) 
-      { 
+      if ( i >= m_DIM )
+      {
         const AbsFunction& aux = GaudiMath::Constant( 0 , m_DIM ) ;
-        return Genfun::FunctionNoop( &aux ) ;       
+        return Genfun::FunctionNoop( &aux ) ;
       }
       const  AbsFunction& aux = GaudiMath::Derivative( *this , i ) ;
       return Genfun::FunctionNoop( &aux );
     }
-    
+
     // ========================================================================
     /// Function value
     // ========================================================================
-    double SimpleFunction::operator()  ( double value ) const 
+    double SimpleFunction::operator()  ( double value ) const
     {
       double result = 0 ;
-      switch ( m_case ) 
+      switch ( m_case )
       {
-      case TrivialArg  : 
+      case TrivialArg  :
         result = (*m_func1) ( value  ) ; break ;
       case ArrayArg    :
         std::fill ( m_arg2 , m_arg2 + m_DIM , 0.0 );
@@ -273,33 +273,33 @@ namespace Genfun
       return result ;
     }
     // ========================================================================
-    
+
     // ========================================================================
     /// Function value
     // ========================================================================
-    double SimpleFunction::operator()  ( const Argument& argument ) const 
+    double SimpleFunction::operator()  ( const Argument& argument ) const
     {
       double result = 0 ;
-      switch ( m_case ) 
+      switch ( m_case )
       {
-      case TrivialArg  : 
+      case TrivialArg  :
         result = (*m_func1) ( argument[0]  ) ; break ;
       case ArrayArg    :
         for( size_t i = 0 ; i < m_DIM ; ++i ) { m_arg2[i] = argument[i] ; }
         return (*m_func2)( m_arg2 ) ;        ; break ;
       case VectorArg   :
         for( size_t i = 0 ; i < m_DIM ; ++i ) { m_arg3[i] = argument[i] ; }
-        result = (*m_func3) ( m_arg3 ) ; break ;        
+        result = (*m_func3) ( m_arg3 ) ; break ;
       default:
         break ;
-      }      
+      }
       return result ;
     }
-    
+
   } // end of namespace GaudiMathImplementation
 } // end of namespace Genfun
 
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
diff --git a/GaudiGSL/src/Lib/GslErrorHandlers.cpp b/GaudiGSL/src/Lib/GslErrorHandlers.cpp
index 1eced5f26970a3e01f07e8bf499630fa72e2e7c0..9a089beaf05c2225d916ae96953fbcdb674c262b 100644
--- a/GaudiGSL/src/Lib/GslErrorHandlers.cpp
+++ b/GaudiGSL/src/Lib/GslErrorHandlers.cpp
@@ -1,6 +1,6 @@
 // $Id: GslErrorHandlers.cpp,v 1.1 2003/11/19 16:55:59 mato Exp $
 // ============================================================================
-// 
+//
 // ============================================================================
 // Include files
 // GaudiKernel
@@ -12,53 +12,48 @@
 #include "GaudiGSL/GslErrorHandlers.h"
 #include "GaudiGSL/GaudiGSL.h"
 
-/** @file 
- * 
+#include <sstream>
+
+/** @file
+ *
  *  Implementation file for functionns form GslErrorHandlers namespace
  *  @see GslErrorHandlers
- *  
+ *
  *  @author Vanya Belyaev Ivan.Belyaev@itep.ru
  *  @date   29/04/2002
  */
 
-void GslErrorHandlers::ignoreTheError 
-( const char* /* reason */ , 
-  const char* /* file   */ , 
-  int         /* line   */ , 
+void GslErrorHandlers::ignoreTheError
+( const char* /* reason */ ,
+  const char* /* file   */ ,
+  int         /* line   */ ,
   int         /* code   */ )
 {}
 
-void GslErrorHandlers::handleTheError 
-( const char* reason , 
-  const char* file   , 
-  int         line   , 
+void GslErrorHandlers::handleTheError
+( const char* reason ,
+  const char* file   ,
+  int         line   ,
   int         code   )
 {
-  // het the GSL service 
+  // het the GSL service
   const IGslSvc* svc = GaudiGSL::gslSvc() ;
-  // handle the error if service is valid 
+  // handle the error if service is valid
   if( 0 != svc ) { svc->handle( GslError( reason , file , line , code ) ) ; }
 }
 
-void GslErrorHandlers::throwException 
-( const char* reason , 
-  const char* file   , 
-  int         line   , 
+void GslErrorHandlers::throwException
+( const char* reason ,
+  const char* file   ,
+  int         line   ,
   int         code   )
 {
-  std::string error( " GSL ErrorCode=" );
-  static char s_aux[512];
-  error += std::string( s_aux  , s_aux  + sprintf( s_aux , "%d" , code  ) );
-  error += ": '"   ;
-  error += reason  ;
-  error += "' in the file '" ;
-  error += file    ;
-  error += "' at the line "  ;
-  error += std::string( s_aux  , s_aux  + sprintf( s_aux , "%d" , line ) );
-  error += "'"     ;
-  throw GaudiException( error , "*GLS Error*" , StatusCode::FAILURE );
+  std::ostringstream error;
+  error << " GSL ErrorCode=" << code << ": '" << reason
+        << "' in the file '" << file << "' at the line " << line;
+  throw GaudiException( error.str() , "*GLS Error*" , StatusCode::FAILURE );
 }
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
diff --git a/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp b/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp
index 38383f6530c1ac50a1519e2323b4521d8586bb4b..0178b297031c39f9cab55610f7271372301a5989 100644
--- a/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp
+++ b/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp
@@ -32,6 +32,12 @@
 //   The comparison are meant
 #pragma warning(disable:1572)
 #endif
+#ifdef WIN32
+// Disable the warning
+//    C4996: 'std::copy': Function call with parameters that may be unsafe
+// The parameters are checked
+#pragma warning(disable:4996)
+#endif
 
 namespace Genfun
 {
diff --git a/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp b/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp
index 1f06cac975097c688b80dd8c8bd7d7103d74b0e1..77c8668215c2c4248e49aa0d3d80e4c74f8178f6 100644
--- a/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp
+++ b/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp
@@ -1,10 +1,10 @@
 // $Id: NumericalIndefiniteIntegral.cpp,v 1.2 2007/05/24 14:39:11 hmd Exp $
 // ============================================================================
-// CVS tag $Name:  $ 
+// CVS tag $Name:  $
 // ============================================================================
 // Include
 // ============================================================================
-// STD & STL 
+// STD & STL
 // ============================================================================
 #include <vector>
 #include <algorithm>
@@ -14,7 +14,7 @@
 #include "gsl/gsl_errno.h"
 #include "gsl/gsl_integration.h"
 // ============================================================================
-// GaudiMath 
+// GaudiMath
 // ============================================================================
 #include "GaudiMath/NumericalIndefiniteIntegral.h"
 #include "GaudiMath/NumericalDerivative.h"
@@ -23,7 +23,7 @@
 // ============================================================================
 #include "GaudiKernel/GaudiException.h"
 // ============================================================================
-// local 
+// local
 // ============================================================================
 #include "Helpers.h"
 // ============================================================================
@@ -40,17 +40,23 @@
 //   The comparison are meant
 #pragma warning(disable:1572)
 #endif
+#ifdef WIN32
+// Disable the warning
+//    C4996: 'std::copy': Function call with parameters that may be unsafe
+// The parameters are checked
+#pragma warning(disable:4996)
+#endif
 
-namespace Genfun 
+namespace Genfun
 {
-  namespace GaudiMathImplementation 
+  namespace GaudiMathImplementation
   {
-    
-    struct NumericalIndefiniteIntegral::_Workspace 
+
+    struct NumericalIndefiniteIntegral::_Workspace
     { gsl_integration_workspace* ws ; };
-    struct NumericalIndefiniteIntegral::_Function  
+    struct NumericalIndefiniteIntegral::_Function
     { gsl_function*              fn ; };
-    
+
     // ========================================================================
     /// from CLHEP/GenericFunctions
     // ========================================================================
@@ -60,185 +66,185 @@ namespace Genfun
     // ========================================================================
     /** Standard constructor
      *
-     *  @param function the base function 
-     *  @param index    the variable index 
-     *  @param a        integration limit 
-     *  @param limit flag to distinguisch low variable limit 
+     *  @param function the base function
+     *  @param index    the variable index
+     *  @param a        integration limit
+     *  @param limit flag to distinguisch low variable limit
      *  from high variable limit
      *  @param type     the integration type (adaptive,
      *                  non-adaptive or adaptive for singular functions
-     *  @param key      Gauss-Kronrad integration rule 
-     *  @param epsabs   absolute precision for integration 
-     *  @param epsrel   relative precision for integration 
-     *  @param lim      bisection limit 
+     *  @param key      Gauss-Kronrad integration rule
+     *  @param epsabs   absolute precision for integration
+     *  @param epsrel   relative precision for integration
+     *  @param lim      bisection limit
      */
     // ========================================================================
     NumericalIndefiniteIntegral::NumericalIndefiniteIntegral
     ( const AbsFunction&                         function  ,
-      const size_t                               index     , 
-      const double                               a         , 
-      const GaudiMath::Integration::Limit        limit     , 
-      const GaudiMath::Integration::Type         type      , 
-      const GaudiMath::Integration::KronrodRule  rule      , 
-      const double                               epsabs    , 
-      const double                               epsrel    , 
-      const size_t                               size      ) 
-      : AbsFunction () 
+      const size_t                               index     ,
+      const double                               a         ,
+      const GaudiMath::Integration::Limit        limit     ,
+      const GaudiMath::Integration::Type         type      ,
+      const GaudiMath::Integration::KronrodRule  rule      ,
+      const double                               epsabs    ,
+      const double                               epsrel    ,
+      const size_t                               size      )
+      : AbsFunction ()
       , m_function  ( function.clone()                    )
       , m_DIM       ( function.dimensionality()           )
       , m_index     ( index                               )
-      , m_a         ( a                                   ) 
+      , m_a         ( a                                   )
       , m_limit     ( limit                               )
-      , m_type      ( type                                ) 
-      , m_category  ( GaudiMath::Integration::Finite      ) 
-      , m_rule      ( rule                                ) 
+      , m_type      ( type                                )
+      , m_category  ( GaudiMath::Integration::Finite      )
+      , m_rule      ( rule                                )
       //
-      , m_points    (                                     ) 
+      , m_points    (                                     )
       , m_pdata     ( 0                                   )
       //
-      , m_epsabs    ( epsabs                              ) 
-      , m_epsrel    ( epsrel                              ) 
+      , m_epsabs    ( epsabs                              )
+      , m_epsrel    ( epsrel                              )
       //
-      , m_result    ( GSL_NEGINF                          ) 
-      , m_error     ( GSL_POSINF                          ) 
+      , m_result    ( GSL_NEGINF                          )
+      , m_error     ( GSL_POSINF                          )
       //
-      , m_size      ( size                                ) 
-      , m_ws        ( 0                                   ) 
-      , m_argument  ( function.dimensionality()           ) 
+      , m_size      ( size                                )
+      , m_ws        ( 0                                   )
+      , m_argument  ( function.dimensionality()           )
     {
-      if ( GaudiMath::Integration::Fixed == m_rule ) 
+      if ( GaudiMath::Integration::Fixed == m_rule )
         { m_rule = GaudiMath::Integration::Default ; }
-      if ( m_index >= m_DIM  ) 
+      if ( m_index >= m_DIM  )
         { Exception("::constructor: invalid variable index") ; }
     }
     // ========================================================================
-    
-    /** standard constructor 
-     *  @param function the base function 
-     *  @param index    the variable index 
-     *  @param a        integration limit 
-     *  @param limit flag to distinguisch low variable limit 
+
+    /** standard constructor
+     *  @param function the base function
+     *  @param index    the variable index
+     *  @param a        integration limit
+     *  @param limit flag to distinguisch low variable limit
      *               from high variable limit
-     *  @param points   list of known function singularities 
-     *  @param epsabs   absolute precision for integration 
-     *  @param epsrel   relative precision for integration 
+     *  @param points   list of known function singularities
+     *  @param epsabs   absolute precision for integration
+     *  @param epsrel   relative precision for integration
      */
-    NumericalIndefiniteIntegral::NumericalIndefiniteIntegral 
+    NumericalIndefiniteIntegral::NumericalIndefiniteIntegral
     ( const AbsFunction&                   function ,
-      const size_t                         index    , 
-      const double                         a        , 
+      const size_t                         index    ,
+      const double                         a        ,
       const Points&                        points   ,
-      const GaudiMath::Integration::Limit  limit    , 
-      const double                         epsabs   , 
+      const GaudiMath::Integration::Limit  limit    ,
+      const double                         epsabs   ,
       const double                         epsrel   ,
-      const size_t                         size     ) 
-      : AbsFunction () 
+      const size_t                         size     )
+      : AbsFunction ()
       , m_function  ( function.clone()          )
-      , m_DIM       ( function.dimensionality() ) 
-      , m_index     ( index                     ) 
+      , m_DIM       ( function.dimensionality() )
+      , m_index     ( index                     )
       , m_a         ( a                         )
       , m_limit     ( limit                     )
       , m_type      ( GaudiMath::Integration::    Other )
       , m_category  ( GaudiMath::Integration:: Singular )
       , m_rule      ( GaudiMath::Integration::    Fixed )
-      , m_points    ( points  ) 
-      , m_pdata     ( 0       ) 
+      , m_points    ( points  )
+      , m_pdata     ( 0       )
       , m_epsabs    ( epsabs  )
-      , m_epsrel    ( epsrel  ) 
+      , m_epsrel    ( epsrel  )
       //
-      , m_result    ( GSL_NEGINF                          ) 
-      , m_error     ( GSL_POSINF                          ) 
+      , m_result    ( GSL_NEGINF                          )
+      , m_error     ( GSL_POSINF                          )
       //
-      , m_size      ( size                                ) 
-      , m_ws        ( 0                                   ) 
-      , m_argument  ( function.dimensionality()           ) 
+      , m_size      ( size                                )
+      , m_ws        ( 0                                   )
+      , m_argument  ( function.dimensionality()           )
     {
-      if ( m_index >= m_DIM ) 
-        { Exception("::constructor: invalid variable index") ; } 
+      if ( m_index >= m_DIM )
+        { Exception("::constructor: invalid variable index") ; }
       m_pdata = new double[ 2 + m_points.size() ] ;
       m_points.push_back( a ) ;
       std::sort( m_points.begin() , m_points.end() ) ;
-      m_points.erase ( std::unique( m_points.begin () , 
+      m_points.erase ( std::unique( m_points.begin () ,
                                     m_points.end   () ) , m_points.end() );
     }
-    
+
     // ========================================================================
-    /** standard constructor 
-     *  the integral limt is assumed to be infinity 
-     *  @param function the base function 
-     *  @param index    the variable index 
-     *  @param limit flag to distinguisch low variable limit 
+    /** standard constructor
+     *  the integral limt is assumed to be infinity
+     *  @param function the base function
+     *  @param index    the variable index
+     *  @param limit flag to distinguisch low variable limit
      *               from high variable limit
      */
     // ========================================================================
-    NumericalIndefiniteIntegral::NumericalIndefiniteIntegral 
+    NumericalIndefiniteIntegral::NumericalIndefiniteIntegral
     ( const AbsFunction&                  function  ,
-      const size_t                        index     , 
+      const size_t                        index     ,
       const GaudiMath::Integration::Limit limit     ,
-      const double                        epsabs    , 
-      const double                        epsrel    , 
-      const size_t                        size      ) 
-      : AbsFunction () 
-      , m_function  ( function.clone() ) 
+      const double                        epsabs    ,
+      const double                        epsrel    ,
+      const size_t                        size      )
+      : AbsFunction ()
+      , m_function  ( function.clone() )
       , m_DIM       ( function.dimensionality() )
       , m_index     ( index            )
-      , m_a         ( GSL_NEGINF       ) // should not be used! 
+      , m_a         ( GSL_NEGINF       ) // should not be used!
       , m_limit     ( limit            )
-      , m_type      ( GaudiMath::Integration::    Other ) 
+      , m_type      ( GaudiMath::Integration::    Other )
       , m_category  ( GaudiMath::Integration:: Infinite )
       , m_rule      ( GaudiMath::Integration::    Fixed )
-      , m_points    (            ) 
+      , m_points    (            )
       , m_pdata     ( 0          )
-      , m_epsabs    ( epsabs     ) 
+      , m_epsabs    ( epsabs     )
       , m_epsrel    ( epsrel     )
-      , m_result    ( GSL_NEGINF ) 
-      , m_error     ( GSL_POSINF ) 
-      , m_size      ( size       ) 
-      , m_ws        ( 0          ) 
-      , m_argument  ( function.dimensionality()           ) 
+      , m_result    ( GSL_NEGINF )
+      , m_error     ( GSL_POSINF )
+      , m_size      ( size       )
+      , m_ws        ( 0          )
+      , m_argument  ( function.dimensionality()           )
     {
-      if ( m_index >= m_DIM ) 
+      if ( m_index >= m_DIM )
         { Exception("::constructor: invalid variable index") ; }
     }
     // ========================================================================
 
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
     NumericalIndefiniteIntegral::
     NumericalIndefiniteIntegral( const NumericalIndefiniteIntegral& right )
-      : AbsFunction () 
-      , m_function  ( right.m_function->clone() ) 
-      , m_DIM       ( right.m_DIM      ) 
-      , m_index     ( right.m_index    ) 
-      , m_a         ( right.m_a        ) 
-      , m_limit     ( right.m_limit    ) 
-      , m_type      ( right.m_type     ) 
+      : AbsFunction ()
+      , m_function  ( right.m_function->clone() )
+      , m_DIM       ( right.m_DIM      )
+      , m_index     ( right.m_index    )
+      , m_a         ( right.m_a        )
+      , m_limit     ( right.m_limit    )
+      , m_type      ( right.m_type     )
       , m_category  ( right.m_category )
       , m_rule      ( right.m_rule     )
-      , m_points    ( right.m_points   ) 
-      , m_pdata     ( 0 )           // attention 
-      , m_epsabs    ( right.m_epsabs   ) 
-      , m_epsrel    ( right.m_epsrel   ) 
-      , m_result    ( GSL_NEGINF       ) 
+      , m_points    ( right.m_points   )
+      , m_pdata     ( 0 )           // attention
+      , m_epsabs    ( right.m_epsabs   )
+      , m_epsrel    ( right.m_epsrel   )
+      , m_result    ( GSL_NEGINF       )
       , m_error     ( GSL_POSINF       )
-      , m_size      ( right.m_size     ) 
+      , m_size      ( right.m_size     )
       , m_ws        ( 0                )
       , m_argument  ( right.m_argument )
     {
-      m_pdata = new double[ 2 + m_points.size() ] ; // attention! 
+      m_pdata = new double[ 2 + m_points.size() ] ; // attention!
     }
     // ========================================================================
 
-      
+
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
     NumericalIndefiniteIntegral::~NumericalIndefiniteIntegral()
     {
-      if( 0 != m_ws ) 
-        { 
+      if( 0 != m_ws )
+        {
           gsl_integration_workspace_free ( m_ws->ws ) ;
           delete m_ws ;
           m_ws = 0 ;
@@ -251,38 +257,38 @@ namespace Genfun
     // ========================================================================
     // throw the exception
     // ========================================================================
-    StatusCode NumericalIndefiniteIntegral::Exception 
-    ( const std::string& message , 
-      const StatusCode&  sc      ) const 
+    StatusCode NumericalIndefiniteIntegral::Exception
+    ( const std::string& message ,
+      const StatusCode&  sc      ) const
     {
-      throw GaudiException( "NumericalIndefiniteIntegral::" + message , 
+      throw GaudiException( "NumericalIndefiniteIntegral::" + message ,
                             "*GaudiMath*" , sc ) ;
       return sc ;
     }
     // ========================================================================
-    
+
     // ========================================================================
-    /// evaluate the function 
+    /// evaluate the function
     // ========================================================================
-    double NumericalIndefiniteIntegral::operator() 
-      ( const double argument ) const 
+    double NumericalIndefiniteIntegral::operator()
+      ( const double argument ) const
     {
-      // reset the result and the error  
+      // reset the result and the error
       m_result = GSL_NEGINF ;
       m_error  = GSL_POSINF ;
-      
-      // check the argument 
+
+      // check the argument
       if( 1 != m_DIM ) { Exception ( "operator(): invalid argument size " ) ; };
-      
+
       m_argument[0] = argument ;
       return (*this) ( m_argument );
     }
     // ========================================================================
 
     // ========================================================================
-    /// Derivatives 
+    /// Derivatives
     // ========================================================================
-    Genfun::Derivative 
+    Genfun::Derivative
     NumericalIndefiniteIntegral::partial ( unsigned int idx ) const
     {
       if      ( idx >= m_DIM   )
@@ -292,70 +298,70 @@ namespace Genfun
           const AbsFunction& aux = NumericalDerivative( *this , idx ) ;
           return Genfun::FunctionNoop( &aux ) ;
         }
-      else if ( GaudiMath::Integration::VariableLowLimit == limit () ) 
-        { 
+      else if ( GaudiMath::Integration::VariableLowLimit == limit () )
+        {
           const AbsFunction& aux = -1 * function() ;
           return Genfun::FunctionNoop( &aux ) ;
         }
       const AbsFunction& aux = function() ;
       return Genfun::FunctionNoop( &aux ) ;
     }
-    
+
     // ========================================================================
-    /// evaluate the function 
+    /// evaluate the function
     // ========================================================================
-    double NumericalIndefiniteIntegral::operator() 
-      ( const Argument& argument ) const 
+    double NumericalIndefiniteIntegral::operator()
+      ( const Argument& argument ) const
     {
-      // reset the result and the error  
+      // reset the result and the error
       m_result = GSL_NEGINF ;
       m_error  = GSL_POSINF ;
-      
-      // check the argument 
-      if( argument.dimension() != m_DIM ) 
+
+      // check the argument
+      if( argument.dimension() != m_DIM )
         { Exception ( "operator(): invalid argument size " ) ; };
-      
-      // copy the argument 
+
+      // copy the argument
       {for( size_t i  = 0 ; i < m_DIM ; ++i ){ m_argument[i] = argument[i];}}
-      
-      // create the helper object 
+
+      // create the helper object
       GSL_Helper helper( *m_function , m_argument , m_index );
-      
-      // use GSL to evaluate the numerical derivative 
+
+      // use GSL to evaluate the numerical derivative
       gsl_function F ;
       F.function = &GSL_Adaptor ;
       F.params   = &helper                 ;
       _Function F1    ;
       F1.fn      = &F ;
-      
+
       if        (  GaudiMath::Integration::Infinite         == category () )
         { return   QAGI ( &F1 ) ; }                                // RETURN
       else if   (  GaudiMath::Integration::Singular         == category () )
         { return   QAGP ( &F1 ) ; }                                // RETURN
       else if   (  GaudiMath::Integration::Finite           == category () )
-        if      (  GaudiMath::Integration::NonAdaptive      == type     () ) 
+        if      (  GaudiMath::Integration::NonAdaptive      == type     () )
           { return QNG  ( &F1 ) ; }                                // RETURN
-        else if (  GaudiMath::Integration::Adaptive         == type     () ) 
+        else if (  GaudiMath::Integration::Adaptive         == type     () )
           { return QAG  ( &F1 ) ; }                                // RETURN
-        else if (  GaudiMath::Integration::AdaptiveSingular == type     () ) 
+        else if (  GaudiMath::Integration::AdaptiveSingular == type     () )
           { return QAGS ( &F1 ) ; }                                // RETURN
-        else 
+        else
           { Exception ( "::operator(): invalid type "  ); }
-      else 
+      else
         { Exception ( "::operator(): invalid category "  ); }
-      
+
       return 0 ;
     }
     // ========================================================================
-    
+
+    // ========================================================================
+    /// allocate the integration workspace
     // ========================================================================
-    /// allocate the integration workspace 
-    // ======================================================================== 
-    NumericalIndefiniteIntegral::_Workspace* 
-    NumericalIndefiniteIntegral::allocate() const 
+    NumericalIndefiniteIntegral::_Workspace*
+    NumericalIndefiniteIntegral::allocate() const
     {
       if ( 0 != m_ws ) { return m_ws; }
-      gsl_integration_workspace* aux = 
+      gsl_integration_workspace* aux =
         gsl_integration_workspace_alloc( size () );
       if ( 0 == aux ) { Exception ( "allocate()::invalid workspace" ) ; };
       m_ws = new _Workspace() ;
@@ -363,218 +369,218 @@ namespace Genfun
       return m_ws ;
     }
     // ========================================================================
-    
+
     // ========================================================================
     // adaptive integration on infinite interval
     // ========================================================================
-    double NumericalIndefiniteIntegral::QAGI ( _Function* F ) const 
+    double NumericalIndefiniteIntegral::QAGI ( _Function* F ) const
     {
-      // check the argument 
+      // check the argument
       if( 0 == F ) { Exception("::QAGI: invalid function"); }
-      
+
       const double x = m_argument[m_index] ;
-      
-      // allocate workspace 
+
+      // allocate workspace
       if( 0 == ws() ) { allocate() ; }
-      
+
       int ierror = 0 ;
-      switch ( limit() ) 
+      switch ( limit() )
         {
-        case GaudiMath::Integration::VariableLowLimit  : 
-          ierror = gsl_integration_qagiu ( F->fn     , x        ,  
-                                           m_epsabs  , m_epsrel , 
-                                           size ()   , ws()->ws , 
+        case GaudiMath::Integration::VariableLowLimit  :
+          ierror = gsl_integration_qagiu ( F->fn     , x        ,
+                                           m_epsabs  , m_epsrel ,
+                                           size ()   , ws()->ws ,
                                            &m_result , &m_error ) ; break ;
         case GaudiMath::Integration::VariableHighLimit :
           ierror = gsl_integration_qagil ( F->fn     , x        ,
-                                           m_epsabs  , m_epsrel , 
-                                           size ()   , ws()->ws , 
+                                           m_epsabs  , m_epsrel ,
+                                           size ()   , ws()->ws ,
                                            &m_result , &m_error ) ; break ;
         default :
           Exception ( "::QAGI: invalid mode" ) ;
         };
-      
-      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAGI" , 
+
+      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAGI" ,
                                 __FILE__ , __LINE__ , ierror ) ;}
-      
+
       return m_result ;
     }
     // ========================================================================
-    
+
     // ========================================================================
-    // adaptive integration with known singular points 
+    // adaptive integration with known singular points
     // ========================================================================
-    double NumericalIndefiniteIntegral::QAGP( _Function* F ) const 
+    double NumericalIndefiniteIntegral::QAGP( _Function* F ) const
     {
       if( 0 == F ) { Exception("QAGP::invalid function") ; }
-      
+
       const double x = m_argument[m_index] ;
-      if ( m_a == x  ) 
-        { 
+      if ( m_a == x  )
+        {
           m_result = 0    ;
           m_error  = 0    ;   // EXACT !
-          return m_result ; 
+          return m_result ;
         }
-      
+
       // no known singular points ?
       if( points().empty() ) { return QAGS( F ) ; }
-      
-      // integration limits 
+
+      // integration limits
       const double a = std::min ( m_a , x ) ;
       const double b = std::max ( m_a , x ) ;
-      
+
       // "active" singular points
-      Points::const_iterator lower = 
+      Points::const_iterator lower =
         std::lower_bound ( points().begin() , points().end() , a ) ;
-      Points::const_iterator upper = 
+      Points::const_iterator upper =
         std::upper_bound ( points().begin() , points().end() , b ) ;
-      
+
       Points pnts ( upper - lower ) ;
       std::copy( lower , upper , pnts.begin() );
       if ( *lower != a       ) { pnts.insert( pnts.begin () , a ) ; }
       if ( *upper != b       ) { pnts.insert( pnts.end   () , b ) ; }
       std::copy( pnts.begin() , pnts.end() , m_pdata );
       const size_t npts = pnts.size() ;
-      
-      // use GSL 
-      int ierror = 
-        gsl_integration_qagp ( F->fn                , 
-                               m_pdata   , npts     , 
+
+      // use GSL
+      int ierror =
+        gsl_integration_qagp ( F->fn                ,
+                               m_pdata   , npts     ,
                                m_epsabs  , m_epsrel ,
-                               size ()   , ws()->ws , 
+                               size ()   , ws()->ws ,
                                &m_result , &m_error ) ;
-      
-      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAGI " , 
+
+      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAGI " ,
                                 __FILE__ , __LINE__ , ierror ) ; }
-      
+
       // sign
-      if      ( GaudiMath::Integration::VariableHighLimit == limit() 
+      if      ( GaudiMath::Integration::VariableHighLimit == limit()
                 &&  x < m_a  ) { m_result *= -1 ; }
-      else if ( GaudiMath::Integration::VariableLowLimit  == limit() 
+      else if ( GaudiMath::Integration::VariableLowLimit  == limit()
                 &&  x > m_a  ) { m_result *= -1 ; }
-      
+
       return m_result ;
     }
     // ========================================================================
-    
+
     // ========================================================================
-    // non-adaptive integration 
+    // non-adaptive integration
     // ========================================================================
-    double NumericalIndefiniteIntegral::QNG ( _Function* F ) const 
+    double NumericalIndefiniteIntegral::QNG ( _Function* F ) const
     {
       if( 0 == F ) { Exception("QNG::invalid function") ; }
-      
+
       const double x = m_argument[m_index] ;
-      if ( m_a == x  ) 
-        { 
+      if ( m_a == x  )
+        {
           m_result = 0    ;
           m_error  = 0    ;   // EXACT !
-          return m_result ; 
+          return m_result ;
         }
-      
-      // integration limits 
+
+      // integration limits
       const double a = std::min ( m_a , x ) ;
       const double b = std::max ( m_a , x ) ;
-      
+
       size_t neval = 0 ;
-      int ierror = 
-        gsl_integration_qng ( F->fn                 ,  
-                              a         ,         b , 
-                              m_epsabs  ,  m_epsrel , 
+      int ierror =
+        gsl_integration_qng ( F->fn                 ,
+                              a         ,         b ,
+                              m_epsabs  ,  m_epsrel ,
                               &m_result , &m_error  , &neval  ) ;
-      
-      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QNG " , 
+
+      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QNG " ,
                                 __FILE__ , __LINE__ , ierror ) ; }
-      
+
       // sign
-      if      ( GaudiMath::Integration::VariableHighLimit == limit() 
+      if      ( GaudiMath::Integration::VariableHighLimit == limit()
                 &&  x < m_a  ) { m_result *= -1 ; }
-      else if ( GaudiMath::Integration::VariableLowLimit  == limit() 
+      else if ( GaudiMath::Integration::VariableLowLimit  == limit()
                 &&  x > m_a  ) { m_result *= -1 ; }
 
       return m_result ;
     }
-    
+
     // ========================================================================
-    // simple adaptive integration 
+    // simple adaptive integration
     // ========================================================================
-    double NumericalIndefiniteIntegral::QAG ( _Function* F ) const 
+    double NumericalIndefiniteIntegral::QAG ( _Function* F ) const
     {
       if( 0 == F ) { Exception("QAG::invalid function") ; }
-      
+
       const double x = m_argument[m_index] ;
-      if ( m_a == x  ) 
-        { 
+      if ( m_a == x  )
+        {
           m_result = 0    ;
           m_error  = 0    ;   // EXACT !
-          return m_result ; 
+          return m_result ;
         }
-      
-      // allocate workspace 
+
+      // allocate workspace
       if( 0 == ws () ) { allocate () ; }
-      
-      // integration limits 
+
+      // integration limits
       const double a = std::min ( m_a , x ) ;
       const double b = std::max ( m_a , x ) ;
-      
-      int ierror = 
-        gsl_integration_qag ( F->fn                    , 
-                              a         ,            b , 
-                              m_epsabs  ,     m_epsrel , 
-                              size   () , (int) rule() , ws ()->ws , 
+
+      int ierror =
+        gsl_integration_qag ( F->fn                    ,
+                              a         ,            b ,
+                              m_epsabs  ,     m_epsrel ,
+                              size   () , (int) rule() , ws ()->ws ,
                               &m_result ,     &m_error             );
-      
-      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAG " , 
+
+      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAG " ,
                                 __FILE__ , __LINE__ , ierror ) ; }
-      
+
       // sign
-      if      ( GaudiMath::Integration::VariableHighLimit == limit() 
+      if      ( GaudiMath::Integration::VariableHighLimit == limit()
                 &&  x < m_a  ) { m_result *= -1 ; }
-      else if ( GaudiMath::Integration::VariableLowLimit  == limit() 
+      else if ( GaudiMath::Integration::VariableLowLimit  == limit()
                 &&  x > m_a  ) { m_result *= -1 ; }
-      
+
       return m_result ;
     }
     // ========================================================================
-    
+
     // ========================================================================
-    // adaptive integration with singularities 
+    // adaptive integration with singularities
     // ========================================================================
-    double NumericalIndefiniteIntegral::QAGS ( _Function* F ) const 
+    double NumericalIndefiniteIntegral::QAGS ( _Function* F ) const
     {
       if( 0 == F ) { Exception("QAG::invalid function") ; }
-      
+
       const double x = m_argument[m_index] ;
-      if ( m_a == x  ) 
-        { 
+      if ( m_a == x  )
+        {
           m_result = 0    ;
           m_error  = 0    ;   // EXACT !
-          return m_result ; 
+          return m_result ;
         }
-      
-      // allocate workspace 
+
+      // allocate workspace
       if( 0 == ws () ) { allocate () ; }
-      
-      // integration limits 
+
+      // integration limits
       const double a = std::min ( m_a , x ) ;
       const double b = std::max ( m_a , x ) ;
-      
-      int ierror = 
-        gsl_integration_qags ( F->fn                , 
-                               a         , b        , 
-                               m_epsabs  , m_epsrel , 
-                               size   () , ws()->ws , 
+
+      int ierror =
+        gsl_integration_qags ( F->fn                ,
+                               a         , b        ,
+                               m_epsabs  , m_epsrel ,
+                               size   () , ws()->ws ,
                                &m_result , &m_error );
-      
-      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAGS " , 
+
+      if( ierror ) { gsl_error( "NumericalIndefiniteIntegral::QAGS " ,
                                 __FILE__ , __LINE__ , ierror ) ; }
-      
+
       // sign
-      if      ( GaudiMath::Integration::VariableHighLimit == limit() 
+      if      ( GaudiMath::Integration::VariableHighLimit == limit()
                 &&  x < m_a  ) { m_result *= -1 ; }
-      else if ( GaudiMath::Integration::VariableLowLimit  == limit() 
+      else if ( GaudiMath::Integration::VariableLowLimit  == limit()
                 &&  x > m_a  ) { m_result *= -1 ; }
-      
+
       return m_result ;
     }
     // ========================================================================
@@ -584,5 +590,5 @@ namespace Genfun
 
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
diff --git a/GaudiGSL/src/Lib/Splines.cpp b/GaudiGSL/src/Lib/Splines.cpp
index df002947a8eff768072c55f865eb3e2b876faf4e..cc7f907297a80caf386447cb8681d4d1bbfca170 100644
--- a/GaudiGSL/src/Lib/Splines.cpp
+++ b/GaudiGSL/src/Lib/Splines.cpp
@@ -2,7 +2,7 @@
 // ============================================================================
 // Include files
 // ============================================================================
-// GSL 
+// GSL
 // ============================================================================
 #include "gsl/gsl_interp.h"
 #include "gsl/gsl_spline.h"
@@ -12,10 +12,12 @@
 #include "GaudiMath/Splines.h"
 #include "GaudiMath/GaudiMath.h"
 // ============================================================================
+#include <cstring>
 
-/** @file 
+
+/** @file
  *  Implementation file for class GSLSplines
- *  @date 2004-03-06 
+ *  @date 2004-03-06
  *  @author Vanya BELYAEV Ivan.Belyaev@itep.ru
  */
 
@@ -23,96 +25,107 @@ namespace Genfun
 {
   namespace GaudiMathImplementation
   {
-    /** constructor from vectors and type 
-     *  @param x    vector of x 
-     *  @param y    vector of y(x) 
-     *  @param type interpolation type 
+    /** constructor from vectors and type
+     *  @param x    vector of x
+     *  @param y    vector of y(x)
+     *  @param type interpolation type
      */
-    SplineBase::SplineBase 
-    ( const SplineBase::Data1D&            x    , 
-      const SplineBase::Data1D&            y    ,  
-      const GaudiMath::Interpolation::Type type ) 
-      : m_init      ( false    ) 
+    SplineBase::SplineBase
+    ( const SplineBase::Data1D&            x    ,
+      const SplineBase::Data1D&            y    ,
+      const GaudiMath::Interpolation::Type type )
+      : m_init      ( false    )
       , m_dim       ( x.size() )
       , m_x         ( new double[ x.size() ] )
-      , m_y         ( new double[ y.size() ] ) 
-      , m_spline    ( 0 ) 
-      , m_accel     ( 0 ) 
-      , m_type      ( type ) 
+      , m_y         ( new double[ y.size() ] )
+      , m_spline    ( 0 )
+      , m_accel     ( 0 )
+      , m_type      ( type )
     {
+#ifdef WIN32
+// Disable the warning
+//    C4996: 'std::copy': Function call with parameters that may be unsafe
+// The parameters are checked
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
       std::copy( x.begin() , x.end() , m_x ) ;
-      std::copy( y.begin() , y.end() , m_y ) ; 
+      std::copy( y.begin() , y.end() , m_y ) ;
+#ifdef WIN32
+#pragma warning(pop)
+#endif
+
     }
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from vector of (x,y(x)) pairs  
+    /** constructor from vector of (x,y(x)) pairs
      *  @param data vector of (x,y(x)) pairs
-     *  @param type interpolaiton type 
+     *  @param type interpolaiton type
      */
     // ========================================================================
-    SplineBase::SplineBase 
-    ( const SplineBase::Data2D&            data , 
-      const GaudiMath::Interpolation::Type type ) 
-      : m_init      ( false       ) 
+    SplineBase::SplineBase
+    ( const SplineBase::Data2D&            data ,
+      const GaudiMath::Interpolation::Type type )
+      : m_init      ( false       )
       , m_dim       ( data.size() )
       , m_x         ( new double[ data.size() ] )
-      , m_y         ( new double[ data.size() ] ) 
-      , m_spline    ( 0    ) 
-      , m_accel     ( 0    ) 
-      , m_type      ( type ) 
+      , m_y         ( new double[ data.size() ] )
+      , m_spline    ( 0    )
+      , m_accel     ( 0    )
+      , m_type      ( type )
     {
       double*  _x = m_x ;
-      double*  _y = m_y ;      
+      double*  _y = m_y ;
       for( Data2D::const_iterator it =
-             data.begin() ; data.end() != it ; ++it ) 
+             data.begin() ; data.end() != it ; ++it )
       {
         *_x = it -> first  ; ++_x ;
-        *_y = it -> second ; ++_y ; 
+        *_y = it -> second ; ++_y ;
       }
     }
     // ========================================================================
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
-    SplineBase::SplineBase ( const SplineBase& right ) 
-      : m_init      ( false       ) 
-      , m_dim       ( right.m_dim ) 
+    SplineBase::SplineBase ( const SplineBase& right )
+      : m_init      ( false       )
+      , m_dim       ( right.m_dim )
       , m_x         ( new double[ right.m_dim ] )
-      , m_y         ( new double[ right.m_dim ] ) 
-      , m_spline    ( 0            ) 
-      , m_accel     ( 0            ) 
-      , m_type      ( right.m_type ) 
+      , m_y         ( new double[ right.m_dim ] )
+      , m_spline    ( 0            )
+      , m_accel     ( 0            )
+      , m_type      ( right.m_type )
     {
-      std::copy( right.m_x , right.m_x + right.m_dim , m_x ) ;
-      std::copy( right.m_y , right.m_y + right.m_dim , m_y ) ;
+      std::memcpy(m_x, right.m_x, m_dim);
+      std::memcpy(m_y, right.m_y, m_dim);
     }
     // ========================================================================
 
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
-    SplineBase::~SplineBase() 
+    SplineBase::~SplineBase()
     {
-      if ( 0 != m_spline ) { gsl_spline_free       ( m_spline ) ; }      
+      if ( 0 != m_spline ) { gsl_spline_free       ( m_spline ) ; }
       if ( 0 != m_accel  ) { gsl_interp_accel_free ( m_accel  ) ; }
-      
+
       if ( 0 != m_x      ) { delete[] m_x      ; }
       if ( 0 != m_y      ) { delete[] m_y      ; }
     }
     // ========================================================================
-    
+
     // ========================================================================
-    void SplineBase::initialize() const 
+    void SplineBase::initialize() const
     {
-      if ( m_init ) { return ; }                                 // RETURN 
-      
+      if ( m_init ) { return ; }                                 // RETURN
+
       const gsl_interp_type* T = 0 ;
-      
+
       switch ( m_type )
       {
-      case GaudiMath::Interpolation::Linear           : 
+      case GaudiMath::Interpolation::Linear           :
         T = gsl_interp_linear            ; break ;
       case GaudiMath::Interpolation::Polynomial       :
         T = gsl_interp_polynomial        ; break ;
@@ -127,155 +140,155 @@ namespace Genfun
       default :
         T = gsl_interp_cspline           ; break ;
       };
-      
+
       m_spline = gsl_spline_alloc( T , m_dim ) ;
-      
+
       gsl_spline_init( m_spline , m_x , m_y , m_dim ) ;
-      
-      m_accel  = gsl_interp_accel_alloc() ; 
-      
+
+      m_accel  = gsl_interp_accel_alloc() ;
+
       m_init   = true ;
-      
+
     }
     // ========================================================================
-    
+
     // ========================================================================
-    double SplineBase::eval  ( const double x ) const 
+    double SplineBase::eval  ( const double x ) const
     {
       if ( !m_init ) { initialize() ; }
       return gsl_spline_eval ( m_spline , x , m_accel );
     }
     // ========================================================================
-    
+
     // ========================================================================
     double SplineBase::deriv  ( const double x ) const
     {
       if ( !m_init ) { initialize() ; }
-      return gsl_spline_eval_deriv  ( m_spline , x , m_accel ); 
+      return gsl_spline_eval_deriv  ( m_spline , x , m_accel );
     }
     // ========================================================================
-    
+
     // ========================================================================
     double SplineBase::deriv2 ( const double x ) const
     {
       if ( !m_init ) { initialize() ; }
-      return gsl_spline_eval_deriv2 ( m_spline , x , m_accel ); 
+      return gsl_spline_eval_deriv2 ( m_spline , x , m_accel );
     }
     // ========================================================================
-    
+
     // ========================================================================
-    double SplineBase::integ  ( const double a , 
+    double SplineBase::integ  ( const double a ,
                                 const double b ) const
     {
       if ( !m_init ) { initialize() ; }
-      return gsl_spline_eval_integ ( m_spline , a , b , m_accel ) ; 
+      return gsl_spline_eval_integ ( m_spline , a , b , m_accel ) ;
     }
     // ========================================================================
-    
-    
+
+
     // ========================================================================
     FUNCTION_OBJECT_IMP( GSLSpline )
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from vectors and type 
+    /** constructor from vectors and type
+     *
+     *  @code
      *
-     *  @code 
-     *  
-     *   Data1D x = .. ; 
-     *   Data1D y = .. ; 
-     *  
-     *   const AbsFunction& func = 
+     *   Data1D x = .. ;
+     *   Data1D y = .. ;
+     *
+     *   const AbsFunction& func =
      *        GSLSpline( x , y , GaudiMath::Interpolation::Cspline ) ;
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
+     *
      *
-     *  @param x    vector of x 
-     *  @param y    vector of y 
-     *  @param type interpolation type 
+     *  @param x    vector of x
+     *  @param y    vector of y
+     *  @param type interpolation type
      */
     // ========================================================================
-    GSLSpline::GSLSpline 
-    ( const GSLSpline::Data1D&             x    , 
-      const GSLSpline::Data1D&             y    ,  
-      const GaudiMath::Interpolation::Type type ) 
-      : AbsFunction () 
-      , m_spline ( x , y , type ) 
+    GSLSpline::GSLSpline
+    ( const GSLSpline::Data1D&             x    ,
+      const GSLSpline::Data1D&             y    ,
+      const GaudiMath::Interpolation::Type type )
+      : AbsFunction ()
+      , m_spline ( x , y , type )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from data vector 
+    /** constructor from data vector
      *
-     *  @code 
-     *  
-     *   Data2D data = ... ; 
-     *  
-     *   const AbsFunction& func = 
+     *  @code
+     *
+     *   Data2D data = ... ;
+     *
+     *   const AbsFunction& func =
      *        GSLSpline( data , GaudiMath::Interpolation::Cspline );
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
      *
-     *  @param data vector of (x,y) pairs  
-     *  @param type interpolation type 
+     *
+     *  @param data vector of (x,y) pairs
+     *  @param type interpolation type
      */
     // ========================================================================
     GSLSpline::GSLSpline
-    ( const GSLSpline::Data2D&             data , 
-      const GaudiMath::Interpolation::Type type ) 
-      : AbsFunction () 
-      , m_spline    ( data , type ) 
+    ( const GSLSpline::Data2D&             data ,
+      const GaudiMath::Interpolation::Type type )
+      : AbsFunction ()
+      , m_spline    ( data , type )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// constructor from SplineBase 
+    /// constructor from SplineBase
     // ========================================================================
     GSLSpline::GSLSpline
-    ( const SplineBase& right ) 
-      : AbsFunction () 
-      , m_spline    ( right ) 
+    ( const SplineBase& right )
+      : AbsFunction ()
+      , m_spline    ( right )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
     GSLSpline::GSLSpline
-    ( const GSLSpline& right ) 
-      : AbsFunction () 
-      , m_spline    ( right  ) 
+    ( const GSLSpline& right )
+      : AbsFunction ()
+      , m_spline    ( right  )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
     GSLSpline::~GSLSpline(){}
     // ========================================================================
 
     // ========================================================================
-    double GSLSpline::operator() (       double    x ) const 
+    double GSLSpline::operator() (       double    x ) const
     { return m_spline.eval( x    ) ; }
     // ========================================================================
-    double GSLSpline::operator() ( const Argument& x ) const 
+    double GSLSpline::operator() ( const Argument& x ) const
     { return m_spline.eval( x[0] ) ; }
     // ========================================================================
-    
+
     // ========================================================================
-    /// Derivatives 
+    /// Derivatives
     // ========================================================================
-    Genfun::Derivative GSLSpline::partial( unsigned int i  ) const 
+    Genfun::Derivative GSLSpline::partial( unsigned int i  ) const
     {
-      if ( i >= 1 ) 
+      if ( i >= 1 )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0.0 , 1 ) ;
         return Genfun::FunctionNoop( &aux ) ;
@@ -288,106 +301,106 @@ namespace Genfun
     // ========================================================================
     FUNCTION_OBJECT_IMP( GSLSplineDeriv )
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from vectors and type 
+    /** constructor from vectors and type
+     *
+     *  @code
      *
-     *  @code 
-     *  
-     *   Data1D x = .. ; 
-     *   Data1D y = .. ; 
-     *  
-     *   const AbsFunction& func = 
+     *   Data1D x = .. ;
+     *   Data1D y = .. ;
+     *
+     *   const AbsFunction& func =
      *        GSLSplineDeriv( x , y , GaudiMath::Interpolation::Cspline ) ;
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
+     *
      *
-     *  @param x    vector of x 
-     *  @param y    vector of y 
-     *  @param type interpolation type 
+     *  @param x    vector of x
+     *  @param y    vector of y
+     *  @param type interpolation type
      */
     // ========================================================================
-    GSLSplineDeriv::GSLSplineDeriv 
-    ( const GSLSplineDeriv::Data1D&        x    , 
-      const GSLSplineDeriv::Data1D&        y    ,  
-      const GaudiMath::Interpolation::Type type ) 
-      : AbsFunction () 
-      , m_spline ( x , y , type ) 
+    GSLSplineDeriv::GSLSplineDeriv
+    ( const GSLSplineDeriv::Data1D&        x    ,
+      const GSLSplineDeriv::Data1D&        y    ,
+      const GaudiMath::Interpolation::Type type )
+      : AbsFunction ()
+      , m_spline ( x , y , type )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from data vector 
+    /** constructor from data vector
      *
-     *  @code 
-     *  
-     *   Data2D data = ... ; 
-     *  
-     *   const AbsFunction& func = 
+     *  @code
+     *
+     *   Data2D data = ... ;
+     *
+     *   const AbsFunction& func =
      *        GSLSpline( data , GaudiMath::Interpolation::Cspline );
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
      *
-     *  @param data vector of (x,y) pairs  
-     *  @param type interpolation type 
+     *
+     *  @param data vector of (x,y) pairs
+     *  @param type interpolation type
      */
     // ========================================================================
     GSLSplineDeriv::GSLSplineDeriv
-    ( const GSLSplineDeriv::Data2D&        data , 
-      const GaudiMath::Interpolation::Type type ) 
-      : AbsFunction () 
-      , m_spline    ( data , type ) 
+    ( const GSLSplineDeriv::Data2D&        data ,
+      const GaudiMath::Interpolation::Type type )
+      : AbsFunction ()
+      , m_spline    ( data , type )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// constructor from SplineBase 
+    /// constructor from SplineBase
     // ========================================================================
     GSLSplineDeriv::GSLSplineDeriv
-    ( const SplineBase& right ) 
-      : AbsFunction () 
-      , m_spline    ( right ) 
+    ( const SplineBase& right )
+      : AbsFunction ()
+      , m_spline    ( right )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
     GSLSplineDeriv::GSLSplineDeriv
-    ( const GSLSplineDeriv& right ) 
-      : AbsFunction () 
-      , m_spline    ( right  ) 
+    ( const GSLSplineDeriv& right )
+      : AbsFunction ()
+      , m_spline    ( right  )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
     GSLSplineDeriv::~GSLSplineDeriv(){}
     // ========================================================================
 
     // ========================================================================
-    double GSLSplineDeriv::operator() (       double    x ) const 
+    double GSLSplineDeriv::operator() (       double    x ) const
     { return m_spline.deriv ( x    ) ; }
     // ========================================================================
-    double GSLSplineDeriv::operator() ( const Argument& x ) const 
+    double GSLSplineDeriv::operator() ( const Argument& x ) const
     { return m_spline.deriv ( x[0] ) ; }
     // ========================================================================
-    
+
     // ========================================================================
-    /// Derivatives 
+    /// Derivatives
     // ========================================================================
-    Genfun::Derivative GSLSplineDeriv::partial( unsigned int i  ) const 
+    Genfun::Derivative GSLSplineDeriv::partial( unsigned int i  ) const
     {
-      if ( i >= 1 ) 
+      if ( i >= 1 )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0.0 , 1 ) ;
         return Genfun::FunctionNoop( &aux ) ;
@@ -400,106 +413,106 @@ namespace Genfun
     // ========================================================================
     FUNCTION_OBJECT_IMP( GSLSplineDeriv2 )
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from vectors and type 
+    /** constructor from vectors and type
+     *
+     *  @code
+     *
+     *   Data1D x = .. ;
+     *   Data1D y = .. ;
      *
-     *  @code 
-     *  
-     *   Data1D x = .. ; 
-     *   Data1D y = .. ; 
-     *  
-     *   const AbsFunction& func = 
+     *   const AbsFunction& func =
      *        GSLSplineDeriv( x , y , GaudiMath::Interpolation::Cspline ) ;
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
+     *
      *
-     *  @param x    vector of x 
-     *  @param y    vector of y 
-     *  @param type interpolation type 
+     *  @param x    vector of x
+     *  @param y    vector of y
+     *  @param type interpolation type
      */
     // ========================================================================
-    GSLSplineDeriv2::GSLSplineDeriv2 
-    ( const GSLSplineDeriv2::Data1D&       x    , 
-      const GSLSplineDeriv2::Data1D&       y    ,  
-      const GaudiMath::Interpolation::Type type ) 
-      : AbsFunction () 
-      , m_spline ( x , y , type ) 
+    GSLSplineDeriv2::GSLSplineDeriv2
+    ( const GSLSplineDeriv2::Data1D&       x    ,
+      const GSLSplineDeriv2::Data1D&       y    ,
+      const GaudiMath::Interpolation::Type type )
+      : AbsFunction ()
+      , m_spline ( x , y , type )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from data vector 
+    /** constructor from data vector
+     *
+     *  @code
      *
-     *  @code 
-     *  
-     *   Data2D data = ... ; 
-     *  
-     *   const AbsFunction& func = 
+     *   Data2D data = ... ;
+     *
+     *   const AbsFunction& func =
      *        GSLSplineDeriv2( data , GaudiMath::Interpolation::Cspline );
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
+     *
      *
-     *  @param data vector of (x,y) pairs  
-     *  @param type interpolation type 
+     *  @param data vector of (x,y) pairs
+     *  @param type interpolation type
      */
     // ========================================================================
     GSLSplineDeriv2::GSLSplineDeriv2
-    ( const GSLSplineDeriv2::Data2D&       data , 
-      const GaudiMath::Interpolation::Type type ) 
-      : AbsFunction () 
-      , m_spline    ( data , type ) 
+    ( const GSLSplineDeriv2::Data2D&       data ,
+      const GaudiMath::Interpolation::Type type )
+      : AbsFunction ()
+      , m_spline    ( data , type )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// constructor from SplineBase 
+    /// constructor from SplineBase
     // ========================================================================
     GSLSplineDeriv2::GSLSplineDeriv2
-    ( const SplineBase& right ) 
-      : AbsFunction () 
-      , m_spline    ( right ) 
+    ( const SplineBase& right )
+      : AbsFunction ()
+      , m_spline    ( right )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
     GSLSplineDeriv2::GSLSplineDeriv2
-    ( const GSLSplineDeriv2& right ) 
-      : AbsFunction () 
-      , m_spline    ( right  ) 
+    ( const GSLSplineDeriv2& right )
+      : AbsFunction ()
+      , m_spline    ( right  )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
     GSLSplineDeriv2::~GSLSplineDeriv2(){}
     // ========================================================================
 
     // ========================================================================
-    double GSLSplineDeriv2::operator() (       double    x ) const 
+    double GSLSplineDeriv2::operator() (       double    x ) const
     { return m_spline.deriv2 ( x    ) ; }
     // ========================================================================
-    double GSLSplineDeriv2::operator() ( const Argument& x ) const 
+    double GSLSplineDeriv2::operator() ( const Argument& x ) const
     { return m_spline.deriv2 ( x[0] ) ; }
     // ========================================================================
-    
+
     // ========================================================================
-    /// Derivatives 
+    /// Derivatives
     // ========================================================================
-    Genfun::Derivative GSLSplineDeriv2::partial( unsigned int i  ) const 
+    Genfun::Derivative GSLSplineDeriv2::partial( unsigned int i  ) const
     {
-      if ( i >= 1 ) 
+      if ( i >= 1 )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0.0 , 1 ) ;
         return Genfun::FunctionNoop( &aux ) ;
@@ -513,113 +526,113 @@ namespace Genfun
     // ========================================================================
     FUNCTION_OBJECT_IMP( GSLSplineInteg )
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from vectors and type 
+    /** constructor from vectors and type
+     *
+     *  @code
+     *
+     *   Data1D x = .. ;
+     *   Data1D y = .. ;
      *
-     *  @code 
-     *  
-     *   Data1D x = .. ; 
-     *   Data1D y = .. ; 
-     *  
-     *   const AbsFunction& func = 
+     *   const AbsFunction& func =
      *        GSLSplineInteg( x , y , GaudiMath::Interpolation::Cspline , -1 ) ;
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
+     *
      *
-     *  @param x    vector of x 
-     *  @param y    vector of y 
-     *  @param type interpolation type 
+     *  @param x    vector of x
+     *  @param y    vector of y
+     *  @param type interpolation type
      */
     // ========================================================================
-    GSLSplineInteg::GSLSplineInteg 
-    ( const GSLSplineInteg::Data1D&        x     , 
-      const GSLSplineInteg::Data1D&        y     ,  
-      const GaudiMath::Interpolation::Type type  , 
-      const double                         low   ) 
-      : AbsFunction (      ) 
+    GSLSplineInteg::GSLSplineInteg
+    ( const GSLSplineInteg::Data1D&        x     ,
+      const GSLSplineInteg::Data1D&        y     ,
+      const GaudiMath::Interpolation::Type type  ,
+      const double                         low   )
+      : AbsFunction (      )
       , m_spline    ( x    , y , type )
       , m_low       ( low  )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /** constructor from data vector 
+    /** constructor from data vector
+     *
+     *  @code
+     *
+     *   Data2D data = ... ;
      *
-     *  @code 
-     *  
-     *   Data2D data = ... ; 
-     *  
-     *   const AbsFunction& func = 
+     *   const AbsFunction& func =
      *        GSLSplineInteg( data , GaudiMath::Interpolation::Cspline , -1 );
-     *  
+     *
      *   const double value = 1 ;
      *   const double result = func( value ) ;
      *
-     *  @endcode 
-     * 
+     *  @endcode
+     *
      *
-     *  @param data vector of (x,y) pairs  
-     *  @param type interpolation type 
+     *  @param data vector of (x,y) pairs
+     *  @param type interpolation type
      */
     // ========================================================================
     GSLSplineInteg::GSLSplineInteg
-    ( const GSLSplineInteg::Data2D&        data  , 
+    ( const GSLSplineInteg::Data2D&        data  ,
       const GaudiMath::Interpolation::Type type  ,
       const double                         low   )
-      : AbsFunction () 
-      , m_spline    ( data , type ) 
+      : AbsFunction ()
+      , m_spline    ( data , type )
       , m_low       ( low  )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// constructor from SplineBase 
+    /// constructor from SplineBase
     // ========================================================================
     GSLSplineInteg::GSLSplineInteg
-    ( const SplineBase& right , 
-      const double      low   ) 
-      : AbsFunction () 
-      , m_spline    ( right ) 
+    ( const SplineBase& right ,
+      const double      low   )
+      : AbsFunction ()
+      , m_spline    ( right )
       , m_low       ( low   )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// copy constructor 
+    /// copy constructor
     // ========================================================================
     GSLSplineInteg::GSLSplineInteg
-    ( const GSLSplineInteg& right ) 
-      : AbsFunction () 
-      , m_spline    ( right       ) 
-      , m_low       ( right.m_low ) 
+    ( const GSLSplineInteg& right )
+      : AbsFunction ()
+      , m_spline    ( right       )
+      , m_low       ( right.m_low )
     {}
     // ========================================================================
-    
+
     // ========================================================================
-    /// destructor 
+    /// destructor
     // ========================================================================
     GSLSplineInteg::~GSLSplineInteg(){}
     // ========================================================================
-    
+
     // ========================================================================
-    double GSLSplineInteg::operator() (       double    x ) const 
+    double GSLSplineInteg::operator() (       double    x ) const
     { return m_spline.integ ( m_low , x    ) ; }
     // ========================================================================
-    double GSLSplineInteg::operator() ( const Argument& x ) const 
+    double GSLSplineInteg::operator() ( const Argument& x ) const
     { return m_spline.integ ( m_low , x[0] ) ; }
     // ========================================================================
-    
+
     // ========================================================================
-    /// Derivatives 
+    /// Derivatives
     // ========================================================================
-    Genfun::Derivative GSLSplineInteg::partial( unsigned int i  ) const 
+    Genfun::Derivative GSLSplineInteg::partial( unsigned int i  ) const
     {
-      if ( i >= 1 ) 
+      if ( i >= 1 )
       {
         const AbsFunction& aux = GaudiMath::Constant( 0.0 , 1 ) ;
         return Genfun::FunctionNoop( &aux ) ;
diff --git a/GaudiKernel/GaudiKernel/IAuditor.h b/GaudiKernel/GaudiKernel/IAuditor.h
index 445cc0ae990f31089b91f2e7b509ffc93082a588..272fb72c217e9ea1736f2a9f3c337580fee7e99f 100644
--- a/GaudiKernel/GaudiKernel/IAuditor.h
+++ b/GaudiKernel/GaudiKernel/IAuditor.h
@@ -102,19 +102,26 @@ public:
 
 };
 
-inline std::ostream & operator << (std::ostream & s, IAuditor::StandardEventType e) {
+/// Simple mapping function from IAuditor::StandardEventType to string.
+inline const char* toStr(IAuditor::StandardEventType e) {
   switch (e) {
-    case IAuditor::Initialize   : return s << "Initialize";
-    case IAuditor::ReInitialize : return s << "ReInitialize";
-    case IAuditor::Execute      : return s << "Execute";
-    case IAuditor::BeginRun     : return s << "BeginRun";
-    case IAuditor::EndRun       : return s << "EndRun";
-    case IAuditor::Finalize     : return s << "Finalize";
-    case IAuditor::Start        : return s << "Start";
-    case IAuditor::Stop         : return s << "Stop";
-    case IAuditor::ReStart      : return s << "ReStart";
+    case IAuditor::Initialize   : return "Initialize";
+    case IAuditor::ReInitialize : return "ReInitialize";
+    case IAuditor::Execute      : return "Execute";
+    case IAuditor::BeginRun     : return "BeginRun";
+    case IAuditor::EndRun       : return "EndRun";
+    case IAuditor::Finalize     : return "Finalize";
+    case IAuditor::Start        : return "Start";
+    case IAuditor::Stop         : return "Stop";
+    case IAuditor::ReStart      : return "ReStart";
   }
-  return s; // cannot be reached, but make the compiler happy
+  return NULL; // cannot be reached, but make the compiler happy
+}
+
+inline std::ostream & operator << (std::ostream & s, IAuditor::StandardEventType e) {
+  return s << toStr(e);
 }
+
+
 #endif // GAUDIKERNEL_IAUDITOR_H
 
diff --git a/GaudiKernel/GaudiKernel/IMessageSvc.h b/GaudiKernel/GaudiKernel/IMessageSvc.h
index 63909c0897bf0243ac34bd22ff999544e28c082d..8374158043fb4a5ec3f00aa60afa8e9933d79236 100644
--- a/GaudiKernel/GaudiKernel/IMessageSvc.h
+++ b/GaudiKernel/GaudiKernel/IMessageSvc.h
@@ -1,4 +1,3 @@
-// $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/IMessageSvc.h,v 1.8 2008/10/01 14:39:27 marcocle Exp $
 #ifndef GAUDIKERNEL_IMESSAGESVC_H
 #define GAUDIKERNEL_IMESSAGESVC_H
 
@@ -185,7 +184,19 @@ public:
    */
   virtual int messageCount( MSG::Level level ) const = 0;
 
+};
 
+class GAUDI_API IInactiveMessageCounter: virtual public IInterface {
+public:
+  /// InterfaceID
+  DeclareInterfaceID(IInactiveMessageCounter,1,0);
+
+  /** Increment deactivated message count.
+   *  Used by MsgStream to record the sources of messages that are prepared, but
+   *  not printed (because if insufficient level).
+   */
+  virtual void incrInactiveCount( MSG::Level level,
+                                  const std::string& src ) = 0;
 };
 
 #endif // GAUDIKERNEL_IMESSAGESVC_H
diff --git a/GaudiKernel/GaudiKernel/Incident.h b/GaudiKernel/GaudiKernel/Incident.h
index 838e2fa364da9195291c7f98de561ce0b0745239..2d3da0521eeb97821500008e141bc733a9d6a7fd 100644
--- a/GaudiKernel/GaudiKernel/Incident.h
+++ b/GaudiKernel/GaudiKernel/Incident.h
@@ -64,7 +64,7 @@ namespace IncidentType
   const std::string EndStream  = "EndStream";  ///< Processing of the stream has finished
 
   const std::string AbortEvent = "AbortEvent"; ///< Stop processing the current event and pass to te next one
-  
+
   //Added by R. Lambert 2009-09-03, for summary services
   //define a preprocessor macro to allow backward-compatibility
 #define GAUDI_FILE_INCIDENTS
@@ -73,11 +73,15 @@ namespace IncidentType
   const std::string FailOutputFile = "FailOutputFile"; ///< could not create or write to this file
   const std::string WroteToOutputFile = "WroteToOutputFile"; ///< the output file was written to in this event
   const std::string EndOutputFile   = "EndOutputFile";   ///< an output file has been finished
-  
+
   const std::string BeginInputFile = "BeginInputFile"; ///< a new input file has been started
   const std::string FailInputFile = "FailInputFile"; ///< could not open or read from this file
   const std::string EndInputFile   = "EndInputFile";   ///< an input file has been finished
 
+  /// Incident raised just before entering loop over the algorithms.
+  const std::string BeginProcessing = "BeginProcessing";
+  /// Incident raised just after the loop over the algorithms (note: before the execution of OutputStreams).
+  const std::string EndProcessing = "EndProcessing";
 }
 
 #endif //GAUDI_INCIDENT_H
diff --git a/GaudiKernel/GaudiKernel/Kernel.h b/GaudiKernel/GaudiKernel/Kernel.h
index 81724b75f8c21465a946638a9c12a5787f4fe67e..c04b04bee1fd1e33e7a2b22966cf6e2a47db2ba1 100755
--- a/GaudiKernel/GaudiKernel/Kernel.h
+++ b/GaudiKernel/GaudiKernel/Kernel.h
@@ -116,4 +116,16 @@
 #endif // GAUDI_V20_COMPAT
 // ---------------------------------- Symbol visibility macros (end)
 
+
+// -------------- LIKELY/UNLIKELY macros (begin)
+// Use compiler hinting to improve branch prediction for linux
+#ifdef __GNUC__
+#  define LIKELY(x)       __builtin_expect((x),1)
+#  define UNLIKELY(x)     __builtin_expect((x),0)
+#else
+#  define LIKELY(x)       x
+#  define UNLIKELY(x)     x
+#endif
+// -------------- LIKELY/UNLIKELY macros (end)
+
 #endif  // GAUDIKERNEL_KERNEL_H
diff --git a/GaudiKernel/GaudiKernel/KeyedObject.h b/GaudiKernel/GaudiKernel/KeyedObject.h
index ce9be7d4a979bcdc2f560fba9a344cf174f1b51c..b7c7b137eda818c0c20387e9052c107525215da0 100644
--- a/GaudiKernel/GaudiKernel/KeyedObject.h
+++ b/GaudiKernel/GaudiKernel/KeyedObject.h
@@ -1,4 +1,3 @@
-// $Id $
 #ifndef GAUDIKERNEL_KEYEDOBJECT_H
 #define GAUDIKERNEL_KEYEDOBJECT_H
 
@@ -59,7 +58,7 @@ protected:
   void setKey(const key_type& key);
 public:
   /// Standard Constructor. The object key is preset to the invalid value.
-  KeyedObject() : m_refCount(0), m_hasKey(false) {                             }
+  KeyedObject(): m_key(), m_refCount(0), m_hasKey(false) {                     }
   /** Standard Constructor accepting the object's key.
       The key must be valid and cannot be changed later.
   */
diff --git a/GaudiKernel/GaudiKernel/MsgStream.h b/GaudiKernel/GaudiKernel/MsgStream.h
index dea8417169fcaac80df1b25dba41bb8725d86401..2b7b7f311992eb79ac806782e81def975c32c510 100644
--- a/GaudiKernel/GaudiKernel/MsgStream.h
+++ b/GaudiKernel/GaudiKernel/MsgStream.h
@@ -1,4 +1,3 @@
-// $Id: MsgStream.h,v 1.43 2008/10/30 23:38:46 marcocle Exp $
 #ifndef GAUDIKERNEL_MSGSTREAM_H
 #define GAUDIKERNEL_MSGSTREAM_H
 
@@ -46,6 +45,12 @@ protected:
   MSG::Level      m_currLevel;
   /// use colors
   bool m_useColors;
+  /// Pointer to service counting messages prepared but not printed because of
+  /// wrong level.
+  IInactiveMessageCounter*    m_inactCounter;
+  /// Flag to state if the inactive messages has to be counted.
+  static bool m_countInactive;
+
 public:
   /// Standard constructor: Connect to message service for output
   GAUDI_API MsgStream(IMessageSvc* svc, int buffer_length=128);
@@ -56,7 +61,8 @@ public:
     : m_service(msg.m_service),
       m_active(msg.m_active),
       m_level(msg.m_level),
-      m_useColors(msg.m_useColors)
+      m_useColors(msg.m_useColors),
+      m_inactCounter(msg.m_inactCounter)
   {
     try { // ignore exception if we cannot copy the string
       m_source = msg.m_source;
@@ -69,7 +75,16 @@ public:
   MsgStream& report(int lvl)   {
     lvl = (lvl >= MSG::NUM_LEVELS) ?
       MSG::ALWAYS : (lvl<MSG::NIL) ? MSG::NIL : lvl;
-    ((m_currLevel=MSG::Level(lvl)) >= level()) ? activate() : deactivate();
+    if  ((m_currLevel=MSG::Level(lvl)) >= level()) {
+      activate();
+    } else {
+      deactivate();
+#ifndef NDEBUG
+      if (MsgStream::countInactive() && m_inactCounter) {
+        m_inactCounter->incrInactiveCount(MSG::Level(lvl),m_source);
+      }
+#endif
+    }
     return *this;
   }
   /// Output method
@@ -145,15 +160,7 @@ public:
     try {
       // this may throw, and we cannot afford it if the stream is used in a catch block
       if(isActive()) {
-#ifdef _WIN32
-        int flg = m_stream.flags();
-        char buf[128];
-        (flg & std::ios::hex) ?
-          ::sprintf(buf,"%I64x",arg) : ::sprintf(buf,"%I64d",arg);
-        m_stream << buf;
-#else
         m_stream << arg;
-#endif
       }
     } catch (...) {}
     return *this;
@@ -223,6 +230,13 @@ public:
   /// Reset the colors to defaults
   GAUDI_API void resetColor();
 
+  /// Enable/disable the count of inactive messages.
+  /// Returns the previous state.
+  static GAUDI_API bool enableCountInactive(bool value = true);
+
+  /// Returns the state of the counting of inactive messages (enabled/disabled).
+  static GAUDI_API bool countInactive();
+
 };
 
 /// MsgStream Modifier: endmsg. Calls the output method of the MsgStream
diff --git a/GaudiKernel/GaudiKernel/Property.h b/GaudiKernel/GaudiKernel/Property.h
index 75147287b91f47b2fad29f02a46bf8e9dd90ee44..3a8b90c91b94216ea4d6587d46cbd918cd650a3a 100644
--- a/GaudiKernel/GaudiKernel/Property.h
+++ b/GaudiKernel/GaudiKernel/Property.h
@@ -439,7 +439,7 @@ PropertyWithVerifier<TYPE,VERIFIER>::set( const TYPE& value )
   /// use verifier!
   if ( !m_verifier.isValid( &value ) ) { return false ; }
   /// update the value
-  i_set( value ) ;
+  this->i_set( value ) ;
   /// invoke the update handler
   return this->useUpdateHandler() ;
 }
diff --git a/GaudiKernel/GaudiKernel/SVectorAsProperty.h b/GaudiKernel/GaudiKernel/SVectorAsProperty.h
index 1452b53a965a7410a0dcf705ec277b14c1be8e71..1eaa1d3a97762cb8658024fc671572c1a782aecf 100644
--- a/GaudiKernel/GaudiKernel/SVectorAsProperty.h
+++ b/GaudiKernel/GaudiKernel/SVectorAsProperty.h
@@ -1,6 +1,6 @@
 // $Id: $
 // ============================================================================
-#ifndef GAUDIKERNEL_GENVCTPARSERS_H 
+#ifndef GAUDIKERNEL_GENVCTPARSERS_H
 #define GAUDIKERNEL_GENVCTPARSERS_H 1
 // ============================================================================
 // Include files
@@ -18,12 +18,12 @@
 // ============================================================================
 #include "Math/SVector.h"
 // ============================================================================
-/** @file 
- *  Declaration of parsing functions for generic vectors to allow 
- *  their usage as properties for Gaudi components 
+/** @file
+ *  Declaration of parsing functions for generic vectors to allow
+ *  their usage as properties for Gaudi components
  *
- *  @attention! this file must be included *BEFORE* * 
- *   any direct or indirect inclusion of GaudiKernel/ToStream.h 
+ *  @attention! this file must be included *BEFORE* *
+ *   any direct or indirect inclusion of GaudiKernel/ToStream.h
  *
  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
  *  @date 2009-09-05
@@ -32,37 +32,47 @@
 namespace Gaudi
 {
   // ==========================================================================
-  namespace Parsers 
+  namespace Parsers
   {
     // ========================================================================
-    /** parse SVector 
-     *  @param result (output) the parsed vector 
-     *  @param input  (input)  the input string 
-     *  @return status code 
+    /** parse SVector
+     *  @param result (output) the parsed vector
+     *  @param input  (input)  the input string
+     *  @return status code
      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
      *  @date 2009-09-05
      */
     template <class SCALAR, unsigned int N>
-    StatusCode parse 
-    ( ROOT::Math::SVector<SCALAR,N>& result , 
-      const std::string&             input  ) 
+    StatusCode parse
+    ( ROOT::Math::SVector<SCALAR,N>& result ,
+      const std::string&             input  )
     {
       std::vector<double> tmp ;
       StatusCode sc = parse ( tmp , input ) ;
-      if ( sc.isFailure()  ) { return sc                  ; } // RETURN 
-      if ( N != tmp.size() ) { return StatusCode::FAILURE ; } // RETURN 
+      if ( sc.isFailure()  ) { return sc                  ; } // RETURN
+      if ( N != tmp.size() ) { return StatusCode::FAILURE ; } // RETURN
+#ifdef WIN32
+// Disable warning
+//    C4996: 'std::copy': Function call with parameters that may be unsafe
+// The parameters are checked
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
       std::copy ( tmp.begin() , tmp.end() , result.begin() ) ;
+#ifdef WIN32
+#pragma warning(pop)
+#endif
       return StatusCode::SUCCESS ;
     }
     // ========================================================================
-  } //                                          end of namespace Gaudi::Parsers 
+  } //                                          end of namespace Gaudi::Parsers
   // ==========================================================================
 } //                                                     end of namespace Gaudi
 // ============================================================================
 namespace Gaudi
 {
   // ==========================================================================
-  namespace Utils 
+  namespace Utils
   {
     // ========================================================================
     template <class SCALAR>
@@ -71,10 +81,10 @@ namespace Gaudi
     /** the general streaming function for SVector using python-tupel format
      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
      *  @date 2009-10-07
-     */   
-    template <class SCALAR, unsigned int N> 
-    std::ostream& toStream 
-    ( const ROOT::Math::SVector<SCALAR,N>& obj , std::ostream& s ) 
+     */
+    template <class SCALAR, unsigned int N>
+    std::ostream& toStream
+    ( const ROOT::Math::SVector<SCALAR,N>& obj , std::ostream& s )
     {
       s << "( ";
       for ( typename ROOT::Math::SVector<SCALAR,N>::const_iterator cur = obj.begin() ;
@@ -84,13 +94,13 @@ namespace Gaudi
         toStream ( *cur , s ) ;
       }
       return s << " )";
-    }  
+    }
     // ========================================================================
-  } // end of namespace Gaudi::Utils 
+  } // end of namespace Gaudi::Utils
   // ==========================================================================
-} //                                                     end of namespace Gaudi 
+} //                                                     end of namespace Gaudi
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
 #endif // GAUDIKERNEL_GENVCTPARSERS_H
 // ============================================================================
diff --git a/GaudiKernel/GaudiKernel/System.h b/GaudiKernel/GaudiKernel/System.h
index 3adf15f8dd430f85b7979462b0930083ba23b681..5f06fd4e4d0a3d67d04187f4f7f30896e725ce53 100644
--- a/GaudiKernel/GaudiKernel/System.h
+++ b/GaudiKernel/GaudiKernel/System.h
@@ -71,16 +71,24 @@ namespace System  {
   GAUDI_API const std::vector<std::string> cmdLineArgs();
   ///char** command line arguments including executable name as arg[0]; You may not modify them!
   GAUDI_API char** argv();
-  ///get a particular environment variable
-  GAUDI_API const std::string getEnv(const char* var);
+  ///get a particular environment variable (returning "UNKNOWN" if not set)
+  GAUDI_API std::string getEnv(const char* var);
+  /// get a particular environment variable, storing the value in the passed string if the
+  /// variable is set. Returns true if the variable is set, false otherwise.
+  GAUDI_API bool getEnv(const char* var, std::string &value);
+  inline bool getEnv(const std::string &var, std::string &value) {
+    return getEnv(var.c_str(), value);
+  }
   ///get all environment variables
-  GAUDI_API const std::vector<std::string> getEnv();
+  GAUDI_API std::vector<std::string> getEnv();
   ///Set an environment variables.
   ///If value is empty, the variable is removed from the environment.
   ///When overwrite is 0, the variable is not set if already present.
   ///Returns 0 on success, -1 on failure.
   ///See man 3 setenv.
   GAUDI_API int setEnv(const std::string &name, const std::string &value, int overwrite = 1);
+  /// Check if an environment variable is set or not.
+  GAUDI_API bool isEnvSet(const char* var);
 #ifdef __linux
   ///A Thread handle
   typedef pthread_t ThreadHandle;
diff --git a/GaudiKernel/GaudiKernel/Time.h b/GaudiKernel/GaudiKernel/Time.h
index 5a4e1aa700c624c90bf3db12c9706a51c9dbdf74..95bb31b154918b076dd5877b43e83526ecfd01f1 100644
--- a/GaudiKernel/GaudiKernel/Time.h
+++ b/GaudiKernel/GaudiKernel/Time.h
@@ -284,8 +284,8 @@ namespace Gaudi {
 
     ValueType  ns (void) const;
 
-    std::string  format (bool local, const std::string &spec) const;
-    std::string  nanoformat (int minwidth = 1, int maxwidth = 9) const;
+    std::string  format (bool local, std::string spec = "%c") const;
+    std::string  nanoformat (size_t minwidth = 1, size_t maxwidth = 9) const;
 
     static bool  isLeap (int year);
 
diff --git a/GaudiKernel/GaudiKernel/time_r.h b/GaudiKernel/GaudiKernel/time_r.h
index 35541dd7e07dbea0351bac396a7d8cd704578b84..bb2dc57d451bdda721e3ad38acea772dc1979ca9 100644
--- a/GaudiKernel/GaudiKernel/time_r.h
+++ b/GaudiKernel/GaudiKernel/time_r.h
@@ -13,12 +13,12 @@
 #ifdef _WIN32
 
 extern "C" {
-  inline struct tm *localtime_r ( const time_t *sec, struct tm *result) {
-    *result = *localtime(sec);
+  inline struct tm * localtime_r(const time_t *sec, struct tm *result) {
+    localtime_s(result, sec);
     return result;
   }
-  inline struct tm *gmtime_r ( const time_t *sec, struct tm *result) {
-    *result = *gmtime(sec);
+  inline struct tm * gmtime_r(const time_t *sec, struct tm *result) {
+    gmtime_s(result, sec);
     return result;
   }
 }
diff --git a/GaudiKernel/cmt/requirements b/GaudiKernel/cmt/requirements
index 57904b3e262a1b32e433d92c8c33b2bb2846dea8..f599aa9d7e514ef80f5f94fed097eecf6734bd33 100644
--- a/GaudiKernel/cmt/requirements
+++ b/GaudiKernel/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiKernel
-version v27r12
+version v27r14
 author "LHCb Gaudi Team"
 
 branches GaudiKernel cmt doc src
@@ -63,6 +63,8 @@ application DirSearchPath_test -group=tests ../tests/src/DirSearchPath_test.cpp
 
 application PathResolver_test -group=tests ../tests/src/PathResolver_test.cpp
 
+application Memory_test -group=tests ../tests/src/Memory_test.cpp
+
 use CppUnit * LCG_Interfaces -no_auto_imports
 
 application test_SerializeSTL -group=tests -import=CppUnit \
@@ -74,9 +76,21 @@ macro_append app_test_SerializeSTL_cppflags ' -Wno-unused-parameter ' \
                                target-winxp '' \
                                  target-icc ''
 
+application test_GaudiTime -group=tests -import=CppUnit \
+                       ../tests/src/test_GaudiTime.cpp
+# FIXME: (MCl) this hides warnings from a broken header file in CppUnit, but may
+#              hide problems in the actual test source.
+macro_append app_test_GaudiTime_cppflags ' -Wno-unused-parameter ' \
+                        no-hide-warnings '' \
+                            target-winxp '' \
+                              target-icc ''
+
+application test_headers_build -group=tests ../tests/src/test_headers_build.cpp
+
 # FIXME: (MCl) hides the warning due to hidden virtual functions in the __shadow__ classes
 #              generated in the dictionaries.
-macro_append dictionary_dict_cpp_cppflags ' -Wno-overloaded-virtual ' no-hide-warnings '' target-winxp ''
+# On Windows hides warning C4996 (security-related warning)
+macro_append dictionary_dict_cpp_cppflags ' -Wno-overloaded-virtual ' no-hide-warnings '' target-winxp ' -D_SCL_SECURE_NO_WARNINGS'
 
 apply_pattern QMTest
 
diff --git a/GaudiKernel/doc/release.notes b/GaudiKernel/doc/release.notes
index 55cda52ae25195f44c3038eeb967d52649f5c88a..7720ac8af0877a2f29694c07fa11bb88395912c7 100644
--- a/GaudiKernel/doc/release.notes
+++ b/GaudiKernel/doc/release.notes
@@ -1,6 +1,59 @@
 Package : GaudiKernel
 Package manager : Marco Clemencic
 
+============================= GaudiKernel v27r14 =============================
+! 2011-04-19 - Marco Clemencic
+ - Fixed a defect spotted by Coverity in KeyedObject (UNINIT_CTOR).
+
+! 2011-04-18 - Marco Clemencic
+ - Moved the LIKELY and UNLIKELY macros to GaudiKernel/Kernel.h
+
+! 2011-04-15 - Charles Leggett
+ - added LIKELY and UNLIKELY macros to improve branch prediction for linux
+ A       GaudiKernel/likely.h
+
+! 2011-04-15 - Marco Clemencic
+ - Fixed a warning triggered by the macro NDEBUG.
+ - Fixes to patch #4820.
+
+! 2011-04-14 - Markus Frank
+ - Patch #4820: fix bug #80947
+   Fix bug accessing system-memory information, if process memory is > 4GB.
+
+! 2011-04-08 - Marco Clemencic
+ - Introduced two new incidents: BeginProcessing and EndProcessing.
+   They are needed to reintroduce the signals around the processing loop as
+   it was the case for BeginEvent and EndEvent before GaudiSvc v17r0.
+
+! 2011-03-28 - Marco Clemencic
+ - Fixed a typo.
+
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+   - Removed some "empty" files (files producing empty objects files),
+     replacing them with a test .cpp file to ensure that the headers do not
+     contain syntax errors.
+
+! 2011-03-22 - Marco Clemencic
+ - Added a function to convert IAuditor::StandardEventType to const char*,
+   (toStr) needed to simplify the implementation of some auditors.
+
+! 2011-03-17 - Marco Clemencic
+ - Modified DirSearchPath to remove boost::filesystem::no_check. It is not
+   needed and breaks on MacOSX in debug mode (at least with Boost 1.44).
+   See patch #4735.
+ - Fixed PathResolver_test to work on MacOSX.
+
+! 2011-03-16 - Charles Leggett, Marco Clemencic
+ - Patch #4722: detect unprotected DEBUG and VERBOSE messages
+
+============================= GaudiKernel v27r13 =============================
+! 2011-02-21 - Charles Leggett
+ - Fixed bug #77534: this-> needed in Property.h
+
 ============================= GaudiKernel v27r12 =============================
 ! 2011-01-19 - Markus Frank
  - Fixes for bug #77109.
diff --git a/GaudiKernel/src/Lib/ChronoEntity.cpp b/GaudiKernel/src/Lib/ChronoEntity.cpp
index ad6813191102f8f37e5ea6d092619692a9253c45..b5c4c77e8d4d4e7ebfc3657e107ca582aee4cfd3 100644
--- a/GaudiKernel/src/Lib/ChronoEntity.cpp
+++ b/GaudiKernel/src/Lib/ChronoEntity.cpp
@@ -1,54 +1,54 @@
-// $Id: ChronoEntity.cpp,v 1.4 2008/06/06 13:20:13 marcocle Exp $ 
+// $Id: ChronoEntity.cpp,v 1.4 2008/06/06 13:20:13 marcocle Exp $
 // ============================================================================
-#define GAUDIKERNEL_CHRONOENTITY_CPP 1 
+#define GAUDIKERNEL_CHRONOENTITY_CPP 1
 // ============================================================================
-// incldue files 
+// incldue files
 // ============================================================================
-// STD & STL 
+// STD & STL
 // ============================================================================
-#include <iostream> 
-#include <iomanip> 
-#include <cmath> 
+#include <iostream>
+#include <iomanip>
+#include <cmath>
 #include <algorithm>
 #include <cstdio>
 // ============================================================================
 // GaudiKernel
 // ============================================================================
-#include "GaudiKernel/Kernel.h" 
-#include "GaudiKernel/System.h" 
-#include "GaudiKernel/ChronoEntity.h" 
+#include "GaudiKernel/Kernel.h"
+#include "GaudiKernel/System.h"
+#include "GaudiKernel/ChronoEntity.h"
 // ============================================================================
-// Boost 
+// Boost
 // ============================================================================
 #include "boost/format.hpp"
 // ============================================================================
-/** @file 
- *  implementation fiel for class ChronoEntity 
+/** @file
+ *  implementation fiel for class ChronoEntity
  *  @author Vanya BELYAEV Ivan.Belyaev@itep.ru
- *  @date:   December 1, 1999 
+ *  @date:   December 1, 1999
  */
 // ============================================================================
-namespace 
+namespace
 {
   /// unit here is microsecond
-  const System::TimeType MyUnit = System::microSec ; // unit here is microsecond 
+  const System::TimeType MyUnit = System::microSec ; // unit here is microsecond
   /// unit here is microsecond
-  const double microsecond  =    1                 ; // unit here is microsecond 
+  const double microsecond  =    1                 ; // unit here is microsecond
   const double millisecond  = 1000  * microsecond ;
-  const double second       = 1000  * millisecond ; 
-  const double minute       =   60  *      second ; 
-  const double hour         =   60  *      minute ; 
-  const double day          =   24  *        hour ; 
-  const double week         =    7  *         day ; 
+  const double second       = 1000  * millisecond ;
+  const double minute       =   60  *      second ;
+  const double hour         =   60  *      minute ;
+  const double day          =   24  *        hour ;
+  const double week         =    7  *         day ;
   const double month        =   30  *         day ;
   const double year         =  365  *         day ;
   const double nanosecond   = 0.001 * microsecond ;
 }
 // ============================================================================
-// Constructor 
+// Constructor
 // ============================================================================
-ChronoEntity::ChronoEntity() 
-  /// current status of this chrono object; 
+ChronoEntity::ChronoEntity()
+  /// current status of this chrono object;
   : m_status        ( IChronoSvc::UNKNOWN )  // current status
   /// delta user time
   , m_delta_user    ( -1 ) // delta user time
@@ -57,11 +57,11 @@ ChronoEntity::ChronoEntity()
   /// delta elapsed time
   , m_delta_elapsed ( -1 ) // delta elapsed time
   /// start stamp for current measurement of user time
-  , m_start_user    (  0 ) // start for user 
+  , m_start_user    (  0 ) // start for user
   /// start stamp for  current measurement of Kernel time
-  , m_start_kernel  (  0 ) // start for kernel 
+  , m_start_kernel  (  0 ) // start for kernel
   /// start stamp for current measurement of Elapsed time
-  , m_start_elapsed (  0 ) // start for elapsed  
+  , m_start_elapsed (  0 ) // start for elapsed
 {}
 // ============================================================================
 // start the chrono
@@ -96,23 +96,23 @@ IChronoSvc::ChronoStatus  ChronoEntity::start()
 IChronoSvc::ChronoStatus  ChronoEntity::stop()
 {
   if ( IChronoSvc::RUNNING != m_status ) { return m_status ; }
-  
+
   // following lines could be platform dependent!
-  
+
   m_delta_user    = System::userTime     ( MyUnit ) - m_start_user    ;
   m_delta_kernel  = System::kernelTime   ( MyUnit ) - m_start_kernel  ;
   m_delta_elapsed = System::ellapsedTime ( MyUnit ) - m_start_elapsed ;
-  
+
   // update the counters:
-  
+
   m_user     += m_delta_user    ;
   m_kernel   += m_delta_kernel  ;
   m_elapsed  += m_delta_elapsed ;
-  
+
   // set new status
-  
-  m_status = IChronoSvc::STOPPED;  
-  
+
+  m_status = IChronoSvc::STOPPED;
+
   return m_status ;
 }
 // ============================================================================
@@ -121,7 +121,7 @@ IChronoSvc::ChronoStatus  ChronoEntity::stop()
 std::string ChronoEntity::outputUserTime      () const
 {
   std::string res ("Time User   : ") ;
-  return res += format 
+  return res += format
     ( uTotalTime     () ,
       uMinimalTime   () ,
       uMeanTime      () ,
@@ -149,137 +149,121 @@ std::string ChronoEntity::outputElapsedTime      () const
 {
   std::string res ("TimeElapsed: ") ;
   return res += format
-    ( eTotalTime     () , 
-      eMinimalTime   () , 
-      eMeanTime      () , 
-      eRMSTime       () , 
-      eMaximalTime   () , 
-      nOfMeasurements() );  
+    ( eTotalTime     () ,
+      eMinimalTime   () ,
+      eMeanTime      () ,
+      eRMSTime       () ,
+      eMaximalTime   () ,
+      nOfMeasurements() );
 }
 // ============================================================================
-// print the chrono  
+// print the chrono
 // ============================================================================
 std::string ChronoEntity::format
-( const double        total     , 
+( const double        total     ,
   const double        minimal   ,
-  const double        mean      , 
-  const double        rms       , 
-  const double        maximal   , 
+  const double        mean      ,
+  const double        rms       ,
+  const double        maximal   ,
   const unsigned long number    ) const
 {
-  ///  
-  const int buffer_size         = 256 ;
-  char      buffer[buffer_size]       ;
-  int       index               = 0   ;
-  ///
+
+  /// @todo: cache the format
+  boost::format fmt("Tot=%2$5.3g%1$s %4$43s #=%3$3lu");
+
   long double  unit = 1.0 ;
-  std::string cunit = ""  ; 
-  ///  
-  if     ( total / microsecond  <  500 ) 
-  { unit = microsecond ; cunit = " [us]"    ; } 
+
+  if     ( total / microsecond  <  500 )
+  { unit = microsecond ; fmt % " [us]" ; }
   else if( total / millisecond  <  500 )
-  { unit = millisecond ; cunit = " [ms]"    ; } 
-  else if( total /      second  <  500 ) 
-  { unit =      second ; cunit = "  [s]"     ; }
+  { unit = millisecond ; fmt % " [ms]" ; }
+  else if( total /      second  <  500 )
+  { unit =      second ; fmt % "  [s]" ; }
   else if( total /      minute  <  500 )
-  { unit =      minute ; cunit = "[min]"   ; }
-  else if( total /        hour  <  500 ) 
-    { unit =        hour ; cunit = "  [h]"     ; }
+  { unit =      minute ; fmt % "[min]" ; }
+  else if( total /        hour  <  500 )
+  { unit =        hour ; fmt % "  [h]" ; }
   else if( total /         day  <   10 )
-  { unit =         day ; cunit = "[day]"   ; }
-  else if( total /        week  <    5 ) 
-  { unit =        week ; cunit = "  [w]"  ; }
-  else if( total /       month  <   20 ) 
-  { unit =       month ; cunit = "[mon]" ; }
-  else                                   
-  { unit =        year ; cunit = "  [y]"  ; } 
-  ///
-  index += sprintf( buffer + index , "Tot=%5.3g" , (double) (total / unit) ) ;
-  index += sprintf( buffer + index , "%s" , cunit.c_str()          ) ;
-  ///
+  { unit =         day ; fmt % "[day]" ; }
+  else if( total /        week  <    5 )
+  { unit =        week ; fmt % "  [w]" ; }
+  else if( total /       month  <   20 )
+  { unit =       month ; fmt % "[mon]" ; }
+  else
+  { unit =        year ; fmt % "  [y]" ; }
+
+  fmt % (double) (total / unit) % number;
+
   if( 1 < number )
   {
-    
-    if     ( mean / microsecond  <  500 ) 
-    { unit = microsecond ; cunit = " [us]"    ; } 
+    /// @todo: cache the format
+    boost::format fmt1("Ave/Min/Max=%2$5.3g(+-%3$5.3g)/%4$5.3g/%5$5.3g%1$s");
+    if     ( mean / microsecond  <  500 )
+    { unit = microsecond ; fmt1 % " [us]" ; }
     else if( mean / millisecond  <  500 )
-    { unit = millisecond ; cunit = " [ms]"    ; } 
-    else if( mean /      second  <  500 ) 
-    { unit =      second ; cunit = "  [s]"     ; }
+    { unit = millisecond ; fmt1 % " [ms]" ; }
+    else if( mean /      second  <  500 )
+    { unit =      second ; fmt1 % "  [s]" ; }
     else if( mean /      minute  <  500 )
-    { unit =      minute ; cunit = "[min]"   ; }
-    else if( mean /        hour  <  500 ) 
-    { unit =        hour ; cunit = "  [h]"     ; }
+    { unit =      minute ; fmt1 % "[min]" ; }
+    else if( mean /        hour  <  500 )
+    { unit =        hour ; fmt1 % "  [h]" ; }
     else if( mean /         day  <   10 )
-    { unit =         day ; cunit = "[day]"   ; }
-    else if( mean /        week  <    5 ) 
-    { unit =        week ; cunit = "  [w]"  ; }
-    else if( mean /       month  <   20 ) 
-    { unit =       month ; cunit = "[mon]" ; }
-    else                                   
-    { unit =        year ; cunit = "[year]"  ; } 
-    ///      
-    index += 
-      sprintf( buffer + index , 
-               " Ave/Min/Max=%5.3g" , (double) ( mean / unit ) ) ;
-    index += 
-      sprintf( buffer + index , 
-               "(+-%5.3g)"          , (double) ( rms  / unit ) ) ;
-    index += 
-      sprintf( buffer + index , 
-               "/%5.3g"             , (double) ( minimal  / unit ) ) ;
-    index += 
-      sprintf( buffer + index , 
-               "/%5.3g"             , (double) ( maximal  / unit ) ) ;
-    ///
-    index += sprintf( buffer + index , "%s" , cunit.c_str() );
-    ///
+    { unit =         day ; fmt1 % "[day]" ; }
+    else if( mean /        week  <    5 )
+    { unit =        week ; fmt1 % "  [w]" ; }
+    else if( mean /       month  <   20 )
+    { unit =       month ; fmt1 % "[mon]" ; }
+    else
+    { unit =        year ; fmt1 % "  [y]" ; }
+
+    fmt1 % (double) ( mean / unit ) % (double) ( rms  / unit )
+         % (double) ( minimal  / unit ) % (double) ( maximal  / unit );
+    fmt % fmt1.str();
   }
-  else
-  { index += sprintf( buffer + index , "%44s" , " " ); }    
-  ///
-  index += sprintf( buffer + index , " #=%3lu" , number );
-  ///
-  return std::string( buffer, 0 , index );
-  ///
+  else {
+    fmt % "";
+  }
+
+  return fmt.str();
 }
 // ============================================================================
-// comparison operator 
+// comparison operator
 // ============================================================================
 bool ChronoEntity::operator<( const ChronoEntity& e ) const
-{ 
-  return 
-    ( &e           == this          ) ? false : 
+{
+  return
+    ( &e           == this          ) ? false :
     ( totalTime () < e.totalTime () ) ? true  :
     ( totalTime () > e.totalTime () ) ? false :
     ( m_user       < e.m_user       ) ? true  :
-    ( e.m_user     <   m_user       ) ? false : 
+    ( e.m_user     <   m_user       ) ? false :
     ( m_kernel     < e.m_kernel     ) ? true  :
-    ( e.m_kernel   <   m_kernel     ) ? false : 
+    ( e.m_kernel   <   m_kernel     ) ? false :
     ( m_elapsed    < e.m_elapsed    ) ? true  :
     ( e.m_elapsed  <   m_elapsed    ) ? false : false ;
 }
 // ============================================================================
-/*  print the chrono according the format and units 
- *  @param typ  the chrono type 
- *  @param fmt  the format string 
+/*  print the chrono according the format and units
+ *  @param typ  the chrono type
+ *  @param fmt  the format string
  *  @param unit the unit
- *  @return the string representations 
+ *  @return the string representations
  *  @see boost::format
  */
 // ============================================================================
-std::string ChronoEntity::outputTime 
-( IChronoSvc::ChronoType typ  , 
-  const std::string&     fmt  , 
-  System::TimeType       unit ) const 
+std::string ChronoEntity::outputTime
+( IChronoSvc::ChronoType typ  ,
+  const std::string&     fmt  ,
+  System::TimeType       unit ) const
 {
   boost::format _fmt ( fmt ) ;
-  // allow various number of arguments 
-  using namespace boost::io ;  
+  // allow various number of arguments
+  using namespace boost::io ;
   _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
   //
   double _unit = microsecond ;
-  switch ( unit ) 
+  switch ( unit )
   {
   case System::Year     : _unit = year        ; break ;
   case System::Month    : _unit = month       ; break ;
@@ -294,27 +278,27 @@ std::string ChronoEntity::outputTime
   }
   //
   const StatEntity* stat = &m_user;
-  switch ( typ ) 
+  switch ( typ )
   {
   case IChronoSvc::USER    : stat = &m_user    ; break ;
   case IChronoSvc::KERNEL  : stat = &m_kernel  ; break ;
   case IChronoSvc::ELAPSED : stat = &m_elapsed ; break ;
   default                  : stat = &m_user    ; break ;
   }
-  //  
-  _fmt 
-    %   ( stat -> nEntries    ()         )   // %1 : #entries 
-    %   ( stat -> flag        () / _unit )   // %2 : total time 
-    %   ( stat -> flagMean    () / _unit )   // %3 : mean time 
-    %   ( stat -> flagRMS     () / _unit )   // %4 : RMS  time 
-    %   ( stat -> flagMeanErr () / _unit )   // %5 : error in mean time 
-    %   ( stat -> flagMin     () / _unit )   // %6 : minimal time 
-    %   ( stat -> flagMax     () / _unit ) ; // %7 : maximal time 
+  //
+  _fmt
+    %   ( stat -> nEntries    ()         )   // %1 : #entries
+    %   ( stat -> flag        () / _unit )   // %2 : total time
+    %   ( stat -> flagMean    () / _unit )   // %3 : mean time
+    %   ( stat -> flagRMS     () / _unit )   // %4 : RMS  time
+    %   ( stat -> flagMeanErr () / _unit )   // %5 : error in mean time
+    %   ( stat -> flagMin     () / _unit )   // %6 : minimal time
+    %   ( stat -> flagMax     () / _unit ) ; // %7 : maximal time
   //
   return _fmt.str() ;
 }
 // ==========================================================================
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
diff --git a/GaudiKernel/src/Lib/DataStreamTool.cpp b/GaudiKernel/src/Lib/DataStreamTool.cpp
index 6a1dae6c84c4ded4e349281e7e30e5cb93d1e9fc..d140319b54565218aa95891b4aa2c54f13f7e2a0 100644
--- a/GaudiKernel/src/Lib/DataStreamTool.cpp
+++ b/GaudiKernel/src/Lib/DataStreamTool.cpp
@@ -18,6 +18,8 @@
 #include "GaudiKernel/ToolFactory.h"
 #include "GaudiKernel/SvcFactory.h"
 
+#include <sstream>
+
 //-----------------------------------------------------------------------------
 // Implementation file for class : DataStreamTool
 //
@@ -80,13 +82,12 @@ StatusCode DataStreamTool::addStream(const std::string & input) {
 
   m_streamSpecs.push_back(input);
 
-  char txt[32];
-
-  std::string strname = name() + "_" + ::_itoa(++m_streamCount, txt, 10);
+  std::ostringstream strname;
+  strname << name() << '_' << ++m_streamCount;
 
   EventSelectorDataStream* s = 0;
 
-  StatusCode status = createStream(strname, input , s );
+  StatusCode status = createStream(strname.str(), input , s );
 
   if( status.isSuccess() && 0 != s ) {
     s->addRef();
@@ -297,10 +298,10 @@ StatusCode DataStreamTool::connectStream( const std::string & info )
     MsgStream log(msgSvc(), name());
     log << MSG::WARNING << "Input stream " << info << "already in use" << endmsg;
   }
-  char txt[32];
-  std::string nam = name() + "_" + ::_itoa(++m_streamCount, txt, 10);
+  std::ostringstream nam;
+  nam << name() << '_' << ++m_streamCount;
   EventSelectorDataStream* s = 0;
-  StatusCode status = createStream(nam, info, s);
+  StatusCode status = createStream(nam.str(), info, s);
   if ( status.isSuccess() )   {
     return connectStream(s);
   }
diff --git a/GaudiKernel/src/Lib/DataSvc.cpp b/GaudiKernel/src/Lib/DataSvc.cpp
index 2013a8a9077aac6ee84ee9304b1ccbce9e172cf6..5f1907752738a9b9a5f45adf6682d7344655920f 100644
--- a/GaudiKernel/src/Lib/DataSvc.cpp
+++ b/GaudiKernel/src/Lib/DataSvc.cpp
@@ -39,6 +39,17 @@
 #include <cstdlib>
 #include <vector>
 #include <algorithm>
+#include <sstream>
+
+namespace {
+  /// Helper function to convert item numbers to path strings
+  /// i.e. int -> "/" + int
+  inline std::string itemToPath(int item) {
+    std::ostringstream path;
+    path << '/' << item;
+    return path.str();
+  }
+}
 
 // If you absolutely need optimization: switch off dynamic_cast.
 // This improves access to the data store roughly by 10 %
@@ -423,18 +434,14 @@ StatusCode DataSvc::registerObject (const std::string& parentPath,
 StatusCode DataSvc::registerObject(const std::string& parentPath,
                                    int item,
                                    DataObject* pObject)   {
-  char buffer[32] = "/";
-  ::_itoa( item, &buffer[1] , 10 );
-  return registerObject(parentPath, buffer, pObject);
+  return registerObject(parentPath, itemToPath(item), pObject);
 }
 
 /// Register object with the data store.
 StatusCode DataSvc::registerObject(DataObject* parentObj,
                                    int item,
                                    DataObject* pObject)   {
-  char buffer[32] = "/";
-  ::_itoa( item, &buffer[1] , 10 );
-  return registerObject(parentObj, buffer, pObject);
+  return registerObject(parentObj, itemToPath(item), pObject);
 }
 
 /// Register object with the data store.
@@ -566,9 +573,7 @@ StatusCode DataSvc::unregisterObject(const std::string& parentPath,
 
 /// Unregister object from the data store.
 StatusCode DataSvc::unregisterObject(const std::string& parentPath, int item) {
-  char objPath[32] = "/";
-  ::_itoa( item, &objPath[1] , 10 );
-  return unregisterObject(parentPath, objPath);
+  return unregisterObject(parentPath, itemToPath(item));
 }
 
 /// Unregister object from the data store.
@@ -626,9 +631,7 @@ StatusCode DataSvc::unregisterObject (DataObject* pParentObj,
 
 /// Unregister object from the data store.
 StatusCode DataSvc::unregisterObject(DataObject* pParentObj, int item)    {
-  char objPath[32] = "/";
-  ::_itoa( item, &objPath[1] , 10 );
-  return unregisterObject(pParentObj, objPath);
+  return unregisterObject(pParentObj, itemToPath(item));
 }
 
 /** Invoke data fault handling if enabled
@@ -892,9 +895,7 @@ StatusCode DataSvc::retrieveObject(const std::string& parentPath,
 StatusCode DataSvc::retrieveObject(const std::string& parentPath,
                                    int item,
                                    DataObject*& pObject)   {
-  char buffer[32] = "/";
-  ::_itoa(item,&buffer[1],10);
-  return retrieveObject(parentPath, buffer, pObject);
+  return retrieveObject(parentPath, itemToPath(item), pObject);
 }
 
 /// Retrieve object from data store.
@@ -909,9 +910,7 @@ StatusCode DataSvc::retrieveObject(DataObject* parentObj,
 StatusCode DataSvc::retrieveObject(DataObject* parentObj,
                                    int item,
                                    DataObject*& pObject)  {
-  char buffer[32] = "/";
-  ::_itoa(item,&buffer[1],10);
-  return retrieveObject(parentObj, buffer, pObject);
+  return retrieveObject(parentObj, itemToPath(item), pObject);
 }
 
 /// Retrieve object identified by its directory from the data store.
@@ -965,18 +964,14 @@ StatusCode DataSvc::findObject(const std::string& parentPath,
 /// Retrieve object identified by its full path from the data store.
 StatusCode DataSvc::findObject(const std::string& parentPath,
                                int item, DataObject*& pObject)   {
-  char buffer[32] = "/";
-  ::_itoa(item,&buffer[1],10);
-  return findObject(parentPath, buffer, pObject);
+  return findObject(parentPath, itemToPath(item), pObject);
 }
 
 /// Find object identified by its full path in the data store.
 StatusCode DataSvc::findObject(DataObject* parentObj,
                                int item,
                                DataObject*& pObject)    {
-  char buffer[32] = "/";
-  ::_itoa(item,&buffer[1],10);
-  return findObject(parentObj, buffer, pObject);
+  return findObject(parentObj, itemToPath(item), pObject);
 }
 
 /// Find object identified by its full path in the data store.
diff --git a/GaudiKernel/src/Lib/DirSearchPath.cpp b/GaudiKernel/src/Lib/DirSearchPath.cpp
index 42348bcd3e18abc6c7f5299e09fdc39dbe11dd8f..9635440b426f49272c97581b924bb7b590d0d0d3 100644
--- a/GaudiKernel/src/Lib/DirSearchPath.cpp
+++ b/GaudiKernel/src/Lib/DirSearchPath.cpp
@@ -1,6 +1,10 @@
-// $Id: DirSearchPath.cpp,v 1.2 2007/10/16 15:37:25 marcocle Exp $
+#ifdef WIN32
+// Disable warning
+//    C4996: '...': Function call with parameters that may be unsafe
+// Noise probably coming from the use of Boost tokenizer
+#pragma warning(disable:4996)
+#endif
 
-//<<<<<< INCLUDES                                                       >>>>>>
 #include <algorithm>  /* find */
 #include <iostream>
 #ifdef __ICC
@@ -21,7 +25,7 @@ using boost::filesystem::is_directory;
 using boost::tokenizer;
 using boost::char_separator;
 
-//structors
+//constructors
 DirSearchPath::DirSearchPath(const std::string& stringifiedPath, const char* separator) {
   addCWD(); //FIXME is this a good idea?
 
@@ -29,37 +33,20 @@ DirSearchPath::DirSearchPath(const std::string& stringifiedPath, const char* sep
 
   Tokenizer tok(stringifiedPath, char_separator<char>(separator));
 
-
   //add names to dir container, filtering dir names to remove invalid ones
   //notice how we iterate over all tokens even if there is an illegal one
   Tokenizer::iterator it = tok.begin();
   while(it != tok.end()) {
     try {
-      //path p( *(it++), boost::filesystem::native);
-      // For some reason native() does not work with boost 1.31. Changed to no_check and cross the fingers....
-      path p( *(it++), boost::filesystem::no_check);
+      path p(*(it++));
       add(p);
     }
-    catch (boost::filesystem::filesystem_error /*err*/) {
+    catch (boost::filesystem::filesystem_error &/*err*/) {
     }
   }
 }
 
 //modifiers
-// bool DirSearchPath::add(const std::string& dirName) {
-//   bool rc(false);
-//   try {
-//     rc=add(path(dirName));
-//   } catch (const filesystem_error& err) {
-// #ifndef NDEBUG
-//     cerr << "DirSearchPath::DirSearchPath: ERROR adding dir "
-// 	 << err.what() << endl;
-//     throw err;
-// #endif
-//   }
-//   return rc;
-// }
-
 bool DirSearchPath::addCWD() {
   return add(boost::filesystem::current_path());
 }
diff --git a/GaudiKernel/src/Lib/Environment.cpp b/GaudiKernel/src/Lib/Environment.cpp
index fa3430eb97c4b7ed83dfc4f388de14aed532d2ee..7402f97e3c082b88f5f59d2c69a30502d7ea2279 100644
--- a/GaudiKernel/src/Lib/Environment.cpp
+++ b/GaudiKernel/src/Lib/Environment.cpp
@@ -1,4 +1,5 @@
 #include "GaudiKernel/Environment.h"
+#include "GaudiKernel/System.h"
 #include <cstdlib>
 
 namespace {
@@ -20,8 +21,9 @@ namespace {
           case '}':
             if ( lvl == mx_lvl )  {
               std::string env(beg+2,c-beg-2);
-              const char* res = ::getenv(env.c_str());
-              std::string rep = (res) ? std::string(res) : i_resolve(env,--recursions);
+              std::string rep;
+              if ( ! System::getEnv(env.c_str(), rep) )
+            	rep = i_resolve(env, --recursions);
               if ( rep.length() )  {
                 std::string e(beg,c-beg+1);
                 size_t idx=std::string::npos;
@@ -31,7 +33,7 @@ namespace {
                 return i_resolve(source, --recursions);
               }
               else  {
-                // error: environment cannot be reolved....
+                // error: environment cannot be resolved....
                 // Try to continue, but there is not too much hope.
               }
             }
@@ -56,42 +58,36 @@ StatusCode System::resolveEnv(const std::string& var, std::string& res, int recu
 }
 
 std::string System::homeDirectory()  {
-   // Return the user's home directory.
+  // Return the user's home directory.
   std::string home_dir = "./";
-  const char *h = 0;
-  if ( 0 == (h = ::getenv("home")))  {
-    h = ::getenv("HOME");
-  }
-  if ( h ) {
-    home_dir = h;
-  }
-  else {
+  // Try to replace the current value with the content of several
+  // environment variables
+  if ( ! (System::getEnv("home", home_dir) ||
+          System::getEnv("HOME", home_dir)) ) {
     // for Windows NT HOME might be defined as either $(HOMESHARE)/$(HOMEPATH)
     //                                         or     $(HOMEDRIVE)/$(HOMEPATH)
-    h = ::getenv("HOMESHARE");
-    if ( 0 == h )  {
-      h = ::getenv("HOMEDRIVE");
-    }
-    if (h) {
-      home_dir = h;
-      h = ::getenv("HOMEPATH");
-      if( h )  {
-        home_dir += h;
-      }
+    if ( System::getEnv("HOMESHARE", home_dir) ||
+         System::getEnv("HOMEDRIVE", home_dir) ) {
+      std::string path;
+      if (System::getEnv("HOMEPATH", path))
+    	home_dir += path;
     }
   }
   return home_dir;
 }
 
 std::string System::tempDirectory()   {
-   // Return a user configured or systemwide directory to create
-   // temporary files in.
-   const char *dir = ::getenv("TEMP");
-   if (!dir)   dir = ::getenv("TEMPDIR");
-   if (!dir)   dir = ::getenv("TEMP_DIR");
-   if (!dir)   dir = ::getenv("TMP");
-   if (!dir)   dir = ::getenv("TMPDIR");
-   if (!dir)   dir = ::getenv("TMP_DIR");
-   if (!dir) return homeDirectory();
-   return dir;
+  // Return a user configured or systemwide directory to create
+  // temporary files in.
+  std::string dir;
+  if ( System::getEnv("TEMP", dir) ||
+       System::getEnv("TEMPDIR", dir) ||
+       System::getEnv("TEMP_DIR", dir) ||
+       System::getEnv("TMP", dir) ||
+       System::getEnv("TMPDIR", dir) ||
+       System::getEnv("TMP_DIR", dir)
+     )
+    return dir;
+  else
+    return homeDirectory();
 }
diff --git a/GaudiKernel/src/Lib/HistoProperty.cpp b/GaudiKernel/src/Lib/HistoProperty.cpp
deleted file mode 100644
index 8c6db3a1a1e414d2aaa298b42e1c804a5f158bf9..0000000000000000000000000000000000000000
--- a/GaudiKernel/src/Lib/HistoProperty.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// $Id: HistoProperty.cpp,v 1.1 2007/09/26 16:13:42 marcocle Exp $
-// ============================================================================
-// Include files
-// ============================================================================
-// GaudiKernel
-// ============================================================================
-#include "GaudiKernel/HistoProperty.h"
-// ============================================================================
-/** @file 
- *  The Implementation file for "HistoProperty"
- *  @author Alexander MAZUROV Alexander.Mazurov@gmail.com 
- *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
- *  @date   2007-09-17 : Ivan BELYAEV
- */
-// ============================================================================
-
-// ============================================================================
-// The END 
-// ============================================================================
diff --git a/GaudiKernel/src/Lib/Message.cpp b/GaudiKernel/src/Lib/Message.cpp
index 1883584950f24d11c9aa523031959c0f56a0b23e..6137a36628e04b54b9ae1e6886092ef6e06c4f39 100644
--- a/GaudiKernel/src/Lib/Message.cpp
+++ b/GaudiKernel/src/Lib/Message.cpp
@@ -8,8 +8,7 @@
 #include "GaudiKernel/IMessageSvc.h"
 #include "GaudiKernel/Message.h"
 #include "GaudiKernel/Timing.h"
-
-#include "GaudiKernel/time_r.h"
+#include "GaudiKernel/Time.h"
 
 using namespace MSG;
 
@@ -30,9 +29,11 @@ const char* Message::DEFAULT_FORMAT = "% F%18W%S%7W%R%T %0W%M";
 const char* Message::DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S,%f";
 
 namespace {
-
-  std::string formattedTime ( std::string fmt, bool universal = false );
-
+  // get the current time from the system and format it according to the format
+  inline std::string formattedTime (const std::string &fmt, bool universal = false )
+  {
+    return Gaudi::Time::current().format(!universal, fmt);
+  }
 }
 
 //#############################################################################
@@ -449,40 +450,3 @@ void Message::sizeField( const std::string& text ) const
 
   m_formatted_msg += newText;
 }
-
-namespace {
-
-  // get the current time from the system and format it according to the format
-  std::string formattedTime ( std::string fmt, bool universal )
-  {
-    // get current time in milliseconds
-    longlong t = System::currentTime( System::milliSec );
-    int msec = static_cast<int>(t % 1000);
-    time_t sec = static_cast<time_t>(t / 1000);
-
-    // convert to break-down time
-    struct tm tms ;
-    if (universal) {
-      gmtime_r( &sec, &tms );
-    } else {
-      localtime_r( &sec, &tms );
-    }
-
-    // replace %f in the format string with miliseconds
-    std::string::size_type n = fmt.find("%f") ;
-    if ( n != std::string::npos ) {
-      char subs[4] ;
-      std::sprintf ( subs, "%03d", msec ) ;
-      while ( n != std::string::npos ) {
-        fmt.replace ( n, 2, subs ) ;
-        n = fmt.find("%f") ;
-      }
-    }
-
-    char buf[128] ;
-    strftime(buf, 128, fmt.c_str(), &tms );
-    return std::string( buf );
-  }
-
-}
-
diff --git a/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp b/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp
index 1294e2fe94b1f070009226567aaf5aad5cb82fb6..4a48fbd65321ea4832997108448226ac641eafc4 100644
--- a/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp
+++ b/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp
@@ -341,7 +341,7 @@ StatusCode MinimalEventLoopMgr::executeRun( int maxevt ) {
   // Call the beginRun() method of all top algorithms
   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
     sc = (*ita)->sysBeginRun();
-    if( !sc.isSuccess() ) {
+    if (!sc.isSuccess()) {
       log << MSG::WARNING << "beginRun() of algorithm " << (*ita)->name() << " failed" << endmsg;
       eventfailed = true;
     }
@@ -349,20 +349,20 @@ StatusCode MinimalEventLoopMgr::executeRun( int maxevt ) {
 
   // Call now the nextEvent(...)
   sc = nextEvent(maxevt);
-  if( !sc.isSuccess() ) {
+  if (!sc.isSuccess()) {
     eventfailed = true;
   }
 
   // Call the endRun() method of all top algorithms
   for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
     sc = (*ita)->sysEndRun();
-    if( !sc.isSuccess() ) {
+    if (!sc.isSuccess()) {
       log << MSG::WARNING << "endRun() of algorithm " << (*ita)->name() << " failed" << endmsg;
       eventfailed = true;
     }
   }
 
-  if( eventfailed ){
+  if (eventfailed) {
     return StatusCode::FAILURE;
   }
   else {
@@ -381,7 +381,7 @@ namespace {
       m_retcode = Gaudi::ReturnCode::Success;
     }
     inline ~RetCodeGuard() {
-      if (Gaudi::ReturnCode::Success != m_retcode) {
+      if (UNLIKELY(Gaudi::ReturnCode::Success != m_retcode)) {
         Gaudi::setAppReturnCode(m_appmgr, m_retcode);
       }
     }
@@ -399,10 +399,10 @@ StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */)    {
   // Call the resetExecuted() method of ALL "known" algorithms
   // (before we were reseting only the topalgs)
   SmartIF<IAlgManager> algMan(serviceLocator());
-  if ( algMan.isValid() ) {
+  if (LIKELY(algMan.isValid())) {
     const ListAlgPtrs& allAlgs = algMan->getAlgorithms() ;
     for( ListAlgPtrs::const_iterator ialg = allAlgs.begin() ; allAlgs.end() != ialg ; ++ialg ) {
-      if ( 0 != *ialg ) (*ialg)->resetExecuted();
+      if (LIKELY(0 != *ialg)) (*ialg)->resetExecuted();
     }
   }
 
@@ -412,7 +412,7 @@ StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */)    {
   for (ListAlg::iterator ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
     StatusCode sc(StatusCode::FAILURE);
     try {
-      if (m_abortEvent){
+      if (UNLIKELY(m_abortEvent)) {
         MsgStream log ( msgSvc() , name() );
         log << MSG::DEBUG << "AbortEvent incident fired by "
                           << m_abortEventSource << endmsg;
@@ -439,7 +439,7 @@ StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */)    {
           << (*ita)->name() << endmsg;
     }
 
-    if( !sc.isSuccess() )  {
+    if (UNLIKELY(!sc.isSuccess()))  {
       MsgStream log( msgSvc(), name() );
       log << MSG::WARNING << "Execution of algorithm " << (*ita)->name() << " failed" << endmsg;
       eventfailed = true;
@@ -447,8 +447,8 @@ StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */)    {
   }
 
   // ensure that the abortEvent flag is cleared before the next event
-  if (m_abortEvent){
-    if (outputLevel() <= MSG::DEBUG) {
+  if (UNLIKELY(m_abortEvent)) {
+    if (UNLIKELY(outputLevel() <= MSG::DEBUG)) {
       MsgStream log ( msgSvc() , name() );
       log << MSG::DEBUG << "AbortEvent incident fired by "
                         << m_abortEventSource << endmsg;
@@ -461,7 +461,7 @@ StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */)    {
     (*ito)->resetExecuted();
       StatusCode sc;
       sc = (*ito)->sysExecute();
-    if( !sc.isSuccess() )  {
+    if (UNLIKELY(!sc.isSuccess()))  {
       MsgStream log( msgSvc(), name() );
       log << MSG::WARNING << "Execution of output stream " << (*ito)->name() << " failed" << endmsg;
       eventfailed = true;
@@ -469,7 +469,7 @@ StatusCode MinimalEventLoopMgr::executeEvent(void* /* par */)    {
   }
 
   // Check if there was an error processing current event
-  if( eventfailed ){
+  if (UNLIKELY(eventfailed)){
     MsgStream log( msgSvc(), name() );
     log << MSG::ERROR << "Error processing event loop." << endmsg;
     return StatusCode(StatusCode::FAILURE,true);
diff --git a/GaudiKernel/src/Lib/ModuleInfo.cpp b/GaudiKernel/src/Lib/ModuleInfo.cpp
index 1c3ab5b083be86997d9030448a9ec1a1e0480cd6..dc003ad5b796d5ffacde7f215f129b370db6a4c3 100644
--- a/GaudiKernel/src/Lib/ModuleInfo.cpp
+++ b/GaudiKernel/src/Lib/ModuleInfo.cpp
@@ -84,13 +84,18 @@ const std::string& System::moduleNameFull()   {
 #ifdef _WIN32
       if ( _psApi.isValid() )   {
         _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)moduleHandle(), name,sizeof(name) );
+        module = name;
       }
-#elif defined(linux) || defined(__APPLE__)
-      ::realpath(((Dl_info*)moduleHandle())->dli_fname, name);
-#elif __hpux
-      ::realpath(((HMODULE*)moduleHandle())->dsc.filename, name);
+#else
+      const char *path =
+#  if defined(linux) || defined(__APPLE__)
+          ((Dl_info*)moduleHandle())->dli_fname;
+#  elif __hpux
+          ((HMODULE*)moduleHandle())->dsc.filename;
+#  endif
+      if (::realpath(path, name))
+        module = name;
 #endif
-      module = name;
     }
   }
   return module;
@@ -208,16 +213,18 @@ const std::string& System::exeName()    {
 #ifdef _WIN32
     if ( _psApi.isValid() && processHandle() )   {
       _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)exeHandle(), name,sizeof(name) );
+      module = name;
     }
 #elif defined(linux) || defined(__APPLE__)
     char cmd[512];
     ::sprintf(cmd, "/proc/%d/exe", ::getpid());
     module = "Unknown";
-    ::readlink(cmd, name, sizeof(name));
+    if (::readlink(cmd, name, sizeof(name)) >= 0)
+      module = name;
 #elif __hpux
-    ::realpath(((HMODULE*)exeHandle())->dsc.filename, name);
+    if (::realpath(((HMODULE*)exeHandle())->dsc.filename, name))
+      module = name;
 #endif
-    module = name;
   }
   return module;
 }
diff --git a/GaudiKernel/src/Lib/MsgStream.cpp b/GaudiKernel/src/Lib/MsgStream.cpp
index 78d9a67d4921f4698cd7a47e7a7be4f0d2e10de7..1f33dc2c544a9164214b34f4d74927c769f0d581 100644
--- a/GaudiKernel/src/Lib/MsgStream.cpp
+++ b/GaudiKernel/src/Lib/MsgStream.cpp
@@ -1,4 +1,3 @@
-// $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/src/Lib/MsgStream.cpp,v 1.13 2008/10/01 14:39:28 marcocle Exp $
 //====================================================================
 //	MsgStream.cpp
 //--------------------------------------------------------------------
@@ -28,22 +27,43 @@
 #include <stdarg.h>
 #include <stdio.h>
 
+bool MsgStream::m_countInactive = false;
+
+bool MsgStream::enableCountInactive(bool value) {
+  bool old = m_countInactive;
+  m_countInactive = value;
+  return old;
+}
+
+bool MsgStream::countInactive() {
+  return m_countInactive;
+}
+
+
 MsgStream::MsgStream(IMessageSvc* svc, int)
 : m_service(svc),
   m_source(""),
-  m_active(false)
+  m_active(false),
+  m_inactCounter(0)
 {
   setLevel((0==svc) ? MSG::INFO : svc->outputLevel());
   m_useColors = (0==svc) ? false : svc->useColor();
+#ifndef NDEBUG
+  m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>(svc) : 0;
+#endif
 }
 
 MsgStream::MsgStream(IMessageSvc* svc, const std::string& source, int)
 : m_service(svc),
   m_source(source),
-  m_active(false)
+  m_active(false),
+  m_inactCounter(0)
 {
   setLevel((0==svc) ? MSG::INFO : svc->outputLevel(source));
   m_useColors = (0==svc) ? false : svc->useColor();
+#ifndef NDEBUG
+  m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>(svc) : 0;
+#endif
 }
 
 MsgStream::~MsgStream()    {
@@ -105,6 +125,11 @@ void MsgStream::resetColor() {
 #endif
 }
 
+#ifdef WIN32
+// Disable warning
+//   C4996: 'vsprintf': This function or variable may be unsafe.
+#pragma warning(disable:4996)
+#endif
 std::string format( const char* fmt, ... )
 {
   const int buffsize = 2048;
diff --git a/GaudiKernel/src/Lib/ParseAtomic.cpp b/GaudiKernel/src/Lib/ParseAtomic.cpp
index 21807543e1ded9cc52322fc08fc98411a76753c4..1b740bc764bdd0ab8cbcc2006901c0a510800303 100644
--- a/GaudiKernel/src/Lib/ParseAtomic.cpp
+++ b/GaudiKernel/src/Lib/ParseAtomic.cpp
@@ -1,21 +1,26 @@
 // $Id: ParseAtomic.cpp,v 1.4 2008/10/28 14:02:18 marcocle Exp $
 // ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.4 $ 
+// CVS tag $Name:  $, version $Revision: 1.4 $
 // ============================================================================
 // Include files
 // ============================================================================
 // Local
 // ============================================================================
+#ifdef WIN32
+// Disable warning
+//   C4146: unary minus operator applied to unsigned type, result still unsigned
+// Coming from the parsers of unsigned integers.
+#pragma warning(disable:4146)
+#endif
 #include "GaudiKernel/Parsers.icpp"
 // ============================================================================
-
 // ============================================================================
-/** @file 
+/** @file
+ *
+ *  Implementation of the parsing function for atomic primitive types
  *
- *  Implementation of the parsing function for atomic primitive types 
- *  
- *  For adding new type you should have only grammar class which recognize 
- *  this type. Then by combining this grammar with such already implemented 
+ *  For adding new type you should have only grammar class which recognize
+ *  this type. Then by combining this grammar with such already implemented
  *  grammars  like VectorGrammar, MapGrammar, PairGrammar you can very simply
  *  implement container types which will work with your type.
  *
@@ -24,31 +29,31 @@
  *
  *  @author Alexander MAZUROV  Alexander.Mazurov@gmail.com
  *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
- *  @date   2006-05-12 
+ *  @date   2006-05-12
  */
 // ============================================================================
 namespace Gaudi
-{ 
+{
   namespace Parsers
   {
     // ========================================================================
-    StatusCode parse ( char&               result  , 
+    StatusCode parse ( char&               result  ,
                        const string&       input   )
     { return parse_char    ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( unsigned char&      result  , 
+    StatusCode parse ( unsigned char&      result  ,
                        const string&       input   )
     { return parse_char    ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( signed char&        result  , 
+    StatusCode parse ( signed char&        result  ,
                        const string&       input   )
     { return parse_char    ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( short&              result , 
+    StatusCode parse ( short&              result ,
                        const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( unsigned short&     result , 
+    StatusCode parse ( unsigned short&     result ,
                        const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
@@ -56,54 +61,54 @@ namespace Gaudi
                        const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( unsigned int&       result , 
+    StatusCode parse ( unsigned int&       result ,
                        const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( long&               result , 
+    StatusCode parse ( long&               result ,
                        const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( unsigned long&      result , 
+    StatusCode parse ( unsigned long&      result ,
                        const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
     StatusCode parse ( long long&          result ,
-                       const string&       input  ) 
+                       const string&       input  )
     { return parse_integer ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( unsigned long long& result , 
+    StatusCode parse ( unsigned long long& result ,
                        const string&       input  )
-    { return parse_integer ( result , input ) ; }    
+    { return parse_integer ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( bool&               result , 
+    StatusCode parse ( bool&               result ,
                        const string&       input  )
     {
       BoolGrammar g;
-      return parse( 
-          createIterator(input), 
+      return parse(
+          createIterator(input),
           IteratorT(),
           g[var(result)=arg1]).full;
     }
     // ========================================================================
-    StatusCode parse ( float&              result , 
-                       const string&       input  ) 
+    StatusCode parse ( float&              result ,
+                       const string&       input  )
     { return parse_real ( result , input ) ; }
     // ========================================================================
     StatusCode parse ( double&             result ,
                        const string&       input  )
     { return parse_real ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( long double&        result , 
+    StatusCode parse ( long double&        result ,
                        const string&       input  )
     { return parse_real ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( string&             result , 
+    StatusCode parse ( string&             result ,
                        const string&       input  )
     {
       StringGrammar g;
       if ( !parse(
-              createIterator(input), 
+              createIterator(input),
               IteratorT(),
               g[var(result)=arg1]).full ){ result = input ; }
       /// @attention always!!!
@@ -113,7 +118,7 @@ namespace Gaudi
 } // end of namespace Gaudi
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
 
 
diff --git a/GaudiKernel/src/Lib/ParseMaps.cpp b/GaudiKernel/src/Lib/ParseMaps.cpp
index efe0635756e964f5fb974df3caa7bee950383e0a..1a8c36287432c37973f942ac31fe57bf36930f10 100644
--- a/GaudiKernel/src/Lib/ParseMaps.cpp
+++ b/GaudiKernel/src/Lib/ParseMaps.cpp
@@ -4,6 +4,12 @@
 // ============================================================================
 // Local
 // ============================================================================
+#ifdef WIN32
+// Disable warning
+//   C4146: unary minus operator applied to unsigned type, result still unsigned
+// Coming from the parsers of unsigned integers.
+#pragma warning(disable:4146)
+#endif
 #include "GaudiKernel/Parsers.icpp"
 // ============================================================================
 /** @file
diff --git a/GaudiKernel/src/Lib/ParseVectorsInteger.cpp b/GaudiKernel/src/Lib/ParseVectorsInteger.cpp
index 92439be57e8fe231e259220bc7f8bbacd7a1220b..d79947741b9c07a3700fab1480876941f1a2e488 100644
--- a/GaudiKernel/src/Lib/ParseVectorsInteger.cpp
+++ b/GaudiKernel/src/Lib/ParseVectorsInteger.cpp
@@ -1,21 +1,26 @@
 // $Id: ParseVectorsInteger.cpp,v 1.2 2007/05/24 14:39:11 hmd Exp $
 // ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.2 $ 
+// CVS tag $Name:  $, version $Revision: 1.2 $
 // ============================================================================
 // Include files
 // ============================================================================
 // Local
 // ============================================================================
+#ifdef WIN32
+// Disable warning
+//   C4146: unary minus operator applied to unsigned type, result still unsigned
+// Coming from the parsers of unsigned integers.
+#pragma warning(disable:4146)
+#endif
 #include "GaudiKernel/Parsers.icpp"
 // ============================================================================
-
 // ============================================================================
-/** @file 
+/** @file
+ *
+ *  Implementation of the parsing functions for std::vector<TYPE>
  *
- *  Implementation of the parsing functions for std::vetctor<TYPE>
- *  
- *  For adding new type you should have only grammar class which recognize 
- *  this type. Then by combining this grammar with such already implemented 
+ *  For adding new type you should have only grammar class which recognize
+ *  this type. Then by combining this grammar with such already implemented
  *  grammars  like VectorGrammar, MapGrammar, PairGrammar you can very simply
  *  implement container types which will work with your type.
  *
@@ -24,43 +29,43 @@
  *
  *  @author Alexander MAZUROV  Alexander.Mazurov@gmail.com
  *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
- *  @date   2006-05-12 
+ *  @date   2006-05-12
  */
 // ============================================================================
 namespace Gaudi
-{ 
+{
   namespace Parsers
   {
     // ========================================================================
-    StatusCode parse ( vector<short>&              result , 
+    StatusCode parse ( vector<short>&              result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<unsigned short>&     result , 
+    StatusCode parse ( vector<unsigned short>&     result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<int>&                result , 
+    StatusCode parse ( vector<int>&                result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<unsigned int>&       result , 
+    StatusCode parse ( vector<unsigned int>&       result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<long>&               result , 
+    StatusCode parse ( vector<long>&               result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<unsigned long>&      result , 
+    StatusCode parse ( vector<unsigned long>&      result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<long long>&          result , 
-                       const string&               input  ) 
+    StatusCode parse ( vector<long long>&          result ,
+                       const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<unsigned long long>& result , 
+    StatusCode parse ( vector<unsigned long long>& result ,
                        const string&               input  )
     { return parse_integer_vector ( result , input ) ; }
 
@@ -68,7 +73,7 @@ namespace Gaudi
 } // end of namespace Gaudi
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
 
 
diff --git a/GaudiKernel/src/Lib/ParseVectorsReal.cpp b/GaudiKernel/src/Lib/ParseVectorsReal.cpp
index 63376d39d27838794561f56c06c51b373b7e03f1..fa6e1b4e47d6f9ae662e84ab7d3810cba68641e4 100644
--- a/GaudiKernel/src/Lib/ParseVectorsReal.cpp
+++ b/GaudiKernel/src/Lib/ParseVectorsReal.cpp
@@ -1,21 +1,26 @@
 // $Id: ParseVectorsReal.cpp,v 1.2 2007/05/24 14:39:11 hmd Exp $
 // ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.2 $ 
+// CVS tag $Name:  $, version $Revision: 1.2 $
 // ============================================================================
 // Include files
 // ============================================================================
 // Local
 // ============================================================================
+#ifdef WIN32
+// Disable warning
+//   C4244: '=' : conversion from 'int' to 'float', possible loss of data
+// Coming from the parsers(?).
+#pragma warning(disable:4244)
+#endif
 #include "GaudiKernel/Parsers.icpp"
 // ============================================================================
-
 // ============================================================================
-/** @file 
+/** @file
+ *
+ *  Implementation of the parsing functions for std::vector<TYPE>
  *
- *  Implementation of the parsing functions for std::vetctor<TYPE>
- *  
- *  For adding new type you should have only grammar class which recognize 
- *  this type. Then by combining this grammar with such already implemented 
+ *  For adding new type you should have only grammar class which recognize
+ *  this type. Then by combining this grammar with such already implemented
  *  grammars  like VectorGrammar, MapGrammar, PairGrammar you can very simply
  *  implement container types which will work with your type.
  *
@@ -24,23 +29,23 @@
  *
  *  @author Alexander MAZUROV  Alexander.Mazurov@gmail.com
  *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
- *  @date   2006-05-12 
+ *  @date   2006-05-12
  */
 // ============================================================================
 namespace Gaudi
-{ 
+{
   namespace Parsers
   {
     // ========================================================================
-    StatusCode parse ( vector<float>&              result , 
+    StatusCode parse ( vector<float>&              result ,
                        const string&               input  )
     { return parse_real_vector    ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<double>&             result , 
+    StatusCode parse ( vector<double>&             result ,
                        const string&               input  )
-    { return parse_real_vector    ( result , input ) ; } 
+    { return parse_real_vector    ( result , input ) ; }
     // ========================================================================
-    StatusCode parse ( vector<long double>&        result , 
+    StatusCode parse ( vector<long double>&        result ,
                        const string&               input  )
     { return parse_real_vector    ( result , input ) ; }
     // ========================================================================
@@ -49,7 +54,7 @@ namespace Gaudi
 } // end of namespace Gaudi
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
 
 
diff --git a/GaudiKernel/src/Lib/PathResolver.cpp b/GaudiKernel/src/Lib/PathResolver.cpp
index a44aa8351860fa2f20165ae4ade6254b9cafea0b..589b02575f6d4f80751e7388a1838959710e9693 100644
--- a/GaudiKernel/src/Lib/PathResolver.cpp
+++ b/GaudiKernel/src/Lib/PathResolver.cpp
@@ -1,4 +1,12 @@
 #include "GaudiKernel/PathResolver.h"
+#include "GaudiKernel/System.h"
+
+#ifdef WIN32
+// Disable warning
+//   C4996: 'std::copy': Function call with parameters that may be unsafe
+// Probably coming from Boost classification.
+#pragma warning(disable:4996)
+#endif
 
 #include <iostream>
 #include <string>
@@ -120,14 +128,8 @@ PathResolver::find_file(const std::string& logical_file_name,
               const std::string& search_path,
               SearchType search_type) {
 
-  const char* path_env = ::getenv (search_path.c_str ());
-
   std::string path_list;
-
-  if (path_env != 0)
-  {
-    path_list = path_env;
-  }
+  System::getEnv(search_path, path_list);
 
   return (find_file_from_list (logical_file_name, path_list, search_type));
 }
@@ -165,14 +167,8 @@ string PathResolver::find_directory (const std::string& logical_file_name,
                                      const std::string& search_path,
                                      SearchType search_type)
 {
-  const char* path_env = ::getenv (search_path.c_str ());
-
   std::string path_list;
-
-  if (path_env != 0)
-    {
-      path_list = path_env;
-    }
+  System::getEnv(search_path, path_list);
 
   return (find_directory_from_list (logical_file_name, path_list, search_type));
 }
@@ -200,11 +196,9 @@ PathResolver::find_directory_from_list (const std::string& logical_file_name,
 PathResolver::SearchPathStatus
 PathResolver::check_search_path (const std::string& search_path)
 {
-  const char* path_env = ::getenv (search_path.c_str ());
-
-  if (path_env == 0) return (EnvironmentVariableUndefined);
-
-  std::string path_list (path_env);
+  std::string path_list;
+  if ( ! System::getEnv(search_path, path_list) )
+    return (EnvironmentVariableUndefined);
 
   vector<string> spv;
   boost::split( spv, path_list, boost::is_any_of( path_separator ), boost::token_compress_on);
diff --git a/GaudiKernel/src/Lib/ProcessDescriptor.cpp b/GaudiKernel/src/Lib/ProcessDescriptor.cpp
index d002b0fcca29b82517f138ed0bcd52f5803296fc..e7f312d754943b2bec6527d68efc462f1c3b15f0 100644
--- a/GaudiKernel/src/Lib/ProcessDescriptor.cpp
+++ b/GaudiKernel/src/Lib/ProcessDescriptor.cpp
@@ -1,16 +1,15 @@
-// $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/src/Lib/ProcessDescriptor.cpp,v 1.16 2007/11/21 13:04:53 marcocle Exp $
 //====================================================================
-//	ProcStat.cpp
+//  ProcStat.cpp
 //--------------------------------------------------------------------
 //
-//	Package    : System (The LHCb System service)
+//  Package    : System (The LHCb System service)
 //
-//  Description: Invoke interactively the ProcStat from a 
+//  Description: Invoke interactively the ProcStat from a
 //               running application
 //
-//	Author     : M.Frank
-//      Created    : 13/11/00
-//	Changes    : 
+//  Author     : M.Frank
+//  Created    : 13/11/00
+//  Changes    :
 //
 //====================================================================
 #define GAUDIKERNEL_PROCSTAT_CPP
@@ -60,7 +59,7 @@ namespace NtApi {
 //  extern "C" long __cdecl NtQueryInformationProcess(
 
     typedef long (WINAPI *__NtQueryInformationProcess)(
-  
+
     void* ProcessHandle,
     long ProcessInformationClass,
     void* ProcessInformation,
@@ -91,42 +90,209 @@ namespace NtApi {
 #include <sys/resource.h>
 #include <cstdio>
 
+/* Format of the Linux proc/stat (man 5 proc, kernel 2.6.35):
+ pid %d      The process ID.
+
+ comm %s     The  filename  of the executable, in parentheses.  This is visible
+             whether or not the executable is swapped out.
+
+ state %c    One character from the string "RSDZTW" where R is  running,  S  is
+             sleeping in an interruptible wait, D is waiting in uninterruptible
+             disk sleep, Z is zombie, T is traced or stopped (on a signal), and
+             W is paging.
+
+ ppid %d     The PID of the parent.
+
+ pgrp %d     The process group ID of the process.
+
+ session %d  The session ID of the process.
+
+ tty_nr %d   The controlling terminal of the process.  (The minor device number
+             is contained in the combination of bits 31 to 20 and 7 to  0;  the
+             major device number is in bits 15 t0 8.)
+
+ tpgid %d    The ID of the foreground process group of the controlling terminal
+             of the process.
+
+ flags %u (%lu before Linux 2.6.22)
+             The kernel flags word of the process.  For bit meanings,  see  the
+             PF_*  defines  in  <linux/sched.h>.   Details depend on the kernel
+             version.
+
+ minflt %lu  The number of minor faults the process has  made  which  have  not
+             required loading a memory page from disk.
+
+ cminflt %lu The  number of minor faults that the process's waited-for children
+             have made.
+
+ majflt %lu  The number of  major  faults  the  process  has  made  which  have
+             required loading a memory page from disk.
+
+ cmajflt %lu The  number of major faults that the process's waited-for children
+             have made.
+
+ utime %lu   Amount of time that this process has been scheduled in user  mode,
+             measured  in  clock  ticks  (divide by sysconf(_SC_CLK_TCK).  This
+             includes guest time, guest_time (time spent running a virtual CPU,
+             see  below),  so that applications that are not aware of the guest
+             time field do not lose that time from their calculations.
+
+ stime %lu   Amount of time that this process  has  been  scheduled  in  kernel
+             mode, measured in clock ticks (divide by sysconf(_SC_CLK_TCK).
+
+ cutime %ld  Amount  of  time that this process's waited-for children have been
+             scheduled in  user  mode,  measured  in  clock  ticks  (divide  by
+             sysconf(_SC_CLK_TCK).   (See  also times(2).)  This includes guest
+             time, cguest_time (time spent running a virtual CPU, see below).
+
+ cstime %ld  Amount of time that this process's waited-for children  have  been
+             scheduled  in  kernel  mode,  measured  in  clock ticks (divide by
+             sysconf(_SC_CLK_TCK).
+
+ priority %ld
+             (Explanation for Linux 2.6)  For  processes  running  a  real-time
+             scheduling  policy (policy below; see sched_setscheduler(2)), this
+             is the negated scheduling priority, minus one; that is,  a  number
+             in  the  range -2 to -100, corresponding to real-time priorities 1
+             to 99.  For processes running  under  a  non-real-time  scheduling
+             policy, this is the raw nice value (setpriority(2)) as represented
+             in the kernel.  The kernel stores nice values as  numbers  in  the
+             range 0 (high) to 39 (low), corresponding to the user-visible nice
+             range of -20 to 19.
+
+             Before Linux 2.6, this was a scaled value based on  the  scheduler
+             weighting given to this process.
+
+ nice %ld    The  nice value (see setpriority(2)), a value in the range 19 (low
+             priority) to -20 (high priority).
+
+ num_threads %ld
+             Number of threads in this process (since Linux 2.6).  Before  ker‐
+             nel  2.6,  this  field was hard coded to 0 as a placeholder for an
+             earlier removed field.
+
+ itrealvalue %ld
+             The time in jiffies before the next SIGALRM is sent to the process
+             due  to  an interval timer.  Since kernel 2.6.17, this field is no
+             longer maintained, and is hard coded as 0.
+
+ starttime %llu (was %lu before Linux 2.6)
+             The time in jiffies the process started after system boot.
+
+ vsize %lu   Virtual memory size in bytes.
+
+ rss %ld     Resident Set Size: number of pages the process has in real memory.
+             This  is  just  the pages which count towards text, data, or stack
+             space.  This does not include pages which have  not  been  demand-
+             loaded in, or which are swapped out.
+
+ rsslim %lu  Current  soft  limit  in  bytes on the rss of the process; see the
+             description of RLIMIT_RSS in getpriority(2).
+
+ startcode %lu
+             The address above which program text can run.
+
+ endcode %lu The address below which program text can run.
+
+ startstack %lu
+             The address of the start (i.e., bottom) of the stack.
+
+ kstkesp %lu The current value of ESP (stack pointer), as found in  the  kernel
+             stack page for the process.
+
+ kstkeip %lu The current EIP (instruction pointer).
+
+ signal %lu  The  bitmap  of  pending  signals,  displayed as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ blocked %lu The  bitmap  of  blocked  signals,  displayed as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ sigignore %lu
+             The  bitmap  of  ignored  signals,  displayed as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ sigcatch %lu
+             The  bitmap  of  caught  signals,  displayed  as a decimal number.
+             Obsolete, because it does not  provide  information  on  real-time
+             signals; use /proc/[pid]/status instead.
+
+ wchan %lu   This  is the "channel" in which the process is waiting.  It is the
+             address of a system call, and can be looked up in  a  namelist  if
+             you   need   a   textual   name.    (If  you  have  an  up-to-date
+             /etc/psdatabase, then try ps -l to see the WCHAN field in action.)
+
+ nswap %lu   Number of pages swapped (not maintained).
+
+ cnswap %lu  Cumulative nswap for child processes (not maintained).
+
+ exit_signal %d (since Linux 2.1.22)
+             Signal to be sent to parent when we die.
+
+ processor %d (since Linux 2.2.8)
+             CPU number last executed on.
+
+ rt_priority %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
+             Real-time scheduling priority, a number in the range 1 to  99  for
+             processes  scheduled under a real-time policy, or 0, for non-real-
+             time processes (see sched_setscheduler(2)).
+
+ policy %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
+             Scheduling policy (see sched_setscheduler(2)).  Decode  using  the
+             SCHED_* constants in linux/sched.h.
+
+ delayacct_blkio_ticks %llu (since Linux 2.6.18)
+             Aggregated  block  I/O  delays, measured in clock ticks (centisec‐
+             onds).
+
+ guest_time %lu (since Linux 2.6.24)
+             Guest time of the process (time spent running a virtual CPU for  a
+             guest  operating  system),  measured  in  clock  ticks  (divide by
+             sysconf(_SC_CLK_TCK).
+
+ cguest_time %ld (since Linux 2.6.24)
+             Guest time of the process's  children,  measured  in  clock  ticks
+             (divide by sysconf(_SC_CLK_TCK).
+*/
 struct linux_proc {
-	int pid; // %d
-	char comm[400]; // %s
-	char state; // %c
-	int ppid; // %d
-	int pgrp; // %d
-	int session; // %d
-	int tty; // %d
-	int tpgid; // %d
-	unsigned int flags; // %u
-	unsigned int minflt; // %u
-	unsigned int cminflt; // %u
-	unsigned int majflt; // %u
-	unsigned int cmajflt; // %u
-	int utime; // %d
-	int stime; // %d
-	int cutime; // %d
-	int cstime; // %d
-	int counter; // %d
-	int priority; // %d
-	unsigned int timeout; // %u
-	unsigned int itrealvalue; // %u
-	int starttime; // %d
-	unsigned int vsize; // %u
-	unsigned int rss; // %u
-	unsigned int rlim; // %u
-	unsigned long startcode; // %u
-	unsigned long endcode; // %u
-	unsigned int startstack; // %u
-	unsigned int kstkesp; // %u
-	unsigned int kstkeip; // %u
-	int signal; // %d
-	int blocked; // %d
-	int sigignore; // %d
-	int sigcatch; // %d
-	unsigned int wchan; // %u
+  int pid;
+  char comm[400];
+  char state;
+  int ppid;
+  int pgrp;
+  int session;
+  int tty;
+  int tpgid;
+  unsigned long flags;
+  unsigned long minflt;
+  unsigned long cminflt;
+  unsigned long majflt;
+  unsigned long cmajflt;
+  unsigned long utime;
+  unsigned long stime;
+  long cutime;
+  long cstime;
+  long priority;
+  long nice;
+  long num_threads;
+  long itrealvalue;
+  unsigned long long starttime;
+  unsigned long vsize;
+  long rss;
+  unsigned long rlim;
+  unsigned long startcode;
+  unsigned long endcode;
+  unsigned long startstack;
+  unsigned long kstkesp;
+  unsigned long kstkeip;
+  unsigned long signal;
+  unsigned long blocked;
+  unsigned long sigignore;
+  unsigned long sigcatch;
+  unsigned long wchan;
 };
 
 #ifdef __APPLE__
@@ -139,7 +305,7 @@ void readProcStat(long pid, linux_proc& pinfo) {
   int cnt, fd;
   char buf[512];
 
-  std::ostringstream ost; 
+  std::ostringstream ost;
 
   ost << "/proc/" << pid << "/stat";
   std::string fname = ost.str();
@@ -149,51 +315,53 @@ void readProcStat(long pid, linux_proc& pinfo) {
   }
 
   lseek(fd,0,SEEK_SET);
-  if((cnt=read(fd,buf,sizeof(buf)))<0)	{
+  if((cnt=read(fd,buf,sizeof(buf)))<0) {
     std::cout << "LINUX Read of Proc file failed:" << std::endl;
     return;
   }
-  
-  if(cnt>0)	{
+
+  // Format
+  if(cnt>0) {
     buf[cnt]='\0';
     sscanf(buf,
-           "%d %s %c %d %d %d %d %d %u %u %u %u %u %d %d %d %d %d %d %u %u %d %u %u %u %lu %lu %u %u %u %d %d %d %d %u",
-	   &pinfo.pid, // %d
-	   pinfo.comm, // %s
-	   &pinfo.state, // %c
-	   &pinfo.ppid, // %d
-	   &pinfo.pgrp, // %d
-	   &pinfo.session, // %d
-	   &pinfo.tty, // %d
-	   &pinfo.tpgid, // %d
-	   &pinfo.flags, // %u
-	   &pinfo.minflt, // %u
-	   &pinfo.cminflt, // %u
-	   &pinfo.majflt, // %u
-	   &pinfo.cmajflt, // %u
-	   &pinfo.utime, // %d
-	   &pinfo.stime, // %d
-	   &pinfo.cutime, // %d
-	   &pinfo.cstime, // %d
-	   &pinfo.counter, // %d
-	   &pinfo.priority, // %d
-	   &pinfo.timeout, // %u
-	   &pinfo.itrealvalue, // %u
-	   &pinfo.starttime, // %d
-	   &pinfo.vsize, // %u
-	   &pinfo.rss, // %u
-	   &pinfo.rlim, // %u
-	   &pinfo.startcode, // %l
-	   &pinfo.endcode, // %l
-	   &pinfo.startstack, // %u
-	   &pinfo.kstkesp, // %u
-	   &pinfo.kstkeip, // %u
-	   &pinfo.signal, // %d
-	   &pinfo.blocked, // %d
-	   &pinfo.sigignore, // %d
-	   &pinfo.sigcatch, // %d
-	   &pinfo.wchan // %u
-	   );
+           //1  2  3  4  5  6  7  8  9  10  1   2   3   4   5   6   7   8   9   20  1   2   3   4   5   6   7   8   9   30  1   2   3   4   5
+           "%d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %llu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu",
+           &pinfo.pid,
+           pinfo.comm,
+           &pinfo.state,
+           &pinfo.ppid,
+           &pinfo.pgrp,
+           &pinfo.session,
+           &pinfo.tty,
+           &pinfo.tpgid,
+           &pinfo.flags,
+           &pinfo.minflt,
+           &pinfo.cminflt,
+           &pinfo.majflt,
+           &pinfo.cmajflt,
+           &pinfo.utime,
+           &pinfo.stime,
+           &pinfo.cutime,
+           &pinfo.cstime,
+           &pinfo.priority,
+           &pinfo.nice,
+           &pinfo.num_threads,
+           &pinfo.itrealvalue,
+           &pinfo.starttime,
+           &pinfo.vsize,
+           &pinfo.rss,
+           &pinfo.rlim,
+           &pinfo.startcode,
+           &pinfo.endcode,
+           &pinfo.startstack,
+           &pinfo.kstkesp,
+           &pinfo.kstkeip,
+           &pinfo.signal,
+           &pinfo.blocked,
+           &pinfo.sigignore,
+           &pinfo.sigcatch,
+           &pinfo.wchan
+           );
   }
   close(fd);
 }
@@ -554,7 +722,7 @@ long System::ProcessDescriptor::query(long pid,
 
 #elif defined(__APPLE__)
     // FIXME (MCl): Make an alternative function get timing on OSX
-    // times() seems to cause a segmentation fault 
+    // times() seems to cause a segmentation fault
 #else  // no /proc file system: assume sys_start for the first call
     tms tmsb;
     static clock_t sys_start = times(0);
diff --git a/GaudiKernel/src/Lib/PropertyVerifier.cpp b/GaudiKernel/src/Lib/PropertyVerifier.cpp
deleted file mode 100644
index 8daeb84027df1b6939057306529acc35a45f26d7..0000000000000000000000000000000000000000
--- a/GaudiKernel/src/Lib/PropertyVerifier.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/src/Lib/PropertyVerifier.cpp,v 1.5 2006/06/06 16:16:25 hmd Exp $
-/**********************************************************
- *
- * Verifier Classes are used with Property Classes to 
- * provide validation criteria for Property values.
- *
- **********************************************************/
-
-#include "GaudiKernel/Kernel.h"
-#include "GaudiKernel/PropertyVerifier.h"
-
-#include <string>
-#include <vector>
-
diff --git a/GaudiKernel/src/Lib/RegistryEntry.cpp b/GaudiKernel/src/Lib/RegistryEntry.cpp
index aec7da19781ad50d9fe60542ddeecf898323fbe0..d0fa5d0987094e7941a80a288381dae3f0e394f9 100644
--- a/GaudiKernel/src/Lib/RegistryEntry.cpp
+++ b/GaudiKernel/src/Lib/RegistryEntry.cpp
@@ -10,7 +10,7 @@
 //	Author     : M.Frank
 //  History    :
 // +---------+----------------------------------------------+---------
-// |    Date |                 Comment                      | Who     
+// |    Date |                 Comment                      | Who
 // +---------+----------------------------------------------+---------
 // | 29/10/98| Initial version                              | MF
 // | 03/02/99| Protect dynamic_cast with try-catch clauses  | MF
@@ -43,12 +43,12 @@ enum Seperator { SEPARATOR='/' };
 
 /// Standard Constructor
 DataSvcHelpers::RegistryEntry::RegistryEntry(const std::string& path, RegistryEntry* parent)
-: m_refCount(0), 
-  m_isSoft(false), 
+: m_refCount(0),
+  m_isSoft(false),
   m_path(path),
   m_pParent(parent),
   m_pAddress(0),
-  m_pObject(0), 
+  m_pObject(0),
   m_pDataProviderSvc(0)
 {
   std::string::size_type sep = m_path.rfind(SEPARATOR);
@@ -259,37 +259,36 @@ DataSvcHelpers::RegistryEntry* DataSvcHelpers::RegistryEntry::i_find(const std::
     std::string::size_type len  = path.length();
     std::string::size_type loc1 = path.find(SEPARATOR,1);
     std::string::size_type len2 = loc1 != std::string::npos ? loc1 : len;
-    const char* data = path.data();
     for (Store::const_iterator i = m_store.begin(); i != m_store.end(); i++ )   {
       RegistryEntry* regEnt = CAST_REGENTRY(RegistryEntry*, *i);
       const std::string& nam = regEnt->name();
-      if ( nam.length() == len2 )   {
-        if ( std::equal(nam.begin(), nam.begin()+len2, data)  )    {
-          try   {
-            if ( loc1 != std::string::npos )   {
-              std::string search_path(path, loc1, len);
-              IRegistry* pDir = regEnt->find(search_path);
-              if ( 0 != pDir )    {
-                return CAST_REGENTRY(RegistryEntry*, pDir);
-              }
-              return 0;
-            }
-            else  {
-              return CAST_REGENTRY(RegistryEntry*, *i);
+      // check that the first len2 chars of path are the same as nam
+      // (i.e. match {len2:3 nam:"/Ab" path:"/Ab/C"}
+      // but not {len2:3 nam:"/Abc" path:"/Ab/C"})
+      if ( path.compare(0, len2, nam) == 0 ) {
+        try {
+          if ( loc1 != std::string::npos ) {
+            std::string search_path(path, loc1, len);
+            IRegistry* pDir = regEnt->find(search_path);
+            if ( 0 != pDir )    {
+              return CAST_REGENTRY(RegistryEntry*, pDir);
             }
+            return 0;
           }
-          catch (...)   {
+          else  {
+            return CAST_REGENTRY(RegistryEntry*, *i);
           }
         }
+        catch (...)   {
+        }
       }
     }
-    if ( m_path.length() == len2 )    {
-      if ( std::equal(m_path.begin(), m_path.begin()+len2, data)  )    {
-        if (len2 < len)   {
-          std::string search_path(path, loc1, len);
-          return i_find(search_path);
-        }
-        //return this;
+    // If this node is "/NodeA", this part allows to find "/NodeA/NodeB" as
+    // our "/NodeB" child.
+    if ( path.compare(0, len2, m_path) == 0 ) {
+      if (len2 < len)   {
+        std::string search_path(path, loc1, len);
+        return i_find(search_path);
       }
     }
   }
@@ -309,7 +308,7 @@ DataSvcHelpers::RegistryEntry* DataSvcHelpers::RegistryEntry::i_find(const DataO
     for (Store::const_iterator i = m_store.begin(); i != m_store.end(); i++ )   {
       try   {
         const RegistryEntry *entry = CAST_REGENTRY(RegistryEntry*, *i);
-        if( 0 != (result = entry->i_find(key)) ) 
+        if( 0 != (result = entry->i_find(key)) )
           return result;
       }
       catch ( ... )   {    }
diff --git a/GaudiKernel/src/Lib/System.cpp b/GaudiKernel/src/Lib/System.cpp
index c03504f9204ff6522d06f03201313e07c8802a58..1df73ef805f4c41e1c897f180bf1e77ef757f1d5 100644
--- a/GaudiKernel/src/Lib/System.cpp
+++ b/GaudiKernel/src/Lib/System.cpp
@@ -128,9 +128,8 @@ unsigned long System::loadDynamicLib(const std::string& name, ImageHandle* handl
   } else {
     // If the name is a logical name (environment variable), the try
     // to load the corresponding library from there.
-    std::string env = name;
-    if ( 0 != ::getenv(env.c_str()) )    {
-      std::string imgName = ::getenv(env.c_str());
+    std::string imgName;
+    if ( getEnv(name, imgName) )    {
       res = loadWithoutEnvironment(imgName, handle);
     } else {
       // build the dll name
@@ -289,78 +288,10 @@ const std::string System::getErrorString(unsigned long error)    {
   return errString;
 }
 
-// This is a little bit complicated....but at least it gives
-// usable results:
-// Native class template:
-//  Spac::templa<Spac::templa<Spac::templ<Spac::templa<AAA::a,Spac::templa<double,unsigned char>>>,B::bbb>,float>
-// is translated under egcs to the unreadable string:
-//  Q24Spact6templa2ZQ24Spact6templa2ZQ24Spact5templ1ZQ24Spact6templa2ZQ23AAA1aZQ24Spact6templa2ZdZUcZQ21B3bbbZf
-
-std::string __typeName(char*&  name);
-std::string __className(char*& name) {
-  std::string result;
-  int j = 0, k, i;
-  if ( 't' == *name ) {
-    goto Template;
-  }
-  for ( i = ::strtol(name, &name, 10);  i > 0; i = ::strtol(name, &name, 10) ) {
-    if ( j++ != 0 ) result.append("::",2);
-    result.append(name, i);
-    if ( *(name+=i) == 't' ) {
-      result.append("::",2);
-    Template:
-      result.append(name, (i=::strtol(++name, &name, 10)));
-      result.append("<");
-      for (k = 0, i=::strtol(name+i, &name, 10); k < i; k++ ) {
-	result += __typeName( ++name );
-	if ( k+1 < i ) result += ",";
-      }
-      result.append(">");
-    }
-  }
-  return result;
-}
-
-std::string __typeName(char*&  name) {
-  if ( *name == 'Q' ) {              // Handle name spaces
-    if ( *(++name) == '_' )          // >= 10 nested name spaces
-      ::strtol(++name, &name, 10);   // type Q_##_...
-    return __className(++name);
-  }
-  else if ( 't' == *name )  {
-    return __className(name);
-  }
-  else  {
-    std::string result;
-    char* ptr;
-    long i = ::strtol(name, &ptr, 10);
-    if ( i <= 0 )  {
-      name = ptr;
-      while ( *name != 0 && *name != 'Z' )  {
-	if ( *name == 'U' )  {
-	  result += "unsigned ";
-	  name++;
-	}
-	switch( *name++ )  {
-	case 'c': result += "char"; break;
-	case 's': result += "short"; break;
-	case 'i': result += "int"; break;
-	case 'l': result += "long"; break;
-	case 'f': result += "float"; break;
-	case 'd': result += "double"; break;
-	default:  result += *(name-1);
-	}
-      }
-      return result;
-    }
-    else {
-      return __className(name);
-    }
-  }
-}
 const std::string System::typeinfoName( const std::type_info& tinfo) {
   return typeinfoName(tinfo.name());
 }
+
 const std::string System::typeinfoName( const char* class_name) {
   std::string result;
 #ifdef _WIN32
@@ -526,9 +457,9 @@ const std::string& System::osVersion() {
   OSVERSIONINFO ut;
   ut.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
   ::GetVersionEx(&ut);
-  char ver[64];
-  sprintf(ver,"%d.%d",ut.dwMajorVersion,ut.dwMinorVersion);
-  osver = ver;
+  std::ostringstream ver;
+  ver << ut.dwMajorVersion << '.' << ut.dwMinorVersion;
+  osver = ver.str();
 #else
   struct utsname ut;
   if (uname(&ut) == 0) {
@@ -546,9 +477,9 @@ const std::string& System::machineType() {
 #ifdef _WIN32
   SYSTEM_INFO ut;
   ::GetSystemInfo(&ut);
-  char arch[64];
-  sprintf(arch,"%d",ut.wProcessorArchitecture);
-  mach =  arch;
+  std::ostringstream arch;
+  arch << ut.wProcessorArchitecture;
+  mach = arch.str();
 #else
   struct utsname ut;
   if (uname(&ut) == 0) {
@@ -594,6 +525,10 @@ const std::vector<std::string> System::cmdLineArgs()    {
   if ( s_argvChars.size() == 0 )    {
     char exe[1024];
 #ifdef _WIN32
+    /// @todo: rewrite the tokenizer to avoid strncpy, etc
+    // Disable warning C4996 triggered by C standard library calls
+#pragma warning(push)
+#pragma warning(disable:4996)
     // For compatibility with UNIX we CANNOT use strtok!
     // If we would use strtok, options like -g="My world" at
     // the command line level would result on NT in TWO options
@@ -624,6 +559,7 @@ const std::vector<std::string> System::cmdLineArgs()    {
       s_argvStrings.push_back(exe);
       s_argvChars.push_back( s_argvStrings.back().c_str());
     }
+#pragma warning(pop)
 #elif defined(linux) || defined(__APPLE__)
     sprintf(exe, "/proc/%d/cmdline", ::getpid());
     FILE *cmdLine = ::fopen(exe,"r");
@@ -655,8 +591,14 @@ char** System::argv()    {
   return (char**)&s_argvChars[0];
 }
 
+#ifdef WIN32
+// disable warning
+//   C4996: 'getenv': This function or variable may be unsafe.
+#pragma warning(disable:4996)
+#endif
+
 /// get a particular env var, return "UNKNOWN" if not defined
-const std::string System::getEnv(const char* var) {
+std::string System::getEnv(const char* var) {
   char* env;
   if  ( (env = getenv(var)) != 0 ) {
     return env;
@@ -665,12 +607,27 @@ const std::string System::getEnv(const char* var) {
   }
 }
 
+/// get a particular env var, storing the value in the passed string (if set)
+bool System::getEnv(const char* var, std::string &value) {
+  char* env;
+  if  ( (env = getenv(var)) != 0 ) {
+    value = env;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+bool System::isEnvSet(const char* var) {
+  return getenv(var) != 0;
+}
+
 /// get all defined environment vars
 #if defined(__APPLE__)
 // Needed for _NSGetEnviron(void)
 #include "crt_externs.h"
 #endif
-const std::vector<std::string> System::getEnv() {
+std::vector<std::string> System::getEnv() {
 #if defined(_WIN32)
 #  define environ _environ
 #elif defined(__APPLE__)
diff --git a/GaudiKernel/src/Lib/Time.cpp b/GaudiKernel/src/Lib/Time.cpp
index 6cd3d398180001d5517a77f112e0f28eb60647f4..1587af6de34524b0b0ce59d97a31e261f5af185c 100644
--- a/GaudiKernel/src/Lib/Time.cpp
+++ b/GaudiKernel/src/Lib/Time.cpp
@@ -2,6 +2,8 @@
 // Include files
 #include "GaudiKernel/Time.h"
 
+#include "GaudiKernel/time_r.h"
+
 #include <iostream>
 #include <cstdio>
 #include <ctime>
@@ -66,8 +68,9 @@ using namespace Gaudi;
 static time_t timegm (struct tm *t) {
   // This code is adapted from wine, samba
   time_t t1 = mktime (t);
-  struct tm gmt = *gmtime (&t1);
-  time_t t2 = mktime (&gmt);
+  struct tm gmt;
+  gmtime_s(&gmt, &t1);
+  time_t t2 = mktime(&gmt);
   return t1 + (t1 - t2);
 }
 #endif
@@ -122,7 +125,7 @@ Time Time::current (void) {
     if( strerror_r(errno, buf, 256) == 0 ) {
       msg << buf;
     } else {
-      msg << "Unknown error retriving current time";
+      msg << "Unknown error retrieving current time";
     }
     throw GaudiException(msg.str(),tag.str(),StatusCode::FAILURE);
   }
@@ -145,7 +148,14 @@ tm Time::split (bool local, int *nsecpart /* = 0 */) const {
     *nsecpart = (int)(m_nsecs % SEC_NSECS);
 
   time_t val = (time_t)(m_nsecs / SEC_NSECS);
-  return *(local ? localtime (&val) : gmtime (&val));
+
+  tm retval;
+  if (local)
+	localtime_r(&val, &retval);
+  else
+	gmtime_r(&val, &retval);
+
+  return retval;
 }
 
 /** Break up the time to the standard library representation, keeping
@@ -229,9 +239,11 @@ Time::ValueType Time::utcoffset (int *daylight /* = 0 */) const {
 #else
   // Adapted from WINE.
   time_t	utctime = (time_t)(m_nsecs / SEC_NSECS);
-  tm		localtm = *localtime (&utctime);
+  tm		localtm;
+  localtime_s(&localtm, &utctime);
   int		savedaylight = localtm.tm_isdst;
-  tm		gmt = *gmtime (&utctime);
+  tm		gmt;
+  gmtime_s(&gmt, &utctime);
 
   gmt.tm_isdst = savedaylight;
   n = utctime - mktime (&gmt);
@@ -241,6 +253,12 @@ Time::ValueType Time::utcoffset (int *daylight /* = 0 */) const {
   return n * SEC_NSECS;
 }
 
+#ifdef WIN32
+// disable warning
+// C4996: 'tzname': This function or variable may be unsafe.
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
 /** Return the local timezone name that applies at this time value.
     On some platforms returns the most recent timezone name (dst or
     non-dst one depending on the time value), not the one that applies
@@ -251,18 +269,40 @@ const char * Time::timezone (int *daylight /* = 0 */) const {
   // extern "C" { extern char *tzname [2]; }
   return tzname [localtm.tm_isdst > 0 ? 1 : 0];
 }
+#ifdef WIN32
+#pragma warning(pop)
+#endif
 
-/** Format the time using @c strftime.  */
-std::string Time::format (bool local, const std::string &spec) const {
-  // FIXME: This doesn't account for nsecs part!
-  std::string	result;
-  tm		time = split (local);
-  int		length = 0;
-
+/** Format the time using @c strftime.
+ *  The additional conversion specifier %f can be used to display
+ *  milliseconds (extension for compatibility with MessageSvc time format).
+ */
+std::string Time::format (bool local, std::string spec) const {
+  /// @FIXME: This doesn't account for nsecs part!
+  std::string            result;
+  tm                     time = split (local);
+  std::string::size_type length = 0;
+
+  // handle the special case of "%f"
+  std::string::size_type pos = spec.find("%f");
+  if (std::string::npos != pos) {
+    // Get the milliseconds string
+    std::string ms = nanoformat(3,3);
+    // Replace all the occurrences of '%f' (if not preceded by '%')
+    while (std::string::npos != pos) {
+      if (pos != 0 && spec[pos-1] != '%') {
+        spec.replace(pos, 2, ms);
+      }
+      pos = spec.find("%f", pos + 1); // search for the next occurrence
+    }
+  }
+  const int MIN_BUF_SIZE = 128;
   do
   {
-    // Guess how much we'll expand.  If we go wrong, we'll expand again.
-    result.resize (result.size() ? result.size()*2 : spec.size()*2, 0);
+    // Guess how much we'll expand.  If we go wrong, we'll expand again. (with a minimum)
+    result.resize(std::max<std::string::size_type>(result.size()*2,
+                    std::max<std::string::size_type>(spec.size()*2, MIN_BUF_SIZE))
+                  , 0);
     length = ::strftime (&result[0], result.size(), spec.c_str(), &time);
   } while (! length);
 
@@ -280,36 +320,25 @@ std::string Time::format (bool local, const std::string &spec) const {
     have at most that many digits.  Both @a minwidth and @a maxwidth
     must be between one and nine inclusive and @a minwidth must be
     less or equal to @a maxwidth.  */
-std::string Time::nanoformat (int minwidth /* = 1 */, int maxwidth /* = 9 */) const {
+std::string Time::nanoformat (size_t minwidth /* = 1 */, size_t maxwidth /* = 9 */) const {
   TimeAssert( (minwidth >= 1) && (minwidth <= maxwidth) && (maxwidth <= 9),
               "nanoformat options do not satisfy: 1 <= minwidth <= maxwidth <= 9");
 
   // Calculate the nanosecond fraction.  This will be < 1000000000.
   int value = (int)(m_nsecs % SEC_NSECS);
 
-  // Calculate modulus by which we truncate value.  If maxwidth is
-  // say 3, we want to mask of the last 6 digits.
-  int modulus = 1;
-  for (int i = 0; i < 9 - maxwidth; ++i)
-    modulus *= 10;
-
-  // Round value by the desired modulus.
-  int rem = value % modulus;
-  value -= rem;
-  if (rem > modulus / 2)
-    value += modulus;
-
-  // Format it, then strip off digits from the right as long as
-  // we zeroes.  The above guarantees enough zeroes on right to
-  // satisfy maxwidth so we need to concern ourselves only about
-  // minwidth.
-  char buf [10];
-  char *p = buf + 8;
-  sprintf (buf, "%09d", value);
-  while (p > buf + minwidth - 1 && *p == '0')
-    *p-- = '\0';
-
-  return buf;
+  std::ostringstream buf;
+  buf.fill('0');
+  buf.width(9);
+  buf << value;
+  std::string out = buf.str();
+  // Find the last non-0 char before maxwidth, but after minwidth
+  // (Note: -1 and +1 are to account for difference between position and size.
+  //        moreover, npos + 1 == 0, so it is correct to say that 'not found' means size of 0)
+  size_t len = out.find_last_not_of('0', maxwidth - 1) + 1;
+  // Truncate the output string to at least minwidth chars
+  out.resize(std::max(len, minwidth));
+  return out;
 }
 
 //////////////////////////////////////////////////////////////////////
diff --git a/GaudiKernel/src/Lib/VectorMap.cpp b/GaudiKernel/src/Lib/VectorMap.cpp
deleted file mode 100644
index 318ec4ad190211de3d8211ffd9bc7b555a12cc8e..0000000000000000000000000000000000000000
--- a/GaudiKernel/src/Lib/VectorMap.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// $Id: VectorMap.cpp,v 1.4 2007/05/24 14:39:11 hmd Exp $
-// ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.4 $
-// ============================================================================
-// Include files 
-// ============================================================================
-// STD & STD
-// ============================================================================
-#include <stdexcept>
-// ============================================================================
-// GaudiKernel
-// ============================================================================
-#include "GaudiKernel/Map.h"
-#include "GaudiKernel/VectorMap.h"
-#include "GaudiKernel/HashMap.h"
-// ============================================================================
-/** @file 
- *  Implementation file for the function 
- *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
- *  @date 2006-11-26
- */
-// ============================================================================
-
-// ============================================================================
-// The END 
-// ============================================================================
diff --git a/GaudiKernel/src/Util/genconf.cpp b/GaudiKernel/src/Util/genconf.cpp
index c74038d699fca92d6249c853c4e49532f28e89bc..12e962f53188acc90626084486206b5e01f13ed2 100644
--- a/GaudiKernel/src/Util/genconf.cpp
+++ b/GaudiKernel/src/Util/genconf.cpp
@@ -47,6 +47,8 @@
 #include "GaudiKernel/HashMap.h"
 #include "GaudiKernel/GaudiHandle.h"
 
+#include "GaudiKernel/Time.h"
+
 #include "Reflex/PluginService.h"
 #include "Reflex/Reflex.h"
 #include "Reflex/SharedLibrary.h"
@@ -58,7 +60,6 @@
 #include <fstream>
 #include <sstream>
 #include <exception>
-#include <ctime>
 #include <set>
 #include <vector>
 
@@ -810,9 +811,8 @@ void configGenerator::genHeader( std::ostream& py,
 //-----------------------------------------------------------------------------
 {
   // python file part
-  time_t rawtime;
-  time( &rawtime );
-  py << "#" << ctime(&rawtime) //<< "\n"
+  std::string now = Gaudi::Time::current().format(true);
+  py << "#" << now //<< "\n"
      << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
   if ( m_importGaudiHandles ) {
     py << "from GaudiKernel.GaudiHandles import *\n";
@@ -823,7 +823,7 @@ void configGenerator::genHeader( std::ostream& py,
   // db file part
   db << "##  -*- python -*-  \n"
      << "# db file automatically generated by genconf on: "
-     << ctime(&rawtime); // << "\n";
+     << now; // << "\n";
   db << "## insulates outside world against anything bad that could happen\n"
      << "## also prevents global scope pollution\n"
      << "def _fillCfgDb():\n";
diff --git a/GaudiKernel/tests/qmtest/gaudikernel.qms/gaudi_time.qmt b/GaudiKernel/tests/qmtest/gaudikernel.qms/gaudi_time.qmt
new file mode 100644
index 0000000000000000000000000000000000000000..11f2d448f17dd7a3702b58fb3bcc9387009c9d8a
--- /dev/null
+++ b/GaudiKernel/tests/qmtest/gaudikernel.qms/gaudi_time.qmt
@@ -0,0 +1,4 @@
+<?xml version="1.0" ?><!DOCTYPE extension  PUBLIC '-//QM/2.3/Extension//EN'  'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
+<extension class="GaudiTest.GaudiExeTest" kind="test">
+  <argument name="program"><text>test_GaudiTime.exe</text></argument>
+</extension>
diff --git a/GaudiKernel/tests/src/DirSearchPath_test.cpp b/GaudiKernel/tests/src/DirSearchPath_test.cpp
index 12aab101f68980254cf34b012ab487cebed0947e..d4f81fa5375235353904d7cfb80f3b924506106f 100644
--- a/GaudiKernel/tests/src/DirSearchPath_test.cpp
+++ b/GaudiKernel/tests/src/DirSearchPath_test.cpp
@@ -22,17 +22,16 @@ using namespace boost::filesystem;
 
 int main() {
   cout << "*** DirSearchPath_test Starts ***" << endl;
-  const bool SHOULDNEVERGETHERE(false);
   DirSearchPath bad("foo:fo:  : *");
   try {
     //make sure tmp is there
     path tmp("tmp");
-    if (!exists(tmp)) create_directory(tmp); 
+    if (!exists(tmp)) create_directory(tmp);
 
     //create a test dir tree under tmp
     path testRoot("tmp/DirSearchPath_test");
     if (exists(testRoot) && !testRoot.empty()) remove_all(testRoot);
-    if (!exists(testRoot)) create_directory(testRoot); 
+    if (!exists(testRoot)) create_directory(testRoot);
     path testSub1(testRoot / path("sub1"));
     create_directory(testSub1);
     path testSub2(testRoot / path("sub2"));
@@ -45,7 +44,7 @@ int main() {
     DirSearchPath searchPath(" :tmp: bla");
 #else
     DirSearchPath searchPath(" ;tmp; bla");
-#endif    
+#endif
     //now look for something
     string fullFileName;
     assert(searchPath.find("DirSearchPath_test", fullFileName));
@@ -59,8 +58,11 @@ int main() {
     if (!testRoot.empty()) remove_all(testRoot);
   } catch (const filesystem_error& err) {
     cerr << err.what() << endl;
+#ifndef NDEBUG
+    const bool SHOULDNEVERGETHERE(false);
     assert(SHOULDNEVERGETHERE);
-  }  
+#endif
+  }
   cout << "*** DirSearchPath_test OK ***" << endl;
-  return 0;  
+  return 0;
 }
diff --git a/GaudiKernel/tests/src/Memory_test.cpp b/GaudiKernel/tests/src/Memory_test.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9b6e5c5d82eedb9ca28529e6e0c513d62786ea24
--- /dev/null
+++ b/GaudiKernel/tests/src/Memory_test.cpp
@@ -0,0 +1,102 @@
+#include "GaudiKernel/Memory.h"
+#include <cstdlib>
+#include <iomanip>
+#include <iostream>
+
+using namespace std;
+using namespace System;
+
+int main(int /* argc */, char** /* argv */) {
+  size_t kB = size_t(1024);
+  size_t nBytes = kB*kB*kB*size_t(5);
+  void* p = ::malloc(nBytes);
+  if ( !p ) {
+    cout << "Failed to allocate " << nBytes << " bytes of memory." << endl;
+    return 1;
+  }
+  cout << endl
+       << "         Gaudi memory module test" << endl
+       << endl
+       << "  Test virtual memory allocation of " << nBytes << " Bytes ["
+       << nBytes/kB << " KB, " << nBytes/kB/kB << " MB, " << nBytes/kB/kB/kB << " GB]"
+       << endl;
+  cout << setw(50) << left  << "  Current usage of non paged memory:"
+       << setw(12) << right << nonPagedMemory(Byte,Memory,-1)      << " Bytes "
+       << setw(10) << right << nonPagedMemory(kByte,Memory,-1)     << " kB "
+       << setw(8 ) << right << nonPagedMemory(MByte,Memory,-1)     << " MB "
+       << setw(4 ) << right << nonPagedMemory(GByte,Memory,-1)     << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Peak usage of non paged memory:"
+       << setw(12) << right << nonPagedMemoryPeak(Byte,Memory,-1)  << " Bytes "
+       << setw(10) << right << nonPagedMemoryPeak(kByte,Memory,-1) << " kB "
+       << setw(8 ) << right << nonPagedMemoryPeak(MByte,Memory,-1) << " MB "
+       << setw(4 ) << right << nonPagedMemoryPeak(GByte,Memory,-1) << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Maximum amount of non-paged memory allowed:"
+       << setw(12) << right << nonPagedMemoryLimit(Byte,Quota,-1)  << " Bytes "
+       << setw(10) << right << nonPagedMemoryLimit(kByte,Quota,-1) << " kB "
+       << setw(8 ) << right << nonPagedMemoryLimit(MByte,Quota,-1) << " MB "
+       << setw(4 ) << right << nonPagedMemoryLimit(GByte,Quota,-1) << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Amount of paged memory currently occupied:"
+       << setw(12) << right << pagedMemory(Byte,Memory,-1)         << " Bytes "
+       << setw(10) << right << pagedMemory(kByte,Memory,-1)        << " kB "
+       << setw(8 ) << right << pagedMemory(MByte,Memory,-1)        << " MB "
+       << setw(4 ) << right << pagedMemory(GByte,Memory,-1)        << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Maximum of paged memory occupied:"
+       << setw(12) << right << pagedMemoryPeak(Byte,Memory,-1)     << " Bytes "
+       << setw(10) << right << pagedMemoryPeak(kByte,Memory,-1)    << " kB "
+       << setw(8 ) << right << pagedMemoryPeak(MByte,Memory,-1)    << " MB "
+       << setw(4 ) << right << pagedMemoryPeak(GByte,Memory,-1)    << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Amount of paged memory that can be occupied:"
+       << setw(12) << right << pagedMemoryLimit(Byte,Quota,-1)     << " Bytes "
+       << setw(10) << right << pagedMemoryLimit(kByte,Quota,-1)    << " kB "
+       << setw(8 ) << right << pagedMemoryLimit(MByte,Quota,-1)    << " MB "
+       << setw(4 ) << right << pagedMemoryLimit(GByte,Quota,-1)    << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Minimum amount of virtual memory:"
+       << setw(12) << right << minMemoryLimit(Byte,Quota,-1)       << " Bytes "
+       << setw(10) << right << minMemoryLimit(kByte,Quota,-1)      << " kB "
+       << setw(8 ) << right << minMemoryLimit(MByte,Quota,-1)      << " MB "
+       << setw(4 ) << right << minMemoryLimit(GByte,Quota,-1)      << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Maximum amount of virtual memory allowed:"
+       << setw(12) << right << maxMemoryLimit(Byte,Quota,-1)       << " Bytes "
+       << setw(10) << right << maxMemoryLimit(kByte,Quota,-1)      << " kB "
+       << setw(8 ) << right << maxMemoryLimit(MByte,Quota,-1)      << " MB "
+       << setw(4 ) << right << maxMemoryLimit(GByte,Quota,-1)      << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Amount of mapped memory:"
+       << setw(12) << right << mappedMemory(Byte,Memory,-1)        << " Bytes "
+       << setw(10) << right << mappedMemory(kByte,Memory,-1)       << " kB "
+       << setw(8 ) << right << mappedMemory(MByte,Memory,-1)       << " MB "
+       << setw(4 ) << right << mappedMemory(GByte,Memory,-1)       << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Peak of mapped mameory usage:"
+       << setw(12) << right << mappedMemoryPeak(Byte,Memory,-1)    << " Bytes "
+       << setw(10) << right << mappedMemoryPeak(kByte,Memory,-1)   << " kB "
+       << setw(8 ) << right << mappedMemoryPeak(MByte,Memory,-1)   << " MB "
+       << setw(4 ) << right << mappedMemoryPeak(GByte,Memory,-1)   << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Amount of virtual memory used:"
+       << setw(12) << right << virtualMemory(Byte,Memory,-1)       << " Bytes "
+       << setw(10) << right << virtualMemory(kByte,Memory,-1)      << " kB "
+       << setw(8 ) << right << virtualMemory(MByte,Memory,-1)      << " MB "
+       << setw(4 ) << right << virtualMemory(GByte,Memory,-1)      << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Peak of virtual memory usage:"
+       << setw(12) << right << virtualMemoryPeak(Byte,Memory,-1)   << " Bytes "
+       << setw(10) << right << virtualMemoryPeak(kByte,Memory,-1)  << " kB "
+       << setw(8 ) << right << virtualMemoryPeak(MByte,Memory,-1)  << " MB "
+       << setw(4 ) << right << virtualMemoryPeak(GByte,Memory,-1)  << " GB "
+       << endl;
+  cout << setw(50) << left  << "  Maximum amount of the page file allowed:"
+       << setw(12) << right << virtualMemoryLimit(Byte,Quota,-1)   << " Bytes "
+       << setw(10) << right << virtualMemoryLimit(kByte,Quota,-1)  << " kB "
+       << setw(8 ) << right << virtualMemoryLimit(MByte,Quota,-1)  << " MB "
+       << setw(4 ) << right << virtualMemoryLimit(GByte,Quota,-1)  << " GB "
+       << endl;
+  return 0;
+}
diff --git a/GaudiKernel/tests/src/PathResolver_test.cpp b/GaudiKernel/tests/src/PathResolver_test.cpp
index 66d5645c3c17e24bf2cbec2cc489f99f5ddcc75a..10429fdb68fa64321d4ff79c3466472201c83e5a 100644
--- a/GaudiKernel/tests/src/PathResolver_test.cpp
+++ b/GaudiKernel/tests/src/PathResolver_test.cpp
@@ -25,8 +25,12 @@ int main ()
 #ifdef _WIN32
   std::string ref4("C:/WINNT/explorer.exe");
   setEnv("DATAPATH","..\\tests\\PathResolver;..\\tests\\PathResolver\\A;..\\tests\\PathResolver\\B",1);
+#else
+#if defined(__APPLE__)
+  std::string ref4("/usr/bin/true");
 #else
   std::string ref4("/bin/true");
+#endif
   setEnv("DATAPATH","../tests/PathResolver:../tests/PathResolver/A:../tests/PathResolver/B",1);
 #endif
 
diff --git a/GaudiKernel/tests/src/test_GaudiTime.cpp b/GaudiKernel/tests/src/test_GaudiTime.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..30dc13627e05729034f969ea651f11e90e63bcf3
--- /dev/null
+++ b/GaudiKernel/tests/src/test_GaudiTime.cpp
@@ -0,0 +1,201 @@
+/*
+ * Time_test.cpp
+ *
+ *  Created on: Jan 13, 2011
+ *      Author: Marco Clemencic
+ */
+
+#include "GaudiKernel/Time.h"
+
+// from SPI version of the testdriver
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/TextTestRunner.h>
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/TextOutputter.h>
+#include <cppunit/XmlOutputter.h>
+
+// to produce one line per test
+#include <cppunit/TestResult.h>
+//#include <cppunit/BriefTestProgressListener.h>
+//#include <cppunit/TestResultCollector.h>
+
+// needed by the implementation of cool::ProgressListener
+#include <cppunit/Test.h>
+#include <cppunit/TestFailure.h>
+#include <cppunit/TestListener.h>
+
+// provides macros for the tests
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace GaudiKernelTest {
+  class TimeTest: public CppUnit::TestFixture {
+
+    CPPUNIT_TEST_SUITE( TimeTest );
+
+    CPPUNIT_TEST( test_nanoformat );
+    CPPUNIT_TEST( test_format );
+
+    CPPUNIT_TEST_SUITE_END();
+
+  public:
+
+    TimeTest() {}
+    virtual ~TimeTest() {}
+
+    void test_nanoformat() {
+      Gaudi::Time t(2011, 0, 13, 14, 22, 45, 123000, true);
+
+      CPPUNIT_ASSERT_EQUAL( std::string("000123"), t.nanoformat() );
+      CPPUNIT_ASSERT_EQUAL( std::string("000123000"), t.nanoformat(9) );
+      CPPUNIT_ASSERT_EQUAL( std::string("000123"), t.nanoformat(2,7) );
+      CPPUNIT_ASSERT_EQUAL( std::string("0"), t.nanoformat(1, 3) );
+      CPPUNIT_ASSERT_EQUAL( std::string("00012"), t.nanoformat(1, 5) );
+      CPPUNIT_ASSERT_EQUAL( std::string("000"), t.nanoformat(3, 3) );
+
+    }
+
+    void test_format() {
+      Gaudi::Time t(2011, 0, 13, 14, 22, 45, 1230000, true);
+
+      CPPUNIT_ASSERT_EQUAL( std::string("2011-01-13 14:22:45"), t.format(true, "%Y-%m-%d %H:%M:%S") );
+      CPPUNIT_ASSERT_EQUAL( std::string("2011-01-13 14:22:45.001"), t.format(true, "%Y-%m-%d %H:%M:%S.%f") );
+      CPPUNIT_ASSERT_EQUAL( std::string("14:22:45 2011/01/13 "), t.format(true, "%H:%M:%S %Y/%m/%d ") );
+
+    }
+
+    void setUp() {}
+
+    void tearDown() {}
+
+  };
+
+  CPPUNIT_TEST_SUITE_REGISTRATION( TimeTest );
+
+  // Copied from the COOL implementation
+  /** @class ProgressListener
+   *
+   *  Simple TestListener printing one line per test in the standard output.
+   *
+   *  Based on  CppUnit::BriefTestProgressListener (copy and paste)
+   *  using std::cout instead of std::cerr.
+   *
+   *  @author Marco Clemencic
+   *  @date   2006-11-13
+   */
+  class ProgressListener : public CppUnit::TestListener
+  {
+
+  public:
+
+    /// Default constructor.
+    ProgressListener(): m_lastTestFailed(false) {}
+
+    /// Destructor.
+    virtual ~ProgressListener() {}
+
+    void startTest( CppUnit::Test *test )
+    {
+      std::cout << test->getName();
+      std::cout.flush();
+      m_lastTestFailed = false;
+    }
+
+    void addFailure( const CppUnit::TestFailure &failure )
+    {
+      std::cout << " : " << (failure.isError() ? "error" : "assertion");
+      m_lastTestFailed  = true;
+    }
+
+    void endTest( CppUnit::Test * /*test*/ )
+    {
+      if ( !m_lastTestFailed )
+        std::cout  <<  " : OK";
+      std::cout << std::endl;
+    }
+
+  private:
+
+    bool m_lastTestFailed;
+
+  };
+
+}
+
+// Copied from the COOL implementation
+#include <stdexcept>
+int main( int argc, char* argv[] )
+{
+  // Retrieve test path from command line first argument.
+  // Default to "" which resolve to the top level suite.
+  std::string testPath =
+    (argc > 1) ? std::string(argv[1]) : std::string("");
+
+  // Add a listener that collects test result
+  //CppUnit::TestResultCollector result;
+  //controller.addListener( &result );
+
+  /// Get the top level suite from the registry
+  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
+
+  /// Adds the test to the list of test to run
+  // CppUnit::TestRunner runner;
+  CppUnit::TextTestRunner runner;
+  runner.addTest( suite );
+
+  // Change the default outputter to a compiler error format outputter
+  // uncomment the following line if you need a compiler outputter.
+  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
+                                                       std::cout ) );
+
+  // Change the default outputter to a xml error format outputter
+  // uncomment the following line if you need a xml outputter.
+  //runner.setOutputter( new CppUnit::XmlOutputter( &runner.result(),
+  //                                                    std::cout ) );
+
+  runner.eventManager().addListener( new GaudiKernelTest::ProgressListener() );
+
+  //CppUnit::TestResultCollector *collector =
+  //  new CppUnit::TestResultCollector();
+  //runner.eventManager().addListener(collector);
+
+  bool wasSuccessful = false;
+
+  try
+  {
+    wasSuccessful = runner.run( testPath, false, true, false );
+  }
+
+  // Test path not resolved
+  catch ( std::invalid_argument &e )
+  {
+    std::cout  << std::endl << "ERROR: " << e.what() << std::endl;
+    return 0;
+  }
+
+  // Should never happen?
+  catch ( std::exception& e )
+  {
+    std::cout  << std::endl
+               << "UNEXPECTED STD EXCEPTION CAUGHT: "
+               << e.what() << std::endl;
+    return 0;
+  }
+
+  // Should never happen?
+  catch ( ... )
+  {
+    std::cout  << std::endl
+               << "UNKNOWN EXCEPTION CAUGHT" << std::endl;
+    return 0;
+  }
+
+  // Return error code 1 if the one of tests failed.
+  // Print a message on standard error if something failed (for QMTest)
+  if ( ! wasSuccessful ) std::cerr << "Error: CppUnit Failures" << std::endl;
+  int retcode = wasSuccessful ? 0 : 1;
+
+  // Uncomment the next line if you want to integrate CppUnit with Oval
+  // std::cout << "[OVAL] Cppunit-result =" << retcode << std::endl;
+  return retcode;
+
+}
diff --git a/GaudiKernel/tests/src/test_headers_build.cpp b/GaudiKernel/tests/src/test_headers_build.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5202e0b459e94a39d093101ad746d84cad650d65
--- /dev/null
+++ b/GaudiKernel/tests/src/test_headers_build.cpp
@@ -0,0 +1,23 @@
+/** @file
+ * Force the compilation of header files that otherwise would not be read.
+ */
+
+// VectorMap.cpp
+#include <stdexcept>
+#include "GaudiKernel/Map.h"
+#include "GaudiKernel/VectorMap.h"
+#include "GaudiKernel/HashMap.h"
+
+// PropertyVerifier.cpp
+#include "GaudiKernel/Kernel.h"
+#include "GaudiKernel/PropertyVerifier.h"
+#include <string>
+#include <vector>
+
+// HistoProperty.cpp
+#include "GaudiKernel/HistoProperty.h"
+
+/// Empty executable body, just to please the compiler/linker.
+int main() {
+  return 0;
+}
diff --git a/GaudiMP/cmt/requirements b/GaudiMP/cmt/requirements
index 18103fb84d22bbb3c5e7210fb79f1c35b27ea0d5..307f7a92661f13c67788053e91a32b7f0dcf4ec4 100644
--- a/GaudiMP/cmt/requirements
+++ b/GaudiMP/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiMP
-version v1r0
+version v1r1
 
 branches      GaudiMP cmt doc src dict python scripts
 
diff --git a/GaudiMP/doc/release.notes b/GaudiMP/doc/release.notes
index 40c596ba1c2469d76624061eaeb61b157a98e53a..0eb6ff00338655bd9e9f2083299f740652c2b673 100644
--- a/GaudiMP/doc/release.notes
+++ b/GaudiMP/doc/release.notes
@@ -1,6 +1,16 @@
 Package: GaudiMP
 Package manager : Sebastien Binet
 
+================================ GaudiMP v1r1 ================================
+! 2011-04-04 - Pere Mato
+ - Fixes to work with LHCb Brunel
+   1) Namespace changed from GaudiPython to GaudiMP for TESSerializer class
+   2) Firing "EndEvent" incidents in Worker event loop. This was needed to
+      eliminate crashes in Brunel when invalid pointer to collection of
+      cluster was used in fitting algorithms.
+   3) Call update() method after having de-serialize a KeyedContainer<>. This
+      is needed to re-build the internal direct access container.
+
 ============================== GaudiMP v1r0 ==================================
 ! 2011-01-11 - Marco Clemencic
  - Fixed some ICC remarks.
diff --git a/GaudiMP/python/GaudiMP/GMPBase.py b/GaudiMP/python/GaudiMP/GMPBase.py
index ee8de32334abb5acddfc66022079b58b3b4f8209..abdc604a37e9e8ac46b2ea589d5df8c6a84cead4 100644
--- a/GaudiMP/python/GaudiMP/GMPBase.py
+++ b/GaudiMP/python/GaudiMP/GMPBase.py
@@ -485,8 +485,9 @@ class GMPComponent( object ) :
         self.evt = self.a.evtsvc()
         self.hvt = self.a.histsvc()
         self.fsr = self.a.filerecordsvc()
+        self.inc = self.a.service('IncidentSvc','IIncidentSvc')
         self.pers = self.a.service( 'EventPersistencySvc', 'IAddressCreator' )
-        self.ts  = gbl.GaudiPython.TESSerializer( self.evt._idp, self.pers )
+        self.ts  = gbl.GaudiMP.TESSerializer( self.evt._idp, self.pers )
         self.TS  = TESSerializer( self.ts, self.evt,
                                   self.nodeType, self.nodeID, self.log )
         return SUCCESS
@@ -829,6 +830,7 @@ class Worker( GMPComponent ) :
                 tb = self.TS.Dump( )
                 self.evcom.send( (self.currentEvent, tb) )
                 self.nOut += 1
+            self.inc.fireIncident(gbl.Incident('Worker','EndEvent'))
             self.eventLoopSyncer.set()
             self.evt.clearStore( )
         self.log.info('Setting <Last> Event')
diff --git a/GaudiMP/python/GaudiMP/pTools.py b/GaudiMP/python/GaudiMP/pTools.py
index 21024f7e71b32d7fef30acd16432749cfeca2099..264afa33d8d3f7f4d73c30ac9032d41656a2eb6a 100644
--- a/GaudiMP/python/GaudiMP/pTools.py
+++ b/GaudiMP/python/GaudiMP/pTools.py
@@ -304,10 +304,11 @@ class FileRecordsAgent( ) :
         for sourceNode, path, serialob in self.objectsIn :
             self.log.debug('Working with %s'%(path))
             ob = pickle.loads(serialob)
-            if hasattr( ob, "configureDirectAccess" ) :
-                ob.configureDirectAccess()
+            if hasattr( ob, 'update' ) :
+                ob.update()
+            if hasattr( ob, 'numberOfObjects' ) :
                 nCont = ob.numberOfObjects()
-                self.log.debug( '\tcontainedObjects : %i'%(nCont) )
+                self.log.debug( '\t %s has containedObjects : %i'%(type(ob).__name__,  nCont) )
             if sourceNode == 0 :
                 self.log.debug('Registering Object to : %s'%(path))
                 self.fsr.registerObject( path, ob )
diff --git a/GaudiMonitor/cmt/requirements b/GaudiMonitor/cmt/requirements
index c8e8f61b4f50e10c498764a5a3ea6b2de9df2731..05fe269444a75b1758c85704563159e22118855b 100644
--- a/GaudiMonitor/cmt/requirements
+++ b/GaudiMonitor/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiMonitor
-version v2r7
+version v2r8
 
 branches src cmt doc
 use GaudiKernel *
@@ -21,3 +21,5 @@ macro_append cppflags "" \
    target-darwin "" \
    target-winxp  ""
 
+# Hide warnings triggered on VC9 by the C standard library
+macro_append cppflags '' no-hide-warnings '' target-winxp ' /wd4996'
diff --git a/GaudiMonitor/doc/release.notes b/GaudiMonitor/doc/release.notes
index a03cdae700aaf99f3f5b86b4760abf86ad050717..c261e4b997490422700445fb0195547a77a35bdf 100644
--- a/GaudiMonitor/doc/release.notes
+++ b/GaudiMonitor/doc/release.notes
@@ -1,6 +1,11 @@
 Package: GaudiMonitor
 Package manager : Marco Clemencic
 
+============================= GaudiMonitor v2r8 ==============================
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Warnings disabled.
+
 ============================= GaudiMonitor v2r7 ==============================
 ! 2011-01-11 - Marco Clemencic
  - Fixed some ICC remarks.
diff --git a/GaudiPolicy/cmt/fragments/cpp b/GaudiPolicy/cmt/fragments/cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3113cd85b3ca8186833773107429e1b752929846
--- /dev/null
+++ b/GaudiPolicy/cmt/fragments/cpp
@@ -0,0 +1,16 @@
+#-- start of cpp ------
+
+ifneq ($(MAKECMDGOALS),${CONSTITUENT}clean)
+ifneq ($(MAKECMDGOALS),uninstall)
+-include $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d
+endif
+endif
+
+
+$(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.o $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d : ${FULLNAME}  $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
+	$(cpp_echo) ${FULLNAME}
+	@mkdir -p $(@D)
+	$(cpp_silent) $(cppcomp) $(use_pp_cppflags) $(${CONSTITUENT}_pp_cppflags) $(app_${CONSTITUENT}_pp_cppflags) $(${NAME}_pp_cppflags) $(use_cppflags) $(${CONSTITUENT}_cppflags) $(lib_${CONSTITUENT}_cppflags) $(app_${CONSTITUENT}_cppflags) $(${NAME}_cppflags) $(${NAME}_${FILESUFFIX}_cppflags) ${ADDINCLUDE} -MP -MMD -MT $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.o -MT $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d -MF $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d -o $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.o ${FULLNAME}
+
+
+#-- end of cpp ------
diff --git a/GaudiPolicy/cmt/fragments/cpp_library b/GaudiPolicy/cmt/fragments/cpp_library
new file mode 100644
index 0000000000000000000000000000000000000000..b1ab6d6fc2dc337d011bc590a00267677a5bcfa8
--- /dev/null
+++ b/GaudiPolicy/cmt/fragments/cpp_library
@@ -0,0 +1,16 @@
+#-- start of cpp_library -----------------
+
+ifneq ($(MAKECMDGOALS),${CONSTITUENT}clean)
+ifneq ($(MAKECMDGOALS),uninstall)
+-include $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d
+endif
+endif
+
+
+$(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.o $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d : ${FULLNAME}  $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
+	$(cpp_echo) ${FULLNAME}
+	@mkdir -p $(@D)
+	$(cpp_silent) $(cppcomp) $(use_pp_cppflags) $(${CONSTITUENT}_pp_cppflags) $(app_${CONSTITUENT}_pp_cppflags) $(${NAME}_pp_cppflags) $(use_cppflags) $(${CONSTITUENT}_cppflags) $(lib_${CONSTITUENT}_cppflags) $(app_${CONSTITUENT}_cppflags) $(${NAME}_cppflags) $(${NAME}_${FILESUFFIX}_cppflags) ${ADDINCLUDE} -MP -MMD -MT $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.o -MT $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d -MF $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.d -o $(bin)$(binobj)${NAME}${CONSTITUENTSUFFIX}.o ${FULLNAME}
+
+
+#-- end of cpp_library ------------------
diff --git a/GaudiPolicy/cmt/fragments/dependencies b/GaudiPolicy/cmt/fragments/dependencies
index b77d0222e48120379e85dc726aa62d17e47178fd..b74871cba2c3ec09e0f9c25444e4d355e5b458fc 100644
--- a/GaudiPolicy/cmt/fragments/dependencies
+++ b/GaudiPolicy/cmt/fragments/dependencies
@@ -1,13 +1,16 @@
 #-- start of dependency ------------------
+ifneq ($(MAKECMDGOALS),${CONSTITUENT}clean)
+ifneq ($(MAKECMDGOALS),uninstall)
 
-$(bin)${CONSTITUENT}_dependencies.make :: dirs
+#$(bin)${CONSTITUENT}_dependencies.make :: dirs
 
 ifndef QUICK
-$(bin)${CONSTITUENT}_dependencies.make :: ${LINE} requirements $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
-	@echo "------> (${CONSTITUENT}.make) Rebuilding $@"; \
-	  args=`echo $? | sed -e "s#requirements.*##"`; \
-	  $(build_dependencies) ${CONSTITUENT} -all_sources $${args}
+$(bin)${CONSTITUENT}_dependencies.make : ${LINE} $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
+else
+$(bin)${CONSTITUENT}_dependencies.make :
 endif
+	$(echo) "(${CONSTITUENT}.make) Rebuilding $@"; \
+	  $(build_dependencies) ${CONSTITUENT} -all_sources -out=$@ ${LINE}
 
 #$(${CONSTITUENT}_dependencies)
 
@@ -16,6 +19,9 @@ ifndef QUICK
 else
 ifneq ($(QUICK),2)
 -include $(bin)${CONSTITUENT}_dependencies.make
+endif
+endif
+
 endif
 endif
 #-- end of dependency -------------------
diff --git a/GaudiPolicy/cmt/fragments/library b/GaudiPolicy/cmt/fragments/library
index 37b85e7c83e26f6720a851654c86f49112360af3..e7d9ec4051962cded46f2213bd8fd9e7559a3a22 100644
--- a/GaudiPolicy/cmt/fragments/library
+++ b/GaudiPolicy/cmt/fragments/library
@@ -1,12 +1,12 @@
 #-- start of libary ----------------------
 
 ${CONSTITUENT}LIB :: $(${CONSTITUENT}lib) $(${CONSTITUENT}shstamp)
-	@/bin/echo "------> ${CONSTITUENT} : library ok"
+	$(echo) "${CONSTITUENT} : library ok"
 
 $(${CONSTITUENT}lib) :: ${OBJS}
-	$(lib_echo) library
-	$(lib_silent) cd $(bin); \
-	  $(ar) $(${CONSTITUENT}lib) $?
+	$(lib_echo) "static library $@"
+	$(lib_silent) [ ! -f $@ ] || \rm -f $@
+	$(lib_silent) $(ar) $(${CONSTITUENT}lib) ${OBJS}
 	$(lib_silent) $(ranlib) $(${CONSTITUENT}lib)
 	$(lib_silent) cat /dev/null >$(${CONSTITUENT}stamp)
 
@@ -27,14 +27,16 @@ $(${CONSTITUENT}lib) :: ${OBJS}
 #
 
 $(${CONSTITUENT}libname).$(shlibsuffix) :: $(${CONSTITUENT}lib) requirements $(use_requirements) $(${CONSTITUENT}stamps)
-	$(lib_silent) cd $(bin); QUIET=$(QUIET); $(make_shlib) "$(tags)" ${CONSTITUENT} $(${CONSTITUENT}_shlibflags)
+	$(lib_echo) "shared library $@"
+	$(lib_silent) if test "$(makecmd)"; then QUIET=; else QUIET=1; fi; QUIET=$${QUIET} bin=$(bin) $(make_shlib) "$(tags)" ${CONSTITUENT} $(${CONSTITUENT}_shlibflags)
 
 $(${CONSTITUENT}shstamp) :: $(${CONSTITUENT}libname).$(shlibsuffix)
-	@if test -f $(${CONSTITUENT}libname).$(shlibsuffix) ; then cat /dev/null >$(${CONSTITUENT}shstamp) ; fi
+	$(lib_silent) if test -f $(${CONSTITUENT}libname).$(shlibsuffix) ; then cat /dev/null >$(${CONSTITUENT}shstamp) ; fi
 
 ${CONSTITUENT}clean ::
-	$(cleanup_echo) objects
-	$(cleanup_silent) cd $(bin); /bin/rm -f ${OBJS}
+	$(cleanup_echo) objects ${CONSTITUENT}
+	$(cleanup_silent) /bin/rm -f ${OBJS}
+	$(cleanup_silent) /bin/rm -f $(patsubst %.o,%.d,${OBJS}) $(patsubst %.o,%.dep,${OBJS}) $(patsubst %.o,%.d.stamp,${OBJS})
 	$(cleanup_silent) cd $(bin); /bin/rm -rf ${CONSTITUENT}_deps ${CONSTITUENT}_dependencies.make
 
 #-----------------------------------------------------------------
@@ -51,32 +53,31 @@ ${CONSTITUENT} :: ${CONSTITUENT}install
 install :: ${CONSTITUENT}install
 
 ${CONSTITUENT}install :: $(install_dir)/$(${CONSTITUENT}installname)
-	@if test ! "${CMTINSTALLAREA}" = ""; then\
-	  echo "installation done"; \
-	fi
+ifdef CMTINSTALLAREA
+	$(echo) "installation done"
+endif
 
 $(install_dir)/$(${CONSTITUENT}installname) :: $(bin)$(${CONSTITUENT}installname)
-	@if test ! "${CMTINSTALLAREA}" = ""; then \
-	  $(cmt_install_action) \
+ifdef CMTINSTALLAREA
+	$(install_silent) $(cmt_install_action) \
 	    -source "`(cd $(bin); pwd)`" \
 	    -name "$(${CONSTITUENT}installname)" \
 	    -out "$(install_dir)" \
 	    -cmd "$(cmt_installarea_command)" \
-	    -cmtpath "$($(package)_cmtpath)" ; \
-	fi
+	    -cmtpath "$($(package)_cmtpath)"
+endif
 
 ##${CONSTITUENT}clean :: ${CONSTITUENT}uninstall
 
 uninstall :: ${CONSTITUENT}uninstall
 
 ${CONSTITUENT}uninstall ::
-	@if test ! "${CMTINSTALLAREA}" = ""; then \
-	  $(cmt_uninstall_action) \
+ifdef CMTINSTALLAREA
+	$(cleanup_silent) $(cmt_uninstall_action) \
 	    -source "`(cd $(bin); pwd)`" \
 	    -name "$(${CONSTITUENT}installname)" \
 	    -out "$(install_dir)" \
-	    -cmtpath "$($(package)_cmtpath)" ; \
-	fi
-
+	    -cmtpath "$($(package)_cmtpath)"
+endif
 
 #-- end of libary -----------------------
diff --git a/GaudiPolicy/cmt/fragments/library_no_share b/GaudiPolicy/cmt/fragments/library_no_share
index e565ca5b31bbb97dd4a4c9bd94bb4c1bf2f9632e..555740aa6bd0b442cf5e7466b9880dcaf2d930ae 100644
--- a/GaudiPolicy/cmt/fragments/library_no_share
+++ b/GaudiPolicy/cmt/fragments/library_no_share
@@ -3,13 +3,67 @@ ${CONSTITUENT}LIB :: $(${CONSTITUENT}lib)
 	@/bin/echo ${CONSTITUENT} : library ok
 
 $(${CONSTITUENT}lib) :: ${OBJS}
-	$(lib_echo) library
-	$(lib_silent) cd $(bin); $(ar) $(${CONSTITUENT}lib) $?; \
-                      /bin/rm -f $?;touch $? 
-	$(lib_silent)  $(ranlib) $(${CONSTITUENT}lib); \
-	  cat /dev/null >$(${CONSTITUENT}stamp)
+	$(lib_echo) "static library $@"
+	$(lib_silent) $(ar) $(${CONSTITUENT}lib) $?
+	$(lib_silent) $(ranlib) $(${CONSTITUENT}lib)
+	$(lib_silent) cat /dev/null >$(${CONSTITUENT}stamp)
+
+#------------------------------------------------------------------
+#  Future improvement? to empty the object files after
+#  storing in the library
+#
+##	  for f in $?; do \
+##	    rm $${f}; touch $${f}; \
+##	  done
+#------------------------------------------------------------------
+
+#-----------------------------------------------------------------
+#
+#  New section for automatic installation
+#
+#-----------------------------------------------------------------
+
+install_dir = ${CMTINSTALLAREA}/$(tag)/lib
+${CONSTITUENT}installname = $(library_prefix)${CONSTITUENT}$(library_suffix).a
+
+${CONSTITUENT} :: ${CONSTITUENT}install
+
+install :: ${CONSTITUENT}install
+
+${CONSTITUENT}install :: $(install_dir)/$(${CONSTITUENT}installname)
+ifdef CMTINSTALLAREA
+	$(echo) "installation done"
+endif
+
+$(install_dir)/$(${CONSTITUENT}installname) :: $(bin)$(${CONSTITUENT}installname)
+ifdef CMTINSTALLAREA
+	$(install_silent) $(cmt_install_action) \
+	    -source "`(cd $(bin); pwd)`" \
+	    -name "$(${CONSTITUENT}installname)" \
+	    -out "$(install_dir)" \
+	    -cmd "$(cmt_installarea_command)" \
+	    -cmtpath "$($(package)_cmtpath)"
+endif
+
+##${CONSTITUENT}clean :: ${CONSTITUENT}uninstall
+
+uninstall :: ${CONSTITUENT}uninstall
+
+${CONSTITUENT}uninstall ::
+ifdef CMTINSTALLAREA
+	$(cleanup_silent) $(cmt_uninstall_action) \
+	    -source "`(cd $(bin); pwd)`" \
+	    -name "$(${CONSTITUENT}installname)" \
+	    -out "$(install_dir)" \
+	    -cmtpath "$($(package)_cmtpath)"
+endif
 
 ${CONSTITUENT}clean ::
-	$(cleanup_echo) ${OBJS}
-	$(cleanup_silent) cd $(bin); /bin/rm -f ${OBJS}
+	$(cleanup_echo) objects ${CONSTITUENT}
+	$(cleanup_silent) /bin/rm -f ${OBJS}
+	$(cleanup_silent) /bin/rm -f $(patsubst %.o,%.d,${OBJS}) $(patsubst %.o,%.dep,${OBJS}) $(patsubst %.o,%.d.stamp,${OBJS})
+	$(cleanup_silent) cd $(bin); /bin/rm -rf ${CONSTITUENT}_deps ${CONSTITUENT}_dependencies.make
+#	$(cleanup_echo) ${OBJS}
+#	$(cleanup_silent) /bin/rm -f ${OBJS}
 
+#-- end of library_no_share ------
diff --git a/GaudiPolicy/cmt/fragments/tex b/GaudiPolicy/cmt/fragments/tex
index 166d51cbbe782365e1fb3742d50e6268e31cd43c..cfef9b2b8e82cf5f2f717d3c5240f75b8013fcea 100644
--- a/GaudiPolicy/cmt/fragments/tex
+++ b/GaudiPolicy/cmt/fragments/tex
@@ -1,6 +1,16 @@
+#-- start of tex ------
+
+${CONSTITUENT} :: ${FILEPATH}${NAME}.ps
 
 ${FILEPATH}${NAME}.dvi : ${FULLNAME}
-	cd ${doc}; latex ${FULLNAME}
+	$(silent) cd ${FILEPATH}; latex ${NAME}${FILESUFFIX}
 
 ${FILEPATH}${NAME}.ps : ${FILEPATH}${NAME}.dvi
-	cd ${doc}; dvips ${FILEPATH}${NAME}.dvi
+	$(silent) cd ${FILEPATH}; dvips -o ${NAME}.ps ${NAME}.dvi
+
+${CONSTITUENT}clean ::
+	$(cleanup_echo) ${FILEPATH}${NAME}.ps
+	$(cleanup_silent) cd ${FILEPATH}; /bin/rm -f ${NAME}.ps ${NAME}.dvi
+	$(cleanup_silent) cd ${FILEPATH}; /bin/rm -f ${NAME}.aux ${NAME}.log ${NAME}.toc
+
+#-- end of tex ------
diff --git a/GaudiPolicy/cmt/requirements b/GaudiPolicy/cmt/requirements
index 84b1472cfca01669b9c1b0db6b4536524c8390f1..4115f467b8330a217c9a810e4dbd62daeff8b243 100755
--- a/GaudiPolicy/cmt/requirements
+++ b/GaudiPolicy/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiPolicy
-version v11r0
+version v11r2
 
 branches cmt doc
 
@@ -517,6 +517,21 @@ make_fragment sln_dependency_project
 make_fragment sln_dependency_header
 make_fragment sln_dependency_trailer
 
+
+# C++
+# The cpp fragments for enhanced computation of dependencies are not available on Windows
+macro cpp_fragment "cpp" target-winxp ""
+make_fragment $(cpp_fragment)
+macro cpp_library_fragment "cpp_library" target-winxp ""
+make_fragment $(cpp_library_fragment)
+
+macro cmt_compiler_version "${cmt_compiler_version}" \
+              target-gcc43 "gcc43"
+
+macro cppcomp         "$(cpp) -c $(cppdebugflags) $(cppflags) $(pp_cppflags) $(includes)" \
+      VisualC         "cl.exe $(cppdebugflags) $(cppflags) $(pp_cppflags)"
+
+
 # Local copy of the dependencies fragment to allow a "QUICK" option that
 # completely ignores dependencies (useful to speed up builds from scratch).
 macro dep_fragment "" CMTp20070208 "dependencies"
@@ -560,7 +575,8 @@ make_fragment $(lib_fragment)
 macro lib_no_static_fragment "" \
        CMTp20070208&target-winxp "library_no_static" \
        CMTp20090520&target-winxp "library_no_static" \
-       CMTr21&target-unix "library_no_static"
+       CMTr20&target-unix "" \
+       target-unix "library_no_static"
 make_fragment $(lib_no_static_fragment)
 
 # Compilation and Linking flags==============================================
@@ -602,7 +618,7 @@ macro cppdebugflags    "" \
       target-opt        "$(cppoptimized_s)"
 macro cppdebugflags_s  "-g" \
       target-winxp            "/Od /Z7"
-macro cppoptimized_s   "-O2" \
+macro cppoptimized_s   "-O2 -DNDEBUG" \
       target-winxp            ""
 macro cppprofiled_s   "-pg" \
       target-winxp            ""
@@ -611,16 +627,19 @@ macro_append cppdebugflags "" \
 
 # C debug, optimized and profiled options
 macro cdebugflags     "" \
-      target-dbg           "$(cdebugflags_s)"
+      target-dbg           "$(cdebugflags_s)" \
+      target-dbg           "$(coptimized_s)"
 macro cdebugflags_s   "-g" \
       target-winxp           "/Od /Z7"
+macro coptimized_s    "-O2 -DNDEBUG" \
+      target-winxp    ""
 
 # Fortran debug, optimized and profiled options
 macro fdebugflags      "" \
       target-dbg            "$(fdebugflags_s)"
 macro fdebugflags_s    "-g"\
       target-winxp            "/nopdbfile /debug:full /optimize:0"
-macro foptimized_s     "-O2" \
+macro foptimized_s     "-O2 -DNDEBUG" \
       target-winxp            ""
 macro_append fdebugflags "" \
       target-opt        " $(foptimized_s)"
@@ -803,6 +822,9 @@ macro cpplinkflags "" \
 macro_append cpplinkflags "" \
       target-linux               "-Wl,--no-undefined "
 
+macro_remove shlibflags "" \
+      target-mac "-undefined suppress"
+
 macro_append cpplinkflags  "" \
       host-x86_64&target-i686 " -m32" \
       host-x86_64&target-i386 " -m32" \
@@ -1316,3 +1338,4 @@ tag ATLAS no-pyzip
 
 macro_append pp_cppflags "" \
       ATLAS " -DATLAS_GAUDI_V21 "
+
diff --git a/GaudiPolicy/doc/release.notes b/GaudiPolicy/doc/release.notes
index 89f339e01e5058b969047debc650394555c9476e..f45715c4432801c5bfb647ec2f2e5118753e5c1a 100644
--- a/GaudiPolicy/doc/release.notes
+++ b/GaudiPolicy/doc/release.notes
@@ -1,6 +1,51 @@
 package GaudiPolicy
 package manager: Marco Clemencic
 
+============================= GaudiPolicy v11r2 ==============================
+! 2011-04-15 - Marco Clemencic
+ - Fixed the usage of cpp fragments on Windows.
+
+! 2011-04-12 - Marco Clemencic
+ - Improved Javascript code to present QMTest results.
+   - lots of clean-up
+   - switch to jQuery 1.5.2
+   - improved responsiveness
+
+! 2011-04-05 - Hubert Degaudenzi
+ - modified the cmt_compiler_version macro to avoid repeated calls to
+   "gcc --version".
+ - added 2 fragments (cpp and cpp_library) for the native calculation of
+   dependencies by gcc. For each ".o" file a makefile fragment ".d" is
+   created. It contains the include dependencies of the file. The ".d" is then
+   included in the cpp and cpp_library fragment. This reduces the time to
+   calculate the dependencies because only one call to gcc is made to compile
+   the ".ccp" and calculate its dependencies.
+
+! 2011-04-01 - Charles Leggett
+ - get the lib_no_static_fragment macro to work with CMT > v20
+ M cmt/requirements
+
+! 2011-03-17 - Marco Clemencic
+ - Removed the option "-undefined suppress" from the link statement on MacOSX
+   (added by CMT) to have the same behavior as on Linux (-Wl,--no-undefined).
+
+! 2011-03-16 - Charles Leggett, Marco Clemencic
+ - Patch #4727: Add NDEBUG macro for opt builds
+
+! 2011-03-09 - Marco Clemencic
+ - Avoid exception in QMTest if the test executable is not built.
+ - Minor improvements to GaudiTest.py
+
+============================= GaudiPolicy v11r1 ==============================
+! 2011-02-22 - Marco Clemencic
+ - Minor improvement in reference file name matching in QMTest.
+   It is possible to specify any part of the CMTCONFIG in the file name extension,
+   for example "myfile.ref.i686-opt".
+
+! 2011-02-04 - Charles Leggett
+ - Fixed bug #77806: createProjVersHeader breaks with Atlas style tags
+   allow Atlas style GaudiPKJ-XX-YY-ZZ tags
+
 ============================= GaudiPolicy v11r0 ==============================
 ! 2011-01-17 - Marco Clemencic
  - Fixed a small problem with the recent change in the nmake fragments
@@ -11,6 +56,9 @@ package manager: Marco Clemencic
  - Fixed a problem in a regular expression used in the exclusion of lines
    from the references of the tests
 
+! 2011-01-11 - Hubert Degaudenzi
+ - Initial commit for gcc native dependency calculations.
+
 ! 2011-01-07 - Marco Clemencic
  - Fixes to run_qmtest.py to allow creation of HTML output on Windows.
  - Fixed nmake fragments to honor the shlibsuffix macro.
@@ -34,7 +82,7 @@ package manager: Marco Clemencic
 ! 2010-09-09 - Marco Clemencic
  - Changed the default behavior about shared directories: by default shared
    directories are not used. The old behavior can be restored with the tag
-   'use-shared-dir' (the tag ATLAS implies it).
+   'user-shared-dir' (the tag ATLAS implies it).
 
 ! 2010-09-02 - Marco Clemencic
  - Improved and documented the 'pyd_module' and 'pyd_boost_module' (new) patterns.
diff --git a/GaudiPolicy/qmtest_classes/GaudiTest.py b/GaudiPolicy/qmtest_classes/GaudiTest.py
index da3ffea7e100c4cc0cfc2939dd9e7d577e203f0f..b6f29a2e5e8c26e64a9de494f82e5bd4b6e7c6bd 100644
--- a/GaudiPolicy/qmtest_classes/GaudiTest.py
+++ b/GaudiPolicy/qmtest_classes/GaudiTest.py
@@ -1116,6 +1116,9 @@ class GaudiExeTest(ExecTestBase):
         if not reffile:
             return ""
 
+        # function to split an extension in constituents parts
+        platformSplit = lambda p: set(p.split('-' in p and '-' or '_'))
+
         reference = os.path.normpath(os.path.expandvars(reffile))
         # old-style platform-specific reference name
         spec_ref = reference[:-3] + self.GetPlatform()[0:3] + reference[-3:]
@@ -1127,12 +1130,16 @@ class GaudiExeTest(ExecTestBase):
             if not dirname: dirname = '.'
             head = basename + "."
             head_len = len(head)
-            platform = self.GetPlatform()
+            platform = platformSplit(self.GetPlatform())
             candidates = []
             for f in os.listdir(dirname):
-                if f.startswith(head) and platform.startswith(f[head_len:]):
-                    candidates.append( (len(f) - head_len, f) )
+                if f.startswith(head):
+                    req_plat = platformSplit(f[head_len:])
+                    if platform.issuperset(req_plat):
+                        candidates.append( (len(req_plat), f) )
             if candidates: # take the one with highest matching
+                # FIXME: it is not possible to say if x86_64-slc5-gcc43-dbg
+                #        has to use ref.x86_64-gcc43 or ref.slc5-dbg
                 candidates.sort()
                 reference = os.path.join(dirname, candidates[-1][1])
         return reference
@@ -1338,16 +1345,6 @@ class GaudiExeTest(ExecTestBase):
         result['GaudiTest.environment'] = \
             result.Quote('\n'.join(["%s=%s"%(v,os.environ[v]) for v in vars]))
 
-    def _find_program(self,prog):
-        # check if it is an absolute path or the file can be found
-        # from the local directory, otherwise search for it in PATH
-        if not os.path.isabs(prog) and not os.path.isfile(prog):
-            for d in os.environ["PATH"].split(os.pathsep):
-                p = os.path.join(d,prog)
-                if os.path.isfile(p):
-                    return p
-        return prog
-
     def Run(self, context, result):
         """Run the test.
 
@@ -1377,7 +1374,7 @@ class GaudiExeTest(ExecTestBase):
             prog += ".exe"
             prog_ext = ".exe"
 
-        prog = self._find_program(prog)
+        prog = which(prog) or prog
 
         # Convert paths to absolute paths in arguments and reference files
         args = map(rationalizepath, self.args)
@@ -1401,9 +1398,9 @@ class GaudiExeTest(ExecTestBase):
         if prog_ext == ".py":
             args.insert(0,prog)
             if self.GetPlatform()[0:3] == "win":
-                prog = self._find_program("python.exe")
+                prog = which("python.exe") or "python.exe"
             else:
-                prog = self._find_program("python")
+                prog = which("python") or "python"
 
         # Change to the working directory if specified or to the default temporary
         origdir = os.getcwd()
@@ -1587,7 +1584,7 @@ class GaudiExeTest(ExecTestBase):
         data["environment"] = "\n".join(['<mapEntry key=%s value=%s/>' % (quoteattr(k), quoteattr(v))
                                          for k, v in os.environ.iteritems()])
 
-        data["exec"] = which(prog)
+        data["exec"] = which(prog) or prog
         if os.path.basename(data["exec"]).lower().startswith("python"):
             data["stopAtMain"] = "false" # do not stop at main when debugging Python scripts
         else:
diff --git a/GaudiPolicy/qmtest_classes/html_report/ajax-loader.gif b/GaudiPolicy/qmtest_classes/html_report/ajax-loader.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7092c9223097b49dd28d6f530404757cfef9d434
Binary files /dev/null and b/GaudiPolicy/qmtest_classes/html_report/ajax-loader.gif differ
diff --git a/GaudiPolicy/qmtest_classes/html_report/index.html b/GaudiPolicy/qmtest_classes/html_report/index.html
index 3c6185cb52a37ed39f49f688ba784d8c26afcbea..4c8b9fbcd0a777015a09d10ebac985bdf40c77cb 100644
--- a/GaudiPolicy/qmtest_classes/html_report/index.html
+++ b/GaudiPolicy/qmtest_classes/html_report/index.html
@@ -7,20 +7,19 @@
         <meta http-equiv="Content-Type" content="text/html"/>
         <title>QMTest Report</title>
         <link rel="stylesheet" type="text/css" href="style.css"/>
-        <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
+        <script type="text/javascript" src="jquery-1.5.2.min.js"></script>
         <script type="text/javascript" src="scripts.js"></script>
     </head>
     <body>
         <h1 id="title">QMTest Report</h1>
-        <div id="stop_polling" style="display:none">Stop polling</div>
         <h2>Statistics</h2>
-        <div class="summary"></div>
+        <div id="summary" class="loading"></div>
         <h2>Tests That Did Not Pass</h2>
-        <div class="results" filter="FAIL|ERROR|UNTESTED"></div>
+        <div id="results" class="results loading"></div>
         <h2>Test Results</h2>
-        <div class="results hidable"></div>
+        <div id="all_results" class="results loading"></div>
         <h2>Annotations</h2>
-        <div class="annotations hidable"></div>
+        <div id="annotations" class="loading"></div>
         <hr/>
         <div id="log"></div>
     </body>
diff --git a/GaudiPolicy/qmtest_classes/html_report/jquery-1.4.2.min.js b/GaudiPolicy/qmtest_classes/html_report/jquery-1.4.2.min.js
deleted file mode 100644
index 7c243080233761859937d52195b670602731a379..0000000000000000000000000000000000000000
--- a/GaudiPolicy/qmtest_classes/html_report/jquery-1.4.2.min.js
+++ /dev/null
@@ -1,154 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.4.2
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Sat Feb 13 22:33:48 2010 -0500
- */
-(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
-e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
-j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
-"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
-true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
-Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
-(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
-a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
-"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
-function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
-c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
-L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
-"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
-a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
-d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
-a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
-!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
-true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
-parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
-false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
-s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
-applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
-else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
-a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
-w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
-cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
-i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
-" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
-this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
-e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
-c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
-a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
-function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
-k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
-C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
-null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
-e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
-f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
-if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
-d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
-"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
-a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
-isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
-{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
-if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
-e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
-"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
-d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
-!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
-toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
-u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
-function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
-if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
-t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
-g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
-for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
-1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
-relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
-l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
-h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
-CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
-g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
-text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
-setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
-h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
-m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
-"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
-h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
-!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
-h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
-q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
-if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
-(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
-function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
-gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
-c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
-{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
-"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
-d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
-a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
-1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
-a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
-c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
-wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
-prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
-this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
-return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
-""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
-this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
-u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
-1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
-return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
-""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
-c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
-c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
-function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
-Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
-"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
-a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
-a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
-"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
-serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
-function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
-global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
-e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
-"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
-false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
-false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
-c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
-d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
-g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
-1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
-"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
-if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
-this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
-"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
-animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
-j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
-this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
-"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
-c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
-this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
-this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
-e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
-c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
-function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
-this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
-k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
-f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
-c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
-d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
-"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
-e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/GaudiPolicy/qmtest_classes/html_report/jquery-1.5.2.min.js b/GaudiPolicy/qmtest_classes/html_report/jquery-1.5.2.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..f78f96a12f13973ee16bc9d334e403b55502c66a
--- /dev/null
+++ b/GaudiPolicy/qmtest_classes/html_report/jquery-1.5.2.min.js
@@ -0,0 +1,16 @@
+/*!
+ * jQuery JavaScript Library v1.5.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Mar 31 15:28:23 2011 -0400
+ */
+(function(a,b){function ci(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cf(a){if(!b_[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bR(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bQ(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bs.test(a)?e(a,f):bQ(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bQ(a+"["+f+"]",b[f],c,e)}function bP(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bJ,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bP(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bP(a,c,d,e,"*",g));return l}function bO(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bD),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bq(a,b,c){var e=b==="width"?bk:bl,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function bc(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function bb(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function ba(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function _(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function $(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Q(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(L.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(r,"")===a.type?q.push(g.selector):t.splice(i--,1);f=d(a.target).closest(q,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){f=p[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:D?function(a){return a==null?"":D.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){F["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),E&&(d.inArray=function(a,b){return E.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?y=function(){c.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:c.attachEvent&&(y=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",y),d.ready())});return d}(),e="then done fail isResolved isRejected promise".split(" "),f=[].slice;d.extend({_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),f;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(f)return f;f=a={}}var c=e.length;while(c--)a[e[c]]=b[e[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;c<e;c++)b[c]&&d.isFunction(b[c].promise)?b[c].promise().then(i(c),h.reject):--g;g||h.resolveWith(h,b)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}}),function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i<j;i++)g=f[i].name,g.indexOf("data-")===0&&(g=g.substr(5),h(this[0],g,e[g]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=h(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var j=/[\n\t\r]/g,k=/\s+/,l=/\r/g,m=/^(?:href|src|style)$/,n=/^(?:button|input)$/i,o=/^(?:button|input|object|select|textarea)$/i,p=/^a(?:rea)?$/i,q=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(k);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(k);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(j," ");for(var i=0,l=c.length;i<l;i++)h=h.replace(" "+c[i]+" "," ");g.className=d.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),i=b,j=a.split(k);while(f=j[g++])i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(j," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j<k;j++){var m=h[j];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(q.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(l,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&q.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,H(a.origType,a.selector),d.extend({},a,{handler:G,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:x):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var z=function(a){var b=a.relatedTarget;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},A=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?A:z,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?A:z)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&E("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&E("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var B,C=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var F={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=r.exec(h),k="",j&&(k=j[0],h=h.replace(r,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(F[h]+k),h=h+k):h=(F[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)d.event.add(n[p],"live."+H(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+H(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var I=/Until$/,J=/^(?:parents|prevUntil|prevAll)/,K=/,/,L=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,N=d.expr.match.POS,O={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(Q(this,a,!1),"not",a)},filter:function(a){return this.pushStack(Q(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/<tbody/i,W=/<|&#?\w+;/,X=/<(?:script|object|embed|option|style)/i,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,Z={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&Y.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?$(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,bc)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!X.test(a[0])&&(d.support.checkClone||!Y.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1></$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bC=/^(?:select|textarea)/i,bD=/\s+/,bE=/([?&])_=[^&]*/,bF=/(^|\-)([a-z])/g,bG=function(a,b,c){return b+c.toUpperCase()},bH=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bI=d.fn.load,bJ={},bK={},bL,bM;try{bL=c.location.href}catch(bN){bL=c.createElement("a"),bL.href="",bL=bL.href}bM=bH.exec(bL.toLowerCase())||[],d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bI)return bI.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bB,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bC.test(this.nodeName)||bw.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bt,"\r\n")}}):{name:b.name,value:c.replace(bt,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bL,isLocal:bx.test(bM[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bO(bJ),ajaxTransport:bO(bK),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bR(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bS(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bF,bG)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bv.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bu,"").replace(bz,bM[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bD),e.crossDomain==null&&(q=bH.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bM[1]||q[2]!=bM[2]||(q[3]||(q[1]==="http:"?80:443))!=(bM[3]||(bM[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bP(bJ,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!by.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bA.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bE,"$1_="+w);e.url=x+(x===e.url?(bA.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bP(bK,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bQ(g,a[g],c,f);return e.join("&").replace(br,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bT=d.now(),bU=/(\=)\?(&|$)|\?\?/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bT++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bU.test(b.url)||f&&bU.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bU,l),b.url===j&&(f&&(k=k.replace(bU,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bV=d.now(),bW,bX;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bZ()||b$()}:bZ,bX=d.ajaxSettings.xhr(),d.support.ajax=!!bX,d.support.cors=bX&&"withCredentials"in bX,bX=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),!a.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bW[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bW||(bW={},bY()),h=bV++,g.onreadystatechange=bW[h]=c):c()},abort:function(){c&&c(0,1)}}}});var b_={},ca=/^(?:toggle|show|hide)$/,cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,cd=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(ce("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cf(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ce("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(ce("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cf(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(ca.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=cb.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:ce("show",1),slideUp:ce("hide",1),slideToggle:ce("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!cc&&(cc=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(cc),cc=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var cg=/^t(?:able|d|h)$/i,ch=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=ci(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!cg.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=(e==="absolute"||e==="fixed")&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=ch.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!ch.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=ci(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=ci(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);
\ No newline at end of file
diff --git a/GaudiPolicy/qmtest_classes/html_report/scripts.js b/GaudiPolicy/qmtest_classes/html_report/scripts.js
index 2425aba6bdc475d21e06d5d9c8916967110d6cab..2a59a56521fd3a6872d155a756dab3d6ba63b100 100644
--- a/GaudiPolicy/qmtest_classes/html_report/scripts.js
+++ b/GaudiPolicy/qmtest_classes/html_report/scripts.js
@@ -1,254 +1,264 @@
-// Global variables
-var title = "QMTest Report";
+/// Global variable for the summary content.
+var test_results = {};
 
-// If set to false, the automatic polling of new data is interrupted.
-var polling = true;
+/**
+ * Digest the summary JSON object, filling the test_results variable.
+ * @param summary object containing the summary data (response of AJAJ request).
+ */
+function parseSummary(summary) {
+	// Prepare the counters
+	test_results.counter = {"PASS":     0,
+			                "FAIL":     0,
+			                "UNTESTED": 0,
+			                "ERROR":    0,
+			                "total":    summary.length};
+	test_results.tests = {};
+	test_results.not_passed = [];
+	test_results.all_tests = [];
+	for (var i in summary) {
+		var test = summary[i];
+		// Update the counter of the outcome.
+		++test_results.counter[test.outcome];
+		//var test_path = split(".", test.id);
+		test_results.tests[test.id] = test;
+		test_results.all_tests.push(test.id);
+		if (test.outcome != "PASS") {
+			test_results.not_passed.push(test.id);
+		}
+	}
+}
+
+/**
+ * Set the html of the selected elements to a spinning icon (for visual feed back).
+ * Note: the image has been downloaded from http://www.ajaxload.info
+ */
+jQuery.fn.loadingIcon = function() {
+	return this.html('<img src="ajax-loader.gif"/>');
+}
 
 /**
  * Load the annotations file (annotations.json) and fill the annotations block of
  * the DOM.
- *
- * If the key "qmtest.run.end_time" is not present, the test is considered to be
- * running, so a new call to getData() is scheduled and the title of the page
- * is modified to show that it is running.
- *
- * Once the test is completed, the data are not polled anymore.
  */
-function loadAnnotations() {
-	// Asynchronous retrieval
-	$.get('annotations.json', function(data) {
-		// Prepare a table with the annotations
-		var tbody = $("<tbody/>");
-		// This keys are special and must appear first in the table
-		var keys = ["qmtest.run.start_time", "qmtest.run.end_time"];
-		// Add all the other keys to the list of keys
-		for (var key in data) {
-			if ($.inArray(key, keys) == -1) {
-				keys.push(key);
-			}
+jQuery.fn.annotations = function(data) {
+	// Collect the list of keys.
+	// These keys are special and must appear first in the list.
+	var keys = ["qmtest.run.start_time", "qmtest.run.end_time"];
+	// Add all the other keys to the list of keys.
+	for (var key in data) {
+		if ($.inArray(key, keys) == -1) {
+			keys.push(key);
 		}
-		// Add the rows of the table
-		var running = false;
-		for (var i in keys) {
-			var key = keys[i];
-			var value = data[key];
-			if (!value) { // In case of empty value for a key...
-				if (key == "qmtest.run.end_time") {
-					// ... if the key is "end_time", it means the tests are running
-					value = "RUNNING".italics() +
-					        " (the page will be updated every 5s)".small();
-					running = polling;
-				} else {
-					// ... otherwise print a meaningful "None"
-					value = "None".italics();
-				}
-			} else {
-				if ($.isArray(value)) {
-					// In case the value is an Array, let's format it as a list
-					var tmp = $('<ul/>');
-					for (i in value) {
-						tmp.append($('<li/>').text(value[i]))
-					}
-					value = tmp;
-				}
+	}
+	// Prepare a table for the annotations
+	var tbody = $("<tbody/>");
+	// Add the rows of the table
+	for (var i in keys) {
+		var key = keys[i];
+		var value = data[key];
+		if ($.isArray(value)) {
+			// In case the value is an Array, let's format it as a list
+			var tmp = $('<ul/>');
+			for (i in value) {
+				tmp.append($('<li/>').text(value[i]))
 			}
-			tbody.append($("<tr/>")
-				.append($('<td/>').addClass("key").text(key))
-				.append($('<td/>').addClass("value").html(value)));
+			value = tmp;
 		}
-		// Insert the code in the annotations block
-		$('.annotations').html($('<table/>').append(tbody));
-
-		if (running) {
-			// modify the title
-			$("title").html(title + " (running)");
-			$("#title").html(title + " (running)");
-			$("#stop_polling").show();
-			// schedule an upload
-			setTimeout(getData, 5000);
-		} else {
-			// set the title to the actual value
-			$("title").html(title);
-			$("#title").html(title);
-			$("#stop_polling").hide();
-		}
-	}, "json");
+		tbody.append($("<tr/>")
+				.append($('<td class="key"/>').text(key))
+				.append($('<td class="value"/>').html(value)));
+	}
+	// Insert the code in the annotations block and enable the toggle button
+	return this.html($('<table/>').append(tbody));
 }
 
-/**
- * Update the summary block from a list of objects.
- *
- * The minimal requirement for the objects is that they have the field "outcome",
- * which value must be one of ["FAIL", "ERROR", "UNTESTED", "PASS"].
- *
- * @param summary
- */
-function updateSummary(summary) {
-	var counter = {"PASS":0,
-			"FAIL":0,
-			"UNTESTED":0,
-			"ERROR":0};
-	var total = summary.length;
-	// Count the outcomes in the summary.
-	for (var i in summary) {
-		++counter[summary[i]["outcome"]];
-	}
+/// Display the summary table
+jQuery.fn.summary = function() {
+	var counter = test_results.counter;
 	// Prepare a table layout (like the one produced usually by QMTest).
 	var tbody = $("<tbody/>");
 	// row with the total
-	tbody.append($("<tr>")
-		.append($("<td/>").attr("align", "right").text(total))
-		.append($("<td/>").attr("colspan", "3"))
-		.append($("<td/>").text("tests total")));
+	tbody.append($("<tr/>")
+		 .append($("<td align='right'/>").text(counter.total))
+		 .append($("<td colspan='3'/><td>tests total</td>")));
 	var result_types = ["FAIL", "ERROR", "UNTESTED", "PASS"];
 	for (var i in result_types) {
 		var result_type = result_types[i];
 		if (counter[result_type]) {
-			tbody.append($("<tr>")
-				.append($("<td/>").attr("align", "right").text(counter[result_type]))
-				.append("<td>(</td>")
-				.append($("<td/>").attr("align", "right").text(Math.round(counter[result_type] / total * 100)))
-				.append("<td>%)</td>")
-				.append($("<td/>").text("tests " + result_type)).addClass(result_type)
-				);
+			tbody.append($("<tr/>")
+				     .append($("<td align='right'/>")
+					     .text(counter[result_type]))
+				     .append("<td>(</td>")
+				     .append($("<td align='right'/>")
+					     .text(Math.round(counter[result_type]
+							      / counter.total * 100)))
+				     .append("<td>%)</td>")
+				     .append($("<td/>")
+					     .text("tests " + result_type))
+				     .addClass(result_type));
 		}
 	}
-	// Put the table in the summary block.
-	$('.summary').html($("<table/>").append(tbody));
+	return this.html($("<table/>").html(tbody));
 }
 
-/**
- * Update the results from a list of objects.
- *
- * The format of the objects in the list must be:
- *
- * {"id": "...", "outcome": "...", "cause": "...", "fields": [...]}
- *
- * @param summary
+/** Generate foldable lists.
  */
-function updateResults(summary) {
-	// Loop over each block with class "results" to fill it
-	$(".results").each(function(){
-		// Allow a custom regexp to select which outcomes to include.
-		// The regexp must be included in the attribute "filter".
-		var pattern = null;
-		if ($(this).attr("filter"))
-			pattern = new RegExp($(this).attr("filter"));
-		// Top-level list
-		var html = $("<ul/>");
-		var any_match = false; // to store if we put anything in the list
-		for (var i in summary) { // one item per test
-			var test_data = summary[i];
-			var outcome = test_data["outcome"];
-			// operate only on the outcomes matching the pattern (if specified)
-			if ( !pattern || outcome.match(pattern) ) {
-				any_match = true;
-				var it_res = $("<li/>").css("list-style-image", "url(plus.png)")
-					.append($("<span/>").addClass("testid clickable")
-						.append(test_data["id"]))
-					.append(": ");
-				var outcome_el = $("<span/>").addClass(outcome)
-						.text(outcome);
-				it_res.append(outcome_el);
-				if (test_data["cause"]) {
-					it_res.append(" ")
-					      .append($("<span/>").addClass("cause")
-							      .text(test_data["cause"]));
-				}
-				var fields_el = $("<div/>").addClass("fields").hide();
-				// Add the list of available fields for the test.
-				var fields = summary[i]["fields"];
-				var sublist = $("<ul/>");
-				for (var j in fields) {
-					sublist.append($("<li/>").css("list-style-image", "url(plus.png)")
-						.append($("<span/>").addClass("fieldid clickable")
-							.append(fields[j]))
-						.append($("<div/>")
-							.attr("href",test_data["id"] + "/" + fields[j])
-							.attr("loaded", "false").hide()
-							));
-				}
-				it_res.append(fields_el.append(sublist));
-				html.append(it_res);
-			}
-		}
-		if (any_match) {
-			$(this).html(html)
-			// add also a small link to collapse the tree
-			.append($("<span>Collapse all</span>").addClass("clickable")
-					.click(function(){
-						$('.results div.fields').hide();
-						$('.results div[href]').hide();
-						$('.results span.testid').parent().css('list-style-image', 'url(plus.png)');
-						$('.results span.fieldid').parent().css('list-style-image', 'url(plus.png)');
-					}));
-		} else {
-			$(this).html("None.");
-		}
-	});
-	// Instrument nodes
-	$('.results span.testid').click(function(){
-		var parent = $(this).parent();
-		var child = parent.find('div.fields');
-		if (child.is(':hidden')) {
-			child.show();
-			parent.css('list-style-image', 'url(minus.png)');
-		} else {
-			child.hide();
-			parent.css('list-style-image', 'url(plus.png)');
-		}
+jQuery.fn.foldable = function() {
+    this.each(function() {
+	    var me = $(this);
+	    me.addClass("folded")
+	    // wrap the content of the element with a clickable span
+	    // (includes the ul)
+	    .wrapInner($("<span class='clickable'/>")
+		       .click(function(){
+			       var me = $(this);
+			       me.next().toggle();
+			       me.parent().toggleClass("folded expanded");
+			       return false; // avoid bubbling of the event
+			   }));
+	    // this moves the ul after the span (and hides it in the meanwhile)
+	    me.append($("span > ul", me).hide());
 	});
-	$('.results span.fieldid').click(function(){
-		var parent = $(this).parent();
-		var div = parent.find('div');
-		if (div.attr("loaded") == "false") {
-			div.load(div.attr("href"), function(){
-				$(this).attr("loaded", "true");
-			});
-		}
-		if (div.is(':hidden')) {
-			div.show();
-			parent.css('list-style-image', 'url(minus.png)');
+};
+
+/** Modify the items that have the "url" data, making them clickable
+ *  and followed by a hidden block with the content of the link specified.
+ */
+jQuery.fn.loader = function() {
+    this.each(function() { // loop over all the selected elements
+      var me = $(this);
+      if (me.data("url")) { // modify the element only if it does have a data "url"
+	  me.addClass("folded")
+	      // wrap the "text" of the element with a clickable span that loads the url
+	      .wrapInner($("<span class='clickable'/>")
+			 .click(function(){ // trigger the loading on click
+				 var me = $(this);
+				 me.after($("<div/>").loadingIcon().load(me.parent().data("url")));
+				 me.unbind("click"); // replace the click handler
+				 me.click(function(){ // this handler just toggle the visibility
+					 var me = $(this);
+					 me.next().toggle();
+					 me.parent().toggleClass("folded expanded");
+					 return false; // avoid bubbling of the event
+				     });
+				 me.parent().toggleClass("folded expanded");
+				 return false; // avoid bubbling of the event
+			     }));
+      }
+    });
+};
+
+/**
+ * Helper function to re-use the code for the toggle button callback
+ */
+jQuery.fn.toggleNextButton = function(data) {
+	if (data === undefined) data = {};
+	if (data.hide === undefined) data.hide = "(hide)";
+	if (data.show === undefined) data.show = "(show)";
+	if (data.start_visible === undefined) data.start_visible = false;
+	this.click(function() {
+		var me = $(this);
+		me.next().toggle();
+		if (me.next().is(":visible")) {
+			me.text(data.hide);
 		} else {
-			div.hide();
-			parent.css('list-style-image', 'url(plus.png)');
+			me.text(data.show);
 		}
-	});
+	}).text(data.start_visible ? data.hide : data.show)
+	  .next().toggle(data.start_visible);
+	return this;
 }
-/**
- * Load the summary file "summary.json" and update the summary and result blocks.
+
+/** Make a given element toggleable using a show/hide button inserted just before
+ *  it.
  */
-function loadSummary() {
-	$.get("summary.json", function(summary) {
-		updateSummary(summary);
-		updateResults(summary);
-	}, "json");
+jQuery.fn.makeToggleable = function(data) {
+	this.each(function() {
+		var btn = $("<span class='clickable'/>");
+		$(this).before(btn);
+		btn.toggleNextButton(data);
+	});
+	return this;
 }
 
-/**
- * Load all the data (both annotations and summary).
+/** Display the list of results
+ * @param tests list of test ids to be displayed, if not specified, default to the
+ * not passed ones
+ * @param ignore_fields fields not to be shown
+ * @param field_order list of fields to be specified before the others in the specified order
  */
-function getData() {
-	loadAnnotations();
-	loadSummary();
-}
+jQuery.fn.results = function(tests, ignore_fields, fields_order) {
+	tests = tests || test_results.not_passed;
+	ignore_fields = ignore_fields || [];
+	fields_order = fields_order || [];
 
-// Function to be executed on load.
-$('body').ready(function(){
-	$(".hidable").hide();
-	$(".hidable").before($("<span>(show)</span>").addClass("togglelink clickable"));
-	$("span.togglelink").click(function(){
-		var me = $(this);
-		me.next().toggle();
-		if (me.html() == "(show)") {
-			me.html("(hide)");
-		} else {
-			me.html("(show)");
+	var ul = $("<ul/>");
+	$.each(tests, function(i, test) {
+		test = test_results.tests[test];
+
+		var entry = $("<li/>")
+		.append($("<span class='testid'/>").text(test.id + ": "))
+		.append($("<span/>").addClass(test.outcome).text(test.outcome));
+		if (test.cause) {
+			entry.append(" ")
+			.append($("<span class='cause'/>")
+					.text(test.cause));
 		}
+
+		// Prepare the list of field ids to display
+		var field_ids = $.makeArray(fields_order);
+		$.each(test.fields, function(i,f){
+			if ($.inArray(f, ignore_fields) < 0 && $.inArray(f, field_ids) < 0){
+				field_ids.push(f);
+			}
+		});
+
+		var fields = $("<ul class='fieldid'/>");
+		$.each(field_ids, function(index, field) {
+			fields.append($("<li/>").data("url", test.id + "/" + field)
+					.text(field));
+		});
+		entry.append(fields);
+		ul.append(entry);
+	});
+
+	$("li", ul).loader();
+	$("li:has(ul)", ul).foldable();
+
+	return this.html(ul)
+	.append($('<div class="clickable">Collapse all</div>').click(function(){
+		$(this).prev().find(".expanded > .clickable")
+		.next().hide()
+		.parent().toggleClass("folded expanded");
+	}));
+}
+
+/// Code executed when the page is ready.
+$(function () {
+	$(".loading").loadingIcon().removeClass("loading");
+	var ignore_fields = ["qmtest.cause", "qmtest.target"];
+	var fields_order = ["qmtest.start_time", "qmtest.end_time"];
+	// load the summary
+	$.get("summary.json", parseSummary, 'json')
+	.success(function(){
+		$("#summary").summary();
+		$("#results").results(null, ignore_fields, fields_order);
+		$("#all_results").html($('<span class="clickable">(show)</span>')
+				.click(function(){
+					var parent = $(this).parent();
+					parent.loadingIcon();
+					// actually we already got the JSON data, but this allows to trigger a
+					// background execution.
+					$.getJSON("summary.json")
+					.success(function() {
+						parent.results(test_results.all_tests, ignore_fields, fields_order)
+							  .makeToggleable({start_visible: true});
+					});
+				})).removeClass("loading");
 	});
-	$("#stop_polling").addClass("clickable").click(function(){
-		polling = false;
-		getData();
+	// load annotations
+	$.getJSON('annotations.json')
+	.success(function(data) {
+		$('#annotations').annotations(data).makeToggleable().removeClass("loading");
 	});
-	getData();
 });
diff --git a/GaudiPolicy/qmtest_classes/html_report/style.css b/GaudiPolicy/qmtest_classes/html_report/style.css
index d8663019b544013ea574114fca993e94234aa678..455ac01343352ae94b1dd22a43f5437c7b50c817 100644
--- a/GaudiPolicy/qmtest_classes/html_report/style.css
+++ b/GaudiPolicy/qmtest_classes/html_report/style.css
@@ -8,23 +8,26 @@ color: red;
 .UNTESTED {
 color: orange;
 }
-.results .cause {
-color: gray;
-font-size: small;
+
+.testid {
+color: black;
 }
-.results span.testid:hover {
-	color: red;
+.testid:hover {
+color: red;
 }
-.results span.fieldid:hover {
-	color: red;
+
+.fieldid .clickable {
+color: black;
 }
-/* "Collapse all" */
-.results ul + span:hover  {
-	color: blue;
+.fieldid .clickable:hover {
+color: red;
 }
-span.togglelink:hover {
-	color: red;
+
+.results .cause {
+color: gray;
+font-size: small;
 }
+
 /* ** Cursor feedback ** */
 /* Tooltip feedback */
 .with_tooltip {
@@ -33,4 +36,16 @@ span.togglelink:hover {
 /* clickable feedback */
 .clickable {
 	cursor: pointer;
+	color: blue;
+}
+.clickable:hover {
+	color: red;
+}
+
+/* foldable list bullets */
+li.folded {
+  list-style-image: url(plus.png);
+}
+li.expanded {
+  list-style-image: url(minus.png);
 }
diff --git a/GaudiPolicy/scripts/createProjVersHeader.py b/GaudiPolicy/scripts/createProjVersHeader.py
index 983cccb71ea9f2995cd66d7096bc4e87100ac39b..81e4368fb9378f8e56272e175c9347c405b3e8fc 100644
--- a/GaudiPolicy/scripts/createProjVersHeader.py
+++ b/GaudiPolicy/scripts/createProjVersHeader.py
@@ -7,8 +7,9 @@ def main():
     project, version, outputfile = sys.argv[1:]
     print "Creating %s for %s %s"%(outputfile, project, version) 
     
-    m = re.match("v([0-9]+)r([0-9]+)(?:p[0-9])?",version)
-    majver, minver = [ int(x) for x in m.groups() ]
+    m = re.match("(v|([A-Za-z]+\-))(?P<maj_ver>[0-9]+)(r|\-)(?P<min_ver>[0-9]+)(?:(p|\-)(?P<pat_ver>[0-9]+))?",version)
+    majver = int(m.groupdict()['maj_ver'])
+    minver = int(m.groupdict()['min_ver'])
     
     outdir = os.path.dirname(outputfile)
     if not os.path.exists(outdir):
diff --git a/GaudiPoolDb/cmt/requirements b/GaudiPoolDb/cmt/requirements
old mode 100755
new mode 100644
index bbc59890a1b92c983bdb1759b9d2c18061e0ecc6..5799672b7221c6a1cfed6aa4fd74a89cbfdd9a67
--- a/GaudiPoolDb/cmt/requirements
+++ b/GaudiPoolDb/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiPoolDb
-version v5r10
+version v5r12
 
 branches  cmt doc src GaudiPoolDb options main test
 
@@ -50,7 +50,7 @@ document reflex_dictionary_generator schemaGaudiPoolDbGen -group=t_tests $(GAUDI
 macro_append schemaGaudiPoolDb_reflex_options '--select=$(GAUDIPOOLDBROOT)/test/schema_dict.xml $(gccxmlopts) --gccxmlpath=$(GCCXML_home)/bin -D__SCHEMA_CHANGE__ '
 macro_append lib_schemaGaudiPoolDb_cppflags   ' -D__SCHEMA_CHANGE__ '
 
-library schemaGaudiPoolDb -no_static -group=t_tests -import=Reflex -import=POOL -import=GaudiPoolDb ../$(tag)/dict/schemaGaudiPoolDb/*.cpp ../test/*.cpp
+library schemaGaudiPoolDb -no_static -group=t_tests -import=Reflex -import=POOL ../$(tag)/dict/schemaGaudiPoolDb/*.cpp ../test/*.cpp
 apply_pattern component_library library=schemaGaudiPoolDb group=t_tests
 macro_append schemaGaudiPoolDb_shlibflags ' $(GaudiPoolDb_linkopts) '
 
diff --git a/GaudiPoolDb/doc/release.notes b/GaudiPoolDb/doc/release.notes
index b6127790a1f052a422309ffdf6613c2944ed4b5e..deea069c27950073b2e77f33d66e9752cdd112e0 100644
--- a/GaudiPoolDb/doc/release.notes
+++ b/GaudiPoolDb/doc/release.notes
@@ -1,5 +1,22 @@
 Package: GaudiPoolDb
-Package Manager: Markus Frank, Marco Clemencic
+Package Manager: Markus Frank
+
+============================= GaudiPoolDb v5r12 ==============================
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+
+============================= GaudiPoolDb v5r11 ==============================
+! 2011-02-21 - Marco Clemencic
+ - Fixed bug #78456: warning/error when building GaudiPoolDb
+   Removed the (unneeded) '-import=GaudiPoolDb'
+ - Modified patch #4622 to use the new ROOT version macro ROOT_FULL_VERSION,
+   which takes into account the patch letter.
+
+! 2011-02-08 - Markus Frank
+ - Patch #4662: Fix for ROOT bug #77747
 
 ============================= GaudiPoolDb v5r10 ==============================
 ! 2011-01-19 - Markus Frank
diff --git a/GaudiPoolDb/src/PoolDbCnvSvc.cpp b/GaudiPoolDb/src/PoolDbCnvSvc.cpp
old mode 100755
new mode 100644
index 1fb1443f3dd7296b3945b7223fb57f8103c533d0..976ebda9898b65d04847f34bee24cd47abcf18e4
--- a/GaudiPoolDb/src/PoolDbCnvSvc.cpp
+++ b/GaudiPoolDb/src/PoolDbCnvSvc.cpp
@@ -8,6 +8,12 @@
 //   TODO: To be removed, coming from CORAL
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 
 //====================================================================
 //	PoolDbCnvSvc implementation
diff --git a/GaudiPoolDb/src/PoolDbIOHandler.cpp b/GaudiPoolDb/src/PoolDbIOHandler.cpp
index 3bc06e0741e44cb49c4f4e391c5213e63b795189..1ddead9e055f6131567657e2e54b1f716cd47a81 100644
--- a/GaudiPoolDb/src/PoolDbIOHandler.cpp
+++ b/GaudiPoolDb/src/PoolDbIOHandler.cpp
@@ -13,6 +13,12 @@
 //   TODO: To be removed, coming from ROOT
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 
 #include "GaudiPoolDb/PoolDbIOHandler.h"
 #include "GaudiKernel/ObjectContainerBase.h"
@@ -196,22 +202,35 @@ void PoolDbIOHandler<ContainedObject>::put(TBuffer &b, void* obj) {
   m_root->WriteBuffer(b, obj);
 }
 
+// required for backward compatibility
+#ifndef ROOT_FULL_VERSION
+#define ROOT_FULL_VERSION(a,b,c,p) (((a)<<24)+((b)<<16)+((c)<<8)+(p))
+#define ROOT_FULL_VERSION_CODE (ROOT_VERSION_CODE << 8)
+#endif
+
 static void getOID_40000(TBuffer& b, TClass* cl, Token::OID_t& oid) {
   unsigned long loid[2];
-  UInt_t start, count, tmp;
+  UInt_t start, count;
+#if (ROOT_FULL_VERSION_CODE < ROOT_FULL_VERSION(5,28,0,'a'))
+  UInt_t tmp;
+#endif
   // read the class version from the buffer
   /* Version_t vsn = */ b.ReadVersion(&start, &count, 0);
   switch(count) {
   case 22:              // These tokens were written as pair<long,long>
+#if (ROOT_FULL_VERSION_CODE < ROOT_FULL_VERSION(5,28,0,'a'))
     b >> tmp;           //
+#endif
     b.ReadFastArray(loid,2); // There was a bug in POOL....
     oid.first = loid[0];
     oid.second = loid[1];
     break;              // see TBuffer::ReadFastArray(ulong*, int)
+#if (ROOT_FULL_VERSION_CODE < ROOT_FULL_VERSION(5,28,0,'a'))
   case 14:              // Normal case: version:checksum+8 Bytes
     b >> tmp;           //
   case 10:              // Normal case: version:checksum+8 Bytes
   case 8:               // Without checksum and version
+#endif
   default:              // No better idea
     b.ReadFastArray(&oid.first, 2);
     break;
diff --git a/GaudiProfiling/src/app/pfm_gen_analysis.cpp b/GaudiProfiling/src/app/pfm_gen_analysis.cpp
index 94f636cea4ee92fef2f7b94f2167304a9cc96efd..dffece60dc00a1df5f145513cacca78b2e74bdc0 100644
--- a/GaudiProfiling/src/app/pfm_gen_analysis.cpp
+++ b/GaudiProfiling/src/app/pfm_gen_analysis.cpp
@@ -109,13 +109,13 @@ class PipeReader
    }
    iss = new std::istringstream(result, std::istringstream::in);
   }
-  
+
   ~PipeReader(void)
   {
    pclose(pipe);
    delete iss;
   }
-  
+
   std::istringstream &output(void)
   {
    return *iss;
@@ -186,7 +186,7 @@ class FileInfo
    {
     return i->NAME.c_str();
    }
-    
+
    if(i == m_symbolCache.begin())
    {
     return m_symbolCache.begin()->NAME.c_str();
@@ -194,7 +194,7 @@ class FileInfo
 
    --i;
 
-   return i->NAME.c_str(); 
+   return i->NAME.c_str();
   }
 
   Offset next(Offset offset)
@@ -204,7 +204,7 @@ class FileInfo
    {
     return 0;
    }
-   return i->OFFSET;      
+   return i->OFFSET;
   }
 
  private:
@@ -217,7 +217,7 @@ class FileInfo
 
   typedef std::vector<CacheItem> SymbolCache;
   SymbolCache m_symbolCache;
-  
+
   struct CacheItemComparator
   {
    bool operator()(const CacheItem& a, const int &b) const
@@ -241,16 +241,16 @@ class FileInfo
    while(objdump.output())
    {
     // Checks the following regexp
-    //    
+    //
     //    LOAD\\s+off\\s+(0x[0-9A-Fa-f]+)\\s+vaddr\\s+(0x[0-9A-Fa-f]+)
-    // 
+    //
     // and sets vmbase to be $2 - $1 of the first matched entry.
-      
+
     std::string line;
     std::getline(objdump.output(), line);
-    
+
     if(!objdump.output()) break;
-    if(line.empty()) continue;      
+    if(line.empty()) continue;
     const char *lineptr = line.c_str();
     if(!skipWhitespaces(lineptr, &lineptr)) continue;
     if(!skipString("LOAD", lineptr, &lineptr)) continue;
@@ -268,13 +268,13 @@ class FileInfo
     vmbase=finalBase - initialBase;
     matched = true;
     break;
-   }    
+   }
    if(!matched)
    {
     fprintf(stderr, "Cannot determine VM base address for %s\n", NAME.c_str());
     fprintf(stderr, "Error while running `objdump -p %s`\n", NAME.c_str());
     exit(1);
-   }    
+   }
    std::string commandLine2 = "nm -t d -n " + NAME;
    PipeReader nm(commandLine2.c_str());
    while(nm.output())
@@ -287,10 +287,10 @@ class FileInfo
     const char *begin = line.c_str();
     char *endptr = 0;
     int address = strtol(begin, &endptr, 10);
-    if(endptr == begin) continue; 
-    if(*endptr++ != ' ') continue; 
-    if(isspace(*endptr++)) continue; 
-    if(*endptr++ != ' ') continue; 
+    if(endptr == begin) continue;
+    if(*endptr++ != ' ') continue;
+    if(isspace(*endptr++)) continue;
+    if(*endptr++ != ' ') continue;
     char *symbolName = endptr;
     while(*endptr && !isspace(*endptr)) endptr++;
     if(*endptr != 0) continue;
@@ -298,7 +298,7 @@ class FileInfo
     if(symbolName[0] == '.') continue;
     // Create a new symbol with the given fileoffset.
     // The symbol is automatically saved in the FileInfo cache by offset.
-    // If a symbol with the same offset is already there, the new one 
+    // If a symbol with the same offset is already there, the new one
     // replaces the old one.
     int offset = address-vmbase;
     if(m_symbolCache.size() && (m_symbolCache.back().OFFSET == offset)) m_symbolCache.back().NAME = symbolName;
@@ -471,15 +471,15 @@ void calc_core_deriv_values(double totalCycles)
  for(std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
  {
   (it->second)["Total Cycles"] = (it->second)["UNHALTED_CORE_CYCLES"];
-  (it->second)["Stalled Cycles"] = (it->second)["RS_UOPS_DISPATCHED CMASK=1 INV=1"]; 
+  (it->second)["Stalled Cycles"] = (it->second)["RS_UOPS_DISPATCHED CMASK=1 INV=1"];
   (it->second)["L2 Miss Impact"] = (it->second)["MEM_LOAD_RETIRED:L2_LINE_MISS"] * CORE_L2_MISS_CYCLES;
-  (it->second)["L2 Hit Impact"] = ((it->second)["MEM_LOAD_RETIRED:L1D_LINE_MISS"] - (it->second)["MEM_LOAD_RETIRED:L2_LINE_MISS"]) * CORE_L2_HIT_CYCLES; 
+  (it->second)["L2 Hit Impact"] = ((it->second)["MEM_LOAD_RETIRED:L1D_LINE_MISS"] - (it->second)["MEM_LOAD_RETIRED:L2_LINE_MISS"]) * CORE_L2_HIT_CYCLES;
   (it->second)["L1 DTLB Miss Impact"] = (it->second)["MEM_LOAD_RETIRED:DTLB_MISS"] * CORE_L1_DTLB_MISS_CYCLES;
-  (it->second)["LCP Stalls Impact"] = (it->second)["ILD_STALL"] * CORE_LCP_STALL_CYCLES;  
+  (it->second)["LCP Stalls Impact"] = (it->second)["ILD_STALL"] * CORE_LCP_STALL_CYCLES;
   (it->second)["Loads Blocked by Unknown Address Store Impact"] = (it->second)["LOAD_BLOCK:STA"] * CORE_UNKNOWN_ADDR_STORE_CYCLES;
   (it->second)["Loads Overlapped with Stores Impact"] = (it->second)["LOAD_BLOCK:OVERLAP_STORE"] * CORE_OVERLAPPING_CYCLES;
   (it->second)["Loads Spanning across Cache Lines Impact"] = (it->second)["LOAD_BLOCK:UNTIL_RETIRE"] * CORE_SPAN_ACROSS_CACHE_LINE_CYCLES;
-  (it->second)["Store-Fwd Stalls Impact"] = (it->second)["Loads Blocked by Unknown Address Store Impact"] + (it->second)["Loads Overlapped with Stores Impact"] + (it->second)["Loads Spanning across Cache Lines Impact"];  
+  (it->second)["Store-Fwd Stalls Impact"] = (it->second)["Loads Blocked by Unknown Address Store Impact"] + (it->second)["Loads Overlapped with Stores Impact"] + (it->second)["Loads Spanning across Cache Lines Impact"];
   (it->second)["Counted Stalled Cycles"] = (it->second)["L2 Miss Impact"] + (it->second)["L2 Hit Impact"] + (it->second)["LCP Stalls Impact"] + (it->second)["L1 DTLB Miss Impact"] + (it->second)["Store-Fwd Stalls Impact"];
   (it->second)["Instructions Retired"] = (it->second)["INSTRUCTIONS_RETIRED"];
   (it->second)["ITLB Miss Rate in %"] = ((it->second)["ITLB_MISS_RETIRED"]/(it->second)["INSTRUCTIONS_RETIRED"])*100;
@@ -488,14 +488,14 @@ void calc_core_deriv_values(double totalCycles)
   (it->second)["Store Instructions"] = (it->second)["INST_RETIRED:STORES"];
   (it->second)["Other Instructions"] = (it->second)["INST_RETIRED:OTHER"] - (it->second)["SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"] - (it->second)["BRANCH_INSTRUCTIONS_RETIRED"];
   (it->second)["% of Mispredicted Branches"] = ((it->second)["MISPREDICTED_BRANCH_RETIRED"]/(it->second)["BRANCH_INSTRUCTIONS_RETIRED"])*100;
-  (it->second)["Packed SIMD Computational Instructions"] = (it->second)["SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"]; 
-  (it->second)["Counted Instructions Retired"] = (it->second)["Branch Instructions"] + (it->second)["Load Instructions"] + (it->second)["Store Instructions"] + (it->second)["Other Instructions"] + (it->second)["Packed SIMD Computational Instructions"]; 
+  (it->second)["Packed SIMD Computational Instructions"] = (it->second)["SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"];
+  (it->second)["Counted Instructions Retired"] = (it->second)["Branch Instructions"] + (it->second)["Load Instructions"] + (it->second)["Store Instructions"] + (it->second)["Other Instructions"] + (it->second)["Packed SIMD Computational Instructions"];
   (it->second)["CPI"] = (it->second)["UNHALTED_CORE_CYCLES"]/(it->second)["INSTRUCTIONS_RETIRED"];
 
   double localPerformanceImprovement = (it->second)["CPI"]/EXPECTED_CPI;
   double cyclesAfterImprovement = (it->second)["UNHALTED_CORE_CYCLES"]/localPerformanceImprovement;
   double totalCyclesAfterImprovement = totalCycles-(it->second)["UNHALTED_CORE_CYCLES"]+cyclesAfterImprovement;
-  (it->second)["iMargin"] = 100-(totalCyclesAfterImprovement/totalCycles)*100; 
+  (it->second)["iMargin"] = 100-(totalCyclesAfterImprovement/totalCycles)*100;
 
   (it->second)["% of Total Cycles"] = (it->second)["RS_UOPS_DISPATCHED CMASK=1 INV=1"]*100/(it->second)["UNHALTED_CORE_CYCLES"];
   (it->second)["L2 Miss % of counted Stalled Cycles"] =(it->second)["L2 Miss Impact"]*100/(it->second)["Counted Stalled Cycles"];
@@ -587,7 +587,7 @@ void init_nhm_caa_events_displ()
  nhm_caa_events_displ.push_back("");
  nhm_caa_events_displ.push_back("Cycles IFETCH served by L3 (No Snoop)");
  nhm_caa_events_displ.push_back("L3 (No Snoop) IFECTHes % Impact");
- nhm_caa_events_displ.push_back("");  
+ nhm_caa_events_displ.push_back("");
  nhm_caa_events_displ.push_back("Total Branch Instructions Executed");
  nhm_caa_events_displ.push_back("% of Mispredicted Branches");
  nhm_caa_events_displ.push_back("");
@@ -642,12 +642,12 @@ void calc_nhm_deriv_values(double totalCycles)
   (it->second)["L3 Miss -> Remote DRAM Hit Impact"] = (it->second)["MEM_UNCORE_RETIRED:REMOTE_DRAM"] * I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES;
   (it->second)["L3 Miss -> Remote Cache Hit Impact"] = (it->second)["MEM_UNCORE_RETIRED:REMOTE_CACHE_LOCAL_HOME_HIT"] * I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES;
   (it->second)["L3 Miss -> Total Impact"] = (it->second)["L3 Miss -> Local DRAM Hit Impact"] + (it->second)["L3 Miss -> Remote DRAM Hit Impact"] + (it->second)["L3 Miss -> Remote Cache Hit Impact"];
-  (it->second)["L1 DTLB Miss Impact"] = (it->second)["DTLB_LOAD_MISSES:WALK_COMPLETED"] * I7_L1_DTLB_WALK_COMPLETED_CYCLES;  
+  (it->second)["L1 DTLB Miss Impact"] = (it->second)["DTLB_LOAD_MISSES:WALK_COMPLETED"] * I7_L1_DTLB_WALK_COMPLETED_CYCLES;
   (it->second)["Counted Stalled Cycles due to Load Ops"] = (it->second)["L3 Miss -> Total Impact"] + (it->second)["L2 Hit Impact"] + (it->second)["L1 DTLB Miss Impact"] + (it->second)["L3 Unshared Hit Impact"] + (it->second)["L2 Other Core Hit Modified Impact"] + (it->second)["L2 Other Core Hit Impact"];
   (it->second)["Cycles spent during DIV & SQRT Ops"] = (it->second)["ARITH:CYCLES_DIV_BUSY"];
   (it->second)["Total Counted Stalled Cycles"] = (it->second)["Counted Stalled Cycles due to Load Ops"] + (it->second)["Cycles spent during DIV & SQRT Ops"];
   (it->second)["Stalled Cycles"] = (it->second)["Total Counted Stalled Cycles"]; //TO BE FIXED when UOPS_EXECUTED:0x3f is fixed!!
-  (it->second)["% of Total Cycles"] = (it->second)["Stalled Cycles"] * 100 / (it->second)["CPU_CLK_UNHALTED:THREAD_P"]; //TO BE FIXED!! see above 
+  (it->second)["% of Total Cycles"] = (it->second)["Stalled Cycles"] * 100 / (it->second)["CPU_CLK_UNHALTED:THREAD_P"]; //TO BE FIXED!! see above
   (it->second)["L3 Miss % of Load Stalls"] = (it->second)["L3 Miss -> Total Impact"] * 100 / (it->second)["Counted Stalled Cycles due to Load Ops"];
   (it->second)["L2 Hit % of Load Stalls"] = (it->second)["L2 Hit Impact"] * 100 / (it->second)["Counted Stalled Cycles due to Load Ops"];
   (it->second)["L1 DTLB Miss % of Load Stalls"] = (it->second)["L1 DTLB Miss Impact"] * 100 / (it->second)["Counted Stalled Cycles due to Load Ops"];
@@ -678,7 +678,7 @@ void calc_nhm_deriv_values(double totalCycles)
   (it->second)["% of IFETCHes served by L3 (No Snoop)"] = (it->second)["OFFCORE_RESPONSE_0:DMND_IFETCH:UNCORE_HIT"] * 100 / (it->second)["L2_RQSTS:IFETCH_MISS"];
   (it->second)["% of L2 IFETCH misses"] = (it->second)["L2_RQSTS:IFETCH_MISS"] * 100 / ((it->second)["L2_RQSTS:IFETCH_MISS"] + (it->second)["L2_RQSTS:IFETCH_HIT"]);
   (it->second)["L1 ITLB Miss Impact"] = (it->second)["ITLB_MISSES:WALK_COMPLETED"] * I7_L1_ITLB_WALK_COMPLETED_CYCLES;
-  
+
   (it->second)["Total Branch Instructions Executed"] = (it->second)["BR_INST_EXEC:ANY"];
   (it->second)["% of Mispredicted Branches"] = (it->second)["BR_MISP_EXEC:ANY"] * 100 / (it->second)["BR_INST_EXEC:ANY"];
   (it->second)["Direct Near Calls % of Total Branches Executed"] = (it->second)["BR_INST_EXEC:DIRECT_NEAR_CALL"] * 100 / (it->second)["Total Branch Instructions Executed"];
@@ -690,7 +690,7 @@ void calc_nhm_deriv_values(double totalCycles)
   (it->second)["Total Branch Instructions Retired"] = (it->second)["BR_INST_RETIRED:ALL_BRANCHES"];
   (it->second)["Conditionals % of Total Branches Retired"] = (it->second)["BR_INST_RETIRED:CONDITIONAL"] * 100 / (it->second)["Total Branch Instructions Retired"];
   (it->second)["Near Calls % of Total Branches Retired"] = (it->second)["BR_INST_RETIRED:NEAR_CALL"] * 100 / (it->second)["Total Branch Instructions Retired"];
-  
+
   (it->second)["Instruction Starvation % of Total Cycles"] = ((it->second)["UOPS_ISSUED:ANY CMASK=1 INV=1"] - (it->second)["RESOURCE_STALLS:ANY"])* 100 / (it->second)["CPU_CLK_UNHALTED:THREAD_P"];
   (it->second)["% of Total Cycles spent handling FP exceptions"] = (it->second)["UOPS_DECODED:MS CMASK=1"]* 100 / (it->second)["CPU_CLK_UNHALTED:THREAD_P"];
   (it->second)["# of Instructions per Call"] = (it->second)["INST_RETIRED:ANY_P"] / (it->second)["BR_INST_EXEC:NEAR_CALLS"];
@@ -709,7 +709,7 @@ void calc_nhm_deriv_values(double totalCycles)
   double cyclesAfterImprovement = (it->second)["CPU_CLK_UNHALTED:THREAD_P"]/localPerformanceImprovement;
   double totalCyclesAfterImprovement = totalCycles-(it->second)["CPU_CLK_UNHALTED:THREAD_P"]+cyclesAfterImprovement;
   (it->second)["iMargin"] = 100-(totalCyclesAfterImprovement/totalCycles)*100;
- 
+
   (it->second)["Load % of all Instructions"] = (it->second)["MEM_INST_RETIRED:LOADS"] * 100 / (it->second)["INST_RETIRED:ANY_P"];
   (it->second)["Store % of all Instructions"] = (it->second)["MEM_INST_RETIRED:STORES"] * 100 / (it->second)["INST_RETIRED:ANY_P"];
   (it->second)["Branch % of all Instructions"] = (it->second)["BR_INST_RETIRED:ALL_BRANCHES"] * 100 / (it->second)["INST_RETIRED:ANY_P"];
@@ -854,7 +854,7 @@ void html_special_chars(const char *s, char *s_mod)
 // parses the argument and returns just the function name without arguments or return types
 const char *func_name(const char *demangled_symbol)
 {
- char *operator_string_begin = strstr(demangled_symbol, "operator");
+ char *operator_string_begin = const_cast<char *>(strstr(demangled_symbol, "operator"));
  if(operator_string_begin != NULL)
  {
   char *operator_string_end = operator_string_begin+8;
@@ -868,17 +868,17 @@ const char *func_name(const char *demangled_symbol)
   {
    operator_string_end+=6;
    *operator_string_end='\0';
-  } 
+  }
   else if(strstr(operator_string_end, "new[]")==operator_string_end)
   {
    operator_string_end+=5;
    *operator_string_end='\0';
-  } 
+  }
   else if(strstr(operator_string_end, "new")==operator_string_end)
   {
    operator_string_end+=3;
    *operator_string_end='\0';
-  } 
+  }
   else if(strstr(operator_string_end, ">>=")==operator_string_end)
   {
    operator_string_end+=3;
@@ -1018,7 +1018,7 @@ const char *func_name(const char *demangled_symbol)
   {
    operator_string_end+=1;
    *operator_string_end='\0';
-  }   
+  }
   else if(strstr(operator_string_end, "+")==operator_string_end)
   {
    operator_string_end+=1;
@@ -1071,7 +1071,7 @@ const char *func_name(const char *demangled_symbol)
   }
   return operator_string_begin;
  }
- char *end_of_demangled_name = strrchr(demangled_symbol, ')');
+ char *end_of_demangled_name = const_cast<char *>(strrchr(demangled_symbol, ')'));
  if(end_of_demangled_name != NULL)
  {
   int pars = 1;
@@ -1121,7 +1121,7 @@ const char *func_name(const char *demangled_symbol)
    c = *(--end_of_func_name);
   }
   return ++end_of_func_name;
- } 
+ }
  return demangled_symbol;
 }
 
@@ -1174,7 +1174,7 @@ void put_S_module(S_module *cur_module, const char *dir)
   fprintf(module_file, "<ul>\n");
   for(std::vector<std::string>::const_iterator it = S_events.begin(); it != S_events.end(); ++it)
   {
-   fprintf(module_file, "<li><a href=\"#%s\">%s</a></li>\n", it->c_str(), it->c_str());  
+   fprintf(module_file, "<li><a href=\"#%s\">%s</a></li>\n", it->c_str(), it->c_str());
   }
   fprintf(module_file, "</ul>\n");
  }// if(result == modules_tot_samples.end()) //not found
@@ -1246,7 +1246,7 @@ void put_S_module(S_module *cur_module, const char *dir)
   char temp[MAX_SYM_LENGTH];
   bzero(temp, MAX_SYM_LENGTH);
   strcpy(temp, sym);
-  strcpy(simple_sym, (func_name(temp)));      
+  strcpy(simple_sym, (func_name(temp)));
   if(strrchr(lib, '/')!=NULL && *(strrchr(lib, '/')+1)!='\0')
   {
    strcpy(simple_lib, strrchr(lib, '/')+1);
@@ -1304,7 +1304,7 @@ int read_S_file(const char *dir, const char *filename)
  bzero(event, MAX_EVENT_NAME_LENGTH);
  bzero(cur_module_name, MAX_MODULE_NAME_LENGTH);
  bzero(arch, MAX_ARCH_NAME_LENGTH);
- 
+
  S_module *cur_module = new S_module();
  unsigned int module_num = 0;
 
@@ -1341,7 +1341,7 @@ int read_S_file(const char *dir, const char *filename)
      fprintf(stderr, "ERROR: Invalid module name. \nLINE: %s\naborting...\n", line);
      exit(1);
     }
-    bzero(cur_module_name, MAX_MODULE_NAME_LENGTH);    
+    bzero(cur_module_name, MAX_MODULE_NAME_LENGTH);
     strncpy(cur_module_name, line, strlen(line)-strlen(end_sym));
     cur_module->init(cur_module_name, arch, event, cmask, inv, sp);
     cur_module->set_total(atoi(end_sym+1));
@@ -1384,7 +1384,7 @@ int read_S_file(const char *dir, const char *filename)
       {
        strcpy(final_sym, temp_sym);
       }
-     } 
+     }
      else
      {
       strcpy(final_sym, "???");
@@ -1414,7 +1414,7 @@ int read_S_file(const char *dir, const char *filename)
   fprintf(stderr, "ERROR: Unable to open input file: %s\naborting...\n", filename);
   exit(1);
  }
- delete cur_module; //delete it! 
+ delete cur_module; //delete it!
  return 0;
 }
 
@@ -1581,7 +1581,7 @@ void put_C_header(FILE *fp, std::vector<std::string> &columns)
  for(std::vector<std::string>::const_iterator it = columns.begin(); it != columns.end(); ++it)
  {
   if(strlen(it->c_str())==0) fprintf(fp, "<th bgcolor=\"#FFFFFF\">&nbsp;</th>\n");
-  else fprintf(fp, "<th>%s</th>\n", (*it).c_str());  
+  else fprintf(fp, "<th>%s</th>\n", (*it).c_str());
  }
  fprintf(fp, "</tr>\n");
  return;
@@ -1604,7 +1604,7 @@ void put_C_modules(FILE *fp, std::vector<std::string> &columns)
    else
    {
     if((it->second).find(*jt) == (it->second).end())
-    {    
+    {
      fprintf(stderr, "ERROR: Cannot find derivate value \"%s\"!!!\naborting...\n", (*jt).c_str());
      exit(1);
     }
@@ -1628,7 +1628,7 @@ void put_C_header_csv(FILE *fp, std::vector<std::string> &columns)
  for(std::vector<std::string>::const_iterator it = columns.begin(); it != columns.end(); ++it)
  {
   if(strlen(it->c_str())==0);
-  else fprintf(fp, ",%s", (*it).c_str());  
+  else fprintf(fp, ",%s", (*it).c_str());
  }
  fprintf(fp, "\n");
  return;
@@ -1645,7 +1645,7 @@ void put_C_modules_csv(FILE *fp, std::vector<std::string> &columns)
    else
    {
     if((it->second).find(*jt) == (it->second).end())
-    {    
+    {
      fprintf(stderr, "ERROR: Cannot find derivate value \"%s\"!!!\naborting...\n", (*jt).c_str());
      exit(1);
     }
@@ -1733,7 +1733,7 @@ double getTotalCycles()
 }
 
 // main()
-// takes as argument the directory containing results 
+// takes as argument the directory containing results
 // and produces the HTML directory inside of it containing browsable statistics
 int main(int argc, char *argv[])
 {
@@ -1755,7 +1755,7 @@ int main(int argc, char *argv[])
  strcpy(dir, argv[1]);
  if(!csv)
  {
-  strcat(dir, "/HTML"); 
+  strcat(dir, "/HTML");
   int res = mkdir(dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
   if(res!=0)
   {
@@ -1883,7 +1883,7 @@ int main(int argc, char *argv[])
   if(!csv) put_C_footer(fp);
   fclose(fp);
  }
- else 
+ else
  {
   if(!csv)
   {
diff --git a/GaudiRelease/cmt/requirements b/GaudiRelease/cmt/requirements
index b0afc1520307a24924f27e81d9f8cc7f3269d949..55b17fcc6135a906a6f16ba089563f65d6eb1394 100644
--- a/GaudiRelease/cmt/requirements
+++ b/GaudiRelease/cmt/requirements
@@ -3,11 +3,11 @@
 
 package GaudiRelease
 
-version v22r0
+version v22r2
 branches doc cmt
 
 # CMT and Gaudi policy
-use GaudiPolicy	   v11r0
+use GaudiPolicy	   v11r2
 
 # Note for conditional use statements: only the tags which are defined
 # at the level of CMT (and CMTSITE) can be used. This means that
@@ -16,36 +16,36 @@ use GaudiPolicy	   v11r0
 # the level of the package itself with a "macro_remove constituents"
 
 # Gaudi executable
-use Gaudi          v22r0
+use Gaudi          v22r2
 
 # Gaudi libraries - generic
-use GaudiKernel    v27r12
-use GaudiSvc       v18r12
-use GaudiAud       v9r3
-use GaudiAlg       v13r5
-use GaudiGSL       v7r8
-use GaudiUtils     v3r11
+use GaudiKernel    v27r14
+use GaudiSvc       v18r14
+use GaudiAud       v9r4
+use GaudiAlg       v13r7
+use GaudiGSL       v7r10
+use GaudiUtils     v3r12
 
 # Technology-specific Persistency packages
 #use HbookCnv       v15r0
-use RootHistCnv    v10r6
-use GaudiPoolDb    v5r10
+use RootHistCnv    v10r7
+use GaudiPoolDb    v5r12
 use GaudiPython    v11r0
 
 # Container package specifying the minimum set of core packages
-use GaudiSys       v22r0
+use GaudiSys       v22r2
 
 # Monitoring utility. Can use also MonaLisa
-use GaudiMonitor   v2r7
+use GaudiMonitor   v2r8
 
 # Profiling components and tools
 use GaudiProfiling v1r0
 
 # Multi Processing libraries
-use GaudiMP v1r0
+use GaudiMP v1r1
 
 # Examples packages
-use GaudiExamples   v22r0
+use GaudiExamples   v22r2
 
 
 # Atlas packages
@@ -82,6 +82,7 @@ apply_pattern LHCb_external pkg=Qt
 apply_pattern LHCb_external pkg=xqilla
 apply_pattern LHCb_external pkg=neurobayes_expert
 apply_pattern LHCb_external pkg=graphviz
+apply_pattern LHCb_external pkg=Frontier_Client
 #apply_pattern LHCb_external pkg=
 
 # -- LHCbGrid external packages --
diff --git a/GaudiRelease/cmt/tag_release.py b/GaudiRelease/cmt/tag_release.py
index ec3912bf5a26b1d003a6a3ad5f93b9d98b3afb55..1ad7239781555081219694d06dc1f7e6ed052965 100644
--- a/GaudiRelease/cmt/tag_release.py
+++ b/GaudiRelease/cmt/tag_release.py
@@ -50,7 +50,7 @@ def svn_exists(url):
     l = [x.rstrip("/") for x in svn_ls(d)]
     return b in l
 
-def checkout_structure(url, proj):
+def checkout_structure(url, proj, branch):
     def checkout_level(base):
         dirs = ["%s/%s" % (base, d) for d in svn_ls(base) if d.endswith("/")]
         apply(svn, ["up", "-N"] + dirs).wait()
@@ -61,14 +61,26 @@ def checkout_structure(url, proj):
     old_dir = os.getcwd()
     os.chdir(root)
     svn("up", "-N", proj).wait()
-    for base in [proj, proj + "/trunk"]:
+    br = [proj] + branch.split("/")
+    for base in [ "/".join(br[:n+1]) for n in range(len(br))]:
         checkout_level(base)
     checkout_level(proj + "/tags")
     os.chdir(old_dir)
     return root
 
 def main():
-    use_pre = len(sys.argv) > 1 and 'pre' in  sys.argv
+    from optparse import OptionParser
+    parser = OptionParser()
+    parser.add_option("--pre", action = "store_true",
+                      help = "Create -pre tags instead of final tags.")
+    parser.add_option("-b", "--branch",
+                      help = "Use the given (global) branch as source for the tags instead of the trunk")
+    opts, args = parser.parse_args()
+    if opts.branch:
+        opts.branch = "/".join(["branches", "GAUDI", opts.branch])
+    else:
+        opts.branch = "trunk"
+
     url = "svn+ssh://svn.cern.ch/reps/gaudi"
     proj = "Gaudi"
     container = "GaudiRelease"
@@ -78,7 +90,7 @@ def main():
     try:
         os.chdir(tempdir)
         # prepare repository structure (and move to its top level)
-        os.chdir(checkout_structure(url, proj))
+        os.chdir(checkout_structure(url, proj, opts.branch))
 
         # note that the project does not have "-pre"
         pvers = "%s_%s" % (proj.upper(), packages[container])
@@ -87,7 +99,8 @@ def main():
         ptagdir = "%s/tags/%s/%s" % (proj, proj.upper(), pvers)
         if not svn_exists(ptagdir):
             svn("mkdir", ptagdir).wait()
-            svn("cp", "%s/trunk/cmt" % proj, ptagdir + "/cmt").wait()
+            svn("cp", "/".join([proj, opts.branch, "cmt"]), ptagdir + "/cmt").wait()
+            svn("cp", "/".join([proj, opts.branch, "Makefile.cmt"]), ptagdir + "/Makefile.cmt").wait()
 
         # prepare package tags
         tag_re = re.compile(r"^v(\d+)r(\d+)(?:p(\d+))?$")
@@ -97,22 +110,22 @@ def main():
             # I have to make the tag if it doesn't exist and (if we use -pre tags)
             # neither the -pre tag exists.
             no_tag = not svn_exists(pktagdir)
-            make_tag = no_tag or (use_pre and no_tag and not svn_exists(pktagdir + "-pre"))
+            make_tag = no_tag or (opts.pre and no_tag and not svn_exists(pktagdir + "-pre"))
             if make_tag:
-                if use_pre:
+                if opts.pre:
                     pktagdir += "-pre"
-                svn("cp", "%s/trunk/%s" % (proj, p), pktagdir).wait()
+                svn("cp", "/".join([proj, opts.branch, p]), pktagdir).wait()
                 # Atlas type of tag
                 tagElements = tag_re.match(tag)
                 if tagElements:
                     tagElements = "-".join([ "%02d" % int(el or "0") for el in tagElements.groups() ])
                     pktagdir = "%s/tags/%s/%s-%s" % (proj, p, p, tagElements)
-                    svn("cp", "%s/trunk/%s" % (proj, p), pktagdir).wait()
+                    svn("cp", "/".join([proj, opts.branch, p]), pktagdir).wait()
             else:
                 if not no_tag:
                     svn("up", "-N", pktagdir).wait() # needed for the copy in the global tag
 
-        if not use_pre:
+        if not opts.pre:
             # prepare the full global tag too
             for p in packages:
                 tag = packages[p]
diff --git a/GaudiRelease/doc/DoxyFile.cfg b/GaudiRelease/doc/DoxyFile.cfg
index b32c750b3659def720dd269d3cae04855ba0d174..5d0131f9ac77d0e17ef0dda38709db76929d6131 100644
--- a/GaudiRelease/doc/DoxyFile.cfg
+++ b/GaudiRelease/doc/DoxyFile.cfg
@@ -17,3 +17,7 @@ INPUT            = $(GAUDI_HOME)
 
 #this line should be placed after the DoxyCommon.cfg inclusion
 FILE_PATTERNS    += *DoxygenMain.doc
+
+# Disable the multi-thread feature of Doxygen because it may cause problems
+# (it seems it has still problems in 1.7.2 on large projects)
+DOT_NUM_THREADS = 1
diff --git a/GaudiRelease/doc/release.notes b/GaudiRelease/doc/release.notes
index 59c69ca032bb55c3d3f6aea4b29a3f9320e2cdab..f41edbaa12427e04a7db17b7271688ac7672cd0b 100644
--- a/GaudiRelease/doc/release.notes
+++ b/GaudiRelease/doc/release.notes
@@ -1,6 +1,17 @@
 Package: GaudiRelease
 Manatiner: Marco Clemencic
 
+! 2011-04-20 - Marco Clemencic
+ - Updated tag_release.py script to allow tagging from a (global) branch.
+
+============================= GaudiRelease v22r2 =============================
+! 2011-04-14 - Marco Clemencic
+ - Switched to LCGCMT 60b and added Frontier_Client to the LHCb externals.
+
+! 2011-02-28 - Marco Clemencic
+ - Disable Doxygen multi-thread feature.
+
+============================= GaudiRelease v22r1 =============================
 ============================= GaudiRelease v22r0 =============================
 ! 2011-01-17 - Marco Clemencic
  - Removed a couple of obsolete LHCb-specific packages from the requirements.
diff --git a/GaudiRelease/doc/release.notes.html b/GaudiRelease/doc/release.notes.html
index 1c13616dc8a5405139ec0ea0932d9501abcb9217..b90594b26a90c44b96c5021cbe406696843f0f32 100644
--- a/GaudiRelease/doc/release.notes.html
+++ b/GaudiRelease/doc/release.notes.html
@@ -38,6 +38,140 @@ Package Coordinator: Marco Clemencic, Charles Leggett<br>
 Purpose: Gaudi common set of packages<br><br>
 </pre>
 <!-- ====================================================================== -->
+<h2><a name="v22r2">Gaudi v22r2</a> (2011-04-20)</h2>
+<h3>Externals version: <a href="http://lcgsoft.cern.ch/index.py?page=cfg_overview&cfg=60b">LCGCMT_60b</a></h3>
+<h3>General Changes</h3>
+<ul>
+<li>Modified the way dependencies are computed on Unix: make gcc generate them at the same time of the compilation<br/>
+    (<span class="author">Hubert Degaudenzi</span>)</li>
+<li>Fixed VC9 warnings:
+<ul><li>Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.</li>
+     <li>Disabled some warnings.</li></ul>
+    (<span class="author">Marco Clemencic</span>)</li>
+<li>Introduced two new incidents: BeginProcessing and EndProcessing.
+   They are needed to reintroduce the signals around the processing loop as
+   it was the case for BeginEvent and EndEvent before GaudiSvc v17r0.<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+<li>Patch #4722: detect unprotected DEBUG and VERBOSE messages<br/>
+    (<span class="author">Charles Leggett, Marco Clemencic</span>)</li>
+</ul>
+<h3>Packages Changes</h3>
+<ul>
+<li>GaudiPolicy (v11r2):
+<ul>
+<li>Improvements in the QMTest code and in the HTML representation of the results<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+<li>Patch #4727: Add NDEBUG macro for opt builds<br/>
+    (<span class="author">Charles Leggett, Marco Clemencic</span>)</li>
+<li>Minor fix in the link statements on MacOSX<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+<li>Get the lib_no_static_fragment macro to work with CMT &gt; v20<br/>
+    (<span class="author">Charles Leggett</span>)</li>
+</ul>
+</li>
+<li>GaudiKernel (v27r14):
+<ul>
+<li>Added LIKELY and UNLIKELY macros to make it possible to hint the compiler about branch optimizations.<br/>
+    (<span class="author">Charles Leggett</span>)</li>
+<li>Patch #4820: fix for bug #80947 (access system-memory information, if process memory is &gt; 4GB.)<br/>
+    (<span class="author">Markus Frank</span>)</li>
+<li>Modified DirSearchPath to remove <code>boost::filesystem::no_check</code>. It is not
+   needed and breaks on MacOSX in debug mode (at least with Boost 1.44).
+   See patch #4735.<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiSvc (v18r14):
+<ul>
+<li>Patch #4819: THistSvc: protect DEBUG messages, add AutoFlush property.<br/>
+    (<span class="author">Charles Leggett</span>)</li>
+</ul>
+</li>
+<li>GaudiAlg (v13r7):
+<ul>
+<li>Patch #4814: Move EventNodeKiller algorithm from LHCb to Gaudi.<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+<li>Patch #4711: fixed doxygen comment<br/>
+    (<span class="author">Patrick Koppenburg</span>)</li>
+</ul>
+</li>
+<li>GaudiGSL (v7r10):
+<ul>
+<li>Excluded from the dictionaries few classes that are causing troubles on Windows (see ROOT bug #78837).<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiMP (v1r1):
+<ul>
+<li>Fixes to work with LHCb Brunel (see release notes of the package)
+    (<span class="author">Pere Mato</span>)</li>
+</ul>
+</li>
+<li>GaudiAud (v9r4):
+<ul>
+<li>Fixed bug #79627: ChronoAuditor broken for start/stop event types.<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiRelease (v22r2):
+<ul>
+<li>Switched to LCGCMT 60b and added Frontier_Client to the LHCb externals.<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+</ul>
+<!-- ====================================================================== -->
+<h2><a name="v22r1">Gaudi v22r1</a> (2011-02-21)</h2>
+<h3>Externals version: <a href="http://lcgsoft.cern.ch/index.py?page=cfg_overview&cfg=60a">LCGCMT_60a</a></h3>
+<h3>General Changes</h3>
+<ul>
+<li>Updated to pick up the patch release of ROOT (with a fixed memory leak)</li>
+</ul>
+<h3>Packages Changes</h3>
+<ul>
+<li>GaudiPolicy (v11r1):
+<ul>
+<li>Fixed bug #77806: createProjVersHeader breaks with Atlas style tags
+    allow Atlas style GaudiPKJ-XX-YY-ZZ tags<br/>
+    (<span class="author">Charles Leggett</span>)</li>
+</ul>
+</li>
+<li>GaudiKernel (v27r13):
+<ul>
+<li>Fixed bug #77534: this-&gt; needed in Property.h<br/>
+    (<span class="author">Charles Leggett</span>)</li>
+</ul>
+</li>
+<li>GaudiSvc (v18r13):
+<ul>
+<li>Added another special case for the order of service finalization
+    (NTupleSvc after ToolSvc, because of GaudiTupleTool)<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiPoolDb (v5r11):
+<ul>
+<li>Patch #4662: Fix for ROOT bug #77747<br/>
+    (<span class="author">Markus Frank, Marco Clemencic</span>)</li>
+<li>Fixed bug #78456: warning/error when building GaudiPoolDb<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiAlg (v13r6):
+<ul>
+<li>Fixes for ICC<br/>
+    (<span class="author">Marco Clemencic</span>)</li>
+</ul>
+</li>
+<li>GaudiGSL (v7r9):
+<ul>
+<li>Fixed bug #77948: GaudiGSL/requirements calls for lcg_dictionary<br/>
+    (<span class="author">Charles Leggett, Marco Clemencic</span>)</li>
+</ul>
+</li>
+</ul>
+<!-- ====================================================================== -->
 <h2><a name="v22r0">Gaudi v22r0</a> (2011-01-19)</h2>
 <h3>Externals version: <a href="http://lcgsoft.cern.ch/index.py?page=cfg_overview&cfg=60">LCGCMT_60</a></h3>
 <h3>General Changes</h3>
diff --git a/GaudiSvc/cmt/requirements b/GaudiSvc/cmt/requirements
index d45943933e75c0edf4d615a94e403e8463cd8abd..6a936f94bb9d3d09f2bf8b6092549b7dca64dddc 100755
--- a/GaudiSvc/cmt/requirements
+++ b/GaudiSvc/cmt/requirements
@@ -1,5 +1,5 @@
 package GaudiSvc
-version v18r12
+version v18r14
 
 branches src cmt doc
 use GaudiKernel *
diff --git a/GaudiSvc/doc/release.notes b/GaudiSvc/doc/release.notes
index 0224274a6faa9dac0895c0dbeb104d2b858ced64..23c11716366769a624fd5ea24d2493137b8cc713 100644
--- a/GaudiSvc/doc/release.notes
+++ b/GaudiSvc/doc/release.notes
@@ -1,6 +1,35 @@
 Package: GaudiSvc
 Package manager : Marco Clemencic
 
+============================== GaudiSvc v18r14 ===============================
+! 2011-04-15 - Charles Leggett
+ - Patch #4819: THistSvc: protect DEBUG messages, add AutoFlush property
+   This patch adds a new integer property AutoFlush to the THistSvc to set the
+   ROOT AutoFlush value for TTrees, and protects DEBUG messages so that they
+   only get created if the logging level is sufficiently low.
+
+! 2011-04-15 - Marco Clemencic
+ - Fixed a warning triggered by the macro NDEBUG.
+
+! 2011-04-08 - Marco Clemencic
+ - Introduced two new incidents: BeginProcessing and EndProcessing.
+   They are needed to reintroduce the signals around the processing loop as
+   it was the case for BeginEvent and EndEvent before GaudiSvc v17r0.
+
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+
+! 2011-03-16 - Charles Leggett, Marco Clemencic
+ - Patch #4722: detect unprotected DEBUG and VERBOSE messages
+
+============================== GaudiSvc v18r13 ===============================
+! 2011-02-18 - Marco Clemencic
+ - Added another special case for the order of service finalization
+   (NTupleSvc after ToolSvc, because of GaudiTupleTool).
+
 ============================== GaudiSvc v18r12 ===============================
 ! 2011-01-20 - Marco Clemencic
  - Fixed bug #74981: failure in algorithm initialization doesn't stop
diff --git a/GaudiSvc/src/ApplicationMgr/ApplicationMgr.cpp b/GaudiSvc/src/ApplicationMgr/ApplicationMgr.cpp
index 05234bf8b2b8101718f84bf36a3a52642af7cd1e..5fd4518b1c4788f9057cb6742a4ead13b67cc6dc 100644
--- a/GaudiSvc/src/ApplicationMgr/ApplicationMgr.cpp
+++ b/GaudiSvc/src/ApplicationMgr/ApplicationMgr.cpp
@@ -21,17 +21,20 @@
 #include "GaudiKernel/ThreadGaudi.h"
 
 #include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/Time.h"
+#include "GaudiKernel/System.h"
+using System::getEnv;
+using System::isEnvSet;
 
 #include <algorithm>
 #include <cassert>
 #include <ctime>
 #include <limits>
 
-DECLARE_OBJECT_FACTORY(ApplicationMgr)
-
 static const char* s_eventloop = "EventLoop";
 static const char* s_runable   = "Runable";
 
+DECLARE_OBJECT_FACTORY(ApplicationMgr)
 
 // Implementation class for the Application Manager. In this way the
 // ApplicationMgr class is a fully insulated concrete class. Clients
@@ -233,9 +236,9 @@ StatusCode ApplicationMgr::i_startup() {
       return sc;
     }
   }
-  else if ( 0 != getenv("JOBOPTPATH") ) {// Otherwise the Environment JOBOPTPATH
+  else if ( isEnvSet("JOBOPTPATH") ) {// Otherwise the Environment JOBOPTPATH
     sc = jobOptsIProp->setProperty (StringProperty("PATH",
-                                                   getenv("JOBOPTPATH")));
+                                                   getEnv("JOBOPTPATH")));
     if( !sc.isSuccess() )   {
       fatal()
            << "Error setting PATH option in JobOptionsSvc from env"
@@ -342,15 +345,11 @@ StatusCode ApplicationMgr::configure() {
     }
 
     // Add the host name and current time to the message
-    time_t t;
-    std::time( &t );
-    tm* localt = std::localtime( &t );
-
     log << MSG::ALWAYS
         << std::endl
         << "                                "
         << "          running on " << System::hostName()
-        << " on " << std::asctime( localt )
+        << " on " << Gaudi::Time::current().format(true) << std::endl
         << "=================================================================="
         << "=================================================================="
         << endmsg;
diff --git a/GaudiSvc/src/ApplicationMgr/EventLoopMgr.cpp b/GaudiSvc/src/ApplicationMgr/EventLoopMgr.cpp
index 32a372ff9cc47ca8cb07d4eead48f45f5b532768..6897573b96ebfc8d50d60db9dd637eecd981f389 100644
--- a/GaudiSvc/src/ApplicationMgr/EventLoopMgr.cpp
+++ b/GaudiSvc/src/ApplicationMgr/EventLoopMgr.cpp
@@ -281,7 +281,6 @@ StatusCode EventLoopMgr::finalize()    {
   return StatusCode::SUCCESS;
 }
 
-
 //--------------------------------------------------------------------------------------------
 // executeEvent(void* par)
 //--------------------------------------------------------------------------------------------
@@ -297,7 +296,9 @@ StatusCode EventLoopMgr::executeEvent(void* par)    {
   }
 
   // Execute Algorithms
+  m_incidentSvc->fireIncident(Incident(name(), IncidentType::BeginProcessing));
   StatusCode sc = MinimalEventLoopMgr::executeEvent(par);
+  m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing));
 
   // Check if there was an error processing current event
   if( !sc.isSuccess() ){
diff --git a/GaudiSvc/src/ApplicationMgr/ServiceManager.cpp b/GaudiSvc/src/ApplicationMgr/ServiceManager.cpp
index d78037b3646cc66be1398e06750728615e90d291..3aeb03680db7c5d41b708c09cd9200548f036aa1 100644
--- a/GaudiSvc/src/ApplicationMgr/ServiceManager.cpp
+++ b/GaudiSvc/src/ApplicationMgr/ServiceManager.cpp
@@ -13,8 +13,6 @@
 #include <iostream>
 #include <cassert>
 
-DECLARE_OBJECT_FACTORY(ServiceManager)
-
 using ROOT::Reflex::PluginService;
 
 /// needed when no service is found or could be returned
@@ -402,6 +400,7 @@ StatusCode ServiceManager::finalize()
     setPriority("THistSvc",pri_tool-1).ignore();
     setPriority("ChronoStatSvc",pri_tool-2).ignore();
     setPriority("AuditorSvc",pri_tool-3).ignore();
+    setPriority("NTupleSvc",pri_tool-1).ignore();
     setPriority("HistogramDataSvc",pri_tool-1).ignore();
     // Preserve the relative ordering between HistogramDataSvc and HistogramPersistencySvc
     setPriority("HistogramPersistencySvc",pri_tool-2).ignore();
@@ -433,7 +432,7 @@ StatusCode ServiceManager::finalize()
   ListSvc::iterator it;
   while (!tmpList.empty()) {
     it = tmpList.begin();
-    const std::string& name = it->service->name(); 
+    const std::string& name = it->service->name();
     const unsigned long rc = it->service->refCount() - 1; // exclude the count due to the temporary list
     debug() << "---- " << name
             << " (refCount = " << rc << ")" << endmsg;
@@ -491,3 +490,5 @@ bool ServiceManager::loopCheckEnabled() const {
 void ServiceManager::setLoopCheckEnabled(bool en) {
   m_loopCheck = en;
 }
+
+DECLARE_OBJECT_FACTORY(ServiceManager)
diff --git a/GaudiSvc/src/DetectorDataSvc/DetDataSvc.cpp b/GaudiSvc/src/DetectorDataSvc/DetDataSvc.cpp
index b253b572f3ad0a758b74e63e5d3d477d01624e2e..5111dac17facb148774a2ef8e5fa8fc60e490fd4 100644
--- a/GaudiSvc/src/DetectorDataSvc/DetDataSvc.cpp
+++ b/GaudiSvc/src/DetectorDataSvc/DetDataSvc.cpp
@@ -11,6 +11,9 @@
 #include "GaudiKernel/DataObject.h"
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/SvcFactory.h"
+#include "GaudiKernel/System.h"
+using System::isEnvSet;
+using System::getEnv;
 
 // Instantiation of a static factory class used by clients to create
 // instances of this service
@@ -61,10 +64,11 @@ StatusCode DetDataSvc::setupDetectorDescription() {
     if( m_detDbLocation.empty() || "empty" == m_detDbLocation ) {
 
       // if the name of DBlocation is not given - construct it!
-	    // by retrieving the value of XMLDDBROOT
+	  // by retrieving the value of XMLDDBROOT
 
-      if ( 0 != getenv("XMLDDDBROOT") ) {
-        m_detDbLocation  = getenv("XMLDDDBROOT");
+      /// @todo: remove references to obsolete package XMLDDDBROOT
+      if ( isEnvSet("XMLDDDBROOT") ) {
+        m_detDbLocation  = getEnv("XMLDDDBROOT");
         m_detDbLocation += "/DDDB/lhcb.xml";
       }
     }
@@ -304,4 +308,3 @@ StatusCode DetDataSvc::updateObject( DataObject* toUpdate ) {
   return StatusCode::SUCCESS;
 
 }
-
diff --git a/GaudiSvc/src/HistogramSvc/H1D.cpp b/GaudiSvc/src/HistogramSvc/H1D.cpp
index 6f96c178b3418a9043c4cf55789de868ad088871..551187db64f26b6f6f51c854dbb1a855ad1f7003 100644
--- a/GaudiSvc/src/HistogramSvc/H1D.cpp
+++ b/GaudiSvc/src/HistogramSvc/H1D.cpp
@@ -4,12 +4,16 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 #include "H1D.h"
 #include "GaudiPI.h"
 #include "GaudiKernel/StreamBuffer.h"
 #include "GaudiKernel/ObjectFactory.h"
-typedef Gaudi::Histogram1D H1D;
-DECLARE_DATAOBJECT_FACTORY(H1D)
 
 std::pair<DataObject*,AIDA::IHistogram1D*> Gaudi::createH1D(const std::string& title,int nBins,double xlow, double xup)  {
   Histogram1D* p = new Histogram1D(new TH1D(title.c_str(),title.c_str(),nBins,xlow,xup));
@@ -285,3 +289,6 @@ StreamBuffer& Gaudi::Histogram1D::serialize(StreamBuffer& s) const {
   s << stats[0] << stats[1] << stats[2] << stats[3];
   return s;
 }
+
+typedef Gaudi::Histogram1D H1D;
+DECLARE_DATAOBJECT_FACTORY(H1D)
diff --git a/GaudiSvc/src/HistogramSvc/H2D.cpp b/GaudiSvc/src/HistogramSvc/H2D.cpp
index 81bb19ef4d55ea5394f31550ac16cccc656a9597..bc3f6e727746a22547fd65538b57772db5c73c3d 100644
--- a/GaudiSvc/src/HistogramSvc/H2D.cpp
+++ b/GaudiSvc/src/HistogramSvc/H2D.cpp
@@ -4,14 +4,18 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 #include "H2D.h"
 #include "H1D.h"
 #include "P1D.h"
 #include "TH1D.h"
 #include "TProfile.h"
 #include "GaudiKernel/ObjectFactory.h"
-typedef Gaudi::Histogram2D H2D;
-DECLARE_DATAOBJECT_FACTORY(H2D)
 
 std::pair<DataObject*,IHistogram2D*> Gaudi::createH2D(const std::string & title,int binsX,double iminX,double imaxX,int binsY,double iminY,double imaxY) {
   Histogram2D* p = new Histogram2D(new TH2D(title.c_str(),title.c_str(),binsX, iminX, imaxX, binsY, iminY, imaxY));
@@ -34,7 +38,7 @@ std::pair<DataObject*,IHistogram2D*> Gaudi::createH2D(const IHistogram2D& hist)
   return std::pair<DataObject*,IHistogram2D*>(n,n);
 }
 
-std::pair<DataObject*,IHistogram1D*> 
+std::pair<DataObject*,IHistogram1D*>
 Gaudi::slice1DX(const std::string& nam,const IHistogram2D& hist,int first, int last)  {
   TH2 *r = getRepresentation<IHistogram2D,TH2>(hist);
   TH1D *t = r ? r->ProjectionX("_px",first,last,"e") : 0;
@@ -43,7 +47,7 @@ Gaudi::slice1DX(const std::string& nam,const IHistogram2D& hist,int first, int l
   return std::pair<DataObject*,IHistogram1D*>(p,p);
 }
 
-std::pair<DataObject*,IHistogram1D*> 
+std::pair<DataObject*,IHistogram1D*>
 Gaudi::slice1DY(const std::string& nam,const IHistogram2D& hist,int first, int last)  {
   TH2  *r = getRepresentation<IHistogram2D,TH2>(hist);
   TH1D *t = r ? r->ProjectionY("_py",first,last,"e") : 0;
@@ -52,7 +56,7 @@ Gaudi::slice1DY(const std::string& nam,const IHistogram2D& hist,int first, int l
   return std::pair<DataObject*,IHistogram1D*>(p,p);
 }
 
-std::pair<DataObject*,IHistogram1D*> 
+std::pair<DataObject*,IHistogram1D*>
 Gaudi::project1DY(const std::string& nam,const IHistogram2D& hist,int first,int last) {
   TH2 *r = getRepresentation<IHistogram2D,TH2>(hist);
   TH1D *t = r ? r->ProjectionY("_px",first,last,"e") : 0;
@@ -61,7 +65,7 @@ Gaudi::project1DY(const std::string& nam,const IHistogram2D& hist,int first,int
   return std::pair<DataObject*,IHistogram1D*>(p,p);
 }
 
-std::pair<DataObject*,IProfile1D*> 
+std::pair<DataObject*,IProfile1D*>
 Gaudi::profile1DX(const std::string& nam,const IHistogram2D& hist,int first,int last)  {
   TH2 *r = Gaudi::getRepresentation<IHistogram2D,TH2>(hist);
   TProfile *t = r ? r->ProfileX("_pfx",first,last,"e") : 0;
@@ -70,7 +74,7 @@ Gaudi::profile1DX(const std::string& nam,const IHistogram2D& hist,int first,int
   return std::pair<DataObject*,IProfile1D*>(p,p);
 }
 
-std::pair<DataObject*,IProfile1D*> 
+std::pair<DataObject*,IProfile1D*>
 Gaudi::profile1DY(const std::string& nam, const IHistogram2D& hist,int first, int last) {
   TH2 *r = getRepresentation<IHistogram2D,TH2>(hist);
   TProfile *t = r ? r->ProfileY("_pfx",first,last,"e") : 0;
@@ -83,9 +87,9 @@ Gaudi::profile1DY(const std::string& nam, const IHistogram2D& hist,int first, in
 namespace Gaudi {
   template <>
   void * Generic2D<IHistogram2D,TH2D>::cast(const std::string & className) const {
-    if (className == "AIDA::IHistogram2D") 
-      return (IHistogram2D*)this; 
-    else if (className == "AIDA::IHistogram") 
+    if (className == "AIDA::IHistogram2D")
+      return (IHistogram2D*)this;
+    else if (className == "AIDA::IHistogram")
       return (IHistogram*)this;
     return 0;
   }
@@ -97,7 +101,7 @@ namespace Gaudi {
     return int(xx*xx+0.5);
   }
 
-  template <> 
+  template <>
   void Generic2D<AIDA::IHistogram2D,TH2D>::adoptRepresentation(TObject* rep)  {
     TH2D* imp = dynamic_cast<TH2D*>(rep);
     if ( imp )  {
@@ -132,20 +136,20 @@ Gaudi::Histogram2D::Histogram2D(TH2D* rep)  {
 }
 
 bool Gaudi::Histogram2D::setBinContents( int i,int j,int entries,double height,double error,double centreX,double centreY) {
-  m_rep->SetBinContent(rIndexX(i), rIndexY(j), height); 
-  m_rep->SetBinError(rIndexX(i), rIndexY(j), error); 
-  // accumulate sumwx for in range bins 
-  if (i >=0 && j >= 0) { 
-    m_sumwx += centreX*height; 
-    m_sumwy += centreY*height; 
+  m_rep->SetBinContent(rIndexX(i), rIndexY(j), height);
+  m_rep->SetBinError(rIndexX(i), rIndexY(j), error);
+  // accumulate sumwx for in range bins
+  if (i >=0 && j >= 0) {
+    m_sumwx += centreX*height;
+    m_sumwy += centreY*height;
   }
   m_sumEntries += entries;
   return true;
 }
 
 bool  Gaudi::Histogram2D::reset() {
-  m_sumwx = 0; 
-  m_sumwy = 0; 
+  m_sumwx = 0;
+  m_sumwy = 0;
   return Base::reset();
 }
 
@@ -156,48 +160,48 @@ bool  Gaudi::Histogram2D::reset() {
 #pragma warning(disable:1572)
 #endif
 bool Gaudi::Histogram2D::fill ( double x,double y,double weight) {
-  (weight==1.) ? m_rep->Fill(x,y) : m_rep->Fill(x,y,weight ); 
+  (weight==1.) ? m_rep->Fill(x,y) : m_rep->Fill(x,y,weight );
   return true;
 }
 
-bool Gaudi::Histogram2D::setRms(double rmsX,double rmsY) { 
-  m_rep->SetEntries(m_sumEntries); 
-  std::vector<double> stat(11); 
-  stat[0] =  sumBinHeights();  
-  stat[1] = 0; 
-  if(equivalentBinEntries() != 0) 
+bool Gaudi::Histogram2D::setRms(double rmsX,double rmsY) {
+  m_rep->SetEntries(m_sumEntries);
+  std::vector<double> stat(11);
+  stat[0] =  sumBinHeights();
+  stat[1] = 0;
+  if(equivalentBinEntries() != 0)
     stat[1] = (sumBinHeights() * sumBinHeights()) / equivalentBinEntries();
   stat[2] = m_sumwx;
-  double meanX = 0; 
-  if(sumBinHeights() != 0) meanX =  m_sumwx/ sumBinHeights(); 
-  stat[3] = (meanX*meanX + rmsX*rmsX) * sumBinHeights(); 
+  double meanX = 0;
+  if(sumBinHeights() != 0) meanX =  m_sumwx/ sumBinHeights();
+  stat[3] = (meanX*meanX + rmsX*rmsX) * sumBinHeights();
   stat[4] = m_sumwy;
-  double meanY = 0; 
-  if(sumBinHeights() != 0) meanY =  m_sumwy/ sumBinHeights(); 
-  stat[5] = (meanY*meanY + rmsY*rmsY) * sumBinHeights(); 
-  stat[6] = 0; 
-  m_rep->PutStats(&stat.front()); 
-  return true; 
+  double meanY = 0;
+  if(sumBinHeights() != 0) meanY =  m_sumwy/ sumBinHeights();
+  stat[5] = (meanY*meanY + rmsY*rmsY) * sumBinHeights();
+  stat[6] = 0;
+  m_rep->PutStats(&stat.front());
+  return true;
 }
 
-void Gaudi::Histogram2D::copyFromAida(const IHistogram2D& h) { 
+void Gaudi::Histogram2D::copyFromAida(const IHistogram2D& h) {
   // implement here the copy
   delete m_rep;
   const char* tit = h.title().c_str();
   if (h.xAxis().isFixedBinning() && h.yAxis().isFixedBinning()  )
     m_rep = new TH2D(tit,tit,
-                     h.xAxis().bins(),h.xAxis().lowerEdge(),h.xAxis().upperEdge(), 
-                     h.yAxis().bins(),h.yAxis().lowerEdge(),h.yAxis().upperEdge() ); 
+                     h.xAxis().bins(),h.xAxis().lowerEdge(),h.xAxis().upperEdge(),
+                     h.yAxis().bins(),h.yAxis().lowerEdge(),h.yAxis().upperEdge() );
   else {
     Edges eX, eY;
-    for (int i =0; i < h.xAxis().bins(); ++i) 
-      eX.push_back(h.xAxis().binLowerEdge(i)); 
+    for (int i =0; i < h.xAxis().bins(); ++i)
+      eX.push_back(h.xAxis().binLowerEdge(i));
     // add also upperedges at the end
-    eX.push_back(h.xAxis().upperEdge() ); 
-    for (int i =0; i < h.yAxis().bins(); ++i) 
-      eY.push_back(h.yAxis().binLowerEdge(i)); 
+    eX.push_back(h.xAxis().upperEdge() );
+    for (int i =0; i < h.yAxis().bins(); ++i)
+      eY.push_back(h.yAxis().binLowerEdge(i));
     // add also upperedges at the end
-    eY.push_back(h.yAxis().upperEdge() ); 
+    eY.push_back(h.yAxis().upperEdge() );
     m_rep = new TH2D(tit,tit,eX.size()-1,&eX.front(),eY.size()-1,&eY.front());
   }
   m_xAxis.initialize(m_rep->GetXaxis(),true);
@@ -207,43 +211,46 @@ void Gaudi::Histogram2D::copyFromAida(const IHistogram2D& h) {
   m_sumwx = 0;
   m_sumwy = 0;
   // statistics
-  double sumw = h.sumBinHeights();    
-  double sumw2 = 0; 
-  if (h.equivalentBinEntries() != 0) 
+  double sumw = h.sumBinHeights();
+  double sumw2 = 0;
+  if (h.equivalentBinEntries() != 0)
     sumw2 = ( sumw * sumw ) /h.equivalentBinEntries();
-  double sumwx = h.meanX()*h.sumBinHeights(); 
+  double sumwx = h.meanX()*h.sumBinHeights();
   double sumwx2 = (h.meanX()*h.meanX() + h.rmsX()*h.rmsX() )*h.sumBinHeights();
-  double sumwy = h.meanY()*h.sumBinHeights(); 
+  double sumwy = h.meanY()*h.sumBinHeights();
   double sumwy2 = (h.meanY()*h.meanY() + h.rmsY()*h.rmsY() )*h.sumBinHeights();
-  double sumwxy = 0; 
+  double sumwxy = 0;
 
   // copy the contents in  (AIDA underflow/overflow are -2,-1)
-  for (int i=-2; i < xAxis().bins(); ++i) { 
-    for (int j=-2; j < yAxis().bins(); ++j) { 
+  for (int i=-2; i < xAxis().bins(); ++i) {
+    for (int j=-2; j < yAxis().bins(); ++j) {
       // root binning starts from one !
-      m_rep->SetBinContent(rIndexX(i), rIndexY(j), h.binHeight(i,j) ); 
-      m_rep->SetBinError(rIndexX(i), rIndexY(j), h.binError(i,j) ); 
-      // calculate statistics 
-      if ( i >= 0 && j >= 0) { 
-        sumwxy += h.binHeight(i,j)*h.binMeanX(i,j)*h.binMeanY(i,j); 
+      m_rep->SetBinContent(rIndexX(i), rIndexY(j), h.binHeight(i,j) );
+      m_rep->SetBinError(rIndexX(i), rIndexY(j), h.binError(i,j) );
+      // calculate statistics
+      if ( i >= 0 && j >= 0) {
+        sumwxy += h.binHeight(i,j)*h.binMeanX(i,j)*h.binMeanY(i,j);
       }
-    }    
+    }
   }
-  // need to do set entries after setting contents otherwise root will recalulate them 
-  // taking into account how many time  SetBinContents() has been called 
-  m_rep->SetEntries(h.allEntries()); 
-  // fill stat vector  
-  std::vector<double> stat(11); 
-  stat[0] = sumw; 
-  stat[1] = sumw2; 
-  stat[2] = sumwx; 
-  stat[3] = sumwx2; 
-  stat[4] = sumwy; 
-  stat[5] = sumwy2; 
-  stat[6] = sumwxy; 
+  // need to do set entries after setting contents otherwise root will recalulate them
+  // taking into account how many time  SetBinContents() has been called
+  m_rep->SetEntries(h.allEntries());
+  // fill stat vector
+  std::vector<double> stat(11);
+  stat[0] = sumw;
+  stat[1] = sumw2;
+  stat[2] = sumwx;
+  stat[3] = sumwx2;
+  stat[4] = sumwy;
+  stat[5] = sumwy2;
+  stat[6] = sumwxy;
   m_rep->PutStats(&stat.front());
 }
 
+typedef Gaudi::Histogram2D H2D;
+DECLARE_DATAOBJECT_FACTORY(H2D)
+
 #ifdef __ICC
 // re-enable icc remark #1572
 #pragma warning(pop)
diff --git a/GaudiSvc/src/HistogramSvc/H3D.cpp b/GaudiSvc/src/HistogramSvc/H3D.cpp
index 8a10fadd1bca0c15959d5030d570031354463d8d..fe9d1073711670800c506c092b4779a8a44a08ed 100644
--- a/GaudiSvc/src/HistogramSvc/H3D.cpp
+++ b/GaudiSvc/src/HistogramSvc/H3D.cpp
@@ -3,6 +3,12 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 
 #include "GaudiKernel/DataObject.h"
 #include "GaudiKernel/ObjectFactory.h"
@@ -49,8 +55,6 @@ namespace Gaudi {
     double m_sumwz;
   };
 }
-typedef Gaudi::Histogram3D H3D;
-DECLARE_DATAOBJECT_FACTORY(H3D)
 
 namespace Gaudi {
   template <>
@@ -273,3 +277,6 @@ void Gaudi::Histogram3D::copyFromAida(const AIDA::IHistogram3D & h) {
 // re-enable icc remark #1572
 #pragma warning(pop)
 #endif
+
+typedef Gaudi::Histogram3D H3D;
+DECLARE_DATAOBJECT_FACTORY(H3D)
diff --git a/GaudiSvc/src/HistogramSvc/HistogramSvc.cpp b/GaudiSvc/src/HistogramSvc/HistogramSvc.cpp
index 85f1e839980db00146ea0294eae21ed81d9fb32b..0b19f642afb5e3a5416da316fb6aa2774a1e5ac9 100644
--- a/GaudiSvc/src/HistogramSvc/HistogramSvc.cpp
+++ b/GaudiSvc/src/HistogramSvc/HistogramSvc.cpp
@@ -4,6 +4,12 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 // ============================================================================
 // Include files
 // ============================================================================
@@ -11,6 +17,7 @@
 // ============================================================================
 #include <cstdlib>
 #include <stdexcept>
+#include <sstream>
 // ============================================================================
 // GaudiKernel
 // ============================================================================
@@ -60,8 +67,8 @@ namespace
 }
 //------------------------------------------------------------------------------
 std::string HistogramSvc::_STR(int i)  {
-  char txt[32];
-  return _itoa(i, txt, 10);
+  std::ostringstream txt; txt << i;
+  return txt.str();
 }
 //------------------------------------------------------------------------------
 StatusCode HistogramSvc::registerObject(CSTR full, IBaseHistogram* obj)  {
@@ -71,7 +78,7 @@ StatusCode HistogramSvc::registerObject(CSTR full, IBaseHistogram* obj)  {
 //------------------------------------------------------------------------------
 StatusCode HistogramSvc::registerObject
 (DataObject* pPar,CSTR obj,IBaseHistogram* hObj) {
-  // Set the hstogram id
+  // Set the histogram id
   if (obj[0] == SEPARATOR)    {
     // hObj->setTitle(obj.substr(1) + "|" + hObj->title());
     if (!hObj->annotation().addItem("id", obj.substr(1)))
@@ -82,7 +89,7 @@ StatusCode HistogramSvc::registerObject
     if (!hObj->annotation().addItem("id", obj))
       hObj->annotation().setValue("id", obj);
   }
-  // Register the hstogram in the hstogram data store
+  // Register the histogram in the histogram data store
   return DataSvc::registerObject(pPar,obj,__cast(hObj));
 }
 
@@ -450,8 +457,6 @@ StatusCode HistogramSvc::finalize     ()
   }
   return DataSvc::finalize () ;
 }
-// ============================================================================
-
 // ============================================================================
 // The END
 // ============================================================================
diff --git a/GaudiSvc/src/HistogramSvc/P1D.cpp b/GaudiSvc/src/HistogramSvc/P1D.cpp
index 8d7c96f0b3a31b0b24d265f3bb30a2b1a5b1b32b..8a37cd401694738e0f528c193bdff480afac6def 100644
--- a/GaudiSvc/src/HistogramSvc/P1D.cpp
+++ b/GaudiSvc/src/HistogramSvc/P1D.cpp
@@ -3,17 +3,21 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 
 #include <cmath>
 #include "P1D.h"
 #include "GaudiKernel/ObjectFactory.h"
-typedef Gaudi::Profile1D P1D;
-DECLARE_DATAOBJECT_FACTORY(P1D)
 
 std::pair<DataObject*,AIDA::IProfile1D*> Gaudi::createProf1D
-( const std::string& title , 
-  int nBins  , double xlow, double xup, 
-  double ylow, double yup, const std::string& opt )  
+( const std::string& title ,
+  int nBins  , double xlow, double xup,
+  double ylow, double yup, const std::string& opt )
 {
   TProfile* _p = new TProfile(title.c_str(),title.c_str(),nBins,xlow,xup,ylow,yup,opt.c_str() ) ;
   Profile1D* p = new Profile1D(_p);
@@ -21,10 +25,10 @@ std::pair<DataObject*,AIDA::IProfile1D*> Gaudi::createProf1D
 }
 
 std::pair<DataObject*,AIDA::IProfile1D*> Gaudi::createProf1D
-( const std::string& title, 
-  const Edges& e, double ylow, double yup , 
-  const std::string& opt )  
-{  
+( const std::string& title,
+  const Edges& e, double ylow, double yup ,
+  const std::string& opt )
+{
   Profile1D* p = new Profile1D(new TProfile(title.c_str(),title.c_str(),e.size()-1,&e.front(),ylow,yup,opt.c_str()));
   return std::pair<DataObject*,AIDA::IProfile1D*>(p,p);
 }
@@ -36,22 +40,22 @@ std::pair<DataObject*,AIDA::IProfile1D*> Gaudi::createProf1D(const AIDA::IProfil
 }
 
 namespace Gaudi {
-  template <> 
-  int Generic1D<AIDA::IProfile1D,TProfile>::binEntries (int index) const  { 
+  template <>
+  int Generic1D<AIDA::IProfile1D,TProfile>::binEntries (int index) const  {
     return int(m_rep->GetBinEntries( rIndex(index) )+0.5);
   }
 
-  template <> void* Generic1D<AIDA::IProfile1D,TProfile>::cast(const std::string& className) const {  
-    if (className == "AIDA::IProfile1D") 
-      return const_cast<AIDA::IProfile1D*>((AIDA::IProfile1D*)this); 
-    else if (className == "AIDA::IProfile") 
-      return const_cast<AIDA::IProfile*>((AIDA::IProfile*)this); 
-    else if (className == "AIDA::IBaseHistogram") 
-      return const_cast<AIDA::IBaseHistogram*>((AIDA::IBaseHistogram*)this); 
+  template <> void* Generic1D<AIDA::IProfile1D,TProfile>::cast(const std::string& className) const {
+    if (className == "AIDA::IProfile1D")
+      return const_cast<AIDA::IProfile1D*>((AIDA::IProfile1D*)this);
+    else if (className == "AIDA::IProfile")
+      return const_cast<AIDA::IProfile*>((AIDA::IProfile*)this);
+    else if (className == "AIDA::IBaseHistogram")
+      return const_cast<AIDA::IBaseHistogram*>((AIDA::IBaseHistogram*)this);
     return 0;
   }
 
-  template <> 
+  template <>
   void Generic1D<AIDA::IProfile1D,TProfile>::adoptRepresentation(TObject* rep)  {
     TProfile* imp = dynamic_cast<TProfile*>(rep);
     if ( imp )  {
@@ -84,18 +88,18 @@ void Gaudi::Profile1D::init(const std::string& title, bool initialize_axis) {
   if ( initialize_axis )  {
     axis().initialize(m_rep->GetXaxis(),false);
   }
-  //m_rep->SetErrorOption("s"); 
+  //m_rep->SetErrorOption("s");
   m_rep->SetDirectory(0);
   m_sumEntries = 0;
 }
 
-bool Gaudi::Profile1D::setBinContents(int i, int entries,double height,double /*error*/, double spread, double /* centre */ ) { 
-  m_rep->SetBinEntries(rIndex(i), entries ); 
-  // set content takes in root height * entries 
+bool Gaudi::Profile1D::setBinContents(int i, int entries,double height,double /*error*/, double spread, double /* centre */ ) {
+  m_rep->SetBinEntries(rIndex(i), entries );
+  // set content takes in root height * entries
   m_rep->SetBinContent(rIndex(i), height*entries );
-  // set error takes sqrt of bin sum(w*y**2) 
-  double sumwy2Bin = ( spread*spread + height*height )*entries; 
-  m_rep->SetBinError(rIndex(i), sqrt(sumwy2Bin) ); 
+  // set error takes sqrt of bin sum(w*y**2)
+  double sumwy2Bin = ( spread*spread + height*height )*entries;
+  m_rep->SetBinError(rIndex(i), sqrt(sumwy2Bin) );
   m_sumEntries += entries;
   // not very efficient (but do evey bin since root cannot figure out by himself)
   m_rep->SetEntries(m_sumEntries);
@@ -111,3 +115,6 @@ bool Gaudi::Profile1D::fill ( double x, double y, double weight )  {
   (weight == 1.) ? m_rep->Fill(x,y) : m_rep->Fill(x,y,weight);
   return true;
 }
+
+typedef Gaudi::Profile1D P1D;
+DECLARE_DATAOBJECT_FACTORY(P1D)
diff --git a/GaudiSvc/src/HistogramSvc/P2D.cpp b/GaudiSvc/src/HistogramSvc/P2D.cpp
index fd68d235bb27a810eb5195655f1612f96e21e7b0..60a00951b2dc95220da97a557c9cda1f793d6126 100644
--- a/GaudiSvc/src/HistogramSvc/P2D.cpp
+++ b/GaudiSvc/src/HistogramSvc/P2D.cpp
@@ -3,6 +3,12 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 #include "GaudiKernel/DataObject.h"
 #include "GaudiKernel/ObjectFactory.h"
 #include "GaudiPI.h"
@@ -42,8 +48,6 @@ namespace Gaudi {
     static const CLID& classID()     { return CLID_ProfileH2; }
   };
 }
-typedef Gaudi::Profile2D P2D;
-DECLARE_DATAOBJECT_FACTORY(P2D)
 
 namespace Gaudi {
   template <>
@@ -103,3 +107,6 @@ Gaudi::Profile2D::Profile2D(TProfile2D* rep)    {
   adoptRepresentation(rep);
   m_sumEntries = 0;
 }
+
+typedef Gaudi::Profile2D P2D;
+DECLARE_DATAOBJECT_FACTORY(P2D)
diff --git a/GaudiSvc/src/IssueLogger/IssueLogger.cpp b/GaudiSvc/src/IssueLogger/IssueLogger.cpp
index 16577b1d32be9d0afe232b42bbdb7feff0084255..c7d60c0c1afa3381338e5ecf5d1306703fe3dfe5 100644
--- a/GaudiSvc/src/IssueLogger/IssueLogger.cpp
+++ b/GaudiSvc/src/IssueLogger/IssueLogger.cpp
@@ -5,11 +5,11 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/Tokenizer.h"
 #include "GaudiKernel/System.h"
+#include "GaudiKernel/Time.h"
 
 #include <sstream>
 #include <streambuf>
 #include <algorithm>
-#include <time.h>
 
 #include "boost/bind.hpp"
 
@@ -20,7 +20,7 @@ DECLARE_SERVICE_FACTORY(IssueLogger)
 //*************************************************************************//
 inline void toupper(std::string &s)
 {
-  std::transform(s.begin(), s.end(), s.begin(), 
+  std::transform(s.begin(), s.end(), s.begin(),
                  (int(*)(int)) toupper);
 }
 
@@ -252,24 +252,7 @@ IssueLogger::report(IssueSeverity::Level lev, const std::string& str,
   std::string msg = m_levelTrans[lev] + "  " + org + "  \"" + str + "\"";
 
   if (m_showTime) {
-    const time_t t = time( 0 );
-    tm *tt = localtime( &t );
-
-    ostringstream os;
-    os << (tt->tm_hour < 10 ? "0" : "" ) << tt->tm_hour << ":"
-       << (tt->tm_min < 10 ? "0" : "" )  << tt->tm_min << ":"
-       << (tt->tm_sec < 10 ? "0" : "" )  << tt->tm_sec << " "
-       << tt->tm_year + 1900 << "/"
-       << (tt->tm_mon < 9 ? "0" : "" )   << tt->tm_mon+1 << "/"
-       << (tt->tm_mday < 10 ? "0" : "" ) << tt->tm_mday << " "
-#ifdef __linux
-       << tt->tm_zone;
-#else
-       << " " ;
-#endif
-
-    msg += " [" + os.str() +"]";
-
+    msg += " [" + Gaudi::Time::current().format(true, "%H:%M:%S %Y/%m/%d %Z") +"]";
   }
 
   if (lev >= m_traceLevel) {
diff --git a/GaudiSvc/src/JobOptionsSvc/Parser.cpp b/GaudiSvc/src/JobOptionsSvc/Parser.cpp
index 74df8a68fc9e3bb029953484c13df17576462e77..20c0a616859b2bb4d39a81ae9f6f76f77c245c2d 100644
--- a/GaudiSvc/src/JobOptionsSvc/Parser.cpp
+++ b/GaudiSvc/src/JobOptionsSvc/Parser.cpp
@@ -1,8 +1,15 @@
 // $Id: Parser.cpp,v 1.11 2007/12/06 15:14:21 marcocle Exp $
 // ============================================================================
+#ifdef WIN32
+// Disable warning
+//   C4996: 'std::copy': Function call with parameters that may be unsafe
+// Probably coming from Boost classification.
+#pragma warning(disable:4996)
+#endif
+// ============================================================================
 // Include files
 // ============================================================================
-// STD & STL 
+// STD & STL
 // ============================================================================
 #include <iostream>
 // ============================================================================
@@ -16,7 +23,7 @@
 // ============================================================================
 #include <GaudiKernel/SystemOfUnits.h>
 // ============================================================================
-// local 
+// local
 // ============================================================================
 #include "ParserUtils.h"
 #include "ParserGrammar.h"
@@ -26,14 +33,14 @@
 namespace fs = boost::filesystem;
 namespace ba = boost::algorithm;
 // ============================================================================
-namespace 
+namespace
 {
   const std::string GPP_COMMENT = "//GP:" ;
 }
 // ============================================================================
 Gaudi::Parsers::Parser::Parser
-( Catalogue&                catalogue , 
-  std::vector<std::string>& included  , 
+( Catalogue&                catalogue ,
+  std::vector<std::string>& included  ,
   std::ostream&             m         )
   : m_isPrint(true)
   , m_isPrintOptions(false)
@@ -46,9 +53,9 @@ Gaudi::Parsers::Parser::Parser
 }
 // ============================================================================
 Gaudi::Parsers::Parser::Parser
-( Catalogue&                      catalogue  , 
-  std::vector<std::string>&       included   ,  
-  const std::vector<std::string>& searchPath , 
+( Catalogue&                      catalogue  ,
+  std::vector<std::string>&       included   ,
+  const std::vector<std::string>& searchPath ,
   std::ostream&                   m          )
   : m_isPrint(true)
   , m_isPrintOptions(false)
@@ -60,10 +67,10 @@ Gaudi::Parsers::Parser::Parser
   initUnits();
 }
 // ============================================================================
-Gaudi::Parsers::Parser::Parser 
-( Catalogue&                catalogue  ,  
-  std::vector<std::string>& included   ,  
-  const std::string&        searchPath , 
+Gaudi::Parsers::Parser::Parser
+( Catalogue&                catalogue  ,
+  std::vector<std::string>& included   ,
+  const std::string&        searchPath ,
   std::ostream&             m          )
   : m_isPrint(true)
   , m_isPrintOptions(false)
@@ -104,7 +111,7 @@ void Gaudi::Parsers::Parser::matchUnits
 
 // ============================================================================
 long double Gaudi::Parsers::Parser::matchUnit
-( const std::string& unit, 
+( const std::string& unit,
   const Position& pos)
 {
   UnitsStoreT::const_iterator u = m_units.find(unit);
@@ -114,24 +121,24 @@ long double Gaudi::Parsers::Parser::matchUnit
       ( Message::E_ERROR ,
         Message::C_UNITNOTFOUND,
         boost::str(boost::format("Cann't find unit \"%1%\"")%unit),pos);
-    return 1;      
+    return 1;
   }
   return u->second;
 }
 // ============================================================================
 void Gaudi::Parsers::Parser::matchUnitEntry
-( const std::string& newUnit , 
+( const std::string& newUnit ,
   double value,
   const Position& pos)
 {
   if(isPrint())
   {
-    m_stream 
-      << boost::format("%4% %2%  = %3%; %|78t|%1%") 
-      % posString(pos.line(), pos.column()) 
-      % newUnit 
-      % value 
-      % GPP_COMMENT 
+    m_stream
+      << boost::format("%4% %2%  = %3%; %|78t|%1%")
+      % posString(pos.line(), pos.column())
+      % newUnit
+      % value
+      % GPP_COMMENT
       << std::endl ;
   }
   m_units[newUnit] = value ;
@@ -139,7 +146,7 @@ void Gaudi::Parsers::Parser::matchUnitEntry
 // ============================================================================
 void Gaudi::Parsers::Parser::matchAssign
 ( const std::string& objName  ,
-  const std::string& propName , 
+  const std::string& propName ,
   const Sign& oper,
   const std::vector<std::string>& vectorValue,
   const Position& pos,bool isVector)
@@ -147,13 +154,13 @@ void Gaudi::Parsers::Parser::matchAssign
   // --------------------------------------------------------------------------
   if(isPrint())
   {
-    m_stream 
-      << boost::format("%2% %3% %4%;%|72t|%5% %1%") 
-      % posString(pos.line(),pos.column()) 
-      % (objName+"."+propName) 
-      % sign(oper) 
-      % valueToString(vectorValue , isVector) 
-      % GPP_COMMENT 
+    m_stream
+      << boost::format("%2% %3% %4%;%|72t|%5% %1%")
+      % posString(pos.line(),pos.column())
+      % (objName+"."+propName)
+      % sign(oper)
+      % valueToString(vectorValue , isVector)
+      % GPP_COMMENT
       << std::endl ;
   }
   // --------------------------------------------------------------------------
@@ -187,7 +194,7 @@ void Gaudi::Parsers::Parser::matchAssign
       ok = foundProp.addValues(vectorValue);
       if(ok.isFailure()){
         addMessage
-          ( Message::E_ERROR, 
+          ( Message::E_ERROR,
             Message::C_CANNOTADDTONOTVECTOR,
             boost::str
             ( boost::format
@@ -204,11 +211,11 @@ void Gaudi::Parsers::Parser::matchAssign
       ok = foundProp.removeValues(vectorValue,count);
       if(ok.isFailure()){
         addMessage
-          ( Message::E_ERROR, 
+          ( Message::E_ERROR,
             Message::C_CANNOTREMOVEFROMNOTVECTOR,
             boost::str
             ( boost::format
-              ( "Cannot remove values from not vector property \"%1%.%2%\"" ) 
+              ( "Cannot remove values from not vector property \"%1%.%2%\"" )
               %  objName % propName),pos);
         return;
       }
@@ -216,19 +223,19 @@ void Gaudi::Parsers::Parser::matchAssign
       if (count == 0)
       {
         addMessage
-          ( Message::E_WARNING, 
+          ( Message::E_WARNING,
             Message::C_ZEROREMOVED,
             boost::str
             ( boost::format
-              ( "Nothing removed from property \"%1%.%2%\"" ) 
-              %  objName % propName),pos);   
+              ( "Nothing removed from property \"%1%.%2%\"" )
+              %  objName % propName),pos);
       }
       else
       {
         m_catalogue.addProperty(objName,foundProp);
       }
-      
-    } 
+
+    }
     // ------------------------------------------------------------------------
   }
 }
@@ -236,14 +243,14 @@ void Gaudi::Parsers::Parser::matchAssign
 void Gaudi::Parsers::Parser::setIsPrint
 ( bool on , const Gaudi::Parsers::Position& pos)
 {
-  // ignore the printout if the full print is activated  
+  // ignore the printout if the full print is activated
   if ( on && m_isPrintOptions ) { return ; }
   m_isPrint = on;
-  m_stream 
-    << boost::format("%3% printing is %2% %|78t|%1%") 
-    % posString(pos.line(),pos.column()) 
-    % (on?"ON":"OFF") 
-    % GPP_COMMENT 
+  m_stream
+    << boost::format("%3% printing is %2% %|78t|%1%")
+    % posString(pos.line(),pos.column())
+    % (on?"ON":"OFF")
+    % GPP_COMMENT
     << std::endl ;
 }
 // ============================================================================
@@ -251,13 +258,13 @@ void Gaudi::Parsers::Parser::setIsPrintOptions
 ( bool on , const Position& pos)
 {
   m_isPrintOptions = on;
-  m_stream 
-    << boost::format ("%3% printing options is %2% %|78t|%1%") 
-    % posString(pos.line(),pos.column()) 
-    % (on?"ON":"OFF") 
-    % GPP_COMMENT 
+  m_stream
+    << boost::format ("%3% printing options is %2% %|78t|%1%")
+    % posString(pos.line(),pos.column())
+    % (on?"ON":"OFF")
+    % GPP_COMMENT
     << std::endl ;
-  // deactivate the printout if the print of all options is activated 
+  // deactivate the printout if the print of all options is activated
   if ( m_isPrintOptions && m_isPrint ) { setIsPrint ( false , pos ) ; }
 }
 // ============================================================================
@@ -283,7 +290,7 @@ StatusCode Gaudi::Parsers::Parser::parseFile
   const Position& pos,
   bool isUnitsFile)
 {
-  StatusCode  ok;  
+  StatusCode  ok;
   std::vector<std::string> sp = m_searchPath;
   if(pos.fileName().length()>0){
     // Add current file directory to search path
@@ -298,21 +305,21 @@ StatusCode Gaudi::Parsers::Parser::parseFile
                boost::str(boost::format("Couldn't find file \"%1%\"") % fileName),pos);
     return StatusCode::FAILURE;
   }
-  
+
   ok = isIncluded(fileToParse);
   if(ok.isSuccess())
   {
-    const std::string _msg = 
+    const std::string _msg =
       ( boost::format("Skip already included file  \"%1%\"") % fileToParse ).str() ;
     addMessage ( Message::E_WARNING , Message::C_OK , _msg , pos ) ;
-    if ( isPrint() ) 
-    { 
-      m_stream 
-        << boost::format("%3% skip already included file  \"%2%\" %|78t|%1%") 
-        % posString(pos.line(), pos.column()) 
-        % fileToParse 
+    if ( isPrint() )
+    {
+      m_stream
+        << boost::format("%3% skip already included file  \"%2%\" %|78t|%1%")
+        % posString(pos.line(), pos.column())
+        % fileToParse
         % GPP_COMMENT
-        << std::endl ; 
+        << std::endl ;
     }
     return StatusCode::SUCCESS;
   }
@@ -325,61 +332,61 @@ StatusCode Gaudi::Parsers::Parser::parseFile
        boost::str
        (boost::format("Couldn't open file \"%1%\"") % fileToParse),pos);
     return StatusCode::FAILURE;
-  }  
+  }
   m_included.push_back(fileToParse);
-  
-  
+
+
   IteratorT beginpos(input.begin(), input.end(), fileToParse);
   IteratorT endpos;
-  
-  boost::spirit::parse_info<IteratorT> info; 
-  SkipperGrammar grSkipper;      
-  
+
+  boost::spirit::parse_info<IteratorT> info;
+  SkipperGrammar grSkipper;
+
   if(!isUnitsFile){
-    m_stream 
-      << boost::format("%3% include \"%2%\" %|78t|%1%") 
-      % posString(pos.line(), pos.column()) 
-      % fileToParse 
-      % GPP_COMMENT 
+    m_stream
+      << boost::format("%3% include \"%2%\" %|78t|%1%")
+      % posString(pos.line(), pos.column())
+      % fileToParse
+      % GPP_COMMENT
       << std::endl ;
     ParserGrammar grParser(this);
     info = boost::spirit::parse(beginpos, endpos, grParser >> end_p,grSkipper);
   }else{
-    m_stream 
-      << boost::format("#units \"%3%\" %|72t|%2% %1%") 
-      % posString(pos.line(), pos.column()) 
-      % GPP_COMMENT 
-      % fileToParse 
+    m_stream
+      << boost::format("#units \"%3%\" %|72t|%2% %1%")
+      % posString(pos.line(), pos.column())
+      % GPP_COMMENT
+      % fileToParse
       << std::endl ;
     UnitsFileGrammar grParser(this);
-    info = boost::spirit::parse(beginpos, endpos, grParser >> end_p,grSkipper);    
+    info = boost::spirit::parse(beginpos, endpos, grParser >> end_p,grSkipper);
   }
   boost::spirit::file_position stoppos = info.stop.get_position();
   if (!info.full) {
     addMessage(Message::E_ERROR, Message::C_SYNTAXERROR,
                "Syntax error",Position(stoppos.file,stoppos.line,stoppos.column));
-    return StatusCode::FAILURE;      
+    return StatusCode::FAILURE;
   }
   {
     std::string _msg =
-      ( boost::format("Parsed file \"%2%\" %|78t|%1%")  
-        % posString(stoppos.line, stoppos.column) 
+      ( boost::format("Parsed file \"%2%\" %|78t|%1%")
+        % posString(stoppos.line, stoppos.column)
         % fileToParse ) .str() ;
-    addMessage ( Message::E_VERBOSE , 
-                 Message::C_OK , 
+    addMessage ( Message::E_VERBOSE ,
+                 Message::C_OK ,
                  _msg ,
                  Position(stoppos.file,stoppos.line,stoppos.column) ) ;
     if ( isPrint() )
-    { 
-      m_stream 
+    {
+      m_stream
         << boost::format("%3% end  \"%2%\" %|78t|%1%")
-        % posString(stoppos.line, stoppos.column) 
-        % fileToParse 
-        % GPP_COMMENT 
-        << std::endl ; 
+        % posString(stoppos.line, stoppos.column)
+        % fileToParse
+        % GPP_COMMENT
+        << std::endl ;
     }
   }
-  return StatusCode::SUCCESS;  
+  return StatusCode::SUCCESS;
 }
 // ============================================================================
 std::string Gaudi::Parsers::Parser::severityName
@@ -395,20 +402,20 @@ std::string Gaudi::Parsers::Parser::severityName
   case Message::E_VERBOSE :
     return "VERBOSE"   ;
   default:
-    return "UNDEFINED" ; 
+    return "UNDEFINED" ;
   }
 }
 // ============================================================================
 void Gaudi::Parsers::Parser::addMessage
 ( const Message::Severity& severity ,
-  const Message::Code&     code     , 
-  const std::string&       message  , 
+  const Message::Code&     code     ,
+  const std::string&       message  ,
   const Position&          pos      )
 {
   Message result
     ( severity , code,
       boost::str(boost::format("%1%(%2%,%3%) : %4% #%5% : %6%") % pos.fileName()
-                 % pos.line() % pos.column() % severityName(severity) % code 
+                 % pos.line() % pos.column() % severityName(severity) % code
                  % message));
   m_messages.push_back(result);
 }
@@ -435,12 +442,12 @@ void Gaudi::Parsers::Parser::resolveReferences()
 {
   Catalogue::CatalogueT cat = m_catalogue.catalogue();
   // ----------------------------------------------------------------------------
-  for( Catalogue::CatalogueT::const_iterator curObj = cat.begin();  
+  for( Catalogue::CatalogueT::const_iterator curObj = cat.begin();
        curObj!=cat.end();curObj++)
   {
     std::string objName = curObj->first;
     // ------------------------------------------------------------------------
-    for( std::vector<PropertyEntry>::const_iterator curProp = 
+    for( std::vector<PropertyEntry>::const_iterator curProp =
            curObj->second.begin();curProp != curObj->second.end(); curProp++)
     {
       std::string value = curProp->value();
@@ -451,7 +458,7 @@ void Gaudi::Parsers::Parser::resolveReferences()
         std::string refprop(value.begin()+1,value.end());
         ba::split(objAndProp,
                   refprop,
-                  ba::is_any_of("."));            
+                  ba::is_any_of("."));
         PropertyEntry foundProperty;
         StatusCode ok;
         ok = m_catalogue.findProperty(objAndProp[0],objAndProp[1],
@@ -468,8 +475,8 @@ void Gaudi::Parsers::Parser::resolveReferences()
         {
           // -------------------------------------------------------------------
           if((ba::to_lower_copy(objAndProp[0]) == objName)
-             && 
-             (ba::to_lower_copy(objAndProp[1]) 
+             &&
+             (ba::to_lower_copy(objAndProp[1])
               == curProp->name()))
           {
             // ----------------------------------------------------------------
@@ -547,5 +554,5 @@ std::string Gaudi::Parsers::Parser::posString(int line, int column)
 // ============================================================================
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
diff --git a/GaudiSvc/src/JobOptionsSvc/ParserUtils.cpp b/GaudiSvc/src/JobOptionsSvc/ParserUtils.cpp
index fbbde710492dcf6181ab1fb431b553c6ceb0a0a5..52cc99f2256b15410dd2efe3aa63fcb23b2c8ac2 100644
--- a/GaudiSvc/src/JobOptionsSvc/ParserUtils.cpp
+++ b/GaudiSvc/src/JobOptionsSvc/ParserUtils.cpp
@@ -1,6 +1,6 @@
 // $Id: ParserUtils.cpp,v 1.7 2007/05/24 14:41:22 hmd Exp $
 // ============================================================================
-// CVS tag $Name:  $, version $Revision: 1.7 $ 
+// CVS tag $Name:  $, version $Revision: 1.7 $
 // ============================================================================
 // Include files
 // ============================================================================
@@ -21,16 +21,17 @@
 // ============================================================================
 #include "ParserUtils.h"
 #include "ParserGrammar.h"
+#include "GaudiKernel/System.h"
 // ============================================================================
 namespace fs = boost::filesystem;
 using namespace std;
 
 // ============================================================================
 /** @file
- *  implementation file for helper functions from 
- *  namespace Gaudi::Parsers and namespace Gaudi::Parsers:Utils 
- *  @see Gaudi::Parsers 
- *  @see Gaudi::Parsers::Utils 
+ *  implementation file for helper functions from
+ *  namespace Gaudi::Parsers and namespace Gaudi::Parsers:Utils
+ *  @see Gaudi::Parsers
+ *  @see Gaudi::Parsers::Utils
  *
  *  @author Alexander MAZUROV Alexander.Mazurov@gmail.com
  *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
@@ -44,7 +45,7 @@ StatusCode Gaudi::Parsers::parse
 {
   StatusCode res = parser.parse(fileName);
   msgs = parser.messages();
-  return res;  
+  return res;
 }
 // ============================================================================
 StatusCode Gaudi::Parsers::parse
@@ -55,8 +56,8 @@ StatusCode Gaudi::Parsers::parse
   vector<Gaudi::Parsers::Message>& msgs)
 {
   return parse
-    ( Gaudi::Parsers::Parser(catalogue, included, searchPath) , 
-      filename , msgs ) ;  
+    ( Gaudi::Parsers::Parser(catalogue, included, searchPath) ,
+      filename , msgs ) ;
 }
 // ============================================================================
 StatusCode Gaudi::Parsers::parse
@@ -67,8 +68,8 @@ StatusCode Gaudi::Parsers::parse
   vector<Gaudi::Parsers::Message>& msgs)
 {
   return parse
-    ( Gaudi::Parsers::Parser (catalogue , included, searchPath ) , 
-      filename ,  msgs ) ;  
+    ( Gaudi::Parsers::Parser (catalogue , included, searchPath ) ,
+      filename ,  msgs ) ;
 }
 // ============================================================================
 StatusCode Gaudi::Parsers::parse
@@ -83,33 +84,30 @@ StatusCode Gaudi::Parsers::parse
 StatusCode Gaudi::Parsers::Utils::getEnv
 ( const std::string& envName , std::string& envValue )
 {
-  char* envch = getenv(envName.c_str());
-	if(envch==NULL) { return StatusCode::FAILURE; }
-	envValue = envch;
-  return StatusCode::SUCCESS;
+  return (System::getEnv(envName, envValue)) ? StatusCode::SUCCESS : StatusCode::FAILURE;
 }
 // ============================================================================
-std::string 
+std::string
 Gaudi::Parsers::Utils::removeEnvironment(const std::string& input){
   std::string result=input;// result
-  
+
   const char* re = "\\$(([A-Za-z0-9_]+)|\\(([A-Za-z0-9_]+)\\))";
   std::string::const_iterator start, end;
   boost::regex expression(re);
   start = input.begin();
-  end = input.end();   
+  end = input.end();
   boost::match_results<std::string::const_iterator> what;
   boost::match_flag_type flags = boost::match_default;
-  while ( boost::regex_search(start, end, what, expression, flags ) )   
+  while ( boost::regex_search(start, end, what, expression, flags ) )
   {
     std::string var,env;
     std::string matched(what[0].first,what[0].second);
     std::string v1(what[2].first,what[2].second);
-    std::string v2(what[3].first,what[3].second);      
-    
+    std::string v2(what[3].first,what[3].second);
+
     if ( v1.length()>0){ var = v1; }
     else { var = v2; }
-    
+
     StatusCode ok = getEnv(var, env);
     if(ok.isSuccess())
     { boost::algorithm::replace_first(result,matched, env); }
@@ -122,9 +120,9 @@ Gaudi::Parsers::Utils::removeEnvironment(const std::string& input){
 }
 // ============================================================================
 StatusCode Gaudi::Parsers::Utils::searchFile
-( const std::string&              fileInput  , 
+( const std::string&              fileInput  ,
   bool                            addCurrent ,
-  const std::vector<std::string>& dirs       , 
+  const std::vector<std::string>& dirs       ,
   std::string&                    fileOutput )
 {
 	std::string result;
@@ -134,10 +132,10 @@ StatusCode Gaudi::Parsers::Utils::searchFile
     fs::path currentPath = givenPath;
     std::vector<std::string> sdirs = dirs;
     if(addCurrent){
-      sdirs.insert(sdirs.begin(), 
+      sdirs.insert(sdirs.begin(),
                    fs::initial_path().native_directory_string());
     }
-    std::vector<std::string>::const_iterator current = 
+    std::vector<std::string>::const_iterator current =
       sdirs.begin(),end=sdirs.end();
     while(1) {
       if(fs::exists(currentPath)) {
@@ -163,7 +161,7 @@ StatusCode Gaudi::Parsers::Utils::readFile
   if (!in.is_open()) { return StatusCode::FAILURE; }
   char c;
   while (!in.get(c).eof()) { result += c; }
-  return StatusCode::SUCCESS;  
+  return StatusCode::SUCCESS;
 }
 // ============================================================================
 bool Gaudi::Parsers::Utils::isWin()
@@ -172,7 +170,7 @@ bool Gaudi::Parsers::Utils::isWin()
   return true;
 #else
   return false;
-#endif  
+#endif
 }
 // ============================================================================
 std::string Gaudi::Parsers::Utils::pathSeparator()
@@ -196,20 +194,20 @@ std::vector<std::string> Gaudi::Parsers::Utils::extractPath
 }
 // ============================================================================
 StatusCode Gaudi::Parsers::Utils::parseValue
-( const string&             input        , 
+( const string&             input        ,
   std::string&              stringResult ,
   std::vector<std::string>& vectorResult )
 {
-  
-  typedef 
+
+  typedef
     boost::spirit::position_iterator<std::string::const_iterator> IteratorT;
-  
+
   Gaudi::Parsers::ValueGrammar   grValue;
   Gaudi::Parsers::SkipperGrammar grSkipper;
   IteratorT beginpos(input.begin(), input.end(), "");
   IteratorT endpos;
   boost::tuple<std::string, std::vector<std::string> > result;
-  boost::spirit::parse_info<IteratorT> info = 
+  boost::spirit::parse_info<IteratorT> info =
     boost::spirit::parse
     (beginpos, endpos, grValue[var(result)=arg1] ,grSkipper);
   if (!info.full){ return StatusCode::FAILURE; }
@@ -220,6 +218,6 @@ StatusCode Gaudi::Parsers::Utils::parseValue
 // ============================================================================
 
 // ============================================================================
-// The END 
+// The END
 // ============================================================================
 
diff --git a/GaudiSvc/src/MessageSvc/MessageSvc.cpp b/GaudiSvc/src/MessageSvc/MessageSvc.cpp
index 7e17e87b7b66191ec9f3275ac3e06286a55e183f..129bb849315f06f975ac6bd37939aac00c1c368c 100644
--- a/GaudiSvc/src/MessageSvc/MessageSvc.cpp
+++ b/GaudiSvc/src/MessageSvc/MessageSvc.cpp
@@ -1,4 +1,3 @@
-// $Id: MessageSvc.cpp,v 1.27 2008/10/21 16:25:55 marcocle Exp $
 #ifdef _WIN32
 // Avoid conflicts between windows and the message service.
 #define NOMSG
@@ -66,6 +65,11 @@ MessageSvc::MessageSvc( const std::string& name, ISvcLocator* svcloc )
   declareProperty( "defaultLimit",  m_msgLimit[MSG::NIL]     = defaultLimit );
 
   declareProperty( "enableSuppression", m_suppress = false );
+  declareProperty( "countInactive", m_inactCount = false )->declareUpdateHandler( &MessageSvc::setupInactCount, this );
+#ifndef NDEBUG
+  // initialize the MsgStream static flag.
+  MsgStream::enableCountInactive(m_inactCount);
+#endif
 
   declareProperty( "loggedStreams",
                    m_loggedStreamsName,
@@ -308,59 +312,148 @@ void MessageSvc::setupThreshold(Property& prop) {
   }
 
 }
+
+//#############################################################################
+
+#ifdef NDEBUG
+void MessageSvc::setupInactCount(Property&) {}
+#else
+void MessageSvc::setupInactCount(Property&prop) {
+  if (prop.name() == "countInactive") {
+    BooleanProperty *p = dynamic_cast<BooleanProperty*>(&prop);
+    if (p)
+      MsgStream::enableCountInactive(p->value());
+  }
+}
+#endif
+
+
 //#############################################################################
 /// Finalize Service
 StatusCode MessageSvc::finalize() {
 
   m_suppress = false;
 
-  std::ostringstream os;
+  {
+    std::ostringstream os;
 
-  if (m_stats) {
-    os << "Summarizing all message counts" << endl;
-  } else {
-    os << "Listing sources of suppressed message: " << endl;
-  }
+    if (m_stats) {
+      os << "Summarizing all message counts" << endl;
+    } else {
+      os << "Listing sources of suppressed message: " << endl;
+    }
 
-  os << "=====================================================" << endl;
-  os << " Message Source              |   Level |    Count" << endl;
-  os << "-----------------------------+---------+-------------" << endl;
+    os << "=====================================================" << endl;
+    os << " Message Source              |   Level |    Count" << endl;
+    os << "-----------------------------+---------+-------------" << endl;
 
 
-  bool found(false);
+    bool found(false);
 
-  std::map<std::string,MsgAry>::const_iterator itr;
-  for (itr=m_sourceMap.begin(); itr!=m_sourceMap.end(); ++itr) {
-    for (unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic) {
-      if ( (itr->second.msg[ic] >= m_msgLimit[ic] && m_msgLimit[ic] != 0 ) ||
-           (m_stats && itr->second.msg[ic] > 0 && ic >= m_statLevel.value()) ) {
-        os << " ";
-        os.width(28);
-        os.setf(ios_base::left,ios_base::adjustfield);
-        os << itr->first;
+    std::map<std::string,MsgAry>::const_iterator itr;
+    for (itr=m_sourceMap.begin(); itr!=m_sourceMap.end(); ++itr) {
+      for (unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic) {
+        if ( (itr->second.msg[ic] >= m_msgLimit[ic] && m_msgLimit[ic] != 0 ) ||
+            (m_stats && itr->second.msg[ic] > 0 && ic >= m_statLevel.value()) ) {
+          os << " ";
+          os.width(28);
+          os.setf(ios_base::left,ios_base::adjustfield);
+          os << itr->first;
 
-        os << "|";
+          os << "|";
 
-        os.width(8);
-        os.setf(ios_base::right,ios_base::adjustfield);
-        os << levelNames[ic];
+          os.width(8);
+          os.setf(ios_base::right,ios_base::adjustfield);
+          os << levelNames[ic];
 
-        os << " |";
+          os << " |";
 
-        os.width(9);
-        os << itr->second.msg[ic];
+          os.width(9);
+          os << itr->second.msg[ic];
 
-        os << endl;
+          os << endl;
 
-        found = true;
+          found = true;
+        }
       }
     }
+    os << "=====================================================" << endl;
+
+    if (found || m_stats) {
+      cout << os.str();
+    }
   }
-  os << "=====================================================" << endl;
 
-  if (found || m_stats) {
-    cout << os.str();
+#ifndef NDEBUG
+  if (m_inactCount.value()) {
+
+    std::ostringstream os;
+    os << "Listing sources of Unprotected and Unseen messages\n";
+
+    bool found(false);
+
+    unsigned int ml(0);
+    std::map<std::string,MsgAry>::const_iterator itr;
+    for (itr=m_inactiveMap.begin(); itr!=m_inactiveMap.end(); ++itr) {
+      for (unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic) {
+	if (itr->second.msg[ic] != 0) {
+	  if (itr->first.length() > ml) { ml = itr->first.length(); }
+	}
+      }
+    }
+
+    for (unsigned int i=0; i<ml+25; ++i) {
+      os << "=";
+    }
+
+    os << endl << " ";
+    os.width(ml+2);
+    os.setf(ios_base::left,ios_base::adjustfield);
+    os << "Message Source";
+    os.width(1);
+    os << "|   Level |    Count" << endl;
+
+    for (unsigned int i=0; i<ml+3; ++i) {
+      os << "-";
+    }
+    os << "+---------+-----------" << endl;
+
+
+    for (itr=m_inactiveMap.begin(); itr!=m_inactiveMap.end(); ++itr) {
+      for (unsigned int ic = 0; ic < MSG::NUM_LEVELS; ++ic) {
+	if (itr->second.msg[ic] != 0) {
+	  os << " ";
+	  os.width(ml+2);
+	  os.setf(ios_base::left,ios_base::adjustfield);
+	  os << itr->first;
+
+	  os << "|";
+
+	  os.width(8);
+	  os.setf(ios_base::right,ios_base::adjustfield);
+	  os << levelNames[ic];
+
+	  os << " |";
+
+	  os.width(9);
+	  os << itr->second.msg[ic];
+
+	  os << endl;
+
+	  found = true;
+	}
+      }
+    }
+    for (unsigned int i=0; i<ml+25; ++i) {
+      os << "=";
+    }
+    os << endl;
+
+    if (found) {
+      cout << os.str();
+    }
   }
+#endif
 
   return StatusCode::SUCCESS;
 }
@@ -416,12 +509,12 @@ void MessageSvc::reportMessage( const Message& msg, int outputLevel )    {
 
       if ( m_msgLimit[key] != 0 ) {
         if (nmsg == m_msgLimit[key]) {
-          char lim[16];
-          std::string str = levelNames[key] + " message limit (";
-          str += ::_itoa(m_msgLimit[key].value(),lim,10);
-          str += ") reached for ";
-          str += msg.getSource() + ". Suppressing further output.";
-          cmsg = new Message(msg.getSource(),MSG::WARNING,str);
+          std::ostringstream txt;
+          txt << levelNames[key] << " message limit ("
+              << m_msgLimit[key].value()
+              << ") reached for "
+              << msg.getSource() + ". Suppressing further output.";
+          cmsg = new Message(msg.getSource(), MSG::WARNING, txt.str());
           cmsg->setFormat(msg.getFormat());
         } else if (nmsg > m_msgLimit[key]) {
           return;
@@ -749,6 +842,14 @@ int MessageSvc::messageCount( MSG::Level level) const   {
 
 }
 
+// ---------------------------------------------------------------------------
+void
+MessageSvc::incrInactiveCount(MSG::Level level, const std::string& source) {
+
+  ++(m_inactiveMap[source].msg[level]);
+
+}
+
 // ---------------------------------------------------------------------------
 void MessageSvc::setupLogStreams()
 {
diff --git a/GaudiSvc/src/MessageSvc/MessageSvc.h b/GaudiSvc/src/MessageSvc/MessageSvc.h
index 51bd46bfd849262ff66d7059fe84b01d478d9e9c..f04d01652cdb8742b682b845a44fb475014c041c 100644
--- a/GaudiSvc/src/MessageSvc/MessageSvc.h
+++ b/GaudiSvc/src/MessageSvc/MessageSvc.h
@@ -1,4 +1,3 @@
-// $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiSvc/src/MessageSvc/MessageSvc.h,v 1.15 2008/10/21 16:25:55 marcocle Exp $
 #ifndef GAUDI_MESSAGESVC_H
 #define GAUDI_MESSAGESVC_H
 
@@ -29,7 +28,7 @@ class ISvcLocator;
 //
 // Author:      Iain Last
 //
-class MessageSvc : public extends1<Service, IMessageSvc> {
+class MessageSvc : public extends2<Service, IMessageSvc, IInactiveMessageCounter> {
 public:
   typedef std::pair< std::string, std::ostream* > NamedStream;
   typedef std::multimap< int, NamedStream > StreamMap;
@@ -122,6 +121,11 @@ public:
   // Implementation of IMessageSvc::messageCount()
   virtual int messageCount( MSG::Level logLevel ) const;
 
+  // Implementation of IInactiveMessageCounter::incrInactiveCount()
+  virtual void incrInactiveCount( MSG::Level level,
+				  const std::string& src );
+
+
 private:
   std::ostream* m_defaultStream;      ///< Pointer to the output stream.
   Message m_defaultMessage;           ///< Default Message
@@ -130,7 +134,7 @@ private:
   ThresholdMap m_thresholdMap;        ///< Output level threshold map
   std::string m_defaultFormat;        ///< Default format for the messages
   std::string m_defaultTimeFormat;    ///< Default format for timestamps in the messages
-  StringArrayProperty m_thresholdProp[MSG::NUM_LEVELS]; ///< Properties controling
+  StringArrayProperty m_thresholdProp[MSG::NUM_LEVELS]; ///< Properties controlling
   BooleanProperty m_color;
   BooleanProperty m_stats;
   UnsignedIntegerProperty m_statLevel;
@@ -155,8 +159,8 @@ private:
     }
   };
 
-  std::map<std::string,MsgAry> m_sourceMap;
-  BooleanProperty m_suppress;
+  std::map<std::string,MsgAry> m_sourceMap, m_inactiveMap;
+  BooleanProperty m_suppress, m_inactCount;
 
   std::string colTrans(std::string, int);
   typedef std::map<std::string, MSG::Color> ColorMap;
@@ -172,6 +176,7 @@ private:
   void setupColors(Property& prop);
   void setupLimits(Property& prop);
   void setupThreshold(Property& prop);
+  void setupInactCount(Property& prop);
 
   void setupLogStreams();
 
diff --git a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp
index 75992b3f8bf7995dc334e856e7ad426813a7382c..ebad819910f8a46e3a3c6a0b8affec89c9bf2831 100644
--- a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp
+++ b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp
@@ -50,6 +50,15 @@ DECLARE_SERVICE_FACTORY(NTupleSvc)
 /// Selector factory instantiation
 DECLARE_NAMESPACE_OBJECT_FACTORY(NTuple,Selector)
 
+#include <sstream>
+
+namespace {
+  inline std::string toStr(long id) {
+    std::ostringstream s; s << id;
+    return s.str();
+  }
+}
+
 /// Standard Constructor
 NTupleSvc::NTupleSvc(const std::string& name, ISvcLocator* svc)
  : base_class(name, svc)
@@ -419,8 +428,7 @@ NTuple::Tuple* NTupleSvc::book (const std::string& dirPath, const std::string& r
 
 /// Book Ntuple and register it with the data store.
 NTuple::Tuple* NTupleSvc::book (const std::string& dirPath, long id, const CLID& type, const std::string& title)  {
-  char txt[32];
-  return book( dirPath, _itoa(id, txt, 10), type, title);
+  return book( dirPath, toStr(id), type, title);
 }
 
 /// Book Ntuple and register it with the data store.
@@ -448,8 +456,7 @@ NTuple::Tuple* NTupleSvc::book (DataObject* pParent,
                                 long id,
                                 const CLID& type,
                                 const std::string& title)  {
-  char txt[32];
-  return book( pParent, ::_itoa(id, txt,10), type, title);
+  return book( pParent, toStr(id), type, title);
 }
 
 /// Create Ntuple directory and register it with the data store.
@@ -469,14 +476,12 @@ NTuple::Directory* NTupleSvc::createDirectory (DataObject* pParent,
 
 /// Create Ntuple directory and register it with the data store.
 NTuple::Directory* NTupleSvc::createDirectory (DataObject* pParent, long id)    {
-  char txt[32];
-  return createDirectory( pParent, ::_itoa(id, txt,10) );
+  return createDirectory( pParent, toStr(id) );
 }
 
 /// Create Ntuple directory and register it with the data store.
 NTuple::Directory* NTupleSvc::createDirectory (const std::string& dirPath, long id)    {
-  char txt[32];
-  return createDirectory( dirPath, ::_itoa(id, txt,10) );
+  return createDirectory( dirPath, toStr(id) );
 }
 
 /// Create Ntuple directory and register it with the data store.
@@ -699,4 +704,3 @@ StatusCode NTupleSvc::readRecord(DataObject* pParent, const std::string& relPath
   }
   return INVALID_OBJ_PATH;
 }
-
diff --git a/GaudiSvc/src/ParticlePropertySvc/ParticlePropertySvc.cpp b/GaudiSvc/src/ParticlePropertySvc/ParticlePropertySvc.cpp
index dab7ab58f376a6179a2d4bb688aa990fd369a665..5338a2f62f9bc551c9a36391c06cb89eb5d837f1 100644
--- a/GaudiSvc/src/ParticlePropertySvc/ParticlePropertySvc.cpp
+++ b/GaudiSvc/src/ParticlePropertySvc/ParticlePropertySvc.cpp
@@ -18,16 +18,16 @@
 #include "GaudiKernel/ParticleProperty.h"
 #include "GaudiKernel/PhysicalConstants.h"
 #include "GaudiKernel/IFileAccess.h"
+#include "GaudiKernel/System.h"
 // ============================================================================
 //#include "GaudiKernel/ToStream.h"
 // ============================================================================
 // Local
 // ============================================================================
 #include "ParticlePropertySvc.h"
-
 // ============================================================================
 /** Instantiation of a static factory class used by clients to create
- *  instances of this serviceq
+ *  instances of this service
  */
 DECLARE_SERVICE_FACTORY(ParticlePropertySvc)
 // ============================================================================
@@ -62,11 +62,11 @@ ParticlePropertySvc::ParticlePropertySvc
   , m_replaced ()
   , m_fileAccess (0)
 {
+  /// @todo: remove reference to LHCb-specific environment variable
   // Redefine the default name:
-  if( NULL != getenv("PARAMFILESROOT") )
+  if( System::getEnv("PARAMFILESROOT", m_filename) )
   {
-    m_filename  = getenv( "PARAMFILESROOT" ) ;
-    m_filename += "/data/ParticleTable.txt"  ;
+    m_filename += "/data/ParticleTable.txt";
   }
   //
   declareProperty ( "ParticlePropertiesFile" , m_filename  ) ;
@@ -358,6 +358,12 @@ StatusCode ParticlePropertySvc::parse( const std::string& file )
 
     if ( line[0] == '#' ) continue;
 
+    /// @todo: This PPS should be removed from Gaudi, if not, the parser must be improved
+#ifdef WIN32
+// Disable warning
+//   C4996: 'strtok': This function or variable may be unsafe.
+#pragma warning(disable:4996)
+#endif
     std::string par, gid, jid, chg, mas, lif, evt, pyt, mwi ;
     char* token = strtok( line, " " );
     if ( token ) { par = token; token = strtok( NULL, " " );} else continue;
@@ -380,7 +386,7 @@ StatusCode ParticlePropertySvc::parse( const std::string& file )
     long   lpyt = atoi( pyt.c_str() ) ;
     double mW = atof( mwi.c_str() ) * Gaudi::Units::GeV ;
 
-    // Change the particles that do not corresopond to a pdg number
+    // Change the particles that do not correspond to a pdg number
     if ( ljid == 0 ) {
       ljid = 10000000*lgid;
     }
@@ -426,7 +432,7 @@ ParticlePropertySvc::anti ( const ParticleProperty* pp ) const
 // ============================================================================
 /** helper (protected) function to set the valid
  *  particle<-->antiparticle relations
- *  @retutrn status code
+ *  @return status code
  */
 // ============================================================================
 StatusCode ParticlePropertySvc::setAntiParticles()
@@ -615,7 +621,6 @@ bool ParticlePropertySvc::diff
 // re-enable icc remark #1572
 #pragma warning(pop)
 #endif
-
 // ============================================================================
 // The END
 // ============================================================================
diff --git a/GaudiSvc/src/PersistencySvc/PersistencySvc.cpp b/GaudiSvc/src/PersistencySvc/PersistencySvc.cpp
index c8c9b662588efab9be6fa488ca5b624ce23b32ef..b83ce00bf4bc9aa7d470775f6d2a6532fd2d7233 100644
--- a/GaudiSvc/src/PersistencySvc/PersistencySvc.cpp
+++ b/GaudiSvc/src/PersistencySvc/PersistencySvc.cpp
@@ -415,8 +415,8 @@ StatusCode PersistencySvc::createAddress( long /* svc_type */,
                                          const std::string& refAddress,
                                          IOpaqueAddress*& refpAddress)
 {
-  // Assumuption is that the Persistency service decodes that header
-  // and requests the conversion service refered to by the service
+  // Assumption is that the Persistency service decodes that header
+  // and requests the conversion service referred to by the service
   // type to decode the rest
   long new_svc_type = 0;
   CLID new_clid = 0;
@@ -450,40 +450,35 @@ void PersistencySvc::decodeAddrHdr( const std::string& address,
                                     std::string& address_trailer) const
 {
   // For address header, use xml-style format of
-  // <addrhdr service_type="xxx" clid="yyy" />
+  // <address_header service_type="xxx" clid="yyy" />
   service_type = 0;
   clid = 0;
   address_trailer = "";
 
-  // Check for addrhdr tag
+  // Check for address_header tag
   size_t pos = address.find("<address_header");
   if (std::string::npos != pos) {
     // Get service_type
     pos = address.find("service_type=\"");
     if (std::string::npos != pos) {
       pos += 14;
-      size_t end = address.find('\"', pos);
-        if (std::string::npos != end) {
-          std::string str;
-          str.insert(0, address, pos, end-pos);
-          int temp;
-          sscanf(str.c_str(),"%d",&temp);
-          service_type = temp;
-          // Get clid
-          pos = address.find("clid=\"");
+      size_t end = address.find('"', pos);
+      if (std::string::npos != end) {
+        std::istringstream str(address.substr(pos, end-pos));
+        str >> service_type;
+        // Get clid
+        pos = address.find("clid=\"");
         if (std::string::npos != pos) {
           pos += 6;
-          size_t end1 = address.find('\"', pos);
-          if (std::string::npos != end1) {
-            std::string str1;
-            str1.insert(0, address, pos, end1-pos);
-            sscanf(str1.c_str(),"%d",&temp);
-            clid = temp;
+          end = address.find('\"', pos);
+          if (std::string::npos != end) {
+            str.str(address.substr(pos, end-pos)); // reuse the istringstream
+            str >> clid;
             // Get trailer_address
-            pos = address.find(">");
-            if (std::string::npos != pos) {
-              pos += 1;
-              address_trailer.insert(0, address, pos, address.size() - pos);
+            pos = address.find('>');
+            if (pos < (address.size()-2)) { // this means that '>' was found (pos != npos)
+                                            // it is before the last char
+              address_trailer = address.substr(pos+1);
             }
           }
         }
diff --git a/GaudiSvc/src/THistSvc/THistSvc.cpp b/GaudiSvc/src/THistSvc/THistSvc.cpp
index 4862309e180c68575d80b9ff2b343c25cba7779c..87e439cd616d4281054d4ab0bbe1f993056a1758 100644
--- a/GaudiSvc/src/THistSvc/THistSvc.cpp
+++ b/GaudiSvc/src/THistSvc/THistSvc.cpp
@@ -46,6 +46,7 @@ THistSvc::THistSvc( const std::string& name, ISvcLocator* svc )
   : base_class(name, svc), m_log(msgSvc(), name ), signaledStop(false) {
 
   declareProperty ("AutoSave", m_autoSave=0 );
+  declareProperty ("AutoFlush", m_autoFlush=0 );
   declareProperty ("PrintAll", m_print=false);
   declareProperty ("MaxFileSize", m_maxFileSize=10240,
 		   "maximum file size in MB. if exceeded, will cause an abort");
@@ -123,8 +124,9 @@ THistSvc::initialize() {
     static TROOT root("root","ROOT I/O");
     //    gDebug = 99;
   } else {
-    m_log << MSG::VERBOSE << "ROOT already initialized, debug = "
-	  << gDebug<< endmsg;
+    if (m_log.level() <= MSG::VERBOSE)
+      m_log << MSG::VERBOSE << "ROOT already initialized, debug = "
+	    << gDebug<< endmsg;
   }
 
   IIncidentSvc* p_incSvc(0);
@@ -165,7 +167,8 @@ THistSvc::finalize() {
 
   GlobalDirectoryRestore restore;
 
-  m_log << MSG::DEBUG << "THistSvc::finalize" << endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "THistSvc::finalize" << endmsg;
 
   uidMap::const_iterator uitr;
   for (uitr=m_uids.begin(); uitr != m_uids.end(); ++uitr) {
@@ -203,9 +206,10 @@ THistSvc::finalize() {
     }
 
 #ifndef NDEBUG
-    m_log << MSG::DEBUG << "uid: \"" << uitr->first << "\"  temp: "
-        << uitr->second.temp << "  dir: " << dirname
-        << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "uid: \"" << uitr->first << "\"  temp: "
+	    << uitr->second.temp << "  dir: " << dirname
+	    << endmsg;
 #endif
 
 
@@ -232,13 +236,15 @@ THistSvc::finalize() {
       deleted_files.push_back(itr->second.first);
 
 #ifndef NDEBUG
-      m_log << MSG::DEBUG << "finalizing stream/file " << itr->first << ":"
-	    << itr->second.first->GetName()
-	    << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "finalizing stream/file " << itr->first << ":"
+	      << itr->second.first->GetName()
+	      << endmsg;
 #endif
     } else {
 #ifndef NDEBUG
-      m_log << MSG::DEBUG << "already finalized stream " << itr->first << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "already finalized stream " << itr->first << endmsg;
 #endif
       continue;
     }
@@ -267,7 +273,8 @@ THistSvc::finalize() {
       TFile *outputfile;
       //Merge File
       try {
-	m_log << MSG::DEBUG << "Opening Final Output File: " <<m_sharedFiles[itr->first].c_str()<<endmsg;
+	if (m_log.level() <= MSG::DEBUG)
+	  m_log << MSG::DEBUG << "Opening Final Output File: " <<m_sharedFiles[itr->first].c_str()<<endmsg;
 	outputfile = new TFile(m_sharedFiles[itr->first].c_str(), "UPDATE");
       } catch (const std::exception& Exception) {
 	m_log << MSG::ERROR << "exception caught while trying to open root"
@@ -288,10 +295,12 @@ THistSvc::finalize() {
       pi->fireIncident(FileIncident(name(), IncidentType::WroteToOutputFile,
  				    m_sharedFiles[itr->first]));
 
-      m_log << MSG::DEBUG << "THistSvc::write()::Merging Rootfile "<<endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "THistSvc::write()::Merging Rootfile "<<endmsg;
       TFile *inputfile;
       try {
-	m_log << MSG::DEBUG << "Openning again Temporary File: " <<tmpfn.c_str()<<endmsg;
+	if (m_log.level() <= MSG::DEBUG)
+	  m_log << MSG::DEBUG << "Openning again Temporary File: " <<tmpfn.c_str()<<endmsg;
 	inputfile=new TFile(tmpfn.c_str(),"READ");
       } catch (const std::exception& Exception) {
 	m_log << MSG::ERROR << "exception caught while trying to open root"
@@ -313,8 +322,9 @@ THistSvc::finalize() {
       outputfile->Close();
       inputfile->Close();
 
-      m_log << MSG::DEBUG << "Trying to remove temporary file \"" << tmpfn
-	    << "\""<<endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "Trying to remove temporary file \"" << tmpfn
+	      << "\""<<endmsg;
 
       std::remove(tmpfn.c_str());
     }
@@ -391,22 +401,28 @@ THistSvc::getTHists(TDirectory *td, TList & tl, bool rcs) const {
     return StatusCode::FAILURE;
   }
 
-  m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
-	<< td->GetListOfKeys()->GetSize() << " keys" << endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
+	  << td->GetListOfKeys()->GetSize() << " keys" << endmsg;
 
   TIter nextkey(td->GetListOfKeys());
   while (TKey *key = (TKey*)nextkey()) {
-    m_log << MSG::DEBUG << "  key: " << key->GetName();
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "  key: " << key->GetName();
     TObject *obj = key->ReadObj();
     if (obj != 0 && obj->IsA()->InheritsFrom("TDirectory")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
     } else if (obj != 0 && obj->IsA()->InheritsFrom("TH1")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
       tl.Add(obj);
     } else if (obj != 0) {
-      m_log << " [" << obj->IsA()->GetName() << "]";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " [" << obj->IsA()->GetName() << "]";
     }
-    m_log << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << endmsg;
   }
 
   // operate recursively
@@ -446,9 +462,10 @@ THistSvc::getTHists(const std::string& dir, TList & tl, bool rcs) const {
     r2 += ":/";
     r2 += rem;
 
-    m_log << MSG::DEBUG << "getTHists: \"" << dir
-	  << "\" looks like a stream name."  << " associated TFile: \""
-	  << itr->second.first->GetName() << "\"" << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTHists: \"" << dir
+	    << "\" looks like a stream name."  << " associated TFile: \""
+	    << itr->second.first->GetName() << "\"" << endmsg;
 
     if (gDirectory->cd(r2.c_str())) {
       m_curstream = stream;
@@ -456,13 +473,15 @@ THistSvc::getTHists(const std::string& dir, TList & tl, bool rcs) const {
       m_curstream = "";
       return sc;
     } else {
-      m_log << MSG::DEBUG << "getTHists: no such TDirectory \""
-	    << r2 << "\"" << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "getTHists: no such TDirectory \""
+	      << r2 << "\"" << endmsg;
     }
 
   } else {
-    m_log << MSG::DEBUG << "getTHists: stream \"" << stream << "\" not found"
-	  << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTHists: stream \"" << stream << "\" not found"
+	    << endmsg;
   }
 
   if (!gDirectory->cd(dir.c_str())) {
@@ -490,20 +509,25 @@ THistSvc::getTTrees(TDirectory *td, TList & tl, bool rcs) const {
     return StatusCode::FAILURE;
   }
 
-  m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
-	<< td->GetListOfKeys()->GetSize() << " keys" << endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
+	  << td->GetListOfKeys()->GetSize() << " keys" << endmsg;
 
   TIter nextkey(td->GetListOfKeys());
   while (TKey *key = (TKey*)nextkey()) {
-    m_log << MSG::DEBUG << "  key: " << key->GetName();
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "  key: " << key->GetName();
     TObject *obj = key->ReadObj();
     if (obj != 0 && obj->IsA()->InheritsFrom("TDirectory")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
     } else if (obj != 0 && obj->IsA()->InheritsFrom("TTree")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
       tl.Add(obj);
     } else if (obj != 0) {
-      m_log << " [" << obj->IsA()->GetName() << "]";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " [" << obj->IsA()->GetName() << "]";
     }
     m_log << endmsg;
   }
@@ -543,20 +567,23 @@ THistSvc::getTTrees(const std::string& dir, TList & tl, bool rcs) const {
     r2 += ":/";
     r2 += rem;
 
-    m_log << MSG::DEBUG << "getTTrees: \"" << dir
-	  << "\" looks like a stream name."  << " associated TFile: \""
-	  << itr->second.first->GetName() << "\"" << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTTrees: \"" << dir
+	    << "\" looks like a stream name."  << " associated TFile: \""
+	    << itr->second.first->GetName() << "\"" << endmsg;
 
     if (gDirectory->cd(r2.c_str())) {
       return getTTrees(gDirectory,tl,rcs);
     } else {
-      m_log << MSG::DEBUG << "getTTrees: no such TDirectory \""
-	    << r2 << "\"" << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "getTTrees: no such TDirectory \""
+	      << r2 << "\"" << endmsg;
     }
 
   } else {
-    m_log << MSG::DEBUG << "getTTrees: stream \"" << stream << "\" not found"
-	  << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTTrees: stream \"" << stream << "\" not found"
+	    << endmsg;
   }
 
   if (!gDirectory->cd(dir.c_str())) {
@@ -588,17 +615,21 @@ THistSvc::getTHists(TDirectory *td, TList & tl, bool rcs, bool reg) {
     return StatusCode::FAILURE;
   }
 
-  m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
-	<< td->GetListOfKeys()->GetSize() << " keys" << endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
+	  << td->GetListOfKeys()->GetSize() << " keys" << endmsg;
 
   TIter nextkey(td->GetListOfKeys());
   while (TKey *key = (TKey*)nextkey()) {
-    m_log << MSG::DEBUG << "  key: " << key->GetName();
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "  key: " << key->GetName();
     TObject *obj = key->ReadObj();
     if (obj != 0 && obj->IsA()->InheritsFrom("TDirectory")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
     } else if (obj != 0 && obj->IsA()->InheritsFrom("TH1")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
       tl.Add(obj);
       if (reg && m_curstream != "") {
 	string dir = td->GetPath();
@@ -611,16 +642,20 @@ THistSvc::getTHists(TDirectory *td, TList & tl, bool rcs, bool reg) {
 	  id = id + dir + "/" + key->GetName();
 	}
 	if (!exists(id)) {
-	  m_log << "  reg as \"" << id << "\"";
+	  if (m_log.level() <= MSG::DEBUG)
+	    m_log << "  reg as \"" << id << "\"";
 	  regHist(id).ignore();
 	} else {
-	  m_log << "  already registered";
+	  if (m_log.level() <= MSG::DEBUG)
+	    m_log << "  already registered";
 	}
       }
     } else if (obj != 0) {
-      m_log << " [" << obj->IsA()->GetName() << "]";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " [" << obj->IsA()->GetName() << "]";
     }
-    m_log << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << endmsg;
   }
 
   // operate recursively
@@ -659,9 +694,10 @@ THistSvc::getTHists(const std::string& dir, TList & tl, bool rcs, bool reg) {
     r2 += ":/";
     r2 += rem;
 
-    m_log << MSG::DEBUG << "getTHists: \"" << dir
-	  << "\" looks like a stream name."  << " associated TFile: \""
-	  << itr->second.first->GetName() << "\"" << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTHists: \"" << dir
+	    << "\" looks like a stream name."  << " associated TFile: \""
+	    << itr->second.first->GetName() << "\"" << endmsg;
 
     if (gDirectory->cd(r2.c_str())) {
       m_curstream = stream;
@@ -669,13 +705,15 @@ THistSvc::getTHists(const std::string& dir, TList & tl, bool rcs, bool reg) {
       m_curstream = "";
       return sc;
     } else {
-      m_log << MSG::DEBUG << "getTHists: no such TDirectory \""
-	    << r2 << "\"" << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "getTHists: no such TDirectory \""
+	      << r2 << "\"" << endmsg;
     }
 
   } else {
-    m_log << MSG::DEBUG << "getTHists: stream \"" << stream << "\" not found"
-	  << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTHists: stream \"" << stream << "\" not found"
+	    << endmsg;
   }
 
   if (!gDirectory->cd(dir.c_str())) {
@@ -709,17 +747,21 @@ THistSvc::getTTrees(TDirectory *td, TList & tl, bool rcs, bool reg) {
     return StatusCode::FAILURE;
   }
 
-  m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
-	<< td->GetListOfKeys()->GetSize() << " keys" << endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "getTHists: \"" << td->GetPath() << "\": found "
+	  << td->GetListOfKeys()->GetSize() << " keys" << endmsg;
 
   TIter nextkey(td->GetListOfKeys());
   while (TKey *key = (TKey*)nextkey()) {
-    m_log << MSG::DEBUG << "  key: " << key->GetName();
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "  key: " << key->GetName();
     TObject *obj = key->ReadObj();
     if (obj != 0 && obj->IsA()->InheritsFrom("TDirectory")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
     } else if (obj != 0 && obj->IsA()->InheritsFrom("TTree")) {
-      m_log << " (" << obj->IsA()->GetName() << ")";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " (" << obj->IsA()->GetName() << ")";
       tl.Add(obj);
       if (reg && m_curstream != "") {
 	string dir = td->GetPath();
@@ -732,16 +774,20 @@ THistSvc::getTTrees(TDirectory *td, TList & tl, bool rcs, bool reg) {
 	  id = id + dir + "/" + key->GetName();
 	}
 	if (!exists(id)) {
-	  m_log << "  reg as \"" << id << "\"";
+	  if (m_log.level() <= MSG::DEBUG)
+	    m_log << "  reg as \"" << id << "\"";
 	  regHist(id).ignore();
 	} else {
-	  m_log << "  already registered";
+	  if (m_log.level() <= MSG::DEBUG)
+	    m_log << "  already registered";
 	}
       }
     } else if (obj != 0) {
-      m_log << " [" << obj->IsA()->GetName() << "]";
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << " [" << obj->IsA()->GetName() << "]";
     }
-    m_log << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << endmsg;
   }
 
   // operate recursively
@@ -780,20 +826,23 @@ THistSvc::getTTrees(const std::string& dir, TList & tl, bool rcs, bool reg) {
     r2 += ":/";
     r2 += rem;
 
-    m_log << MSG::DEBUG << "getTTrees: \"" << dir
-	  << "\" looks like a stream name."  << " associated TFile: \""
-	  << itr->second.first->GetName() << "\"" << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTTrees: \"" << dir
+	    << "\" looks like a stream name."  << " associated TFile: \""
+	    << itr->second.first->GetName() << "\"" << endmsg;
 
     if (gDirectory->cd(r2.c_str())) {
       return getTTrees(gDirectory,tl,rcs,reg);
     } else {
-      m_log << MSG::DEBUG << "getTTrees: no such TDirectory \""
-	    << r2 << "\"" << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "getTTrees: no such TDirectory \""
+	      << r2 << "\"" << endmsg;
     }
 
   } else {
-    m_log << MSG::DEBUG << "getTTrees: stream \"" << stream << "\" not found"
-	  << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "getTTrees: stream \"" << stream << "\" not found"
+	    << endmsg;
   }
 
   if (!gDirectory->cd(dir.c_str())) {
@@ -927,8 +976,10 @@ THistSvc::regTree(const std::string& id) {
 StatusCode
 THistSvc::regTree(const std::string& id, TTree* hist) {
   StatusCode sc = regHist_i(hist, id);
-  if (hist != 0 && m_autoSave != 0 && sc.isSuccess()) {
-    hist->SetAutoSave(m_autoSave);
+  if (hist != 0 && sc.isSuccess()) {
+    if (m_autoSave != 0) 
+      hist->SetAutoSave(m_autoSave);
+    hist->SetAutoFlush(m_autoFlush);
   }
   return sc;
 }
@@ -1277,6 +1328,7 @@ THistSvc::updateFiles() {
 
 
 #ifndef NDEBUG
+      if (m_log.level() <= MSG::DEBUG)
 	m_log << MSG::DEBUG << "migrating uid: " << uitr->second.id
 	      << "   stream: " << streamName
 	      << "   oldFile: " << oldFileName
@@ -1289,9 +1341,10 @@ THistSvc::updateFiles() {
 	  while ( (sitr=m_fileStreams.find(oldFileName)) != m_fileStreams.end() ) {
 
 #ifndef NDEBUG
-	    m_log << MSG::DEBUG << "changing filename \"" << oldFileName
-		  << "\" to \"" << newFileName << "\" for stream \""
-		  << sitr->second << "\"" << endmsg;
+	    if (m_log.level() <= MSG::DEBUG)
+	      m_log << MSG::DEBUG << "changing filename \"" << oldFileName
+		    << "\" to \"" << newFileName << "\" for stream \""
+		    << sitr->second << "\"" << endmsg;
 #endif
 	    m_fileStreams.erase(sitr);
 	    m_fileStreams.insert( make_pair<std::string,std::string>(newFileName,streamName) );
@@ -1328,14 +1381,16 @@ THistSvc::write() {
   }
 
 
-  m_log << MSG::DEBUG << "THistSvc::write()::List of Files connected in ROOT "
-	<< endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "THistSvc::write()::List of Files connected in ROOT "
+	  << endmsg;
 
   TSeqCollection *filelist=gROOT->GetListOfFiles();
   for (int ii=0; ii<filelist->GetEntries(); ii++) {
-    m_log << MSG::DEBUG
-	  << "THistSvc::write()::List of Files connected in ROOT: \""
-	  << filelist->At(ii)->GetName()<<"\""<<endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG
+	    << "THistSvc::write()::List of Files connected in ROOT: \""
+	    << filelist->At(ii)->GetName()<<"\""<<endmsg;
   }
 
   return StatusCode::SUCCESS;
@@ -1456,9 +1511,10 @@ THistSvc::connect(const std::string& ident) {
     } else {
       TFile *f2 = f_info.first;
       m_files[stream] = make_pair<TFile*,Mode>(f2,newMode);
-      m_log << MSG::DEBUG << "Connecting stream: \"" << stream
-	    << "\" to previously opened TFile: \"" << filename << "\""
-	    << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log << MSG::DEBUG << "Connecting stream: \"" << stream
+	      << "\" to previously opened TFile: \"" << filename << "\""
+	      << endmsg;
       return StatusCode::SUCCESS;
     }
   }
@@ -1561,8 +1617,9 @@ THistSvc::connect(const std::string& ident) {
     out << ishared++;
     filename = string("tmp_THistSvc_")+out.str()+string(".root");
 
-    m_log << MSG::DEBUG << "Creating temp file \"" << filename
-	  << "\" and realfilename="<<realfilename << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "Creating temp file \"" << filename
+	    << "\" and realfilename="<<realfilename << endmsg;
     m_sharedFiles[stream]=realfilename;
 
     try {
@@ -1627,9 +1684,10 @@ THistSvc::connect(const std::string& ident) {
   m_files[stream] = make_pair<TFile*,Mode>(f,newMode);
   m_fileStreams.insert(make_pair<std::string,std::string>(filename,stream));
 
-  m_log << MSG::DEBUG << "Opening TFile \"" << filename << "\"  stream: \""
-	<< stream << "\"  mode: \"" << typ << "\"" << " comp level: " << cl
-	<< endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log << MSG::DEBUG << "Opening TFile \"" << filename << "\"  stream: \""
+	  << stream << "\"  mode: \"" << typ << "\"" << " comp level: " << cl
+	  << endmsg;
 
   return StatusCode::SUCCESS;
 }
@@ -1716,7 +1774,8 @@ THistSvc::removeDoubleSlash(std::string& id) const {
 
 void THistSvc::MergeRootFile(TDirectory *target, TDirectory *source) {
 
-  m_log <<MSG::DEBUG << "Target path: " << target->GetPath() << endmsg;
+  if (m_log.level() <= MSG::DEBUG)
+    m_log <<MSG::DEBUG << "Target path: " << target->GetPath() << endmsg;
   TString path( (char*)strstr(target->GetPath(), ":") );
   path.Remove( 0, 2);
 
@@ -1730,7 +1789,8 @@ void THistSvc::MergeRootFile(TDirectory *target, TDirectory *source) {
   for (int jj=0; jj<nkeys; jj++) {
     key=(TKey*) lkeys->At(jj);
     string pathnameinsource=current_sourcedir->GetPath()+string("/")+key->GetName();
-    m_log <<MSG::DEBUG << "Reading Key:" << pathnameinsource << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log <<MSG::DEBUG << "Reading Key:" << pathnameinsource << endmsg;
     //key->Dump();
     //TObject *obj=key->ReadObj();
     TObject *obj=source->Get(pathnameinsource.c_str());
@@ -1738,8 +1798,9 @@ void THistSvc::MergeRootFile(TDirectory *target, TDirectory *source) {
     if (obj->IsA()->InheritsFrom("TDirectory") ) {
       // it's a subdirectory
 
-      m_log <<MSG::DEBUG << "Found subdirectory " << obj->GetName()
-	    << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log <<MSG::DEBUG << "Found subdirectory " << obj->GetName()
+	      << endmsg;
 
       // create a new subdir of same name and title in the target file
       target->cd();
@@ -1749,13 +1810,15 @@ void THistSvc::MergeRootFile(TDirectory *target, TDirectory *source) {
       MergeRootFile(newtargetdir, source);
 
     } else if (obj->IsA()->InheritsFrom("TTree")) {
-      m_log <<MSG::DEBUG << "Found TTree " << obj->GetName() << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log <<MSG::DEBUG << "Found TTree " << obj->GetName() << endmsg;
       TTree *mytree=dynamic_cast<TTree*>(obj);
       int nentries=(int) mytree->GetEntries();
       mytree->SetBranchStatus("*",1);
 
-      m_log <<MSG::DEBUG << "Dumping TTree " << nentries <<" entries"
-	  << endmsg;
+      if (m_log.level() <= MSG::DEBUG)
+	m_log <<MSG::DEBUG << "Dumping TTree " << nentries <<" entries"
+	      << endmsg;
       //mytree->Print();
       //for (int ij=0; ij<nentries; ij++) {
       //m_log <<MSG::DEBUG << "Dumping TTree Show( " << ij <<" )"
@@ -1810,9 +1873,10 @@ THistSvc::handle( const Incident& /* inc */ ) {
     TFile* tf = itr->second.first;
 
 #ifndef NDEBUG
-    m_log << MSG::DEBUG << "stream: " << itr->first << "  name: "
-	  << tf->GetName() << "  size: " << tf->GetSize()
-	  << endmsg;
+    if (m_log.level() <= MSG::DEBUG)
+      m_log << MSG::DEBUG << "stream: " << itr->first << "  name: "
+	    << tf->GetName() << "  size: " << tf->GetSize()
+	    << endmsg;
 #endif
 
     // Signal job to terminate if output file is too large
diff --git a/GaudiSvc/src/THistSvc/THistSvc.h b/GaudiSvc/src/THistSvc/THistSvc.h
index 509f91b91aeb5d533553fcb084d9f1df05751e6c..d9c721feea5b2d5b285bd9c2c4cf20b12b4080c7 100644
--- a/GaudiSvc/src/THistSvc/THistSvc.h
+++ b/GaudiSvc/src/THistSvc/THistSvc.h
@@ -167,7 +167,7 @@ private:
 
   StringArrayProperty m_inputfile, m_outputfile;
   std::vector<std::string> m_Rstream, m_Wstream;
-  IntegerProperty m_autoSave, m_compressionLevel, m_maxFileSize;
+  IntegerProperty m_autoSave, m_autoFlush, m_compressionLevel, m_maxFileSize;
   BooleanProperty m_print;
 
   /// list of already connected files. This is to keep track of files
diff --git a/GaudiSvc/src/THistSvc/THistSvc.icc b/GaudiSvc/src/THistSvc/THistSvc.icc
index 9fc59e5596852c550f510595a44a25d0cc089373..72788d4c0a2fd71669e68a14a640f4ab32520fe8 100644
--- a/GaudiSvc/src/THistSvc/THistSvc.icc
+++ b/GaudiSvc/src/THistSvc/THistSvc.icc
@@ -52,8 +52,9 @@ StatusCode THistSvc::regHist_i(T* hist, const std::string& id) {
   if (f == 0) {
     temp = true;
     MsgStream log( msgSvc(), name() );
-    log << MSG::DEBUG << "Historgram with id \"" << idr << "\" is temporary"
-        << endmsg;
+    if (log.level() <= MSG::DEBUG)
+      log << MSG::DEBUG << "Historgram with id \"" << idr << "\" is temporary"
+	  << endmsg;
   }
 
 
@@ -128,13 +129,14 @@ StatusCode THistSvc::regHist_i(T* hist, const std::string& id) {
   }
 
   MsgStream log( msgSvc(), name() );
-  log << MSG::DEBUG << "Registering " << System::typeinfoName(typeid(*hist))
-      << " title: \"" << hist->GetTitle()
-      << "\"  id: \"" << uid << "\"  dir: "
-    //      << hist->GetDirectory()->GetPath() << "  "
-      << changeDir(hid)->GetPath()
-      << "  file: " << fname
-      << endmsg;
+  if (log.level() <= MSG::DEBUG) 
+    log << MSG::DEBUG << "Registering " << System::typeinfoName(typeid(*hist))
+	<< " title: \"" << hist->GetTitle()
+	<< "\"  id: \"" << uid << "\"  dir: "
+      //      << hist->GetDirectory()->GetPath() << "  "
+	<< changeDir(hid)->GetPath()
+	<< "  file: " << fname
+	<< endmsg;
 
   m_ids.insert(std::pair<std::string,THistID>(rem, hid));
   m_uids[uid] = hid;
@@ -308,10 +310,10 @@ THistSvc::readHist_i(const std::string& id, T*& hist) const {
 
 
   MsgStream log( msgSvc(), name() );
-  log << MSG::DEBUG << "Read in " << hist->IsA()->GetName() << "  \""
-      << hist->GetName() << "\" from file "
-      << file->GetName() << endmsg;
   if (log.level() <= MSG::DEBUG) {
+    log << MSG::DEBUG << "Read in " << hist->IsA()->GetName() << "  \""
+	<< hist->GetName() << "\" from file "
+	<< file->GetName() << endmsg;
     hist->Print();
   }
 
diff --git a/GaudiSys/cmt/requirements b/GaudiSys/cmt/requirements
index fb47b6c25d508abd0dab491429f7e269c7a72b81..4c094e6064900d59474f7d5adc28d2d8a86d5365 100644
--- a/GaudiSys/cmt/requirements
+++ b/GaudiSys/cmt/requirements
@@ -1,6 +1,6 @@
 # $Id: requirements,v 1.81 2008/11/10 18:54:02 marcocle Exp $
 package GaudiSys
-version v22r0
+version v22r2
 
 branches doc cmt 
 
diff --git a/GaudiSys/doc/release.notes b/GaudiSys/doc/release.notes
index f6e861e0f1d290473bbbaac16ff08bde0cbbf427..70cd6c46fd56919c17dce59471c63c86683fe274 100644
--- a/GaudiSys/doc/release.notes
+++ b/GaudiSys/doc/release.notes
@@ -1,6 +1,8 @@
 package GaudiSys
 package manager: Pere Mato
 
+=============================== GaudiSys v22r2 ===============================
+=============================== GaudiSys v22r1 ===============================
 =============================== GaudiSys v22r0 ===============================
 ============================== GaudiSys v21r11 ===============================
 ============================== GaudiSys v21r10 ===============================
diff --git a/GaudiUtils/cmt/requirements b/GaudiUtils/cmt/requirements
index 03b21d266357d46594787b3e33b5b3da7e1c2022..cab455bde2f8ea9f9e1f69e59ec6c62618d0da66 100644
--- a/GaudiUtils/cmt/requirements
+++ b/GaudiUtils/cmt/requirements
@@ -1,7 +1,7 @@
 # $Id: requirements,v 1.11 2008/11/10 18:54:35 marcocle Exp $ 
 # =============================================================================
 package GaudiUtils
-version v3r11
+version v3r12
 
 # ============== structure ====================================================	
 branches        GaudiUtils src cmt doc
diff --git a/GaudiUtils/doc/release.notes b/GaudiUtils/doc/release.notes
index bdec20601caaa74fda6e220e084478127ee7544f..c2aeb53d16deb6da372b2d6b60ea279f40924911 100644
--- a/GaudiUtils/doc/release.notes
+++ b/GaudiUtils/doc/release.notes
@@ -1,6 +1,13 @@
 Package: GaudiUtils
 Package manager : Marco Clemencic
 
+============================== GaudiUtils v3r12 ==============================
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+
 ============================== GaudiUtils v3r11 ==============================
 ! 2011-01-11 - Marco Clemencic
  - Fixed some ICC remarks.
diff --git a/GaudiUtils/src/Lib/Aida2ROOT.cpp b/GaudiUtils/src/Lib/Aida2ROOT.cpp
index 59e1eb891b5041fd7a0db2d685d72adea36d680d..aa6c05e39a2972f03bb67876504a560b2d9196ef 100644
--- a/GaudiUtils/src/Lib/Aida2ROOT.cpp
+++ b/GaudiUtils/src/Lib/Aida2ROOT.cpp
@@ -4,6 +4,12 @@
 //   TODO: To be removed, since it comes from ROOT TMathBase.h
 #pragma warning(disable:2259)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 // ============================================================================
 // Include files
 // ============================================================================
diff --git a/GaudiUtils/src/Lib/HistoDump.cpp b/GaudiUtils/src/Lib/HistoDump.cpp
index 3ff9adb8598d5d150e0df05da446403f56333158..93c1c6ae5a994bea49f0cfa22b5560dd6764239d 100644
--- a/GaudiUtils/src/Lib/HistoDump.cpp
+++ b/GaudiUtils/src/Lib/HistoDump.cpp
@@ -7,10 +7,16 @@
 //   The comparison are meant
 #pragma warning(disable:1572)
 #endif
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 // ============================================================================
-// Include files 
+// Include files
 // ============================================================================
-// STD & STL 
+// STD & STL
 // ============================================================================
 #include <cmath>
 #include <vector>
@@ -29,23 +35,23 @@
 // ============================================================================
 #include "GaudiKernel/StatusCode.h"
 // ============================================================================
-// ROOT 
+// ROOT
 // ============================================================================
 #include "TH1.h"
 #include "TProfile.h"
 #include "TAxis.h"
 // ============================================================================
-// Boost 
+// Boost
 // ============================================================================
 #include "boost/format.hpp"
 // ============================================================================
-// Local 
+// Local
 // ============================================================================
 #include "GaudiUtils/HistoDump.h"
 #include "GaudiUtils/HistoTableFormat.h"
 #include "GaudiUtils/HistoStats.h"
 // ============================================================================
-namespace 
+namespace
 {
   // ==========================================================================
   /** @struct Histo
@@ -63,24 +69,24 @@ namespace
      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
      *  @date 2009-09-18
      */
-    struct Bin 
+    struct Bin
     {
       // ======================================================================
-      Bin ( const double h = 0  , 
+      Bin ( const double h = 0  ,
             const double e = 0  ,
-            const double l = -1 ) 
-        : height ( h  ) 
-        , error  ( e  ) 
+            const double l = -1 )
+        : height ( h  )
+        , error  ( e  )
         , lower ( l ) {}
       // ======================================================================
-      /// bin height 
-      double height ;                                            //  bin height 
-      /// bin error 
+      /// bin height
+      double height ;                                            //  bin height
+      /// bin error
       double error  ;                                            //   bin error
-      /// lower edge 
-      double lower  ;                                            //  lower edge 
+      /// lower edge
+      double lower  ;                                            //  lower edge
       // ======================================================================
-      Bin& operator+= ( const Bin& right ) 
+      Bin& operator+= ( const Bin& right )
       {
         height          += right.height     ;
         const double e2  = error * error + right.error * right.error ;
@@ -90,45 +96,45 @@ namespace
       // ======================================================================
     } ;
     // ========================================================================
-    /// get Y-max 
-    double maxY ( const bool withErr ) const 
+    /// get Y-max
+    double maxY ( const bool withErr ) const
     {
       double _m  = std::max ( under.height , over.height  ) ;
-      for ( Bins::const_iterator ib = bins.begin() ; bins.end() != ib ; ++ib ) 
+      for ( Bins::const_iterator ib = bins.begin() ; bins.end() != ib ; ++ib )
       { _m = std::max ( _m  , withErr ?  ib->height +  ib->error :  ib->height ) ; }
       return _m ;
     }
-    /// get Y-min 
-    double minY ( const bool withErr ) const 
+    /// get Y-min
+    double minY ( const bool withErr ) const
     {
       double _m  = std::min ( under.height , over.height  ) ;
-      for ( Bins::const_iterator ib = bins.begin() ; bins.end() != ib ; ++ib ) 
+      for ( Bins::const_iterator ib = bins.begin() ; bins.end() != ib ; ++ib )
       { _m = std::min ( _m  , withErr ?  ib->height - ib->error :  ib->height ) ; }
       return _m ;
     }
-    /// rebin the histogram 
-    Histo rebin ( const unsigned int bin ) const 
+    /// rebin the histogram
+    Histo rebin ( const unsigned int bin ) const
     {
-      // create new histogram 
+      // create new histogram
       Histo nh ;
-      // copy overflow & underflow bins 
+      // copy overflow & underflow bins
       nh.under = under ;
       nh.over  = over  ;
       // rebin
-      for ( unsigned int ibin = 0 ; ibin < bins.size() ; ++ibin ) 
+      for ( unsigned int ibin = 0 ; ibin < bins.size() ; ++ibin )
       {
         const Bin& current = bins[ibin] ;
         if      ( nh.bins.empty() ) { nh.bins.push_back ( current ) ; }
         else if ( 0 == ibin % bin ) { nh.bins.push_back ( current ) ; }
-        else                        { nh.bins.back()   += current   ; }    
+        else                        { nh.bins.back()   += current   ; }
       }
       return nh ;
     }
-    // find "null-bin", if any 
+    // find "null-bin", if any
     int nullBin () const
     {
-      for ( Bins::const_iterator ib = bins.begin() ; bins.end() != ib + 1 ; ++ib ) 
-      { if ( ib->lower <= 0 && 0 < (ib+1)->lower ) { return ib - bins.begin() ; } } 
+      for ( Bins::const_iterator ib = bins.begin() ; bins.end() != ib + 1 ; ++ib )
+      { if ( ib->lower <= 0 && 0 < (ib+1)->lower ) { return ib - bins.begin() ; } }
       return -1 ;
     }
     // ========================================================================
@@ -136,23 +142,23 @@ namespace
     // ========================================================================
     /// histogram bins:
     Bins bins  ;                                              // histogram bins
-    /// underflow bin 
-    Bin  under ;                                              //  underflow bin 
-    /// overflow bin 
-    Bin  over  ;                                              //   overflow bin 
+    /// underflow bin
+    Bin  under ;                                              //  underflow bin
+    /// overflow bin
+    Bin  over  ;                                              //   overflow bin
     // ========================================================================
   } ;
   // ==========================================================================
-  /** "convert ROOT histogram into "local" histogram 
-   *   @param root (INPUT)  pointer to ROOT histogram 
-   *   @param hist (OUTPUT) local histogram 
-   *   @return StatusCode 
+  /** "convert ROOT histogram into "local" histogram
+   *   @param root (INPUT)  pointer to ROOT histogram
+   *   @param hist (OUTPUT) local histogram
+   *   @return StatusCode
    *   @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
    *   @date 2009-09-19
    */
-  StatusCode _getHisto ( const TH1* root , Histo& hist ) 
+  StatusCode _getHisto ( const TH1* root , Histo& hist )
   {
-    // clear the histogram 
+    // clear the histogram
     hist.bins.clear() ;
     //
     if ( 0 == root  ) { return StatusCode::FAILURE ; } // RETURN
@@ -160,10 +166,10 @@ namespace
     if ( 0 == axis  ) { return StatusCode::FAILURE ; } // RETURN
     const int    nbins = axis->GetNbins () ;
     if ( 0 == nbins ) { return StatusCode::FAILURE ; } // RETURN
-    
-    // underflow bin 
+
+    // underflow bin
     hist.under = Histo::Bin ( root -> GetBinContent ( 0         ) ,
-                              root -> GetBinError   ( 0         ) , 
+                              root -> GetBinError   ( 0         ) ,
                               axis -> GetXmin       ()            ) ;
     // overflow bin
     hist.over  = Histo::Bin ( root -> GetBinContent ( nbins + 1 ) ,
@@ -171,9 +177,9 @@ namespace
                               axis -> GetXmax       ()            ) ;
     //
     //
-    for ( int ibin = 1 ; ibin <= nbins ; ++ibin ) 
+    for ( int ibin = 1 ; ibin <= nbins ; ++ibin )
     {
-      // add to the local histo 
+      // add to the local histo
       Histo::Bin bin ( root -> GetBinContent   ( ibin ) ,
                        root -> GetBinError     ( ibin ) ,
                        axis -> GetBinLowEdge   ( ibin ) ) ;
@@ -182,32 +188,32 @@ namespace
     return StatusCode::SUCCESS ;
   }
   // ==========================================================================
-  /** "convert ROOT 1D-profile into "local" histogram 
-   *   @param root (INPUT)  pointer to ROOT 1D-profile 
-   *   @param hist (OUTPUT) local histogram 
-   *   @return StatusCode 
+  /** "convert ROOT 1D-profile into "local" histogram
+   *   @param root (INPUT)  pointer to ROOT 1D-profile
+   *   @param hist (OUTPUT) local histogram
+   *   @return StatusCode
    *   @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
    *   @date 2009-09-19
    */
-  StatusCode _getHisto ( const TProfile* root      , 
-                         Histo&          hist      , 
-                         const bool   /* spread */ ) 
+  StatusCode _getHisto ( const TProfile* root      ,
+                         Histo&          hist      ,
+                         const bool   /* spread */ )
   {
     const TH1* histo = root ;
     return _getHisto ( histo , hist ) ;
   }
   // ==========================================================================
-  /** "convert AIDA histogram into "local" histogram 
-   *   @param aida (INPUT)  pointer to AIDA histogram 
-   *   @param hist (OUTPUT) local histogram 
-   *   @return StatusCode 
+  /** "convert AIDA histogram into "local" histogram
+   *   @param aida (INPUT)  pointer to AIDA histogram
+   *   @param hist (OUTPUT) local histogram
+   *   @return StatusCode
    *   @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *   @date 2009-09-19
    */
-  StatusCode _getHisto 
-  ( const AIDA::IHistogram1D* aida , Histo& hist ) 
+  StatusCode _getHisto
+  ( const AIDA::IHistogram1D* aida , Histo& hist )
   {
-    // clear the histogram 
+    // clear the histogram
     hist.bins.clear() ;
     //
     if ( 0 == aida ) { return StatusCode::FAILURE ; } // RETURN
@@ -215,18 +221,18 @@ namespace
     const AIDA::IAxis& axis  = aida -> axis () ;
     const int          nbins = axis .  bins () ;
     //
-   // underflow bin 
+   // underflow bin
     hist.under = Histo::Bin ( aida -> binHeight ( AIDA::IAxis::UNDERFLOW_BIN ) ,
-                              aida -> binError  ( AIDA::IAxis::UNDERFLOW_BIN ) , 
+                              aida -> binError  ( AIDA::IAxis::UNDERFLOW_BIN ) ,
                               axis .  lowerEdge ()  ) ;
     // overflow bin
     hist.over  = Histo::Bin ( aida -> binHeight ( AIDA::IAxis::OVERFLOW_BIN  ) ,
                               aida -> binError  ( AIDA::IAxis::OVERFLOW_BIN  ) ,
                               axis .  upperEdge ()  ) ;
     //
-    for ( int ibin = 0 ; ibin < nbins ; ++ibin ) 
+    for ( int ibin = 0 ; ibin < nbins ; ++ibin )
     {
-      // add to the local histo 
+      // add to the local histo
       Histo::Bin bin ( aida -> binHeight    ( ibin ) ,
                        aida -> binError     ( ibin ) ,
                        axis .  binLowerEdge ( ibin ) ) ;
@@ -235,19 +241,19 @@ namespace
     return StatusCode::SUCCESS ;
   }
   // ==========================================================================
-  /** "convert AIDA 1D-profile into "local" histogram 
+  /** "convert AIDA 1D-profile into "local" histogram
    *   @param aida (INPUT)  pointer to AIDA 1D-profile
-   *   @param hist (OUTPUT) local histogram 
-   *   @return StatusCode 
+   *   @param hist (OUTPUT) local histogram
+   *   @return StatusCode
    *   @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
    *   @date 2009-09-19
    */
-  StatusCode _getHisto 
-  ( const AIDA::IProfile1D* aida   , 
-    Histo&                  hist   , 
-    const bool              spread ) 
+  StatusCode _getHisto
+  ( const AIDA::IProfile1D* aida   ,
+    Histo&                  hist   ,
+    const bool              spread )
   {
-    // clear the histogram 
+    // clear the histogram
     hist.bins.clear() ;
     //
     if ( 0 == aida ) { return StatusCode::FAILURE ; } // RETURN
@@ -255,24 +261,24 @@ namespace
     const AIDA::IAxis& axis  = aida -> axis () ;
     const int          nbins = axis .  bins () ;
     //
-    // underflow bin 
+    // underflow bin
     hist.under = Histo::Bin ( aida -> binHeight ( AIDA::IAxis::UNDERFLOW_BIN ) ,
-                              spread ? 
+                              spread ?
                               aida -> binRms    ( AIDA::IAxis::UNDERFLOW_BIN ) :
-                              aida -> binError  ( AIDA::IAxis::UNDERFLOW_BIN ) , 
+                              aida -> binError  ( AIDA::IAxis::UNDERFLOW_BIN ) ,
                               axis .  lowerEdge ()  ) ;
     // overflow bin
     hist.over  = Histo::Bin ( aida -> binHeight ( AIDA::IAxis::OVERFLOW_BIN  ) ,
-                              spread ?                              
+                              spread ?
                               aida -> binRms    ( AIDA::IAxis::OVERFLOW_BIN  ) :
                               aida -> binError  ( AIDA::IAxis::OVERFLOW_BIN  ) ,
                               axis .  upperEdge ()  ) ;
     //
-    for ( int ibin = 0 ; ibin < nbins ; ++ibin ) 
+    for ( int ibin = 0 ; ibin < nbins ; ++ibin )
     {
-      // add to the local histo 
+      // add to the local histo
       Histo::Bin bin ( aida -> binHeight    ( ibin ) ,
-                       spread ?                              
+                       spread ?
                        aida -> binRms       ( ibin ) :
                        aida -> binError     ( ibin ) ,
                        axis .  binLowerEdge ( ibin ) ) ;
@@ -281,42 +287,42 @@ namespace
     return StatusCode::SUCCESS ;
   }
   // ==========================================================================
-  /** find the approrpriate rebin factor 
+  /** find the approrpriate rebin factor
    *  (I suspect that there is some intelligent STD/STL routine for this purpose)
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  inline unsigned int rebin 
-  ( const unsigned int bins , 
-    const unsigned int imax ) 
+  inline unsigned int rebin
+  ( const unsigned int bins ,
+    const unsigned int imax )
   {
-    if ( 0 == imax  ) { return 1 ; }                                  // RETURN 
+    if ( 0 == imax  ) { return 1 ; }                                  // RETURN
     unsigned int ibin = 1 ;
     while ( bins > imax * ibin ) { ++ibin ; }
-    return ibin ;                                                     // RETURN 
+    return ibin ;                                                     // RETURN
   }
   // ==========================================================================
-  /** decompose the double value into decimal significand 
+  /** decompose the double value into decimal significand
    *  (I suspect that there is some intelligent STD/STL routine for this purpose)
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  std::pair<double,int> decompose ( double v ) 
+  std::pair<double,int> decompose ( double v )
   {
-    if      ( 0 == v ) { return std::make_pair ( 0.0 , 0 ) ;  }       // RETURN 
-    else if ( 1 == v ) { return std::make_pair ( 1.0 , 0 ) ;  }       // RETURN 
-    else if ( 0 >  v ) 
+    if      ( 0 == v ) { return std::make_pair ( 0.0 , 0 ) ;  }       // RETURN
+    else if ( 1 == v ) { return std::make_pair ( 1.0 , 0 ) ;  }       // RETURN
+    else if ( 0 >  v )
     {
       std::pair<double,int> r = decompose ( -v ) ;
-      return std::pair<double,int>( -r.first , r.second ) ;          // RETURN 
+      return std::pair<double,int>( -r.first , r.second ) ;          // RETURN
     }
-    else if ( 0.1 > v  ) 
+    else if ( 0.1 > v  )
     {
       int i       = 0 ;
       while ( 0.1 > v   ) { ++i ; v *= 10 ; }       // STUPID
       return std::make_pair ( v , -i ) ;
     }
-    else if ( 1  < v  ) 
+    else if ( 1  < v  )
     {
       int i       = 0 ;
       while ( 1  <= v  ) { ++i ; v /= 10 ; }       // STUPID
@@ -325,99 +331,99 @@ namespace
     return std::make_pair ( v , 1 ) ;
   }
   // ==========================================================================
-  /** "efficient" pow-function 
+  /** "efficient" pow-function
    *  @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
    *  @date 2009-09-19
    */
   inline double _pow ( double __x , unsigned long __n )
   {
-    double __y = __n % 2 ? __x : 1; 
+    double __y = __n % 2 ? __x : 1;
     while ( __n >>= 1 )
     {
       __x = __x * __x;
       if ( __n % 2) { __y = __y * __x; }
-    }  
+    }
     return __y ;
   }
   // ==========================================================================
-  /** find the proper "round" value 
+  /** find the proper "round" value
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
   inline double rValMax ( const double v ) ;
   // ==========================================================================
-  /** find the proper "round" value 
+  /** find the proper "round" value
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
   inline double rValMin ( const double v ) ;
   // ==========================================================================
-  /** find the proper "round" value 
+  /** find the proper "round" value
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  inline double rValMax ( const double v ) 
+  inline double rValMax ( const double v )
   {
-    if      ( 0 == v  ) { return 0                   ; }             // RETURN    
-    else if ( 0 >  v  ) { return -1 * rValMin ( -v ) ; }             // RETURN 
-    // decompose the double value into decimal significand and mantissa  
+    if      ( 0 == v  ) { return 0                   ; }             // RETURN
+    else if ( 0 >  v  ) { return -1 * rValMin ( -v ) ; }             // RETURN
+    // decompose the double value into decimal significand and mantissa
     std::pair<double,int> r = decompose ( v ) ;
-    // 
+    //
     const double f = std::ceil ( 20 * r.first ) / 2 ; // + 1 ;
     const int    l = r.second                   - 1 ;
     return 0 < l ? f * _pow ( 10 ,  l ) : f / _pow ( 10 , -l ) ;
   }
   // ==========================================================================
-  /** find the proper "round" value 
+  /** find the proper "round" value
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  inline double rValMin ( const double v ) 
+  inline double rValMin ( const double v )
   {
-    if      ( 0 == v  ) { return 0                   ; }             // RETURN    
-    else if ( 0 >  v  ) { return -1 * rValMax ( -v ) ; }             // RETURN 
-    // decompose the double value into decimal significand and mantissa  
+    if      ( 0 == v  ) { return 0                   ; }             // RETURN
+    else if ( 0 >  v  ) { return -1 * rValMax ( -v ) ; }             // RETURN
+    // decompose the double value into decimal significand and mantissa
     std::pair<double,int> r = decompose ( v ) ;
     const double f = std::floor ( 20 * r.first ) / 2 ; // - 1 ;
     const int    l = r.second - 1   ;
     return 0 < l ? f * _pow ( 10 ,  l ) : f / _pow ( 10 , -l ) ;
   }
   // ==========================================================================
-  /** make the label for y-axis 
+  /** make the label for y-axis
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  inline std::string yLabel  ( const double value ) 
+  inline std::string yLabel  ( const double value )
   {
     boost::format fmt ( "%10.3g" ) ;
     fmt % value ;
     return fmt.str () ;
   }
   // ==========================================================================
-  /** make the label for x-axis 
+  /** make the label for x-axis
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  inline std::string xLabel  ( const double value ) 
+  inline std::string xLabel  ( const double value )
   {
     boost::format fmt ( "%9.3g" ) ;
     fmt % value ;
     return fmt.str () ;
   }
   // ==========================================================================
-  /// get "correct" symbol 
-  char symbBin ( const Histo::Bin& bin    , 
-                 const double      yLow   , 
-                 const double      yHigh  , 
+  /// get "correct" symbol
+  char symbBin ( const Histo::Bin& bin    ,
+                 const double      yLow   ,
+                 const double      yHigh  ,
                  const bool        yNull  ,
-                 const bool        errors ) 
+                 const bool        errors )
   {
-    if      ( errors && yLow  <= bin.height && bin.height < yHigh             ) { return '*' ; } // O 
+    if      ( errors && yLow  <= bin.height && bin.height < yHigh             ) { return '*' ; } // O
     else if ( errors && yHigh <  bin.height -  bin.error                      ) { return ' ' ; }
     else if ( errors && yLow  >= bin.height +  bin.error                      ) { return ' ' ; }
     else if ( errors                                                          ) { return 'I' ; }
     else if ( yLow  <= bin.height  && bin.height < yHigh                      ) { return '*' ; }
-    else if ( 0 <= bin.height && yLow  <= bin.height  && 0 <  yHigh && !yNull ) { return '*' ; } // + 
+    else if ( 0 <= bin.height && yLow  <= bin.height  && 0 <  yHigh && !yNull ) { return '*' ; } // +
     else if ( 0 >  bin.height && yHigh >  bin.height  && 0 >= yLow  && !yNull ) { return '*' ; } // -
     //
     return ' ' ;
@@ -427,107 +433,107 @@ namespace
    *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
    *  @date 2009-09-19
    */
-  std::ostream& dumpText 
-  ( const Histo&              histo  , 
-    const std::size_t         width  , 
-    const std::size_t         height , 
+  std::ostream& dumpText
+  ( const Histo&              histo  ,
+    const std::size_t         width  ,
+    const std::size_t         height ,
     const bool                errors ,
-    std::ostream&             stream ) 
+    std::ostream&             stream )
   {
-    if (  40    > width  ) { return dumpText ( histo ,  40   , height , errors , stream ) ; } 
-    if ( 200    < width  ) { return dumpText ( histo , 200   , height , errors , stream ) ; } 
-    if ( 150    < height ) { return dumpText ( histo , width , 150    , errors , stream ) ; } 
-    if (  20    > height ) { return dumpText ( histo , width , 20     , errors , stream ) ; } 
+    if (  40    > width  ) { return dumpText ( histo ,  40   , height , errors , stream ) ; }
+    if ( 200    < width  ) { return dumpText ( histo , 200   , height , errors , stream ) ; }
+    if ( 150    < height ) { return dumpText ( histo , width , 150    , errors , stream ) ; }
+    if (  20    > height ) { return dumpText ( histo , width , 20     , errors , stream ) ; }
     if ( height > width  ) { return dumpText ( histo , width , width  , errors , stream ) ; }
     //
     const unsigned int nBins = histo.bins.size() ;
     if ( nBins > width  )
     {
-      // rebin histogram 
+      // rebin histogram
       Histo r = histo.rebin ( rebin ( nBins , width ) ) ;
       return dumpText ( r , width , height , errors , stream ) ;
     }
-    // 
-    // get the Y-scale 
+    //
+    // get the Y-scale
     double yMax = std::max ( rValMax ( histo.maxY ( errors ) ) , 0.0 ) ;
     double yMin = std::min ( rValMin ( histo.minY ( errors ) ) , 0.0 ) ;
-    
+
     if ( yMin == yMax ) { yMax = yMin + 1 ; }
     /// try to define the proper "Y-binning"
     std::pair<double,int> r = decompose ( yMax - yMin ) ;
-    double _ny = std::ceil ( 10 * r.first ) ; //   1 <= ny < 10 
+    double _ny = std::ceil ( 10 * r.first ) ; //   1 <= ny < 10
     if ( 1 >=  _ny  ) { _ny = 10 ; }
     int yBins  = (int) std::max ( 1. , std::ceil ( height / _ny ) ) ;
-    
+
     yBins     *= (int) _ny ;
     if ( 20     > yBins ) { yBins = 20    ; }
-    const double yScale = ( yMax - yMin ) / yBins ;    
-    
+    const double yScale = ( yMax - yMin ) / yBins ;
+
     //
-    const int ySkip = 
+    const int ySkip =
       0 == yBins % 13 ? 13 :
       0 == yBins % 11 ? 11 :
       0 == yBins %  9 ?  9 :
       0 == yBins %  8 ?  8 :
       0 == yBins %  7 ?  7 :
       0 == yBins %  6 ?  6 :
-      0 == yBins %  5 ?  5 : 
+      0 == yBins %  5 ?  5 :
       0 == yBins %  4 ?  4 : 10 ;
-    
+
     const int xSkip =
-      // 0 == nBins % 8 ? 8 : 
-      0 == nBins % 7 ? 7 : 
+      // 0 == nBins % 8 ? 8 :
+      0 == nBins % 7 ? 7 :
       0 == nBins % 6 ? 6 :
-      0 == nBins % 5 ? 5 : 
+      0 == nBins % 5 ? 5 :
       0 == nBins % 4 ? 4 : 10 ;
-    
+
     int iNull = histo.nullBin() ;
 
     if ( 0 <= iNull ) { iNull %= xSkip ; }
     else              { iNull  = 0     ; }
-    
+
     stream << std::endl ;
-    
-    for ( int yLine = -1  ; yLine < yBins ; ++yLine ) 
+
+    for ( int yLine = -1  ; yLine < yBins ; ++yLine )
     {
       const double yHigh = yMax - yScale *   yLine       ;
       // const double yLow  = yHigh - yScale         ;
       const double yLow  = yMax - yScale * ( yLine + 1 ) ;
       //
       std::string line1 = " " ;
-      
+
       const bool ynull  = ( yLow <= 0 && 0 < yHigh )    ;
       const bool yfirst = -1 == yLine || yBins -1  == yLine ;
-      const bool ylab   = 
+      const bool ylab   =
         ( 0  == ( yLine + 1 ) % ySkip ) || yfirst || ynull ;
-      
+
       if ( ylab ) { line1 += yLabel ( ( yLow <= 0 && 0 < yHigh ) ? 0.0 : yLow )  ; }
-      else        { line1 += std::string( 10 , ' ' )                             ; }  
+      else        { line1 += std::string( 10 , ' ' )                             ; }
       //
       line1 += " " ;
       //
-      /// underflow bin: 
+      /// underflow bin:
       line1 += symbBin ( histo.under , yLow , yHigh , ynull , errors ) ;
       //
-      line1 += 
+      line1 +=
         ynull ? "-+" :
         ylab  ? " +" : " |" ;
       //
       std::string line2 ;
       //
       for  ( Histo::Bins::const_iterator ibin = histo.bins.begin() ;
-             histo.bins.end() != ibin ; ++ibin ) 
+             histo.bins.end() != ibin ; ++ibin )
       {
         //char symb = ' ' ;
         const int i = ibin - histo.bins.begin () ;
         //
-        const bool xnull = 
+        const bool xnull =
           ibin->lower <= 0 && ( ibin + 1 ) != histo.bins.end() && 0 < (ibin+1)->lower ;
         const bool xlab  =  iNull == i % xSkip ;
         //
         char symb = symbBin ( *ibin, yLow , yHigh , ynull , errors ) ;
         //
-        if ( ' ' == symb ) 
+        if ( ' ' == symb )
         {
           if      ( ( ynull || yfirst ) && xlab ) { symb = '+' ; }
           else if (   ynull || yfirst           ) { symb = '-' ; }
@@ -542,20 +548,20 @@ namespace
         //
       }
       //
-      std::string line3 = 
-        ynull ? "->" : 
+      std::string line3 =
+        ynull ? "->" :
         ylab  ? "+ " : "| " ;
       //
-      /// overflow bin: 
+      /// overflow bin:
       line3 += symbBin ( histo.over , yLow , yHigh , ynull , errors ) ;
       //
       stream << line1 << line2 << line3  << std::endl ;
       //
     }
-    
-    // get x-labels 
+
+    // get x-labels
     std::vector<std::string> xlabels ;
-    for ( Histo::Bins::const_iterator ib = histo.bins.begin() ; histo.bins.end() != ib ; ++ib ) 
+    for ( Histo::Bins::const_iterator ib = histo.bins.begin() ; histo.bins.end() != ib ; ++ib )
     { xlabels.push_back ( xLabel ( ib->lower )  ) ; }
     // overflow& underflow  label
     const std::string oLabel = xLabel ( histo.over.lower  ) ;
@@ -565,19 +571,19 @@ namespace
     static const std::string s_OVERFLOW  ( " OVERFLOW" ) ;
     //
     //
-    for ( unsigned int yLine = 0 ; yLine < 12 ; ++yLine ) 
+    for ( unsigned int yLine = 0 ; yLine < 12 ; ++yLine )
     {
       std::string line = std::string ( 12 , ' ' ) ;
       //
       if ( yLine < s_UNDERFLOW.size() ) { line += s_UNDERFLOW[yLine] ; }
-      else                              { line += ' '                ; }      
+      else                              { line += ' '                ; }
       //
       line += ' ' ;
       //
       if ( uLabel.size() > yLine ) { line += uLabel[yLine] ; }
       else                         { line += ' '           ; }
       //
-      for  ( Histo::Bins::const_iterator ibin = histo.bins.begin() ; histo.bins.end() != ibin ; ++ibin ) 
+      for  ( Histo::Bins::const_iterator ibin = histo.bins.begin() ; histo.bins.end() != ibin ; ++ibin )
       {
         int ib  = ibin - histo.bins.begin() ;
         const bool xlab  =  ( iNull == ib % xSkip ) ;
@@ -596,380 +602,380 @@ namespace
       stream << line << std::endl ;
     }
     //
-    return stream ; // RETURN 
+    return stream ; // RETURN
   }
 }
 // ============================================================================
-/*  dump the text representation of the histogram 
- *  @param histo  (INPUT) the histogram 
- *  @param stream (OUTUT) the stream  
- *  @param width  (INPUT) the maximal column width 
- *  @param height (INPUT) the proposed coulmn height 
+/*  dump the text representation of the histogram
+ *  @param histo  (INPUT) the histogram
+ *  @param stream (OUTUT) the stream
+ *  @param width  (INPUT) the maximal column width
+ *  @param height (INPUT) the proposed coulmn height
  *  @param errors (INPUT) print/plot errors
- *  @return the stream 
+ *  @return the stream
  *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
 std::ostream& Gaudi::Utils::Histos::histoDump_
-( const AIDA::IHistogram1D* histo   , 
-  std::ostream&             stream  , 
-  const std::size_t         width   ,  
-  const std::size_t         height  , 
-  const bool                errors  ) 
+( const AIDA::IHistogram1D* histo   ,
+  std::ostream&             stream  ,
+  const std::size_t         width   ,
+  const std::size_t         height  ,
+  const bool                errors  )
 {
   stream << std::endl ;
-  if ( 0 == histo     ) { return stream ; }  // RETURN 
+  if ( 0 == histo     ) { return stream ; }  // RETURN
   Histo hist ;
   StatusCode sc = _getHisto ( histo , hist ) ;
-  if ( sc.isFailure() ) { return stream ; }  // RETURN 
+  if ( sc.isFailure() ) { return stream ; }  // RETURN
   //
-  stream 
-    << boost::format ( " Histo TES   : \"%s\"") % path ( histo )  
-    << std::endl 
-    << boost::format ( " Histo Title : \"%s\"") % histo->title() 
-    << std::endl 
+  stream
+    << boost::format ( " Histo TES   : \"%s\"") % path ( histo )
+    << std::endl
+    << boost::format ( " Histo Title : \"%s\"") % histo->title()
+    << std::endl
     << std::endl ;
   //
-  stream 
+  stream
     << boost::format ( " Mean        : %11.5g +- %-10.4g ")
-    % Gaudi::Utils::HistoStats::mean        ( histo ) 
-    % Gaudi::Utils::HistoStats::meanErr     ( histo ) 
-    << std::endl 
+    % Gaudi::Utils::HistoStats::mean        ( histo )
+    % Gaudi::Utils::HistoStats::meanErr     ( histo )
+    << std::endl
     << boost::format ( " Rms         : %11.5g +- %-10.4g ")
-    % Gaudi::Utils::HistoStats::rms         ( histo ) 
-    % Gaudi::Utils::HistoStats::rmsErr      ( histo ) 
-    << std::endl 
+    % Gaudi::Utils::HistoStats::rms         ( histo )
+    % Gaudi::Utils::HistoStats::rmsErr      ( histo )
+    << std::endl
     << boost::format ( " Skewness    : %11.5g +- %-10.4g ")
-    % Gaudi::Utils::HistoStats::skewness    ( histo ) 
-    % Gaudi::Utils::HistoStats::skewnessErr ( histo ) 
-    << std::endl 
+    % Gaudi::Utils::HistoStats::skewness    ( histo )
+    % Gaudi::Utils::HistoStats::skewnessErr ( histo )
+    << std::endl
     << boost::format ( " Kurtosis    : %11.5g +- %-10.4g ")
-    % Gaudi::Utils::HistoStats::kurtosis    ( histo ) 
-    % Gaudi::Utils::HistoStats::kurtosisErr ( histo ) 
-    << std::endl 
+    % Gaudi::Utils::HistoStats::kurtosis    ( histo )
+    % Gaudi::Utils::HistoStats::kurtosisErr ( histo )
+    << std::endl
     << std::endl ;
   //
-  stream 
-    << boost::format ( " Entries     :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |") 
-    % "All" 
+  stream
+    << boost::format ( " Entries     :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |")
+    % "All"
     % "In Range"
-    % "Underflow" 
-    % "Overflow" 
-    % "#Equivalent" 
-    % "Integral" 
-    % "Total" 
-    << std::endl 
-    << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |") 
-    % histo -> allEntries () 
-    % histo -> entries    () 
-    % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) 
-    % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  )  
+    % "Underflow"
+    % "Overflow"
+    % "#Equivalent"
+    % "Integral"
+    % "Total"
+    << std::endl
+    << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |")
+    % histo -> allEntries ()
+    % histo -> entries    ()
+    % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
+    % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  )
     % histo -> equivalentBinEntries ()
-    % histo -> sumBinHeights        () 
-    % histo -> sumAllBinHeights     () 
-    << std::endl 
-    << std::endl ;  
+    % histo -> sumBinHeights        ()
+    % histo -> sumAllBinHeights     ()
+    << std::endl
+    << std::endl ;
   //
   const AIDA::IAnnotation& a = histo->annotation () ;
-  if ( 0 != a.size() ) 
+  if ( 0 != a.size() )
   {
     stream << " Annotation" << std::endl ;
-    for ( int i = 0 ; i < a.size() ; ++i ) 
+    for ( int i = 0 ; i < a.size() ; ++i )
     {
-      stream 
+      stream
         << boost::format ( " | %-25.25s : %-45.45s | ")
-        % a.key   ( i ) 
-        % a.value ( i ) 
+        % a.key   ( i )
+        % a.value ( i )
         << std::endl ;
     }
-    stream << std::endl ; 
+    stream << std::endl ;
   }
   //
   return dumpText ( hist , width , height , errors , stream ) ;
 }
 // ============================================================================
-/*  dump the text representation of the histogram 
- *  @param histo the histogram 
- *  @param stream the stream  
- *  @param width  the maximal column width 
- *  @param height (INPUT) the proposed coulmn height 
+/*  dump the text representation of the histogram
+ *  @param histo the histogram
+ *  @param stream the stream
+ *  @param width  the maximal column width
+ *  @param height (INPUT) the proposed coulmn height
  *  @param errors (INPUT) print/plot errors
  *  @param erorrs print/plot errors
  *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
-std::string Gaudi::Utils::Histos::histoDump 
-( const AIDA::IHistogram1D* histo  , 
-  const std::size_t         width  , 
-  const std::size_t         height  , 
-  const bool                errors ) 
+std::string Gaudi::Utils::Histos::histoDump
+( const AIDA::IHistogram1D* histo  ,
+  const std::size_t         width  ,
+  const std::size_t         height  ,
+  const bool                errors )
 {
   std::ostringstream stream ;
   histoDump_ ( histo , stream , width , height , errors );
   return stream.str() ;
 }
 // ============================================================================
-/*  dump the text representation of the 1D-profile 
- *  @param histo  (INPUT) the profile  
- *  @param stream (OUTUT) the stream  
- *  @param width  (INPUT) the maximal column width 
- *  @param height (INPUT) the proposed coulmn height 
- *  @param spread (INPUT) plot spread/error? 
- *  @return the stream 
+/*  dump the text representation of the 1D-profile
+ *  @param histo  (INPUT) the profile
+ *  @param stream (OUTUT) the stream
+ *  @param width  (INPUT) the maximal column width
+ *  @param height (INPUT) the proposed coulmn height
+ *  @param spread (INPUT) plot spread/error?
+ *  @return the stream
  *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
-// ============================================================================
-std::ostream& Gaudi::Utils::Histos::histoDump_ 
-( const AIDA::IProfile1D*   histo   , 
-  std::ostream&             stream  , 
-  const std::size_t         width   ,  
-  const std::size_t         height  , 
-  const bool                spread  ) 
+ */
+// ============================================================================
+std::ostream& Gaudi::Utils::Histos::histoDump_
+( const AIDA::IProfile1D*   histo   ,
+  std::ostream&             stream  ,
+  const std::size_t         width   ,
+  const std::size_t         height  ,
+  const bool                spread  )
 {
   stream << std::endl ;
-  if ( 0 == histo     ) { return stream ; }  // RETURN 
+  if ( 0 == histo     ) { return stream ; }  // RETURN
   Histo hist ;
   StatusCode sc = _getHisto ( histo , hist , spread ) ;
-  if ( sc.isFailure() ) { return stream ; }  // RETURN 
+  if ( sc.isFailure() ) { return stream ; }  // RETURN
   //
-  stream 
-    << boost::format ( " Histo TES   : \"%s\"") % path ( histo )  
-    << std::endl 
-    << boost::format ( " Histo Title : \"%s\"") % histo->title() 
-    << std::endl 
+  stream
+    << boost::format ( " Histo TES   : \"%s\"") % path ( histo )
+    << std::endl
+    << boost::format ( " Histo Title : \"%s\"") % histo->title()
+    << std::endl
     << std::endl ;
   //
-  stream 
-    << boost::format ( " Mean        : %11.5g ") % histo->mean() 
-    << std::endl 
-    << boost::format ( " Rms         : %11.5g ") % histo->rms () 
-    << std::endl 
+  stream
+    << boost::format ( " Mean        : %11.5g ") % histo->mean()
+    << std::endl
+    << boost::format ( " Rms         : %11.5g ") % histo->rms ()
+    << std::endl
     << std::endl ;
   //
-  stream 
-    << boost::format ( " Entries     :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s |") 
-    % "All" 
+  stream
+    << boost::format ( " Entries     :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s |")
+    % "All"
     % "In Range"
-    % "Underflow" 
-    % "Overflow" 
-    // % "#Equivalent" 
-    % "Integral" 
-    % "Total" 
-    << std::endl 
-    << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g |") 
-    % histo -> allEntries () 
-    % histo -> entries    () 
-    % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) 
-    % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  )  
+    % "Underflow"
+    % "Overflow"
+    // % "#Equivalent"
+    % "Integral"
+    % "Total"
+    << std::endl
+    << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g |")
+    % histo -> allEntries ()
+    % histo -> entries    ()
+    % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
+    % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  )
     // % histo -> equivalentBinEntries ()
-    % histo -> sumBinHeights        () 
-    % histo -> sumAllBinHeights     () 
-    << std::endl 
-    << std::endl ;  
+    % histo -> sumBinHeights        ()
+    % histo -> sumAllBinHeights     ()
+    << std::endl
+    << std::endl ;
   //
   const AIDA::IAnnotation& a = histo->annotation () ;
-  if ( 0 != a.size() ) 
+  if ( 0 != a.size() )
   {
     stream << " Annotation" << std::endl ;
-    for ( int i = 0 ; i < a.size() ; ++i ) 
+    for ( int i = 0 ; i < a.size() ; ++i )
     {
-      stream 
+      stream
         << boost::format ( " | %-25.25s : %-45.45s | ")
-        % a.key   ( i ) 
-        % a.value ( i ) 
+        % a.key   ( i )
+        % a.value ( i )
         << std::endl ;
     }
-    stream << std::endl ; 
+    stream << std::endl ;
   }
   //
   return dumpText ( hist , width , height , true , stream ) ;
 }
 // ============================================================================
-/*  dump the text representation of the 1D-profile 
- *  @param histo the histogram 
- *  @param stream the stream  
- *  @param width  the maximal column width 
- *  @param height (INPUT) the proposed coulmn height 
+/*  dump the text representation of the 1D-profile
+ *  @param histo the histogram
+ *  @param stream the stream
+ *  @param width  the maximal column width
+ *  @param height (INPUT) the proposed coulmn height
  *  @author Vanya BELYAEV  Ivan.BElyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
-std::string Gaudi::Utils::Histos::histoDump 
-( const AIDA::IProfile1D*   histo  , 
-  const std::size_t         width  , 
-  const std::size_t         height , 
-  const bool                spread ) 
+std::string Gaudi::Utils::Histos::histoDump
+( const AIDA::IProfile1D*   histo  ,
+  const std::size_t         width  ,
+  const std::size_t         height ,
+  const bool                spread )
 {
   std::ostringstream stream ;
   histoDump_ ( histo , stream , width , height , spread );
   return stream.str() ;
 }
 // ============================================================================
-/*  dump the text representation of the histogram 
- *  @param histo  (INPUT) the histogram 
- *  @param stream (OUTUT) the stream  
- *  @param width  (INPUT) the maximal column width 
+/*  dump the text representation of the histogram
+ *  @param histo  (INPUT) the histogram
+ *  @param stream (OUTUT) the stream
+ *  @param width  (INPUT) the maximal column width
  *  @param errors (INPUT) print/plot errors
- *  @return the stream 
+ *  @return the stream
  *  @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
-std::ostream& Gaudi::Utils::Histos::histoDump_ 
-( const TH1*                histo  , 
+std::ostream& Gaudi::Utils::Histos::histoDump_
+( const TH1*                histo  ,
   std::ostream&             stream ,
-  const std::size_t         width  , 
-  const std::size_t         height , 
-  const bool                errors ) 
+  const std::size_t         width  ,
+  const std::size_t         height ,
+  const bool                errors )
 {
   const TProfile* profile = dynamic_cast<const TProfile*> ( histo ) ;
-  if ( 0 != profile ) 
+  if ( 0 != profile )
   { return histoDump_ ( profile , stream , width , height ) ; }
   //
   stream << std::endl ;
-  if ( 0 == histo     ) { return stream ; }  // RETURN 
+  if ( 0 == histo     ) { return stream ; }  // RETURN
   Histo hist ;
   StatusCode sc = _getHisto ( histo , hist ) ;
-  if ( sc.isFailure() ) { return stream ; }  // RETURN 
+  if ( sc.isFailure() ) { return stream ; }  // RETURN
   //
-  stream 
-    << boost::format ( " Histo Name  : \"%s\"") 
-    % histo -> GetName () 
-    << std::endl 
-    << boost::format ( " Histo Title : \"%s\"") 
-    % histo -> GetTitle () 
-    << std::endl 
+  stream
+    << boost::format ( " Histo Name  : \"%s\"")
+    % histo -> GetName ()
+    << std::endl
+    << boost::format ( " Histo Title : \"%s\"")
+    % histo -> GetTitle ()
+    << std::endl
     << std::endl ;
   //
-  stream 
+  stream
     << boost::format ( " Mean        : %11.5g +- %-10.4g ")
     % histo -> GetMean      ()
     % histo -> GetMeanError ()
-    << std::endl 
+    << std::endl
     << boost::format ( " Rms         : %11.5g +- %-10.4g ")
     % histo -> GetRMS      ()
     % histo -> GetRMSError ()
-    << std::endl 
+    << std::endl
     << boost::format ( " Skewness    : %11.5g            ")
     % histo -> GetSkewness ()
-    << std::endl 
+    << std::endl
     << boost::format ( " Kurtosis    : %11.5g            ")
     % histo -> GetKurtosis ()
-    << std::endl 
+    << std::endl
     << std::endl ;
   //
-  stream 
-    << boost::format ( " Entries     :\n | %=11s | %=11s | %=11s | %=11s | %=11s |") 
-    % "All" 
-    % "Underflow" 
-    % "Overflow" 
-    % "#Equivalent" 
-    % "Integral" 
-    << std::endl 
-    << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |") 
-    % histo -> GetEntries () 
-    % histo -> GetBinContent ( 0                       ) 
-    % histo -> GetBinContent ( histo->GetNbinsX() + 1  ) 
+  stream
+    << boost::format ( " Entries     :\n | %=11s | %=11s | %=11s | %=11s | %=11s |")
+    % "All"
+    % "Underflow"
+    % "Overflow"
+    % "#Equivalent"
+    % "Integral"
+    << std::endl
+    << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
+    % histo -> GetEntries ()
+    % histo -> GetBinContent ( 0                       )
+    % histo -> GetBinContent ( histo->GetNbinsX() + 1  )
     % histo -> GetEffectiveEntries  ()
     % histo -> Integral             ()
-    << std::endl 
-    << std::endl ;  
+    << std::endl
+    << std::endl ;
   //
   return dumpText ( hist , width , height , errors , stream ) ;
 }
 // ============================================================================
-/*  dump the text representation of the histogram 
- *  @param histo  (INPUT) the histogram 
- *  @param stream (OUTUT) the stream  
- *  @param width  (INPUT) the maximal column width 
+/*  dump the text representation of the histogram
+ *  @param histo  (INPUT) the histogram
+ *  @param stream (OUTUT) the stream
+ *  @param width  (INPUT) the maximal column width
  *  @param errors (INPUT) print/plot errors
- *  @return the stream 
+ *  @return the stream
  *  @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
-std::ostream& Gaudi::Utils::Histos::histoDump_ 
-( const TProfile*           histo  , 
+std::ostream& Gaudi::Utils::Histos::histoDump_
+( const TProfile*           histo  ,
   std::ostream&             stream ,
-  const std::size_t         width  , 
-  const std::size_t         height )  
+  const std::size_t         width  ,
+  const std::size_t         height )
 {
   stream << std::endl ;
-  if ( 0 == histo     ) { return stream ; }  // RETURN 
+  if ( 0 == histo     ) { return stream ; }  // RETURN
   Histo hist ;
   StatusCode sc = _getHisto ( histo , hist , true ) ;
-  if ( sc.isFailure() ) { return stream ; }  // RETURN 
+  if ( sc.isFailure() ) { return stream ; }  // RETURN
   //
-  stream 
-    << boost::format ( " Profile Name  : \"%s\"") 
-    % histo -> GetName () 
-    << std::endl 
-    << boost::format ( " Profile Title : \"%s\"") 
-    % histo -> GetTitle () 
-    << std::endl 
+  stream
+    << boost::format ( " Profile Name  : \"%s\"")
+    % histo -> GetName ()
+    << std::endl
+    << boost::format ( " Profile Title : \"%s\"")
+    % histo -> GetTitle ()
+    << std::endl
     << std::endl ;
   //
-  stream 
+  stream
     << boost::format ( " Mean          : %11.5g ") % histo -> GetMean      ()
-    << std::endl 
+    << std::endl
     << boost::format ( " Rms           : %11.5g ") % histo -> GetRMS      ()
-    << std::endl 
+    << std::endl
     << std::endl ;
   //
-  stream 
-    << boost::format ( " Entries       :\n | %=11s | %=11s | %=11s | %=11s |") 
-    % "All" 
-    % "Underflow" 
-    % "Overflow" 
-    % "Integral" 
-    << std::endl 
-    << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |") 
-    % histo -> GetEntries () 
-    % histo -> GetBinContent ( 0                       ) 
-    % histo -> GetBinContent ( histo->GetNbinsX() + 1  ) 
+  stream
+    << boost::format ( " Entries       :\n | %=11s | %=11s | %=11s | %=11s |")
+    % "All"
+    % "Underflow"
+    % "Overflow"
+    % "Integral"
+    << std::endl
+    << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
+    % histo -> GetEntries ()
+    % histo -> GetBinContent ( 0                       )
+    % histo -> GetBinContent ( histo->GetNbinsX() + 1  )
     % histo -> Integral             ()
-    << std::endl 
-    << std::endl ;  
+    << std::endl
+    << std::endl ;
   //
   return dumpText ( hist , width , height , true , stream ) ;
 }
 // ============================================================================
-/*  dump the text representation of the histogram 
- *  @param histo  (INPUT) the histogram 
- *  @param width  (INPUT) the maximal column width 
+/*  dump the text representation of the histogram
+ *  @param histo  (INPUT) the histogram
+ *  @param width  (INPUT) the maximal column width
  *  @param errors (INPUT) print/plot errors
- *  @return string representation of the histogram       
+ *  @return string representation of the histogram
  *  @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
-std::string Gaudi::Utils::Histos::histoDump 
-( const TH1*                histo  , 
-  const std::size_t         width  , 
-  const std::size_t         height , 
-  const bool                errors ) 
+std::string Gaudi::Utils::Histos::histoDump
+( const TH1*                histo  ,
+  const std::size_t         width  ,
+  const std::size_t         height ,
+  const bool                errors )
 {
   std::ostringstream stream ;
   histoDump_ ( histo , stream , width , height , errors );
   return stream.str() ;
 }
 // ============================================================================
-/*  dump the text representation of the histogram 
- *  @param histo  (INPUT) the histogram 
- *  @param width  (INPUT) the maximal column width 
+/*  dump the text representation of the histogram
+ *  @param histo  (INPUT) the histogram
+ *  @param width  (INPUT) the maximal column width
  *  @param errors (INPUT) print/plot errors
- *  @return string representation of the histogram       
+ *  @return string representation of the histogram
  *  @author Vanya BELYAEV  Ivan.Belyaev@nikhef.nl
  *  @date 2009-09-19
- */ 
+ */
 // ============================================================================
-std::string Gaudi::Utils::Histos::histoDump 
-( const TProfile*           histo  , 
-  const std::size_t         width  , 
-  const std::size_t         height ) 
+std::string Gaudi::Utils::Histos::histoDump
+( const TProfile*           histo  ,
+  const std::size_t         width  ,
+  const std::size_t         height )
 {
   std::ostringstream stream ;
   histoDump_ ( histo , stream , width , height );
@@ -981,5 +987,5 @@ std::string Gaudi::Utils::Histos::histoDump
 
 
 // ============================================================================
-// The END  
+// The END
 // ============================================================================
diff --git a/GaudiUtils/src/Lib/HistoLabels.cpp b/GaudiUtils/src/Lib/HistoLabels.cpp
index fe1ec2231ad9dd3b969f7968f993658cdc864d32..110688418b2b3092b502837b6ca68063481113aa 100644
--- a/GaudiUtils/src/Lib/HistoLabels.cpp
+++ b/GaudiUtils/src/Lib/HistoLabels.cpp
@@ -4,6 +4,12 @@
 //-----------------------------------------------------------------------------
 // Implementation file for class : HistoLabels
 //-----------------------------------------------------------------------------
+#ifdef WIN32
+// Disable warning
+//   warning C4996: 'sprintf': This function or variable may be unsafe.
+// coming from TString.h
+#pragma warning(disable:4996)
+#endif
 
 // local
 #include "GaudiUtils/HistoLabels.h"
@@ -23,8 +29,8 @@ namespace
   //--------------------------------------------------------------------
 
   template <typename R, typename A>
-  bool setAxisLabels_( A* aida, 
-                       const std::string& xAxis, 
+  bool setAxisLabels_( A* aida,
+                       const std::string& xAxis,
                        const std::string& yAxis )
   {
     if (!aida) return false;
@@ -37,7 +43,7 @@ namespace
 
   //--------------------------------------------------------------------
 
-  bool setBinLabels_( TAxis* axis,  
+  bool setBinLabels_( TAxis* axis,
                       const Gaudi::Utils::Histos::BinLabels & labels )
   {
     if (!axis) return false;
@@ -55,7 +61,7 @@ namespace
   //--------------------------------------------------------------------
 
   template <typename R, typename A>
-  bool setBinLabels_( A* aida, 
+  bool setBinLabels_( A* aida,
                       const Gaudi::Utils::Histos::BinLabels& labels )
   {
     if (!aida) return false;
@@ -65,14 +71,14 @@ namespace
   }
 
   template <typename Histogram>
-  bool setBinLabels_( Histogram* hist, 
+  bool setBinLabels_( Histogram* hist,
                       const Gaudi::Utils::Histos::Labels& labels )
   {
     Gaudi::Utils::Histos::BinLabels l;
     l.reserve(labels.size());
-    for ( unsigned i = 0; i<labels.size(); ++i ) 
-    { 
-      l.push_back( Gaudi::Utils::Histos::BinLabel(i,labels[i]) ); 
+    for ( unsigned i = 0; i<labels.size(); ++i )
+    {
+      l.push_back( Gaudi::Utils::Histos::BinLabel(i,labels[i]) );
     }
     return Gaudi::Utils::Histos::setBinLabels(hist,l);
   }
@@ -90,31 +96,31 @@ namespace Gaudi
 
   // --------------------------------------------------------------------------
 
-      bool setBinLabels( AIDA::IHistogram1D* hist, 
-                         const BinLabels& labels ) 
+      bool setBinLabels( AIDA::IHistogram1D* hist,
+                         const BinLabels& labels )
       {
         return setBinLabels_<TH1D>(hist,labels);
       }
 
-      bool setBinLabels( AIDA::IProfile1D* hist, 
-                         const BinLabels& labels ) 
+      bool setBinLabels( AIDA::IProfile1D* hist,
+                         const BinLabels& labels )
       {
         return setBinLabels_<TProfile>(hist,labels);
       }
 
-      bool setBinLabels( AIDA::IHistogram1D* hist, 
+      bool setBinLabels( AIDA::IHistogram1D* hist,
                          const Labels& labels )
       {
         return setBinLabels_(hist,labels);
       }
 
-      bool setBinLabels( AIDA::IProfile1D* hist, 
-                         const Labels& labels ) 
+      bool setBinLabels( AIDA::IProfile1D* hist,
+                         const Labels& labels )
       {
         return setBinLabels_(hist,labels);
       }
 
-      bool setBinLabels( AIDA::IHistogram2D* hist, 
+      bool setBinLabels( AIDA::IHistogram2D* hist,
                          const Labels& xlabels,
                          const Labels& ylabels )
       {
@@ -123,31 +129,31 @@ namespace Gaudi
         if (!h2d)  return false;
         BinLabels lx;
         lx.reserve(xlabels.size());
-        for ( unsigned int i = 0; i < xlabels.size(); ++i ) 
+        for ( unsigned int i = 0; i < xlabels.size(); ++i )
         {
           lx.push_back( Gaudi::Utils::Histos::BinLabel( i , xlabels[i] ) );
         }
         BinLabels ly;
         ly.reserve(ylabels.size());
-        for ( unsigned int i = 0; i < ylabels.size(); ++i ) 
+        for ( unsigned int i = 0; i < ylabels.size(); ++i )
         {
           ly.push_back(Gaudi::Utils::Histos::BinLabel( i , ylabels[i] ) );
         }
-        return ( setBinLabels_( h2d->GetXaxis(), lx ) && 
+        return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
                  setBinLabels_( h2d->GetYaxis(), ly ) );
       }
 
       bool setBinLabels( AIDA::IHistogram2D* hist,
                          const BinLabels& xlabels,
-                         const BinLabels& ylabels) 
+                         const BinLabels& ylabels)
       {
         TH2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
-        return ( h2d && 
-                 setBinLabels_( h2d->GetXaxis(), xlabels ) && 
+        return ( h2d &&
+                 setBinLabels_( h2d->GetXaxis(), xlabels ) &&
                  setBinLabels_( h2d->GetYaxis(), ylabels ) );
       }
 
-      bool setBinLabels( AIDA::IProfile2D* hist, 
+      bool setBinLabels( AIDA::IProfile2D* hist,
                          const Labels& xlabels,
                          const Labels& ylabels )
       {
@@ -156,60 +162,60 @@ namespace Gaudi
         if (!h2d)  return false;
         BinLabels lx;
         lx.reserve(xlabels.size());
-        for ( unsigned int i = 0; i < xlabels.size(); ++i ) 
+        for ( unsigned int i = 0; i < xlabels.size(); ++i )
         {
           lx.push_back(Gaudi::Utils::Histos::BinLabel( i , xlabels[i] ) );
         }
         BinLabels ly;
         ly.reserve(ylabels.size());
-        for ( unsigned int i = 0; i < ylabels.size(); ++i ) 
+        for ( unsigned int i = 0; i < ylabels.size(); ++i )
         {
           ly.push_back(Gaudi::Utils::Histos::BinLabel( i , ylabels[i] ) );
         }
-        return ( setBinLabels_( h2d->GetXaxis(), lx ) && 
+        return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
                  setBinLabels_( h2d->GetYaxis(), ly ) );
       }
 
-      bool setBinLabels( AIDA::IProfile2D* hist, 
+      bool setBinLabels( AIDA::IProfile2D* hist,
                          const BinLabels& xlabels,
                          const BinLabels& ylabels )
       {
         TProfile2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
         return ( h2d &&
-                 setBinLabels_( h2d->GetXaxis(), xlabels ) && 
+                 setBinLabels_( h2d->GetXaxis(), xlabels ) &&
                  setBinLabels_( h2d->GetYaxis(), ylabels ) );
       }
 
       // --------------------------------------------------------------------------
-      
-      bool setAxisLabels( AIDA::IHistogram1D* hist, 
+
+      bool setAxisLabels( AIDA::IHistogram1D* hist,
                           const std::string & xAxis,
                           const std::string & yAxis  )
       {
         return setAxisLabels_<TH1D>( hist, xAxis, yAxis );
       }
-      
-      bool setAxisLabels( AIDA::IProfile1D* hist, 
+
+      bool setAxisLabels( AIDA::IProfile1D* hist,
                           const std::string & xAxis,
                           const std::string & yAxis  )
       {
         return setAxisLabels_<TProfile>( hist, xAxis, yAxis );
       }
 
-      bool setAxisLabels( AIDA::IHistogram2D* hist, 
+      bool setAxisLabels( AIDA::IHistogram2D* hist,
                           const std::string & xAxis,
                           const std::string & yAxis  )
       {
         return setAxisLabels_<TH2D>( hist, xAxis, yAxis );
       }
-      
-      bool setAxisLabels( AIDA::IProfile2D* hist, 
+
+      bool setAxisLabels( AIDA::IProfile2D* hist,
                           const std::string & xAxis,
                           const std::string & yAxis  )
       {
         return setAxisLabels_<TProfile2D>( hist, xAxis, yAxis );
       }
-      
+
       // --------------------------------------------------------------------------
 
     }
diff --git a/GaudiUtils/src/component/XMLCatalogTest.cpp b/GaudiUtils/src/component/XMLCatalogTest.cpp
index 57e7d58460ff22ee39253fd6ace7ade8d02e2904..6c2933b9891cc2436b1a047ea8b5df2b830bc5a1 100644
--- a/GaudiUtils/src/component/XMLCatalogTest.cpp
+++ b/GaudiUtils/src/component/XMLCatalogTest.cpp
@@ -2,6 +2,7 @@
 #include <iostream>
 #include <cstdio>
 #include <ctime>
+#include <sstream>
 
 using namespace Gaudi;
 
@@ -16,23 +17,28 @@ extern "C" int testXMLFileCatalogWrite(int argc, char** argv)   {
   c.getFID(fids);
   time_t start = time(0);
   for(size_t n=fids.size(), i=n; i<n+nwrite; ++i)  {
-    char txt[64];
+    std::ostringstream txt;
     if ( 0 == ((i-n)%10000) ) std::cout << i-n << std::endl;
     std::string fid = c.createFID();
     c.registerFID(fid);
-    sprintf(txt,"PFN1_Test_%lud.dat",static_cast<long unsigned int>(i));
-    c.registerPFN(fid,txt,"ROOT");
-    c.registerPFN(fid,txt,"ROOT");
-    sprintf(txt,"PFN2_Test_%lud.dat",static_cast<long unsigned int>(i));
-    c.registerPFN(fid,txt,"ROOT");
-    sprintf(txt,"PFN3_Test_%lud.dat",static_cast<long unsigned int>(i));
-    c.registerPFN(fid,txt,"ROOT");
-    sprintf(txt,"lfn1_Test_%lud.dat",static_cast<long unsigned int>(i));
-    c.registerLFN(fid,txt);
-    sprintf(txt,"lfn2_Test_%lud.dat",static_cast<long unsigned int>(i));
-    c.registerLFN(fid,txt);
-    sprintf(txt,"lfn3_Test_%lud.dat",static_cast<long unsigned int>(i));
-    c.registerLFN(fid,txt);
+    txt << "PFN1_Test_" << i << ".dat";
+    c.registerPFN(fid,txt.str(),"ROOT");
+    c.registerPFN(fid,txt.str(),"ROOT");
+    txt.str("");
+    txt << "PFN2_Test_" << i << ".dat";
+    c.registerPFN(fid,txt.str(),"ROOT");
+    txt.str("");
+    txt << "PFN3_Test_" << i << ".dat";
+    c.registerPFN(fid,txt.str(),"ROOT");
+    txt.str("");
+    txt << "lfn1_Test_" << i << ".dat";
+    c.registerLFN(fid,txt.str());
+    txt.str("");
+    txt << "lfn2_Test_" << i << ".dat";
+    c.registerLFN(fid,txt.str());
+    txt.str("");
+    txt << "lfn3_Test_" << i << ".dat";
+    c.registerLFN(fid,txt.str());
     c.setMetaData(fid,"Name1","Value1");
     c.setMetaData(fid,"Name1","Value111");
     c.setMetaData(fid,"Name2","Value2");
diff --git a/GaudiUtils/src/component/XMLFileCatalog.cpp b/GaudiUtils/src/component/XMLFileCatalog.cpp
index 7dca1f9107b5565ca05d5ed12e9513cead061d9d..c7e662b67ac77038f0746281f8e295bdddf78456 100644
--- a/GaudiUtils/src/component/XMLFileCatalog.cpp
+++ b/GaudiUtils/src/component/XMLFileCatalog.cpp
@@ -24,6 +24,8 @@
 #include <sys/stat.h>
 #include "uuid/uuid.h"
 
+#include <boost/format.hpp>
+
 using namespace xercesc;
 using namespace Gaudi;
 using namespace std;
@@ -180,7 +182,6 @@ namespace {
 
 /// Create file identifier using UUID mechanism
 std::string Gaudi::createGuidAsString()  {
-  char text[64];
   uuid_t uuid;
   ::uuid_generate_time(uuid);
   struct Guid {
@@ -189,11 +190,12 @@ std::string Gaudi::createGuidAsString()  {
     unsigned short Data3;
     unsigned char  Data4[8];
   } *g = (Guid*)&uuid;
-  ::sprintf(text, "%08X-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX",
-            g->Data1, g->Data2, g->Data3,
-            g->Data4[0], g->Data4[1], g->Data4[2], g->Data4[3],
-            g->Data4[4], g->Data4[5], g->Data4[6], g->Data4[7]);
-  return text;
+
+  boost::format text("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X");
+  text % g->Data1 % g->Data2 % g->Data3;
+  for (int i = 0; i < 8; ++i)
+    text % (unsigned short)g->Data4[i];
+  return text.str();
 }
 // ----------------------------------------------------------------------------
 XMLFileCatalog::XMLFileCatalog(CSTR uri, IMessageSvc* m)
diff --git a/Makefile.cmt b/Makefile.cmt
new file mode 100644
index 0000000000000000000000000000000000000000..642cee3a1dd3bf04071ee92f01ec07efa3e05a5c
--- /dev/null
+++ b/Makefile.cmt
@@ -0,0 +1,297 @@
+################################################################################
+#
+# Generic Makefile for CMT projects.
+#
+# copied to the top-level directory of a project (even user project), it can be
+# used to start a build of the whole project with just a call to "make".
+# It is equivalent to a "cmt broadcast make", or, if invoked with "-j" to a
+# "tbroadcast make -j", but better.
+#
+# Targets:
+#   all: build all the packages (default)
+#   clean: clean all the packages
+#   purge: clean and remove the files by the Makefile
+#   <packagename>: build the package and all the packages it depends on
+#
+# Arguments:
+#   PKG_ONLY : if set, build only the the package specified as target
+#   no_all_groups : if set, build only the main cmt group (all) and not all the
+#                   available ones
+#   LOG_LOCATION : optional directory for the build log files, dependencies etc.
+#                  if not specified, the current directory is used for the
+#                  dependencies and build logs are put in the cmt directory
+#   Package_failure_policy : can be set to stop, skip or ignore (see later
+#                            comment for details)
+#   logging : enabled (default on unix) or disabled (only possibility on windows)
+#
+# This makefile works on Windows as long as you install some Unix standard
+# commands (apart from a standard LHCb environment):
+#
+#  - make
+#    http://gnuwin32.sourceforge.net/packages/make.htm
+#  - awk (gawk)
+#    http://gnuwin32.sourceforge.net/packages/gawk.htm
+#  - sed
+#    http://gnuwin32.sourceforge.net/packages/sed.htm
+#  - coreutils (for rm, uname, tee)
+#    http://gnuwin32.sourceforge.net/packages/coreutils.htm
+#  - bash
+#    http://win-bash.sourceforge.net/
+#    Note: this version is very limited, but we can leverage on the power of
+#          gnu make.
+#
+# Note: on Windows, because of limitations of the bash interpreter, the log
+#       of the build is not enabled by default.
+#       Moreover, the "-j" switch of make is not supported.
+#
+# Author: Marco Clemencic
+#
+################################################################################
+
+# --- Simplistic platform detection
+platform := $(if $(findstring windows,$(shell uname)),windows,unix)
+
+# --- List of Packages in the current directory
+ifeq ($(platform),windows)
+# we do not have 'find' on Windows, so we stick to at most one level of hats
+packages := $(strip $(subst /cmt/requirements,,$(wildcard */cmt/requirements) $(wildcard */*/cmt/requirements)))
+else
+packages := $(strip $(subst /cmt/requirements,,$(shell find . -name requirements | grep cmt/requirements | sed 's/.\///') ))
+endif
+
+# --- Utility functions and variables
+escape_slash = $(subst /,_slash_,$(1))
+unescape_slash = $(subst _slash_,/,$(1))
+full_name = $(subst /,_,$(1))
+COMMA := ,
+
+#  Note: The command "cmt show groups" does not work in old versions of CMT
+cmt_version := $(shell cmt version)
+cmt2008 = $(findstring v1r20p2008, $(cmt_version))
+
+# ATLAS cmt tag implies no_all_groups and the use of LOG_LOCATION
+ifeq ($(filter ATLAS,$(subst $(COMMA), ,$(CMTEXTRATAGS))),ATLAS)
+  no_all_groups = yes
+  ifndef LOG_LOCATION
+    LOG_LOCATION := LOG_$(CMTCONFIG)
+  endif
+  make_extra_flags += --no-print-directory
+endif
+
+
+ifeq ($(no_all_groups),)
+  ifeq (,$(cmt2008))
+    groups = all $(shell cd $(1)/cmt ; cmt show groups)
+  else
+    groups = all all_groups
+  endif
+else
+  # build only the main group
+  groups = all
+endif
+
+# --- Common configuration variables
+# The special environment variable PIPESTATUS is a bash feature, so we have to force
+# the usage of that shell.
+ifeq ($(platform),windows)
+  SHELL=bash.exe
+else
+  SHELL=/bin/bash --norc
+endif
+# Name of the makefile to generate
+ifeq ($(platform),windows)
+Makefile := NMake
+else
+Makefile := Makefile
+endif
+# Name of the mkdir command
+ifneq ($(findstring winxp-vc9,$(CMTCONFIG)),)
+MKDIR := gmkdir
+else
+MKDIR := mkdir
+endif
+# Banners to be printed for the targets.
+define build_banner
+echo "#==============================================================================="
+echo "# Building package $(1) ["`ls $(dependency_dir) | grep -c ".*\.pack\.build"`"/$(words $(packages))]"
+echo "#==============================================================================="
+endef
+define build_banner_in_file
+echo "#===============================================================================" > $(2)
+echo "# Building package $(1) ["`ls $(dependency_dir) | grep -c ".*\.pack\.build"`"/$(words $(packages))]" >> $(2)
+echo "#===============================================================================" >> $(2)
+endef
+define clean_banner
+echo "#==== Cleaning package $(1)"
+endef
+
+# -- Special macro to change the behavior on a failure of a package
+#    (complementary to the option '-k')
+#  Allowed values for Package_failure_policy:
+#    stop:   do not continue (default)
+#    skip:   if a group fails, continue with the next package
+#    ignore: try all the groups even if one fails before going to the next package
+#            (may result in duplicated errors within a package)
+Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;
+ifdef Package_failure_policy
+ifeq ($(Package_failure_policy),stop)
+Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;
+else
+ifeq ($(Package_failure_policy),skip)
+Package_failure_handler = test $$BUILD_RESULT -eq 0 || break ;
+else
+ifeq ($(Package_failure_policy),ignore)
+Package_failure_handler =
+else
+$(error Unknown Package_failure_policy "$(Package_failure_policy)". Allowed values: "stop" (default), "skip", "ignore")
+endif
+endif
+endif
+endif
+
+# -- Macro to enable/disable logging of the build
+#    (there are problems with the logging on Windows)
+ifeq ($(platform),windows)
+logging = disabled
+else
+logging = enabled
+endif
+
+ifeq ($(platform),windows)
+# -- On Windows we have to unset the environment variable MAKEFLAGS because the
+#    options to GNU Make are not compatible with NMake.
+#strip_makeflags = export MAKEFLAGS=$(subst j,,$(subst j 1,,$(MAKEFLAGS))) ;
+strip_makeflags = export MAKEFLAGS= ;
+# -- On Windows, NMake ignore the environment variables, so we have to explicitly
+#    pass CMTEXRATAGS and CMTUSERCONTEXT on the command line.
+ifdef CMTEXTRATAGS
+make_extra_flags += CMTEXTRATAGS="$(CMTEXTRATAGS)"
+endif
+ifdef CMTUSERCONTEXT
+make_extra_flags += CMTUSERCONTEXT="$(CMTUSERCONTEXT)"
+endif
+endif
+
+# Fix the separator for environment variables
+# (needed if the variables are specified as lists in Eclipse)
+override CMTEXTRATAGS := $(subst ;,$(COMMA),$(CMTEXTRATAGS))
+ifneq ($(platform),windows)
+override CMTPROJECTPATH := $(subst ;,:,$(CMTPROJECTPATH))
+endif
+
+# --- Declare the variables that have to be exported
+export PATH LD_LIBRARY_PATH PYTHONPATH CMTEXTRATAGS CMTPROJECTPATH CMTUSERCONTEXT
+
+# --- Declare directories for dependencies, stamp files and log files
+dependency_dir = .$(CMTCONFIG).d
+logfile = $(CURDIR)/$(1)/cmt/build.$(CMTCONFIG).log
+ifdef LOG_LOCATION
+  dependency_dir = $(LOG_LOCATION)/.$(CMTCONFIG).d
+  logfile = $(LOG_LOCATION)/$(call full_name,$(1)).log
+endif
+pkg_build_flag = $(dependency_dir)/$(call full_name,$(1)).pack.build
+
+# --- Main targets
+all: $(packages:=_build)
+
+clean: $(packages:=_clean)
+	$(RM) -r InstallArea/$(CMTCONFIG)
+ifdef LOG_LOCATION
+	$(RM) -r $(LOG_LOCATION)
+endif
+
+# This hack is needed because the stand-alone bash implementation on Windows is very limited (short command line)
+purge: clean $(foreach dep,$(wildcard $(dependency_dir)/*.pack.d),$(dep)_do_purge) $(packages:=/cmt/$(Makefile)_do_purge)
+	$(RM) -r $(dependency_dir)
+%_do_purge: clean
+	$(RM) $*
+
+# This should be the actual implementation
+#purge: clean
+#	$(RM) $(dependency_dir)/*.pack.d $(packages:=/cmt/$(Makefile))
+
+build_flags = $(wildcard $(dependency_dir)/*.pack.build)
+remove_build_flags:
+ifneq ($(build_flags),)
+	@$(RM) -r $(build_flags)
+endif
+
+# --- Add rules to build packages (e.g. "make MyHat/MyPackage")
+$(foreach pack,$(packages),$(eval $(pack): $(pack)_build))
+$(foreach pack,$(packages),$(eval .PHONY: $(pack)))
+# --- Prevents removal of the Makefiles generated by "cmt config"
+$(foreach pack,$(packages),$(eval .PRECIOUS: $(pack)/cmt/$(Makefile)))
+ifeq (,$(cmt2008))
+$(foreach pack,$(packages),$(eval .PRECIOUS: $(pack)/cmt/version.cmt))
+endif
+
+# --- Actual rules
+%/cmt/$(Makefile):
+	@echo Configuring package $*
+	@cd $*/cmt && cmt config
+
+
+ifeq (,$(cmt2008))
+%/cmt/version.cmt: %/cmt/requirements
+	@echo Generate $@
+	@awk 'BEGIN{version="v*"}/^ *version/{version = $$2}END{print version}' $< > $@
+%_build: remove_build_flags %/cmt/$(Makefile) %/cmt/version.cmt
+else
+%_build: remove_build_flags %/cmt/$(Makefile)
+endif
+	@touch $(call pkg_build_flag,$*)
+	@$(call build_banner,$*)
+ifeq ($(logging),enabled)
+	@$(call build_banner_in_file,$*,$(call logfile,$*))
+	@date >> $(call logfile,$*)
+	@echo `cat $*/cmt/version.cmt`" "$* >> $(call logfile,$*)
+	@PWD=`pwd`
+	@+cd $*/cmt ; $(strip_makeflags) \
+	for group in $(call groups,$*) ; do \
+	    $(if $(no_all_groups),,echo "# Building group $$group" | tee -a $(call logfile,$*) ;) \
+		cmt make $(make_extra_flags) $$group 2>&1 | tee -a $(call logfile,$*) ; export BUILD_RESULT=$$PIPESTATUS ; \
+		date >> $(call logfile,$*) ; \
+		$(Package_failure_handler) \
+	done
+else
+	@+cd $*/cmt ; $(strip_makeflags) \
+	for group in $(call groups,$*) ; do \
+	    $(if $(no_all_groups),,echo "# Building group $$group";) \
+		cmt make $(make_extra_flags) $$group ; export BUILD_RESULT=$$? ; \
+		$(Package_failure_handler) \
+	done
+endif
+
+ifeq (,$(cmt2008))
+%_clean: %/cmt/$(Makefile) %/cmt/version.cmt
+else
+%_clean: %/cmt/$(Makefile)
+endif
+	@$(call clean_banner,$*)
+	@cd $*/cmt && cmt make clean binclean
+
+
+## --- Dependencies between packages
+# The PKG_ONLY macro can be used to build a single package disregarding the
+# dependencies between packages.
+ifndef PKG_ONLY
+MKDEPCMD := cmt show uses | sed 's/^\# */\# /' | tr " " "\t" | awk -F"\t" '/^\#\t*use/{if($$5){print $$5"/"$$3}else{print $$3}}'
+$(dependency_dir)/%.pack.d: pack=$(call unescape_slash,$*)
+$(dependency_dir)/%.pack.d:
+	@echo Computing dependencies for package $(pack)
+	@$(MKDIR) -p $(dependency_dir)
+	@echo $(pack)_build: $(patsubst %,%_build,$(filter $(packages),$(shell cd $(pack)/cmt; $(MKDEPCMD)))) > $@
+	@echo $@: $(pack)/cmt/requirements >> $@
+
+ifneq ($(MAKECMDGOALS),purge)
+-include $(patsubst %,$(dependency_dir)/%.pack.d,$(call escape_slash, $(packages)))
+endif
+deps:
+	@#fake target to force the build of the dependencies (implied by the include)
+endif
+
+# --- List of phony targets
+.PHONY: all clean purge deps remove_build_flags
+# This makes the package targets PHONY (.PHONY does not work with implicit rules)
+$(foreach pack,$(packages),$(eval $(pack)_config $(pack)_build $(pack)_clean: FORCE))
+FORCE:
diff --git a/RootHistCnv/cmt/requirements b/RootHistCnv/cmt/requirements
index d4c65897a32507f73433e4db78ee9b436a31ffda..e6c2b3daced553c53ed89f3d0072377780be669c 100644
--- a/RootHistCnv/cmt/requirements
+++ b/RootHistCnv/cmt/requirements
@@ -1,5 +1,5 @@
 package RootHistCnv
-version v10r6
+version v10r7
 
 branches doc cmt src
 
diff --git a/RootHistCnv/doc/release.notes b/RootHistCnv/doc/release.notes
index ccced77d118964b4f1e7c1938e27786e66da0c8b..bc7e3fe829b7e9da842ad7223941a9cff86df03a 100644
--- a/RootHistCnv/doc/release.notes
+++ b/RootHistCnv/doc/release.notes
@@ -1,6 +1,13 @@
 Package: RootHistCnv
 Package manager : David Quarrie
 
+============================= RootHistCnv v10r7 ==============================
+! 2011-03-23 - Marco Clemencic
+ - Fixed VC9 warnings.
+   - Replaced C-style string manipulation and formatting with C++ (and Boost)
+     implementations.
+   - Disabled some warnings.
+
 ============================= RootHistCnv v10r6 ==============================
 ! 2011-01-11 - Marco Clemencic
  - Fixed some ICC remarks.
diff --git a/RootHistCnv/src/RCWNTupleCnv.cpp b/RootHistCnv/src/RCWNTupleCnv.cpp
index 2b0af47b2c40a558a3a5d724790615d675fa69c2..7a103c01e586bbde28aad231847ee7b4165a9ea2 100644
--- a/RootHistCnv/src/RCWNTupleCnv.cpp
+++ b/RootHistCnv/src/RCWNTupleCnv.cpp
@@ -48,10 +48,10 @@ template <class T> void analyzeItem(std::string typ,
   long item_size = (sizeof(T) < 4) ? 4 : sizeof(T);
   long dimension = it->length();
   long ndim = it->ndim()-1;
-  char text[132];
-  desc += var_name;
+  std::ostringstream text;
+  text << var_name;
   if ( it->hasIndex() || it->length() > 1 )   {
-    desc += "[";
+    text << '[';
   }
   if ( it->hasIndex() )   {
     std::string ind_blk, ind_var;
@@ -61,18 +61,17 @@ template <class T> void analyzeItem(std::string typ,
       std::cerr << "ERROR: Index for CWNT variable " << ind_var
 		<< " is in a different block: " << ind_blk << std::endl;
     }
-    desc += ind_var;
+    text << ind_var;
   }
   else if ( it->dim(ndim) > 1 )   {
-    desc += ::_itoa(it->dim(ndim), text, 10);
+    text << it->dim(ndim);
   }
 
   for ( int i = ndim-1; i>=0; i-- ){
-    desc += "][";
-    desc += ::_itoa(it->dim(i), text, 10);
+    text << "][" << it->dim(i);
   }
   if ( it->hasIndex() || it->length() > 1 )   {
-    desc += "]";
+    text << ']';
   }
 
   if (it->range().lower() != it->range().min() &&
@@ -83,7 +82,9 @@ template <class T> void analyzeItem(std::string typ,
     lowerRange = 0;
     upperRange = -1;
   }
-  desc += typ;
+  text << typ;
+
+  desc += text.str();
   size += item_size * dimension;
 }
 
diff --git a/RootHistCnv/src/RConverter.cpp b/RootHistCnv/src/RConverter.cpp
index 2ef880d70e6a03c26dd32b6ef98d4f68969fd98a..e236260b275a7a8e17eac8e966ff0e7aecb03d18 100644
--- a/RootHistCnv/src/RConverter.cpp
+++ b/RootHistCnv/src/RConverter.cpp
@@ -222,9 +222,8 @@ StatusCode RootHistCnv::RConverter::createAddress(const std::string& rzdir,
 						  IOpaqueAddress*& refpAddress)
 //--------------------------------------------------------------------------
 {
-  char obj[32];
-  StatusCode status = createAddress(rzdir, clid,
-				    ::_itoa(id, obj, 10), pTobj, refpAddress);
+  std::ostringstream obj; obj << id;
+  StatusCode status = createAddress(rzdir, clid, obj.str(), pTobj, refpAddress);
   if ( status.isSuccess() )   {
     unsigned long* ipar = (unsigned long*)refpAddress->ipar();
     ipar[0] = id;
diff --git a/cmt/project.cmt b/cmt/project.cmt
index 02a9c96ba73bc0ef87e8d11090994445629a2214..d5253ace88f19bbc54a95fb447e5f11ec1de3a3b 100644
--- a/cmt/project.cmt
+++ b/cmt/project.cmt
@@ -1,9 +1,10 @@
 project GAUDI
 
-use LCGCMT LCGCMT_60
+use LCGCMT LCGCMT_60b
 
 build_strategy with_installarea
 setup_strategy root
 structure_strategy without_version_directory
 
 container GaudiRelease
+