test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BranchDescription.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_BranchDescription_h
2 #define DataFormats_Provenance_BranchDescription_h
3 
4 /*----------------------------------------------------------------------
5 
6 BranchDescription: The full description of a Branch.
7 This description also applies to every product instance on the branch.
8 
9 ----------------------------------------------------------------------*/
17 
18 #include <iosfwd>
19 #include <map>
20 #include <set>
21 #include <string>
22 
23 /*
24  BranchDescription
25 
26  definitions:
27  The event-independent description of an EDProduct.
28 
29 */
30 
31 namespace edm {
33  public:
34  static int const invalidSplitLevel = -1;
35  static int const invalidBasketSize = 0;
36  enum MatchMode { Strict = 0,
38 
40 
42  std::string const& moduleLabel,
43  std::string const& processName,
44  std::string const& className,
47  std::string const& moduleName,
49  TypeWithDict const& theTypeWithDict,
50  bool produced = true,
51  std::set<std::string> const& aliases = std::set<std::string>());
52 
53  BranchDescription(BranchDescription const& aliasForBranch,
54  std::string const& moduleLabelAlias,
55  std::string const& poruductInstanceAlias);
56 
58 
59  void init() {
62  }
63 
64  void initBranchName();
65 
66  void initFromDictionary();
67 
68  void write(std::ostream& os) const;
69 
70  void merge(BranchDescription const& other);
71 
72  std::string const& moduleLabel() const {return moduleLabel_;}
73  std::string const& processName() const {return processName_;}
74  BranchID const& branchID() const {return branchID_;}
75  BranchID const& aliasForBranchID() const {return aliasForBranchID_;}
76  bool isAlias() const {return aliasForBranchID_.isValid() && produced();}
78  std::string const& fullClassName() const {return fullClassName_;}
79  std::string const& className() const {return fullClassName();}
82  bool produced() const {return transient_.produced_;}
83  void setProduced(bool isProduced) {transient_.produced_ = isProduced;}
84  bool present() const {return !transient_.dropped_;}
85  bool dropped() const {return transient_.dropped_;}
86  void setDropped(bool isDropped) {transient_.dropped_ = isDropped;}
87  bool onDemand() const {return transient_.onDemand_;}
88  void setOnDemand(bool isOnDemand) {transient_.onDemand_ = isOnDemand;}
89  bool transient() const {return transient_.transient_;}
90  void setTransient(bool isTransient) {transient_.transient_ = isTransient;}
97  int splitLevel() const {return transient_.splitLevel_;}
99  int basketSize() const {return transient_.basketSize_;}
101 
103  std::string const& moduleName() const {return transient_.moduleName_;}
104 
105  std::set<std::string> const& branchAliases() const {return branchAliases_;}
107  branchAliases_.insert(alias);
108  }
109  std::string const& branchName() const {return transient_.branchName_;}
111  BranchType const& branchType() const {return branchType_;}
114 
116 
118 
119  struct Transients {
120  Transients();
121 
122  void reset();
123 
124  // The parameter set id of the producer.
125  // This is set if and only if produced_ is true.
127 
128  // The module name of the producer.
129  // This is set if and only if produced_ is true.
131 
132  // The branch name, which is currently derivable fron the other attributes.
134 
135  // The wrapped class name, which is currently derivable fron the other attributes.
137 
138  // Was this branch produced in this process rather than in a previous process
139  bool produced_;
140 
141  // Was this branch produced in this current process and by unscheduled production
142  // This item is set only in the framework, not by FWLite.
143  bool onDemand_;
144 
145  // Has the branch been dropped from the product tree in this file
146  // (or if this is a merged product registry, in the first file).
147  // This item is set only in the framework, not by FWLite.
148  bool dropped_;
149 
150  // Is the class of the branch marked as transient
151  // in the data dictionary
153 
154  // A TypeWithDict object for the wrapped object
156 
157  // A TypeWithDict object for the unwrapped object
159 
160  // The split level of the branch, as marked
161  // in the data dictionary.
163 
164  // The basket size of the branch, as marked
165  // in the data dictionary.
167  };
168 
169  private:
170  void throwIfInvalid_() const;
171 
172  // What tree is the branch in?
174 
175  // A human friendly string that uniquely identifies the EDProducer
176  // and becomes part of the identity of a product that it produces
178 
179  // the physical process that this program was part of (e.g. production)
181 
182  // An ID uniquely identifying the branch
184 
185  // the full name of the type of product this is
187 
188  // a readable name of the type of product this is
190 
191  // a user-supplied name to distinguish multiple products of the same type
192  // that are produced by the same producer
194 
195  // The branch ROOT alias(es), which are settable by the user.
196  std::set<std::string> branchAliases_;
197 
198  // If this branch *is* an EDAlias, this field is the BranchID
199  // of the branch for which this branch is an alias.
200  // If this branch is not an EDAlias, the normal case, this field is 0.
202 
204  };
205 
206  inline
207  std::ostream&
208  operator<<(std::ostream& os, BranchDescription const& p) {
209  p.write(os);
210  return os;
211  }
212 
213  bool operator<(BranchDescription const& a, BranchDescription const& b);
214 
215  bool operator==(BranchDescription const& a, BranchDescription const& b);
216 
217  bool combinable(BranchDescription const& a, BranchDescription const& b);
218 
219  std::string match(BranchDescription const& a,
220  BranchDescription const& b,
221  std::string const& fileName);
222 }
223 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:90
type
Definition: HCALResponse.h:21
dictionary aliases
Definition: autoCond.py:46
std::string const & branchName() const
BranchType const & branchType() const
static int const invalidSplitLevel
Definition: Hash.h:42
static int const invalidBasketSize
void setOnDemand(bool isOnDemand)
std::string const & processName() const
bool isValid() const
Definition: BranchID.h:24
void write(std::ostream &os) const
BranchType
Definition: BranchType.h:11
void setWrappedType(TypeWithDict const &type)
void setTransient(bool isTransient)
std::string const & className() const
std::string const & moduleLabel() const
std::string const & productInstanceName() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
TypeID unwrappedTypeID() const
void setWrappedName(std::string const &name)
void setSplitLevel(int level)
std::string const & friendlyClassName() const
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
void setDropped(bool isDropped)
std::type_info const & typeInfo() const
std::string const & moduleName() const
std::string const & fullClassName() const
ParameterSetID const & parameterSetID() const
double b
Definition: hdecay.h:120
std::set< std::string > const & branchAliases() const
std::set< std::string > branchAliases_
BranchID const & aliasForBranchID() const
double a
Definition: hdecay.h:121
BranchID const & originalBranchID() const
tuple level
Definition: testEve_cfg.py:34
void setUnwrappedType(TypeWithDict const &type)
void setBasketSize(int size)
void setProduced(bool isProduced)
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
std::string const & wrappedName() const
tuple size
Write out results.
void insertBranchAlias(std::string const &alias)
TypeWithDict const & wrappedType() const
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
void merge(BranchDescription const &other)
TypeID wrappedTypeID() const