LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
BranchType.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_BranchType_h
2 #define canvas_Persistency_Provenance_BranchType_h
3 
4 // ======================================================================
5 //
6 // BranchType: enumerate/encode/label the three Branch types
7 //
8 // ======================================================================
9 
10 #include <iosfwd>
11 #include <string>
12 #include <type_traits>
13 
14 // ----------------------------------------------------------------------
15 
16 namespace art {
17 
18  // Note: These enum values are used as subscripts for a fixed size
19  // array, so they must not change.
21 
22  std::string const& BranchTypeToString(BranchType);
23  std::string const& BranchTypeToProductTreeName(BranchType);
24  std::string const& BranchTypeToMetaDataTreeName(BranchType);
25  std::string const& BranchTypeToAuxiliaryBranchName(BranchType);
26  std::string const& productProvenanceBranchName(BranchType);
27  std::string const& BranchTypeToMajorIndexName(BranchType);
28  std::string const& BranchTypeToMinorIndexName(BranchType);
29 
30  inline std::ostream&
31  operator<<(std::ostream& os, BranchType const branchType)
32  {
33  return os << BranchTypeToString(branchType);
34  }
35 
36  template <typename F>
37  void
39  {
40  for (std::underlying_type<BranchType>::type i{InEvent}; i < NumBranchTypes;
41  ++i) {
42  auto const bt = static_cast<BranchType>(i);
43  f(bt);
44  }
45  }
46 
47 } // art
48 
49 // ======================================================================
50 
51 #endif /* canvas_Persistency_Provenance_BranchType_h */
52 
53 // Local Variables:
54 // mode: c++
55 // End:
std::string const & BranchTypeToProductTreeName(BranchType const bt)
Definition: BranchType.cc:71
std::string const & productProvenanceBranchName(BranchType const bt)
Definition: BranchType.cc:91
std::string const & BranchTypeToMajorIndexName(BranchType const bt)
Definition: BranchType.cc:101
std::string const & BranchTypeToMinorIndexName(BranchType const bt)
Definition: BranchType.cc:107
std::string const & BranchTypeToMetaDataTreeName(BranchType const bt)
Definition: BranchType.cc:77
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const bt)
Definition: BranchType.cc:83
TFile f
Definition: plotHisto.C:6
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
std::string const & BranchTypeToString(BranchType const bt)
Definition: BranchType.cc:65
BranchType
Definition: BranchType.h:20
Definition: MVAAlg.h:12
void for_each_branch_type(F f)
Definition: BranchType.h:38