LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Provenance.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_Provenance_h
2 #define art_Framework_Principal_Provenance_h
3 // vim: set sw=2 expandtab :
4 
5 //
6 // FIXME: This class is nothing more than a facade around Group,
7 // BranchDescription, and ProductProvenance.
8 //
9 // Provenance: The full description of a product and how it came into
10 // existence.
11 //
12 // definitions:
13 // Product: The EDProduct to which a provenance object is associated
14 // Creator: The EDProducer that made the product.
15 // Parents: The EDProducts used as input by the creator.
16 //
17 // Used by Handle and ValidHandle for the most part.
18 //
19 
25 #include "cetlib/exempt_ptr.h"
26 #include "fhiclcpp/fwd.h"
27 
28 #include <iosfwd>
29 #include <set>
30 #include <string>
31 #include <vector>
32 
33 namespace art {
34 
35  class Provenance {
36  public:
37  // Special Member Functions
38  explicit Provenance();
39  explicit Provenance(cet::exempt_ptr<Group const> g) noexcept;
40 
41  // Full product description
42  BranchDescription const& productDescription() const noexcept;
43 
44  // Selected components of the product description
45  std::string const& branchName() const noexcept;
46  std::string const& producedClassName() const noexcept;
47  std::string const& friendlyClassName() const noexcept;
48  std::string const& moduleLabel() const noexcept;
49  std::string const& productInstanceName() const noexcept;
50  std::string const& processName() const noexcept;
51  InputTag inputTag() const;
52 
53  // Metadata about the product's origin
54  RangeSet const& rangeOfValidity() const;
55  Parentage const& parentage() const;
56  std::vector<ProductID> const& parents() const;
57  fhicl::ParameterSet const& parameterSet() const;
58  std::set<fhicl::ParameterSetID> const& psetIDs() const noexcept;
59 
60  // Identifiers corresponding to this product, necessary for Ptr
61  // support.
62  ProductID productID() const noexcept;
63 
64  // Functions for querying the validity/presence of a product.
65  bool isValid() const noexcept;
66  bool isPresent() const;
67  bool produced() const noexcept;
69 
70  // General utilities
71  bool equals(Provenance const&) const noexcept;
72  std::ostream& write(std::ostream&) const;
73 
74  private:
75  ProductProvenance const& productProvenance() const;
76 
77  cet::exempt_ptr<Group const> group_{nullptr};
78  };
79 
80  bool operator==(Provenance const& a, Provenance const& b) noexcept;
81  std::ostream& operator<<(std::ostream& os, Provenance const& p);
82 }
83 #endif /* art_Framework_Principal_Provenance_h */
84 
85 // Local Variables:
86 // mode: c++
87 // End:
bool operator==(Provenance const &a, Provenance const &b) noexcept
Definition: Provenance.cc:141
Parentage const & parentage() const
Definition: Provenance.cc:103
BranchDescription const & productDescription() const noexcept
Definition: Provenance.cc:24
bool isValid() const noexcept
Definition: Provenance.cc:18
std::vector< ProductID > const & parents() const
Definition: Provenance.cc:109
ProductID productID() const noexcept
Definition: Provenance.cc:72
std::string const & productInstanceName() const noexcept
Definition: Provenance.cc:60
bool equals(Provenance const &) const noexcept
Definition: Provenance.cc:127
InputTag inputTag() const
Definition: Provenance.cc:91
std::string const & moduleLabel() const noexcept
Definition: Provenance.cc:54
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
std::string const & branchName() const noexcept
Definition: Provenance.cc:42
ProductProvenance const & productProvenance() const
Definition: Provenance.cc:133
std::string const & producedClassName() const noexcept
Definition: Provenance.cc:36
std::string const & processName() const noexcept
Definition: Provenance.cc:66
unsigned char ProductStatus
Definition: ProductStatus.h:6
std::string const & friendlyClassName() const noexcept
Definition: Provenance.cc:48
fhicl::ParameterSet const & parameterSet() const
Definition: Provenance.cc:84
cet::exempt_ptr< Group const > group_
Definition: Provenance.h:77
Definition: MVAAlg.h:12
bool produced() const noexcept
Definition: Provenance.cc:30
bool isPresent() const
Definition: Provenance.cc:115
RangeSet const & rangeOfValidity() const
Definition: Provenance.cc:121
ProductStatus productStatus() const
Definition: Provenance.cc:97
std::set< fhicl::ParameterSetID > const & psetIDs() const noexcept
Definition: Provenance.cc:78
std::ostream & write(std::ostream &) const
Definition: Provenance.cc:147