![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 T > |
SG::ReadHandle< T > | makeHandle (const SG::View *view, const SG::ReadHandleKey< T > &rhKey, const EventContext &context) |
| navigate from the TrigComposite to nearest view and fetch object from it 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 24 of file ViewHelper.h.
29 if ( viewNameRoot.find(
' ' ) != std::string::npos )
31 return StatusCode::FAILURE;
38 unsigned int const viewNumber = inputData.size();
39 for (
unsigned int viewIndex = 0; viewIndex < viewNumber; ++viewIndex )
42 SG::View * outputView =
new SG::View( viewNameRoot, viewIndex, allowFallThrough );
46 StatusCode sc = populateHandle.setProxyDict( outputView );
47 if ( !
sc.isSuccess() )
54 sc = populateHandle.record( std::make_unique< T >( inputData[ viewIndex ] ) );
55 if ( !
sc.isSuccess() )
62 return StatusCode::SUCCESS;
◆ makeHandle()
navigate from the TrigComposite to nearest view and fetch object from it
- Returns
- handle (can be invalid)
Definition at line 258 of file ViewHelper.h.
263 if ( handle.setProxyDict( nview ).isFailure() ) {
◆ makeLink()
Create EL to a collection in view.
- Warning
- no checks are made as to the validity of the created EL
Definition at line 276 of file ViewHelper.h.
278 auto proxy =
view->proxy( handle.clid(), handle.key() );
279 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 241 of file ViewHelper.h.
244 if ( common_name.find(
' ' ) != std::string::npos )
249 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 66 of file ViewHelper.h.
70 auto viewContext = std::make_unique< EventContext >( sourceContext );
71 if (
view->getROI().isValid() ) {
80 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 84 of file ViewHelper.h.
89 return StatusCode::FAILURE;
94 if (
dynamic_cast< SG::View*
>( extendedContext.proxy() ) ) {
95 return StatusCode::FAILURE;
100 return StatusCode::FAILURE;
103 if ( viewVector->
empty() ) {
106 return scheduler->scheduleEventView( &sourceContext, nodeName, 0 );
109 if ( reverseOrder ) {
110 for (
auto iter = viewVector->
rbegin(); iter != viewVector->
rend(); ++iter ) {
115 return StatusCode::FAILURE;
125 return StatusCode::FAILURE;
131 return StatusCode::SUCCESS;
reverse_iterator rbegin()
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)
const std::string & key() const
Return the StoreGate ID for the referenced object.
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.
void push_back(SG::View *ptr)
::StatusCode StatusCode
StatusCode definition for legacy code.
Default, invalid implementation of ClassID_traits.
#define ATLAS_THREAD_SAFE
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.