CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.
32  std::vector<BranchDescription const*> const& branchDescriptions);
33 
34  bool selected(BranchDescription const& desc) const;
35 
36  // Printout intended for debugging purposes.
37  void print(std::ostream& os) const;
38 
39  bool initialized() const {return initialized_;}
40 
41  static void checkForDuplicateKeptBranch(BranchDescription const& desc,
42  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc);
43 
44  static void fillDroppedToKept(ProductRegistry const& preg,
45  std::map<BranchID, BranchDescription const*> const& trueBranchIDToKeptBranchDesc,
46  std::map<BranchID::value_type, BranchID::value_type>& droppedBranchIDToKeptBranchID_);
47 
48  private:
49 
50  // We keep a sorted collection of branch names, indicating the
51  // products which are to be selected.
52 
53  // TODO: See if we can keep pointer to (const) BranchDescriptions,
54  // so that we can do pointer comparison rather than string
55  // comparison. This will work if the BranchDescription we are
56  // given in the 'selected' member function is one of the instances
57  // that are managed by the ProductRegistry used to initialize the
58  // entity that contains this ProductSelector.
59  std::vector<std::string> productsToSelect_;
61  };
62 
63  std::ostream&
64  operator<< (std::ostream& os, const ProductSelector& gs);
65 
66 } // namespace edm
67 
68 
69 
70 #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_
bool initialized() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
void print(std::ostream &os) const
preg
Definition: Schedule.cc:369
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)