Commit cfe34cb0 authored by Gerhard Raven's avatar Gerhard Raven
Browse files

Add support for Gaudi::Range_ to DataObjectHandle

and update the SelFilter example to use a DataObjectHandle
parent c11f23dd
......@@ -653,8 +653,6 @@ public:
GaudiAlgorithm( const GaudiAlgorithm& ) = delete;
GaudiAlgorithm& operator=( const GaudiAlgorithm& ) = delete;
private:
GaudiAlgorithm();
// ==========================================================================
private:
// ==========================================================================
......
......@@ -3,6 +3,7 @@
// ============================================================================
// GaudiKernel
// ============================================================================
#include "GaudiKernel/DataObjectHandle.h"
#include "GaudiKernel/IRndmGenSvc.h"
#include "GaudiKernel/RndmGenerators.h"
// ============================================================================
......@@ -25,34 +26,39 @@ namespace Gaudi
*/
class SelFilter : public GaudiAlgorithm
{
// ======================================================================
using Range = Gaudi::Range_<Gaudi::Examples::MyTrack::ConstVector>;
DataObjectReadHandle<Range> m_input{this, "Input", "", "TES location of input container"};
// ======================================================================
public:
// ======================================================================
/// Constructor
using GaudiAlgorithm::GaudiAlgorithm;
SelFilter( const std::string& name, ISvcLocator* pSvcLocator ) : GaudiAlgorithm( name, pSvcLocator ) {}
// using GaudiAlgorithm::GaudiAlgorithm;
// ======================================================================
/// the only one essential method
StatusCode execute() override
{
typedef Gaudi::NamedRange_<Gaudi::Examples::MyTrack::ConstVector> Range;
static Rndm::Numbers flat( randSvc(), Rndm::Flat( -1, 1 ) );
if ( exist<Gaudi::Examples::MyTrack::Selection>( m_input ) ) {
info() << "Selection at '" << m_input.value() << "'" << endmsg;
} else if ( exist<Gaudi::Examples::MyTrack::Container>( m_input ) ) {
info() << "Container at '" << m_input.value() << "'" << endmsg;
if ( exist<Gaudi::Examples::MyTrack::Selection>( m_input.objKey() ) ) {
info() << "Selection at '" << m_input.objKey() << "'" << endmsg;
} else if ( exist<Gaudi::Examples::MyTrack::Container>( m_input.objKey() ) ) {
info() << "Container at '" << m_input.objKey() << "'" << endmsg;
}
if ( !exist<Range>( m_input ) ) {
err() << "No Range is available at location " << m_input.value() << endmsg;
if ( !exist<Range>( m_input.objKey() ) ) {
err() << "No Range is available at location " << m_input.objKey() << endmsg;
}
// get input data in 'blind' way
Range range = get<Range>( m_input );
const auto& range = m_input.get();
// create new selection
Gaudi::Examples::MyTrack::Selection* sample = new Gaudi::Examples::MyTrack::Selection();
auto sample = std::make_unique<Gaudi::Examples::MyTrack::Selection>();
const double pxCut = flat();
const double pyCut = flat();
......@@ -69,15 +75,10 @@ namespace Gaudi
info() << "Sample size is " << range.size() << "/" << size << "/" << sample->size() << endmsg;
// register it in TES
put( sample, name() );
put( sample.release(), name() );
return StatusCode::SUCCESS;
}
// ======================================================================
private:
// ======================================================================
Gaudi::Property<std::string> m_input{this, "Input", "", "TES location of input container"};
// ======================================================================
};
// ========================================================================
} // end of namespace Gaudi::Examples
......
# --> Including file '/afs/cern.ch/work/l/leggett/GaudiSrc/hive/git/DataObjID/Gaudi.3/GaudiExamples/options/Selections.py'
# <-- End of file '/afs/cern.ch/work/l/leggett/GaudiSrc/hive/git/DataObjID/Gaudi.3/GaudiExamples/options/Selections.py'
# setting LC_ALL to "C"
# --> Including file '/project/bfys/graven/master/Gaudi/GaudiExamples/options/Selections.py'
# <-- End of file '/project/bfys/graven/master/Gaudi/GaudiExamples/options/Selections.py'
# Dumping all configurables and properties (different from default)
{'ApplicationMgr': {'EvtMax': 20,
'EvtSel': 'NONE',
......@@ -9,15 +10,15 @@
'Gaudi::Examples::SelFilter/Filter3',
'Gaudi::Examples::SelFilter/Filter4',
'Gaudi::Examples::SelFilter/Filter5']},
'Filter1': {'Input': 'Create1'},
'Filter2': {'Input': 'Filter1'},
'Filter3': {'Input': 'Filter2'},
'Filter4': {'Input': 'Filter3'},
'Filter5': {'Input': 'Filter4'}}
'Filter1': {'Input': DataObjectHandleBase("Create1")},
'Filter2': {'Input': DataObjectHandleBase("Filter1")},
'Filter3': {'Input': DataObjectHandleBase("Filter2")},
'Filter4': {'Input': DataObjectHandleBase("Filter3")},
'Filter5': {'Input': DataObjectHandleBase("Filter4")}}
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v3r5)
running on p05614910w96644.cern.ch on Wed Oct 21 20:05:14 2015
Welcome to ApplicationMgr (GaudiCoreSvc v30r1)
running on stbc-i4 on Fri Dec 22 21:33:39 2017
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
EventLoopMgr WARNING Unable to locate service "EventSelector"
......@@ -28,207 +29,206 @@ 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>
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/34/8
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 8/8/8
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 8/5/5
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 5/5/5
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 5/5/5
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/72/21
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 21/21/21
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 21/21/21
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 21/15/15
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 15/15/15
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/59/20
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 20/15/12
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 12/7/7
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 7/2/2
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 2/2/2
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/83/45
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 45/9/9
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 9/9/5
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 5/5/5
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 5/5/5
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/83/32
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 32/7/7
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 7/7/4
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 4/4/4
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 4/4/4
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/49/20
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 20/20/20
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 20/12/12
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 12/12/12
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 12/12/12
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/50/42
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 42/23/10
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 10/10/10
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 10/9/9
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 9/9/9
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/66/18
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 18/16/16
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 16/16/16
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 16/12/12
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 12/4/4
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/23/11
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 11/11/4
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 4/4/4
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 4/4/4
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 4/4/4
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/74/23
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 23/10/10
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 10/10/10
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 10/10/6
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 6/6/6
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/38/26
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 26/17/17
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 17/12/12
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 12/12/12
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 12/12/12
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/48/9
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 9/9/9
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 9/9/9
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 9/9/9
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 9/5/5
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/50/18
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 18/18/18
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 18/6/6
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 6/6/6
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 6/6/3
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/93/56
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 56/8/1
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 1/1/1
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 1/1/1
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 1/1/1
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/18/6
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 6/6/6
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 6/6/6
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 6/6/5
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 5/5/5
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/72/34
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 34/34/34
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 34/23/23
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 23/23/23
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 23/23/23
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/14/11
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 11/11/4
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 4/4/4
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 4/4/4
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 4/4/4
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/64/19
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 19/8/8
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 8/8/8
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 8/8/8
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 8/8/8
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/14/8
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 8/8/8
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 8/8/8
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 8/8/5
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 5/5/5
Filter1 INFO Container at 'Create1'
Filter1 INFO Container at '/Event/Create1'
Filter1 INFO Sample size is 100/70/44
Filter2 INFO Selection at 'Filter1'
Filter2 INFO Selection at '/Event/Filter1'
Filter2 INFO Sample size is 44/20/19
Filter3 INFO Selection at 'Filter2'
Filter3 INFO Selection at '/Event/Filter2'
Filter3 INFO Sample size is 19/19/19
Filter4 INFO Selection at 'Filter3'
Filter4 INFO Selection at '/Event/Filter3'
Filter4 INFO Sample size is 19/19/15
Filter5 INFO Selection at 'Filter4'
Filter5 INFO Selection at '/Event/Filter4'
Filter5 INFO Sample size is 15/4/4
EventLoopMgr INFO ---> Loop Finished - WSS 51.6953 | total time (skipping 1st evt) 6046559 ns
ApplicationMgr INFO Application Manager Stopped successfully
EventLoopMgr INFO Histograms converted successfully according to request.
ApplicationMgr INFO Application Manager Finalized successfully
......
......@@ -5,11 +5,50 @@
#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/DataObjectHandleBase.h"
#include "GaudiKernel/GaudiException.h"
#include "GaudiKernel/NamedRange.h"
#include "GaudiKernel/Property.h"
#include "GaudiKernel/ServiceLocatorHelper.h"
#include <type_traits>
//---------------------------------------------------------------------------
//
namespace details
{
template <typename T>
using Converter_t = T ( * )( DataObject* );
template <typename T>
T just_cast( DataObject* obj )
{
return static_cast<T>( obj );
}
template <typename Range, typename StorageType>
Range make_range( DataObject* obj )
{
auto c = static_cast<StorageType*>( obj );
if ( UNLIKELY( !c ) ) return Range();
using std::begin;
using std::end;
auto first = begin( *c );
auto last = end( *c );
auto _first = reinterpret_cast<typename Range::const_iterator*>( &first );
auto _last = reinterpret_cast<typename Range::const_iterator*>( &last );
return Range( *_first, *_last );
}
template <typename ValueType, typename Range = Gaudi::Range_<typename ValueType::ConstVector>>
Converter_t<Range> select_range_converter( DataObject* obj )
{
using Selection = typename ValueType::Selection;
auto sel = dynamic_cast<Selection*>( obj );
if ( sel ) return &make_range<Range, typename ValueType::Selection>;
auto con = dynamic_cast<typename ValueType::Container*>( obj );
if ( con ) return &make_range<Range, typename ValueType::Container>;
return nullptr;
}
}
//---------------------------------------------------------------------------
/** DataObjectHandle.h GaudiKernel/DataObjectHandle.h
......@@ -126,25 +165,18 @@ T* DataObjectHandle<T>::get( bool mustExist ) const
}
if ( UNLIKELY( !m_goodType ) ) { // Check type compatibility once
T* obj = dynamic_cast<T*>( dataObj );
m_goodType = ( obj != nullptr );
if ( UNLIKELY( !m_goodType ) ) {
std::string errorMsg( "The type provided for " + objKey() + " is " + System::typeinfoName( typeid( T ) ) +
" and is different from the one of the object in the store." );
// log << MSG::ERROR << errorMsg << endmsg;
throw GaudiException( errorMsg, "Wrong DataObjectType", StatusCode::FAILURE );
}
// log << MSG::DEBUG << "The data type (" << typeid(T).name()
// << ") specified for the handle of " << dataProductName()
// << " is the same of the object in the store. "
// << "From now on the result of a static_cast will be returned." << endmsg;
assert( obj == static_cast<T*>( dataObj ) );
return obj;
}
// setRead();
// From the second read on, this is safe
return static_cast<T*>( dataObj );
}
......@@ -165,22 +197,48 @@ T* DataObjectHandle<T>::put( T* objectp )
template <typename T>
T* DataObjectHandle<T>::getOrCreate()
{
T* obj = get( false );
return obj ? obj : put( new T{} );
}
// this process needs to be locking for multi-threaded applications
// lock(); --> done in caller
//---------------------------------------------------------------------------
T* obj = get( false );
/// specialization for Range_
// object exists, we are done
if ( obj ) {
// unlock();
return obj;
}
template <typename T>
class DataObjectHandle<Gaudi::Range_<T>> : public DataObjectHandleBase
{
public:
using ValueType = std::remove_cv_t<std::remove_pointer_t<typename T::value_type>>;
using Range = Gaudi::Range_<typename ValueType::ConstVector>;
// create it
return put( new T{} );
using DataObjectHandleBase::DataObjectHandleBase;
/**
* Retrieve object from transient data store
*/
Range get() const;
// unlock();
private:
mutable details::Converter_t<Range> m_converter = nullptr;
};
template <typename ValueType>
auto DataObjectHandle<Gaudi::Range_<ValueType>>::get() const -> Range
{
auto dataObj = fetch();
if ( UNLIKELY( !dataObj ) ) {
throw GaudiException( "Cannot retrieve " + objKey() + " from transient store.",
m_owner ? owner()->name() : "no owner", StatusCode::FAILURE );
}
if ( UNLIKELY( m_converter == nullptr ) ) {
m_converter = details::select_range_converter<ValueType>( dataObj );
if ( !m_converter ) {
throw GaudiException( "The type requested for " + objKey() + " cannot be obtained from object in event store",
"Wrong DataObjectType", StatusCode::FAILURE );
}
}
return ( *m_converter )( dataObj );
}
#endif
......@@ -141,7 +141,10 @@ namespace Gaudi
* @param ibegin iterator to begin of the sequence
* @param iend iterator to end of the sequence
*/
Range_( iterator ibegin, iterator iend ) : m_base( ibegin, iend ) {}
template <typename InputIterator>
Range_( InputIterator first, InputIterator last ) : m_base( first, last )
{
}
/** constructor from the pair of iterators
* @param base pair of the iterators
*/
......
Supports Markdown
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