CMS 3D CMS Logo

BranchKey.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_BranchKey_h
2 #define DataFormats_Provenance_BranchKey_h
3 
4 /*----------------------------------------------------------------------
5 
6 BranchKey: The key used to identify a Product in the EventPrincipal. The
7 name of the branch to which the related data product will be written
8 is determined entirely from the BranchKey.
9 
10 ----------------------------------------------------------------------*/
11 #include <iosfwd>
12 #include <string>
13 
14 namespace edm {
15  class BranchDescription;
16 
17  class BranchKey {
18  public:
20  {}
21 
22  BranchKey(std::string const& cn, std::string const& ml,
23  std::string const& pin, std::string const& pn) :
24  friendlyClassName_(cn),
25  moduleLabel_(ml),
27  processName_(pn)
28  {}
29 
30  explicit BranchKey(BranchDescription const& desc);
31 
33  std::string const& moduleLabel() const {return moduleLabel_;}
35  std::string const& processName() const {return processName_;}
36 
37  private:
42  };
43 
44  inline
45  bool
46  operator<(BranchKey const& a, BranchKey const& b) {
47  return
48  a.friendlyClassName() < b.friendlyClassName() ? true :
49  a.friendlyClassName() > b.friendlyClassName() ? false :
50  a.moduleLabel() < b.moduleLabel() ? true :
51  a.moduleLabel() > b.moduleLabel() ? false :
52  a.productInstanceName() < b.productInstanceName() ? true :
53  a.productInstanceName() > b.productInstanceName() ? false :
54  a.processName() < b.processName() ? true :
55  false;
56  }
57 
58  inline
59  bool
60  operator==(BranchKey const& a, BranchKey const& b) {
61  return !(a < b || b < a);
62  }
63 
64  inline
65  bool
66  operator!=(BranchKey const& a, BranchKey const& b) {
67  return !(a == b);
68  }
69 
70  std::ostream&
71  operator<<(std::ostream& os, BranchKey const& bk);
72 }
73 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:92
BranchKey(std::string const &cn, std::string const &ml, std::string const &pin, std::string const &pn)
Definition: BranchKey.h:22
std::string const & friendlyClassName() const
Definition: BranchKey.h:32
std::string productInstanceName_
Definition: BranchKey.h:40
std::string friendlyClassName_
Definition: BranchKey.h:38
std::string const & processName() const
Definition: BranchKey.h:35
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
std::string moduleLabel_
Definition: BranchKey.h:39
std::string processName_
Definition: BranchKey.h:41
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
std::string const & moduleLabel() const
Definition: BranchKey.h:33
double b
Definition: hdecay.h:120
std::string const & productInstanceName() const
Definition: BranchKey.h:34
HLT enums.
double a
Definition: hdecay.h:121
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.