 |
ATLAS Offline Software
|
|
template<typename T > |
StatusCode | makeAndPopulate (std::string const &viewNameRoot, ViewContainer *viewVector, SG::WriteHandleKey< T > const &populateKey, EventContext const &sourceContext, std::vector< T > const &inputData, bool const allowFallThrough=true) |
|
StatusCode | scheduleSingleView (SG::View *view, std::string const &nodeName, EventContext const &sourceContext, EventIDBase::number_type conditionsRun, SmartIF< IScheduler > scheduler) |
|
StatusCode | scheduleViews (ViewContainer *viewVector, std::string const &nodeName, EventContext const &sourceContext, SmartIF< IScheduler > scheduler, bool reverseOrder=false) |
|
SG::View * | makeView (const std::string &common_name, int const unique_index=-1, bool const allowFallThrough=true) |
|
template<typename KEY > |
auto | makeHandle (const SG::View *view, const KEY &key, const EventContext &ctx) |
| Create a view handle from a handle key. More...
|
|
template<typename T , typename CONT > |
SG::WriteDecorHandle< CONT, T > | makeHandle (const SG::View *view, const SG::WriteDecorHandleKey< CONT > &dKey, const EventContext &context) |
| Create WriteDecorHandle for given view and WriteDecorHandleKey. More...
|
|
template<typename T > |
ElementLink< T > | makeLink (const SG::View *view, const SG::ReadHandle< T > &handle, size_t index) |
| Create EL to a collection in view. More...
|
|
◆ makeAndPopulate()
Definition at line 25 of file ViewHelper.h.
30 if ( viewNameRoot.find(
' ' ) != std::string::npos )
32 return StatusCode::FAILURE;
39 unsigned int const viewNumber = inputData.size();
40 for (
unsigned int viewIndex = 0; viewIndex < viewNumber; ++viewIndex )
43 SG::View * outputView =
new SG::View( viewNameRoot, viewIndex, allowFallThrough );
47 StatusCode sc = populateHandle.setProxyDict( outputView );
48 if ( !
sc.isSuccess() )
55 sc = populateHandle.record( std::make_unique< T >( inputData[ viewIndex ] ) );
56 if ( !
sc.isSuccess() )
63 return StatusCode::SUCCESS;
◆ makeHandle() [1/2]
Create a view handle from a handle key.
- Template Parameters
-
- Parameters
-
view | View object |
key | VarHandleKey |
ctx | EventContext |
- Returns
- Handle corresponding to the key type (can be invalid)
Definition at line 273 of file ViewHelper.h.
278 handle.setProxyDict( nview ).ignore();
◆ makeHandle() [2/2]
template<typename T , typename CONT >
Create WriteDecorHandle for given view and WriteDecorHandleKey.
- Template Parameters
-
T | Decoration type (e.g. float) |
CONT | Container type |
- Parameters
-
view | View object |
dKey | WriteDecorHandleKey for the decoration to be written through the view |
ctx | EventContext |
- Returns
- WriteDecorHandleKey (can be invalid)
Definition at line 293 of file ViewHelper.h.
298 auto handle = SG::makeHandle<T>(dKey, context );
299 handle.setProxyDict( nview ).ignore();
◆ makeLink()
Create EL to a collection in view.
- Warning
- no checks are made as to the validity of the created EL
Definition at line 309 of file ViewHelper.h.
311 auto proxy =
view->proxy( handle.clid(), handle.key() );
312 if (
proxy ==
nullptr )
throw std::runtime_error(
"Attempting to make element link with invalid key " + handle.key() );
◆ makeView()
SG::View* ViewHelper::makeView |
( |
const std::string & |
common_name, |
|
|
int const |
unique_index = -1 , |
|
|
bool const |
allowFallThrough = true |
|
) |
| |
|
inline |
- unique_index - gets appended to the view name if >= 0
Definition at line 252 of file ViewHelper.h.
255 if ( common_name.find(
' ' ) != std::string::npos )
260 return new SG::View( common_name, unique_index, allowFallThrough );
◆ scheduleSingleView()
StatusCode ViewHelper::scheduleSingleView |
( |
SG::View * |
view, |
|
|
std::string const & |
nodeName, |
|
|
EventContext const & |
sourceContext, |
|
|
EventIDBase::number_type |
conditionsRun, |
|
|
SmartIF< IScheduler > |
scheduler |
|
) |
| |
|
inline |
Definition at line 67 of file ViewHelper.h.
71 auto viewContext = std::make_unique< EventContext >( sourceContext );
72 if (
view->getROI().isValid() ) {
81 return scheduler->scheduleEventView( &sourceContext, nodeName, std::move( viewContext ) );
◆ scheduleViews()
StatusCode ViewHelper::scheduleViews |
( |
ViewContainer * |
viewVector, |
|
|
std::string const & |
nodeName, |
|
|
EventContext const & |
sourceContext, |
|
|
SmartIF< IScheduler > |
scheduler, |
|
|
bool |
reverseOrder = false |
|
) |
| |
|
inline |
Definition at line 85 of file ViewHelper.h.
90 return StatusCode::FAILURE;
95 if (
dynamic_cast< SG::View*
>( extendedContext.proxy() ) ) {
96 return StatusCode::FAILURE;
101 return StatusCode::FAILURE;
104 if ( viewVector->
empty() ) {
107 return scheduler->scheduleEventView( &sourceContext, nodeName, 0 );
110 if ( reverseOrder ) {
116 return StatusCode::FAILURE;
126 return StatusCode::FAILURE;
132 return StatusCode::SUCCESS;
const_reverse_iterator rend() const noexcept
Return a const_reverse_iterator pointing at the beginning of the collection.
EventIDBase::number_type conditionsRun() const
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
StatusCode scheduleSingleView(SG::View *view, std::string const &nodeName, EventContext const &sourceContext, EventIDBase::number_type conditionsRun, SmartIF< IScheduler > scheduler)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
::StatusCode StatusCode
StatusCode definition for legacy code.
const_reverse_iterator rbegin() const noexcept
Return a const_reverse_iterator pointing past the end of the collection.
void clear()
Erase all the elements in the collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
#define ATLAS_THREAD_SAFE
A "view" of the event store (IProxyDict).
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
bool empty() const noexcept
Returns true if the collection is empty.