LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::detail::PrincipalProcessor< DETAIL > Class Template Reference

#include "ProvenanceDumperImpl.h"

Public Member Functions

 PrincipalProcessor (DETAIL &detail, bool const wantPresentOnly, bool const resolveProducts, bool const wantResolvedOnly)
 
void operator() (art::Principal const &p, void(DETAIL::*func)(art::Provenance const &)) const
 

Private Attributes

DETAIL & detail_
 
bool const wantPresentOnly_
 
bool const resolveProducts_
 
bool const wantResolvedOnly_
 

Detailed Description

template<typename DETAIL>
class art::detail::PrincipalProcessor< DETAIL >

Definition at line 26 of file ProvenanceDumperImpl.h.

Constructor & Destructor Documentation

template<typename DETAIL>
art::detail::PrincipalProcessor< DETAIL >::PrincipalProcessor ( DETAIL &  detail,
bool const  wantPresentOnly,
bool const  resolveProducts,
bool const  wantResolvedOnly 
)
inline

Definition at line 28 of file ProvenanceDumperImpl.h.

References art::detail::PrincipalProcessor< DETAIL >::operator()().

32  : detail_(detail)
33  , wantPresentOnly_(wantPresentOnly)
34  , resolveProducts_(resolveProducts)
35  , wantResolvedOnly_(wantResolvedOnly)
36  {}

Member Function Documentation

template<typename DETAIL >
void art::detail::PrincipalProcessor< DETAIL >::operator() ( art::Principal const &  p,
void(DETAIL::*)(art::Provenance const &)  func 
) const

Definition at line 50 of file ProvenanceDumperImpl.h.

References art::Group::anyProduct(), art::detail::PrincipalProcessor< DETAIL >::detail_, art::Provenance::isPresent(), art::Group::productProvenance(), art::Group::resolveProductIfAvailable(), art::detail::PrincipalProcessor< DETAIL >::resolveProducts_, art::detail::PrincipalProcessor< DETAIL >::wantPresentOnly_, and art::detail::PrincipalProcessor< DETAIL >::wantResolvedOnly_.

Referenced by art::detail::PrincipalProcessor< DETAIL >::PrincipalProcessor().

53  {
54  for (auto const& pr : p) {
55  Group const& g = *pr.second;
56  if (resolveProducts_) {
57  bool const resolved_product = g.resolveProductIfAvailable();
58  if (!resolved_product) {
59  continue;
60  }
61  }
62  bool wantCallFunc = true;
63  Provenance const prov{cet::make_exempt_ptr(&g)};
64  if (wantResolvedOnly_) {
65  wantCallFunc = (g.anyProduct() != nullptr);
66  } else if (wantPresentOnly_) {
67  // Unfortunately, there are files in which the product
68  // provenance has not been appropriately stored for dropped
69  // products. The first check below on the product
70  // provenance pointer is a precondition to calling
71  // prov.isPresent(), getting around this incorrect
72  // persistency behavior.
73  wantCallFunc = (g.productProvenance() != nullptr) && prov.isPresent();
74  }
75 
76  if (wantCallFunc) {
77  (detail_.*func)(prov);
78  }
79  }
80  }

Member Data Documentation

template<typename DETAIL>
DETAIL& art::detail::PrincipalProcessor< DETAIL >::detail_
private
template<typename DETAIL>
bool const art::detail::PrincipalProcessor< DETAIL >::resolveProducts_
private
template<typename DETAIL>
bool const art::detail::PrincipalProcessor< DETAIL >::wantPresentOnly_
private
template<typename DETAIL>
bool const art::detail::PrincipalProcessor< DETAIL >::wantResolvedOnly_
private

The documentation for this class was generated from the following file: