CMS 3D CMS Logo

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, Permissive };
37 
39 
41  std::string const& moduleLabel,
42  std::string const& processName,
43  std::string const& className,
46  std::string const& moduleName,
48  TypeWithDict const& theTypeWithDict,
49  bool produced = true,
50  bool availableOnlyAtEndTransition = false,
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& productInstanceAlias);
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; }
90  bool transient() const { return transient_.transient_; }
91  void setTransient(bool isTransient) { transient_.transient_ = isTransient; }
92  TypeWithDict const& wrappedType() const { return transient_.wrappedType_; }
98  int splitLevel() const { return transient_.splitLevel_; }
100  int basketSize() const { return transient_.basketSize_; }
102 
103  bool isSwitchAlias() const { return not transient_.switchAliasModuleLabel_.empty(); }
107  void setSwitchAliasForBranch(BranchDescription const& aliasForBranch);
108 
109  bool isAnyAlias() const { return isAlias() or isSwitchAlias(); }
110 
113 
115  std::string const& moduleName() const { return transient_.moduleName_; }
116 
117  std::set<std::string> const& branchAliases() const { return branchAliases_; }
119  std::string const& branchName() const { return transient_.branchName_; }
121  BranchType const& branchType() const { return branchType_; }
122  std::string const& wrappedName() const { return transient_.wrappedName_; }
124 
125  bool isMergeable() const { return transient_.isMergeable_; }
127 
129 
131 
132  struct Transients {
133  Transients();
134 
135  void reset();
136 
137  // The parameter set id of the producer.
138  // This is set if and only if produced_ is true.
140 
141  // The module name of the producer.
142  // This is set if and only if produced_ is true.
144 
145  // The branch name, which is currently derivable from the other attributes.
147 
148  // The wrapped class name, which is currently derivable from the other attributes.
150 
151  // For SwitchProducer alias, the label of the aliased-for label; otherwise empty
153 
154  // Need a separate (transient) BranchID for switch, because
155  // otherwise originalBranchID() gives wrong answer when reading
156  // from a file (leading to wrong ProductProvenance to be retrieved)
158 
159  // A TypeWithDict object for the wrapped object
161 
162  // A TypeWithDict object for the unwrapped object
164 
165  // The split level of the branch, as marked
166  // in the data dictionary.
168 
169  // The basket size of the branch, as marked
170  // in the data dictionary.
172 
173  // Was this branch produced in this process rather than in a previous process
174  bool produced_;
175 
176  // Was this branch produced in this current process and by unscheduled production
177  // This item is set only in the framework, not by FWLite.
178  bool onDemand_;
179 
180  // Has the branch been dropped from the product tree in this file
181  // (or if this is a merged product registry, in the first file).
182  // This item is set only in the framework, not by FWLite.
183  bool dropped_;
184 
185  // Is the class of the branch marked as transient
186  // in the data dictionary
188 
189  // if Run or Lumi based, can only get at end transition
191 
192  // True if the product definition has a mergeProduct function
193  // and the branchType is Run or Lumi
195 
196  // True if provenance is set on call from input on read
198  };
199 
200  private:
201  void throwIfInvalid_() const;
202 
203  // What tree is the branch in?
205 
206  // A human friendly string that uniquely identifies the EDProducer
207  // and becomes part of the identity of a product that it produces
209 
210  // the physical process that this program was part of (e.g. production)
212 
213  // An ID uniquely identifying the branch
215 
216  // the full name of the type of product this is
218 
219  // a readable name of the type of product this is
221 
222  // a user-supplied name to distinguish multiple products of the same type
223  // that are produced by the same producer
225 
226  // The branch ROOT alias(es), which are settable by the user.
227  std::set<std::string> branchAliases_;
228 
229  // If this branch *is* an EDAlias, this field is the BranchID
230  // of the branch for which this branch is an alias.
231  // If this branch is not an EDAlias, the normal case, this field is 0.
233 
235  };
236 
237  inline std::ostream& operator<<(std::ostream& os, BranchDescription const& p) {
238  p.write(os);
239  return os;
240  }
241 
242  bool operator<(BranchDescription const& a, BranchDescription const& b);
243 
244  bool operator==(BranchDescription const& a, BranchDescription const& b);
245 
246  bool combinable(BranchDescription const& a, BranchDescription const& b);
247 
248  std::string match(BranchDescription const& a, BranchDescription const& b, std::string const& fileName);
249 } // namespace edm
250 #endif
edm::BranchDescription::availableOnlyAtEndTransition
bool availableOnlyAtEndTransition() const
Definition: BranchDescription.h:89
personalPlayback.level
level
Definition: personalPlayback.py:22
edm::BranchDescription::fullClassName
std::string const & fullClassName() const
Definition: BranchDescription.h:78
edm::BranchDescription::branchID_
BranchID branchID_
Definition: BranchDescription.h:214
edm::BranchDescription::Transients::onDemand_
bool onDemand_
Definition: BranchDescription.h:178
ProvenanceFwd.h
edm::BranchDescription::Transients::splitLevel_
int splitLevel_
Definition: BranchDescription.h:167
edm::BranchDescription::productInstanceName
std::string const & productInstanceName() const
Definition: BranchDescription.h:81
edm::BranchDescription::setBasketSize
void setBasketSize(int size)
Definition: BranchDescription.h:101
edm::BranchDescription::setSplitLevel
void setSplitLevel(int level)
Definition: BranchDescription.h:99
edm::BranchDescription::Transients::availableOnlyAtEndTransition_
bool availableOnlyAtEndTransition_
Definition: BranchDescription.h:190
edm::BranchDescription::basketSize
int basketSize() const
Definition: BranchDescription.h:100
edm::BranchDescription::moduleLabel_
std::string moduleLabel_
Definition: BranchDescription.h:208
edm::BranchDescription::Transients::unwrappedType_
TypeWithDict unwrappedType_
Definition: BranchDescription.h:163
edm::BranchDescription::isSwitchAlias
bool isSwitchAlias() const
Definition: BranchDescription.h:103
edm::BranchDescription::unwrappedType
TypeWithDict const & unwrappedType() const
Definition: BranchDescription.h:94
edm::BranchDescription::setWrappedType
void setWrappedType(TypeWithDict const &type)
Definition: BranchDescription.h:93
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::BranchDescription::wrappedType
TypeWithDict const & wrappedType() const
Definition: BranchDescription.h:92
edm::BranchDescription::splitLevel
int splitLevel() const
Definition: BranchDescription.h:98
BranchID.h
edm::BranchDescription::Transients::produced_
bool produced_
Definition: BranchDescription.h:174
TypeID.h
edm::BranchDescription::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: BranchDescription.h:114
edm::combinable
bool combinable(BranchDescription const &a, BranchDescription const &b)
Definition: BranchDescription.cc:340
TypeWithDict.h
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::BranchDescription::Strict
Definition: BranchDescription.h:36
findQualityFiles.v
v
Definition: findQualityFiles.py:179
watchdog.const
const
Definition: watchdog.py:83
edm::BranchDescription::branchAliases_
std::set< std::string > branchAliases_
Definition: BranchDescription.h:227
edm::BranchDescription::Transients::isMergeable_
bool isMergeable_
Definition: BranchDescription.h:194
edm::BranchDescription::~BranchDescription
~BranchDescription()
Definition: BranchDescription.h:57
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::BranchDescription::clearBranchName
void clearBranchName()
Definition: BranchDescription.h:120
edm::BranchDescription::setWrappedName
void setWrappedName(std::string const &name)
Definition: BranchDescription.h:123
edm::BranchDescription::write
void write(std::ostream &os) const
Definition: BranchDescription.cc:257
edm::BranchDescription::present
bool present() const
Definition: BranchDescription.h:84
edm::BranchDescription::friendlyClassName_
std::string friendlyClassName_
Definition: BranchDescription.h:220
edm::BranchDescription::Permissive
Definition: BranchDescription.h:36
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition: HLTGlobalStatus.h:106
edm::BranchDescription::BranchDescription
BranchDescription()
Definition: BranchDescription.cc:37
edm::BranchDescription::setOnDemand
void setOnDemand(bool isOnDemand)
Definition: BranchDescription.h:88
edm::BranchDescription::setProduced
void setProduced(bool isProduced)
Definition: BranchDescription.h:83
edm::BranchDescription::onDemand
bool onDemand() const
Definition: BranchDescription.h:87
edm::BranchDescription::initializeTransients
void initializeTransients()
Definition: BranchDescription.h:130
edm::BranchDescription::aliasForBranchID
BranchID const & aliasForBranchID() const
Definition: BranchDescription.h:75
edm::BranchDescription::isAlias
bool isAlias() const
Definition: BranchDescription.h:76
edm::BranchDescription::Transients::switchAliasForBranchID_
BranchID switchAliasForBranchID_
Definition: BranchDescription.h:157
edm::BranchDescription::insertBranchAlias
void insertBranchAlias(std::string const &alias)
Definition: BranchDescription.h:118
edm::BranchDescription::setDropped
void setDropped(bool isDropped)
Definition: BranchDescription.h:86
edm::BranchDescription::processName
std::string const & processName() const
Definition: BranchDescription.h:73
edm::operator==
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
Definition: debugging_allocator.h:72
edm::BranchDescription::setUnwrappedType
void setUnwrappedType(TypeWithDict const &type)
Definition: BranchDescription.h:95
edm::BranchDescription::invalidSplitLevel
static const int invalidSplitLevel
Definition: BranchDescription.h:34
edm::BranchDescription::initBranchName
void initBranchName()
Definition: BranchDescription.cc:105
edm::BranchID
Definition: BranchID.h:14
edm::operator<
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:89
edm::BranchDescription::Transients::wrappedType_
TypeWithDict wrappedType_
Definition: BranchDescription.h:160
edm::BranchDescription::Transients::transient_
bool transient_
Definition: BranchDescription.h:187
edm::BranchDescription::originalBranchID
BranchID const & originalBranchID() const
Definition: BranchDescription.h:77
ProductID.h
edm::BranchDescription::wrappedName
std::string const & wrappedName() const
Definition: BranchDescription.h:122
edm::BranchDescription::unwrappedTypeID
TypeID unwrappedTypeID() const
Definition: BranchDescription.h:97
edm::BranchDescription::transient_
Transients transient_
Definition: BranchDescription.h:234
edm::BranchDescription::setSwitchAliasForBranch
void setSwitchAliasForBranch(BranchDescription const &aliasForBranch)
Definition: BranchDescription.cc:235
edm::BranchDescription::MatchMode
MatchMode
Definition: BranchDescription.h:36
edm::Hash
Definition: Hash.h:43
trackingPlots.other
other
Definition: trackingPlots.py:1467
edm::BranchDescription::friendlyClassName
std::string const & friendlyClassName() const
Definition: BranchDescription.h:80
edm::BranchDescription::Transients::wrappedName_
std::string wrappedName_
Definition: BranchDescription.h:149
edm::BranchDescription::dropped
bool dropped() const
Definition: BranchDescription.h:85
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::TypeWithDict
Definition: TypeWithDict.h:38
edm::BranchDescription::isMergeable
bool isMergeable() const
Definition: BranchDescription.h:125
a
double a
Definition: hdecay.h:119
edm::BranchDescription::branchType_
BranchType branchType_
Definition: BranchDescription.h:204
edm::BranchDescription::setSwitchAliasModuleLabel
void setSwitchAliasModuleLabel(std::string label)
Definition: BranchDescription.h:105
edm::TypeWithDict::typeInfo
std::type_info const & typeInfo() const
Definition: TypeWithDict.cc:357
edm::BranchDescription::Transients::branchName_
std::string branchName_
Definition: BranchDescription.h:146
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
edm::BranchDescription::fullClassName_
std::string fullClassName_
Definition: BranchDescription.h:217
edm::BranchDescription::isProvenanceSetOnRead
bool isProvenanceSetOnRead() const noexcept
Definition: BranchDescription.h:111
value
Definition: value.py:1
BranchType.h
edm::BranchDescription::switchAliasModuleLabel
std::string const & switchAliasModuleLabel() const
Definition: BranchDescription.h:104
edm::BranchDescription::Transients::parameterSetID_
ParameterSetID parameterSetID_
Definition: BranchDescription.h:139
edm::BranchDescription::branchType
BranchType const & branchType() const
Definition: BranchDescription.h:121
edm::BranchDescription::branchName
std::string const & branchName() const
Definition: BranchDescription.h:119
edm::BranchDescription::Transients::basketSize_
int basketSize_
Definition: BranchDescription.h:171
edm::BranchDescription::initFromDictionary
void initFromDictionary()
Definition: BranchDescription.cc:154
edm::BranchDescription::produced
bool produced() const
Definition: BranchDescription.h:82
edm::BranchDescription::Transients
Definition: BranchDescription.h:132
edm::BranchDescription::Transients::isProvenanceSetOnRead_
bool isProvenanceSetOnRead_
Definition: BranchDescription.h:197
edm::BranchDescription::updateFriendlyClassName
void updateFriendlyClassName()
Definition: BranchDescription.cc:294
edm::BranchDescription::moduleName
std::string const & moduleName() const
Definition: BranchDescription.h:115
edm::BranchDescription::productInstanceName_
std::string productInstanceName_
Definition: BranchDescription.h:224
edm::BranchDescription::processName_
std::string processName_
Definition: BranchDescription.h:211
edm::TypeID
Definition: TypeID.h:22
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::match
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
Definition: BranchDescription.cc:351
edm::BranchDescription::Transients::moduleName_
std::string moduleName_
Definition: BranchDescription.h:143
edm::BranchDescription::Transients::Transients
Transients()
Definition: BranchDescription.cc:19
edm::BranchDescription::Transients::switchAliasModuleLabel_
std::string switchAliasModuleLabel_
Definition: BranchDescription.h:152
edm::BranchDescription::moduleLabel
std::string const & moduleLabel() const
Definition: BranchDescription.h:72
edm::BranchDescription::merge
void merge(BranchDescription const &other)
Definition: BranchDescription.cc:227
relativeConstraints.value
value
Definition: relativeConstraints.py:53
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
edm::BranchDescription::setIsMergeable
void setIsMergeable(bool v)
Definition: BranchDescription.h:126
edm::BranchDescription::setTransient
void setTransient(bool isTransient)
Definition: BranchDescription.h:91
edm::BranchDescription::branchAliases
std::set< std::string > const & branchAliases() const
Definition: BranchDescription.h:117
edm::BranchDescription::invalidBasketSize
static const int invalidBasketSize
Definition: BranchDescription.h:35
edm::BranchID::isValid
bool isValid() const
Definition: BranchID.h:22
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::BranchDescription::isAnyAlias
bool isAnyAlias() const
Definition: BranchDescription.h:109
edm::BranchDescription::init
void init()
Definition: BranchDescription.h:59
edm::BranchDescription
Definition: BranchDescription.h:32
ParameterSetID.h
edm::BranchDescription::className
std::string const & className() const
Definition: BranchDescription.h:79
edm::BranchDescription::switchAliasForBranchID
BranchID const & switchAliasForBranchID() const
Definition: BranchDescription.h:106
edm::BranchDescription::Transients::reset
void reset()
Definition: BranchDescription.cc:35
edm::BranchDescription::Transients::dropped_
bool dropped_
Definition: BranchDescription.h:183
edm::BranchDescription::aliasForBranchID_
BranchID aliasForBranchID_
Definition: BranchDescription.h:232
edm::BranchDescription::wrappedTypeID
TypeID wrappedTypeID() const
Definition: BranchDescription.h:96
edm::BranchDescription::setIsProvenanceSetOnRead
void setIsProvenanceSetOnRead(bool value=true) noexcept
Definition: BranchDescription.h:112
edm::BranchDescription::branchID
BranchID const & branchID() const
Definition: BranchDescription.h:74
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::BranchDescription::throwIfInvalid_
void throwIfInvalid_() const
Definition: BranchDescription.cc:274
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443