1 #ifndef art_Framework_Principal_SubRun_h 2 #define art_Framework_Principal_SubRun_h 39 cet::exempt_ptr<Consumer> consumer,
84 template <
typename PROD>
86 template <
typename PROD>
88 template <
typename PROD>
90 template <
typename PROD>
94 template <
typename PROD>
95 ProductID put(std::unique_ptr<PROD>&&, std::string
const& instanceName);
96 template <
typename PROD>
98 std::string
const& instanceName,
100 template <
typename PROD>
102 std::string
const& instanceName,
104 template <
typename PROD>
106 std::string
const& instanceName,
121 bool const checkProducts,
122 std::set<TypeLabel>
const& expectedProducts);
126 template <
typename T>
131 template <
typename PROD>
133 std::string
const& productInstanceName,
138 std::unique_ptr<Run const>
const run_;
148 template <
typename PROD>
152 return put<PROD>(std::move(product), std::string{});
155 template <
typename PROD>
160 return put<PROD>(std::move(product), std::string{}, semantic);
163 template <
typename PROD>
168 return put<PROD>(std::move(product), std::string{}, semantic);
171 template <
typename PROD>
176 return put<PROD>(std::move(product), std::string{}, std::move(semantic));
182 template <
typename PROD>
185 std::string
const& productInstanceName)
188 return put_<PROD>(std::move(product), productInstanceName,
productRangeSet_);
191 template <
typename PROD>
194 std::string
const& productInstanceName,
201 template <
typename PROD>
204 std::string
const& productInstanceName,
210 "art error: A SubRun product put with the semantic 'SubRunFragment'\n" 211 " must be able to be aggregated. Please add the appropriate\n" 212 " void aggregate(T const&)\n" 213 " function to your class, or contact artists@fnal.gov.\n");
217 <<
"\nCannot put a product corresponding to a full SubRun using\n" 218 <<
"art::subRunFragment(). This can happen if you attempted to\n" 219 <<
"put a product at beginSubRun using art::subRunFragment().\n" 220 <<
"Please use either:\n" 221 <<
" art::fullSubRun(), or\n" 222 <<
" art::subRunFragment(art::RangeSet const&)\n" 223 <<
"or contact artists@fnal.gov for assistance.\n";
225 return put_<PROD>(std::move(product), productInstanceName,
productRangeSet_);
228 template <
typename PROD>
231 std::string
const& productInstanceName,
237 "art error: A SubRun product put with the semantic 'SubRunFragment'\n" 238 " must be able to be aggregated. Please add the appropriate\n" 239 " void aggregate(T const&)\n" 240 " function to your class, or contact artists@fnal.gov.\n");
241 if (semantic.
rs.collapse().is_full_subRun()) {
243 <<
"\nCannot put a product corresponding to a full SubRun using\n" 244 <<
"art::subRunFragment(art::RangeSet&). Please use:\n" 245 <<
" art::fullSubRun()\n" 246 <<
"or contact artists@fnal.gov for assistance.\n";
248 return put_<PROD>(std::move(product), productInstanceName, semantic.
rs);
251 template <
typename PROD>
254 std::string
const& productInstanceName,
257 TypeID const tid{
typeid(PROD)};
258 if (product.get() ==
nullptr) {
260 <<
"\nA null unique_ptr was passed to 'put'.\n" 261 <<
"The pointer is of type " << tid <<
".\n" 262 <<
"The specified productInstanceName was '" << productInstanceName
268 <<
"\nCannot put a product with an invalid RangeSet.\n" 269 <<
"Please contact artists@fnal.gov.\n";
273 auto wp = std::make_unique<Wrapper<PROD>>(std::move(product));
278 PMValue{std::move(wp), pd, rs});
279 if (!result.second) {
281 <<
"\nAttempt to put multiple products with the\n" 282 <<
"following description onto the SubRun.\n" 283 <<
"Products must be unique per SubRun.\n" 284 <<
"=================================\n" 285 << pd <<
"=================================\n";
288 return pd.productID();
Timestamp const & endTime() const
PROD const * getPointerByLabel(InputTag const &tag) const
SubRunNumber_t subRun() const
ProcessHistory const & processHistory() const
SubRunID const & id() const
bool get(SelectorBase const &, Handle< PROD > &result) const
Timestamp const & endTime() const
std::unique_ptr< Run const > const run_
Timestamp const & beginTime() const
BranchDescription const & getProductDescription(TypeID const &type, std::string const &productInstanceName) const
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
Principal const & principal_
SubRun(SubRunPrincipal const &srp, ModuleDescription const &md, cet::exempt_ptr< Consumer > consumer, RangeSet const &rsForPuttingProducts=RangeSet::invalid())
RangeSet productRangeSet_
Run const & getRun() const
Timestamp const & beginTime() const
SubRunAuxiliary const & aux_
IDNumber_t< Level::SubRun > SubRunNumber_t
void getManyByType(std::vector< Handle< PROD >> &results) const
SubRunNumber_t subRun() const
EDProductGetter const * productGetter(ProductID const pid) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool is_full_subRun() const
void commit(SubRunPrincipal &srp, bool const checkProducts, std::set< TypeLabel > const &expectedProducts)
static RangeSet forSubRun(SubRunID)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
ProductID put(std::unique_ptr< PROD > &&)
static RangeSet invalid()
TypeLabelMap & putProducts()
bool removeCachedProduct(Handle< PROD > &h) 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