CMS 3D CMS Logo

ProductSelector.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_ProductSelector_h
2 #define FWCore_Framework_ProductSelector_h
3 
5 //
6 // Class ProductSelector. Class for user to select specific products in event.
7 //
8 // Author: Bill Tanenbaum, Marc Paterno
9 //
11 
13 
14 #include <iosfwd>
15 #include <map>
16 #include <string>
17 #include <vector>
18 
19 namespace edm {
20  class BranchDescription;
21  class BranchID;
22  class ProductRegistry;
23  class ProductSelectorRules;
24  class ParameterSet;
25 
27  public:
29 
30  // N.B.: we assume there are not null pointers in the vector allBranches.
31  void initialize(ProductSelectorRules const& rules, std::vector<BranchDescription const*> const& branchDescriptions);
32 
33  bool selected(BranchDescription const& desc) const;
34 
35  // Printout intended for debugging purposes.
36  void print(std::ostream& os) const;
37 
38  bool initialized() const { return initialized_; }
39 
40  static void checkForDuplicateKeptBranch(BranchDescription const& desc,
41  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc);
42 
43  static void fillDroppedToKept(ProductRegistry const& preg,
44  std::map<BranchID, BranchDescription const*> const& trueBranchIDToKeptBranchDesc,
45  std::map<BranchID::value_type, BranchID::value_type>& droppedBranchIDToKeptBranchID_);
46 
47  private:
48  // We keep a sorted collection of branch names, indicating the
49  // products which are to be selected.
50 
51  // TODO: See if we can keep pointer to (const) BranchDescriptions,
52  // so that we can do pointer comparison rather than string
53  // comparison. This will work if the BranchDescription we are
54  // given in the 'selected' member function is one of the instances
55  // that are managed by the ProductRegistry used to initialize the
56  // entity that contains this ProductSelector.
57  std::vector<std::string> productsToSelect_;
59  };
60 
61  std::ostream& operator<<(std::ostream& os, const ProductSelector& gs);
62 
63 } // namespace edm
64 
65 #endif
bool selected(BranchDescription const &desc) const
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
std::vector< std::string > productsToSelect_
HLT enums.
bool initialized() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
void print(std::ostream &os) const
Definition: AbsArchive.cc:45
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)