|
| FindAllP ()=default |
| Default constructor: empty query, read information with Read() More...
|
|
| FindAllP (art::Event &event) |
| Constructor: reads all associations from the specified event. More...
|
|
| FindAllP (art::Event &event, art::InputTag assnTag) |
| Constructor: reads one association from the specified event. More...
|
|
art::Ptr< Dest_t > const & | operator[] (art::Ptr< Dest_t > const &src) const |
| Returns the object associated to the specified one. More...
|
|
bool | hasProduct (art::ProductID const &id) const |
| Returns whether there are associations from objects in product id. More...
|
|
bool | hasProduct (art::Ptr< Source_t > const &ptr) const |
| Returns if there are associations from objects with product as ptr. More...
|
|
unsigned int | Read (art::Event &event) |
| Reads all the associations from the event. More...
|
|
unsigned int | Read (art::Event &event, art::InputTag const &assnTag) |
| Reads the specified association from the event. More...
|
|
unsigned int | Add (art::Event &event, art::InputTag const &assnTag) |
| Reads the specified association from the event. More...
|
|
template<typename Source, typename Dest>
class lar::util::details::FindAllP< Source, Dest >
Query object reading all the associations between two classes.
- Template Parameters
-
Source | type of the object we use as query key (indexing object) |
Dest | type of the object we query for |
When assigned an event, this object reads all the associations from Source type classes to Dest type classes in the event, and stores their information in a map to track a Dest object from its Source one. In fact, it assumes that only one Dest object is associated, event-wise, to each single Source object.
Definition at line 117 of file FindAllP.h.
template<typename Source , typename Dest >
Reads the specified association from the event.
- Parameters
-
event | the event to read the associations from |
assnTag | the input tag for the association |
- Exceptions
-
art::Exception | if multiple dest objects are found for one source object |
The existing associations already in cache are not removed.
The input tag for the association is usually simply a string with the name of the module that produced the association, and often the same module has also produced the source objects as well.
Definition at line 292 of file FindAllP.h.
296 art::Handle<Assns_t> handle;
297 if (!event.getByLabel(assnTag, handle)) {
298 throw art::Exception(art::errors::ProductNotFound)
299 <<
"no association found with input tag '" << assnTag <<
"'";
302 return Merge(handle);
unsigned int Merge(art::Handle< Assns_t > &handle)
Adds all associations in the specified handle; returns their number.