1 #ifndef art_Framework_Principal_Run_h 2 #define art_Framework_Principal_Run_h 36 cet::exempt_ptr<Consumer> consumer,
74 template <
typename PROD>
76 template <
typename PROD>
78 template <
typename PROD>
80 template <
typename PROD>
85 template <
typename PROD>
87 template <
typename PROD>
89 std::string
const& instanceName,
91 template <
typename PROD>
93 std::string
const& instanceName,
95 template <
typename PROD>
97 std::string
const& instanceName,
110 std::vector<fhicl::ParameterSet>& ps)
const;
120 bool const checkProducts,
121 std::set<TypeLabel>
const& expectedProducts);
125 template <
typename T>
130 template <
typename PROD>
132 std::string
const& productInstanceName,
146 template <
typename PROD>
150 return put<PROD>(std::move(product), std::string{});
153 template <
typename PROD>
158 return put<PROD>(std::move(product), std::string{}, semantic);
161 template <
typename PROD>
166 return put<PROD>(std::move(product), std::string{}, semantic);
169 template <
typename PROD>
174 return put<PROD>(std::move(product), std::string{}, std::move(semantic));
180 template <
typename PROD>
183 std::string
const& productInstanceName)
186 return put_<PROD>(std::move(product), productInstanceName,
productRangeSet_);
189 template <
typename PROD>
192 std::string
const& productInstanceName,
199 template <
typename PROD>
202 std::string
const& productInstanceName,
208 "art error: A Run product put with the semantic 'RunFragment'\n" 209 " must be able to be aggregated. Please add the appropriate\n" 210 " void aggregate(T const&)\n" 211 " function to your class, or contact artists@fnal.gov.\n");
215 <<
"\nCannot put a product corresponding to a full Run using\n" 216 <<
"art::runFragment(). This can happen if you attempted to\n" 217 <<
"put a product at beginRun using art::runFragment().\n" 218 <<
"Please use either:\n" 219 <<
" art::fullRun(), or\n" 220 <<
" art::runFragment(art::RangeSet const&)\n" 221 <<
"or contact artists@fnal.gov for assistance.\n";
223 return put_<PROD>(std::move(product), productInstanceName,
productRangeSet_);
226 template <
typename PROD>
229 std::string
const& productInstanceName,
235 "art error: A Run product put with the semantic 'RunFragment'\n" 236 " must be able to be aggregated. Please add the appropriate\n" 237 " void aggregate(T const&)\n" 238 " function to your class, or contact artists@fnal.gov.\n");
239 if (semantic.
rs.collapse().is_full_run()) {
241 <<
"\nCannot put a product corresponding to a full Run using\n" 242 <<
"art::runFragment(art::RangeSet&). Please use:\n" 243 <<
" art::fullRun()\n" 244 <<
"or contact artists@fnal.gov for assistance.\n";
246 return put_<PROD>(std::move(product), productInstanceName, semantic.
rs);
249 template <
typename PROD>
252 std::string
const& productInstanceName,
255 TypeID const tid{
typeid(PROD)};
256 if (product.get() ==
nullptr) {
258 <<
"\nA null unique_ptr was passed to 'put'.\n" 259 <<
"The pointer is of type " << tid <<
".\n" 260 <<
"The specified productInstanceName was '" << productInstanceName
266 <<
"\nCannot put a product with an invalid RangeSet.\n" 267 <<
"Please contact artists@fnal.gov.\n";
271 auto wp = std::make_unique<Wrapper<PROD>>(std::move(product));
276 PMValue{std::move(wp), pd, rs});
277 if (!result.second) {
279 <<
"\nAttempt to put multiple products with the\n" 280 <<
"following description onto the Run.\n" 281 <<
"Products must be unique per Run.\n" 282 <<
"=================================\n" 283 << pd <<
"=================================\n";
286 return pd.productID();
PROD const * getPointerByLabel(InputTag const &tag) const
bool getProcessParameterSet(std::string const &processName, std::vector< fhicl::ParameterSet > &ps) const
ProcessHistory const & processHistory() const
bool get(SelectorBase const &, Handle< PROD > &result) const
art::ProductID put(std::unique_ptr< PROD > &&)
BranchDescription const & getProductDescription(TypeID const &type, std::string const &productInstanceName) const
void commit(RunPrincipal &rp, bool const checkProducts, std::set< TypeLabel > const &expectedProducts)
art::ProductID put_(std::unique_ptr< PROD > &&product, std::string const &productInstanceName, RangeSet const &rs)
Put a new product with a 'product instance name' and a 'range set'.
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
void getMany(SelectorBase const &, std::vector< Handle< PROD >> &results) const
Timestamp const & endTime() const
Timestamp const & endTime() const
Run(RunPrincipal const &rp, ModuleDescription const &md, cet::exempt_ptr< Consumer > consumer, RangeSet const &rsForPuttingProducts=RangeSet::invalid())
void getManyByType(std::vector< Handle< PROD >> &results) const
static RangeSet forRun(RunID)
Principal const & principal_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
EDProductGetter const * productGetter(ProductID const pid) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
static RangeSet invalid()
TypeLabelMap & putProducts()
RunAuxiliary const & aux_
Timestamp const & beginTime() const
bool removeCachedProduct(Handle< PROD > &h) const
Timestamp const & beginTime() const
DataViewImpl(DataViewImpl const &)=delete
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool getByToken(ProductToken< PROD > const &token, Handle< PROD > &result) const
IDNumber_t< Level::Run > RunNumber_t
RangeSet productRangeSet_