CMS 3D CMS Logo

Run.cc
Go to the documentation of this file.
2 
6 
7 namespace edm {
8 
10 
12  ModuleDescription const& md,
13  ModuleCallingContext const* moduleCallingContext,
14  bool isAtEnd)
15  : provRecorder_(rp, md, isAtEnd), aux_(rp.aux()), moduleCallingContext_(moduleCallingContext) {}
16 
17  Run::~Run() {}
18 
20 
21  RunIndex Run::index() const { return runPrincipal().index(); }
22 
23  RunPrincipal const& Run::runPrincipal() const { return dynamic_cast<RunPrincipal const&>(provRecorder_.principal()); }
24 
27  }
28 
29  void Run::getAllStableProvenance(std::vector<StableProvenance const*>& provenances) const {
30  runPrincipal().getAllStableProvenance(provenances);
31  }
32 
33  /* Not yet fully implemented
34  bool
35  Run::getProcessParameterSet(std::string const& processName, std::vector<ParameterSet>& psets) const {
36  // Get the relevant ProcessHistoryIDs
37  ProcessHistoryRegistry* phreg = ProcessHistoryRegistry::instance();
38  // Need to fill these in.
39  std::vector<ProcessHistoryID> historyIDs;
40 
41 
42  // Get the relevant ParameterSetIDs.
43  // Need to fill these in.
44  std::vector<ParameterSetID> psetIdsUsed;
45  for(std::vector<ProcessHistoryID>::const_iterator
46  i = historyIDs.begin(),
47  e = historyIDs.end();
48  i != e;
49  ++i) {
50  ProcessHistory temp;
51  phreg->getMapped(*i, temp);
52  }
53 
54  // Look up the ParameterSets for these IDs.
55  pset::Registry* psreg = pset::Registry::instance();
56  for(std::vector<ParameterSetID>::const_iterator
57  i = psetIdsUsed.begin(),
58  e = psetIdsUsed.end();
59  i != e;
60  ++i) {
61  ParameterSet temp;
62  psreg->getMapped(*i, temp);
63  psets.push_back(temp);
64  }
65 
66  return false;
67  }
68 */
69 
70  void Run::setProducer(ProducerBase const* iProducer) {
71  provRecorder_.setProducer(iProducer);
72  //set appropriate size
74  }
75 
76  void Run::commit_(std::vector<edm::ProductResolverIndex> const& iShouldPut) {
77  RunPrincipal const& rp = runPrincipal();
78  size_t nPut = 0;
79  for (size_t i = 0; i < putProducts().size(); ++i) {
80  auto& p = get_underlying_safe(putProducts()[i]);
81  if (p) {
83  ++nPut;
84  }
85  }
86 
87  auto sz = iShouldPut.size();
88  if (sz != 0 and sz != nPut) {
89  //some were missed
90  auto& p = provRecorder_.principal();
91  for (auto index : iShouldPut) {
92  auto resolver = p.getProductResolverByIndex(index);
93  if (not resolver->productResolved() and isEndTransition(provRecorder_.transition()) ==
94  resolver->branchDescription().availableOnlyAtEndTransition()) {
95  resolver->putProduct(std::unique_ptr<WrapperBase>());
96  }
97  }
98  }
99 
100  // the cleanup is all or none
101  putProducts().clear();
102  }
103 
105 
107 
108  BasicHandle Run::getByLabelImpl(std::type_info const&,
109  std::type_info const& iProductType,
110  const InputTag& iTag) const {
112  return h;
113  }
114 } // namespace edm
ProcessHistory const & processHistory() const
void setProducer(ProducerBase const *iProducer)
Definition: Run.cc:70
Provenance getProvenance(BranchID const &theID) const
Definition: Run.cc:25
static const std::string emptyString_
Definition: Run.h:189
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Run.cc:29
ProductPtrVec putProducts_
Definition: Run.h:183
Transition transition() const
Principal const & principal() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
BasicHandle getByLabelImpl(std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const override
Definition: Run.cc:108
Run(RunPrincipal const &rp, ModuleDescription const &md, ModuleCallingContext const *, bool isAtEnd)
Definition: Run.cc:11
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:36
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Principal.cc:830
Provenance getProvenance(BranchID const &bid, ModuleCallingContext const *mcc) const
Definition: Principal.cc:796
CacheIdentifier_t cacheIdentifier() const
Definition: Principal.h:184
constexpr bool isEndTransition(Transition iValue)
Definition: Transition.h:25
unsigned long CacheIdentifier_t
Definition: Run.h:78
void setProducer(ProducerBase const *iProd)
CacheIdentifier_t cacheIdentifier() const
Definition: Run.cc:19
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:142
void commit_(std::vector< edm::ProductResolverIndex > const &iShouldPut)
Definition: Run.cc:76
ProcessHistory const & processHistory() const
Definition: Run.cc:106
RunIndex index() const
Definition: Run.cc:21
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
~Run() override
Definition: Run.cc:17
ProcessHistoryID const & processHistoryID() const
Definition: Run.cc:104
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
ProductPtrVec & putProducts()
Definition: Run.h:168
RunIndex index() const
Definition: RunPrincipal.h:56
HLT enums.
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182