Commit 438713f2 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Moved the code from GaudiTuples::finalize to GaudiTuple::stop

This should avoid finalization order problems with NtupleSvc, but
seems not to work with GaudiPython.
parent 520fb728
......@@ -63,6 +63,13 @@ protected:
*/
virtual StatusCode initialize ();
/** standard stop method
* @see Algorithm
* @see IAlgorithm
* @return status code
*/
virtual StatusCode stop ();
/** standard finalization method
* @see Algorithm
* @see IAlgorithm
......
......@@ -66,6 +66,13 @@ protected:
*/
virtual StatusCode initialize ();
/** standard stop method
* @see Algorithm
* @see IAlgorithm
* @return status code
*/
virtual StatusCode stop ();
/** standard finalization method
* @see Algorithm
* @see IAlgorithm
......
......@@ -331,6 +331,10 @@ protected:
StatusCode i_gtFinalize()
#endif
;
/** standard stop method
* @return status code
*/
virtual StatusCode stop();
// ==========================================================================
private:
// ==========================================================================
......
......@@ -83,13 +83,7 @@ StatusCode GaudiTuples<PBASE>::
// finalize ntupling
//=============================================================================
template <class PBASE>
StatusCode GaudiTuples<PBASE>::
#ifdef __ICC
i_gtFinalize
#else
finalize
#endif
()
StatusCode GaudiTuples<PBASE>::stop()
{
if ( !( nTupleMapTitle () . empty () &&
nTupleMapID () . empty () &&
......@@ -132,9 +126,21 @@ StatusCode GaudiTuples<PBASE>::
m_evtColMapID.clear() ;
}
// finalize base class
return PBASE::finalize();
return PBASE::stop();
}
template <class PBASE>
StatusCode GaudiTuples<PBASE>::
#ifdef __ICC
i_gtFinalize
#else
finalize
#endif
()
{
// finalize base class
return PBASE::finalize();
}
// ============================================================================
// get N-tuple object ( book on-demand ) with unique identidier
// ============================================================================
......@@ -225,11 +231,11 @@ Tuples::Tuple GaudiTuples<PBASE>::nTuple
// Check ID
if ( ID.undefined() )
{ this->Error("Undefined NTuple ID : Title='"+title1+"'"); return Tuple(0); }
// look up in the table
Tuples::TupleObj * tuple = m_nTupleMapID[ ID ] ;
if( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN
// convert ID to the string
const std::string tID = ID.idAsString() ;
......@@ -289,7 +295,7 @@ Tuples::Tuple GaudiTuples<PBASE>::evtCol
// look up in the table
Tuples::TupleObj* tuple = m_evtColMapID[ID] ;
if ( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN
// convert ID to the string
const std::string tID = ID.idAsString() ;
......@@ -373,7 +379,7 @@ long GaudiTuples<PBASE>::printTuples () const
else
{ this->always() << "List of booked N-Tuples in directory "
<< "\"" << nTuplePath() << "\"" << endmsg ; }
// helper container to sort it:
typedef std::map<TupleID,const Tuples::TupleObj*> OrderedMapType;
OrderedMapType OrderedMap ( nTupleMapID().begin() , nTupleMapID().end() ) ;
......@@ -401,7 +407,7 @@ long GaudiTuples<PBASE>::printEvtCols () const
else
{ this->always() << "List of booked Event Tag Collections in directory "
<< "\"" << evtColPath() << "\"" << endmsg ; }
// helper container to sort it:
typedef std::map<TupleID,const Tuples::TupleObj*> OrderedMapType;
OrderedMapType OrderedMap ( evtColMapID().begin() , evtColMapID().end() ) ;
......
......@@ -11,8 +11,8 @@
/* @file GaudiTupleAlg.cpp
*
* Implementation file for class : GaudiTupleAlg
*
* @date 2004-01-23
*
* @date 2004-01-23
* @author Vanya BELYAEV Ivan.Belyaev@itep.ru
* @author Chris Jones Christopher.Rob.Jones@cern.ch
*/
......@@ -33,15 +33,15 @@ GaudiTupleAlg::GaudiTupleAlg( const std::string& name ,
// ============================================================================
// ============================================================================
/// destructor
/// destructor
// ============================================================================
GaudiTupleAlg::~GaudiTupleAlg() { }
GaudiTupleAlg::~GaudiTupleAlg() { }
// ============================================================================
// ============================================================================
// standard initialization method
// ============================================================================
StatusCode GaudiTupleAlg::initialize()
StatusCode GaudiTupleAlg::initialize()
{
// initialize the base class and return
return GaudiTuples<GaudiHistoAlg>::initialize();
......@@ -51,13 +51,23 @@ StatusCode GaudiTupleAlg::initialize()
// ============================================================================
// standard finalization method
// ============================================================================
StatusCode GaudiTupleAlg::finalize()
StatusCode GaudiTupleAlg::finalize()
{
// finalize the base class and return
return GaudiTuples<GaudiHistoAlg>::finalize();
}
// ============================================================================
// ============================================================================
// standard stop method
// ============================================================================
StatusCode GaudiTupleAlg::stop()
{
// finalize the base class and return
return GaudiTuples<GaudiHistoAlg>::stop();
}
// ============================================================================
// ============================================================================
// The END
// ============================================================================
......@@ -12,7 +12,7 @@
*
* Implementation file for class : GaudiTupleTool
*
* @author Vanya BELYAEV Ivan.Belyaev@itep.ru
* @author Vanya BELYAEV Ivan.Belyaev@itep.ru
* @author Chris Jones Christopher.Rob.Jones@cern.ch
* @date 2004-06-28
*/
......@@ -49,6 +49,15 @@ StatusCode GaudiTupleTool::initialize()
}
// ============================================================================
// ============================================================================
// standard stop method
// ============================================================================
StatusCode GaudiTupleTool::stop()
{
// finalize the base class and return
return GaudiTuples<GaudiHistoTool>::stop();
}
// ============================================================================
// standard finalization method
// ============================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment