32 std::shared_ptr<ProductRegistry const> reg,
33 std::shared_ptr<BranchIDListHelper const> branchIDListHelper,
34 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper,
37 unsigned int streamIndex) :
40 luminosityBlockPrincipal_(),
42 unscheduledHandler_(),
43 moduleLabelsRunning_(),
45 branchIDListHelper_(branchIDListHelper),
46 thinnedAssociationsHelper_(thinnedAssociationsHelper),
48 branchListIndexToProcessIndex_(),
49 streamID_(streamIndex) {
101 <<
"EventPrincipal::fillEventPrincipal, Invalid event number provided in EventAuxiliary, It is illegal for the event number to be 0\n";
122 for(
auto const&
prod : *
this) {
123 if (
prod->singleProduct()) {
128 auto const & bd =
prod->branchDescription();
157 std::unique_ptr<WrapperBase> edp,
162 if(edp.get() ==
nullptr) {
164 <<
"put: Cannot put because ptr to product is null."
172 phb->
putProduct(std::move(edp), productProvenance);
178 std::unique_ptr<WrapperBase> edp,
187 phb->
putProduct(std::move(edp), productProvenance);
203 std::shared_ptr<void> guard(
nullptr,[
this,mcc](
const void*){
221 <<
"get by product ID: invalid ProductID supplied\n";
230 <<
"branchIDToProductID: invalid BranchID supplied\n";
233 typedef BIDToIndexMap::const_iterator Iter;
234 typedef std::pair<Iter, Iter> IndexRange;
237 for(Iter it = range.first; it != range.second; ++it) {
243 return ProductID(processIndex+1, productIndex+1);
257 exception<<
"get by product ID: The product with given id: "<<pid
258 <<
"\ntype: "<<phb->productType()
259 <<
"\nproduct instance name: "<<phb->productInstanceName()
260 <<
"\nprocess name: "<<phb->processName()
261 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module which caused this exception to state it reads this data.";
273 <<
"get by product ID: no product with given id: " << pid <<
"\n";
279 if(phb->productWasDeleted()) {
284 if(phb->onDemand()) {
288 <<
"get by ProductID: could not get product with id: " << pid <<
"\n"
289 <<
"Unscheduled execution not allowed to get via ProductID.\n";
294 phb->resolveProduct(status,
false,
nullptr,
nullptr);
312 associatedBranches != iEnd; ++associatedBranches) {
316 if(thinnedAssociation ==
nullptr)
continue;
322 unsigned int thinnedIndex = 0;
335 if(wrapperBase !=
nullptr) {
350 std::vector<WrapperBase const*>& foundContainers,
351 std::vector<unsigned int>&
keys)
const {
358 associatedBranches != iEnd; ++associatedBranches) {
362 if(thinnedAssociation ==
nullptr)
continue;
368 unsigned nKeys = keys.size();
370 std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
372 for(
unsigned k = 0;
k < nKeys; ++
k) {
374 if(foundContainers[
k] !=
nullptr)
continue;
376 if(keys[
k] == doNotLookForThisIndex)
continue;
395 for(
unsigned k = 0;
k < nKeys; ++
k) {
396 if(foundContainers[
k] ==
nullptr)
continue;
397 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
398 keys[
k] = thinnedIndexes[
k];
401 for(
unsigned k = 0;
k < nKeys; ++
k) {
402 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
403 keys[
k] = thinnedIndexes[
k];
404 foundContainers[
k] = bhThinned.
wrapper();
421 std::shared_ptr<UnscheduledHandler>
443 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductHolder cannot be found\n"
444 <<
"This should never happen. Contact a Framework developer";
447 ProductData const* productData = phb->resolveProduct(status,
false,
nullptr,
nullptr);
448 if (productData ==
nullptr) {
454 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
470 std::vector<std::string>::const_iterator
i =
475 <<
"Hit circular dependency while trying to run an unscheduled module.\n"
476 <<
"The last module on the stack shown above requested data from the\n"
477 <<
"module with label: '" << moduleLabel <<
"'.\n"
478 <<
"This is illegal because this module is already running (it is in the\n"
479 <<
"stack shown above, it might or might not be asking for data from itself).\n"
480 <<
"More information related to resolving circular dependences can be found here:\n"
481 <<
"https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideUnscheduledExecution#Circular_Dependence_Errors.";
489 <<
"EventPrincipal::unscheduledFill, Attempting to run unscheduled production\n"
490 <<
"with a null pointer to the ModuleCalling Context. This should never happen.\n"
491 <<
"Contact a Framework developer";
494 std::shared_ptr<void> guard(
nullptr,[
this,mcc](
const void*){
497 auto handlerCall = [
this,&moduleLabel,&mcc]() {
RunPrincipal const & runPrincipal() const
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
EventNumber_t event() const
unsigned short BranchListIndex
WrapperBase * product() const
void setLuminosityBlockPrincipal(std::shared_ptr< LuminosityBlockPrincipal > const &lbp)
EventSelectionIDVector const & eventSelectionIDs() const
ConstProductHolderPtr getProductHolder(BranchID const &oid) const
StreamContext const * getStreamContext() const
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
std::type_info const & dynamicTypeInfo() const
std::shared_ptr< UnscheduledHandler > unscheduledHandler_
BasicHandle getByProductID(ProductID const &oid) const
EventSelectionIDVector eventSelectionIDs_
BranchID pidToBid(ProductID const &pid) const
BranchListIndexes branchListIndexes_
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
Provenance getProvenance(ProductID const &pid, ModuleCallingContext const *mcc) const
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
unsigned long long EventNumber_t
T const * getProduct(RefCore const &ref)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
virtual void readFromSource_(ProductHolderBase const &phb, ModuleCallingContext const *mcc) const override
void putOnRead(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
BranchListIndexes const & branchListIndexes() const
unsigned int LuminosityBlockNumber_t
ProcessHistory const & processHistory() const
ProductID branchIDToProductID(BranchID const &bid) const
RunPrincipal const & runPrincipal() const
std::vector< EventSelectionID > EventSelectionIDVector
virtual WrapperBase const * getThinnedProduct(ProductID const &pid, unsigned int &key) const override
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductHolderPtr const phb)
void setUnscheduledHandler(std::shared_ptr< UnscheduledHandler > iHandler)
EventNumber_t const invalidEventNumber
std::vector< BranchListIndex > BranchListIndexes
BranchDescription const & branchDescription() const
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
ProcessHistoryID const & processHistoryID() const
std::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
void temporaryUnlock(FUNC iFunc)
WrapperBase const * wrapper() const
std::shared_ptr< WrapperBase > wrapper_
virtual WrapperBase const * getIt(ProductID const &pid) const override
BranchID const & branchID() const
ProductID const & thinnedCollectionID() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
unsigned short ProcessIndex
DelayedReader * reader() const
unsigned int value() const
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
virtual unsigned int transitionIndex_() const override
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
T const * product() const
void clearEventPrincipal()
std::shared_ptr< UnscheduledHandler > unscheduledHandler() const
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
EventID const & id() const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
std::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
Base::ConstProductHolderPtr ConstProductHolderPtr
unsigned short ProductIndex
EventPrincipal(std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< BranchIDListHelper const > branchIDListHelper, std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int streamIndex=0)
ProductID const & parentCollectionID() const
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preModuleDelayedGetSignal_
bool hasParentIndex(unsigned int parentIndex, unsigned int &thinnedIndex) const
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
EventAuxiliary const & aux() const
virtual void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
void putProduct(std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
EventNumber_t event() const
void emit(Args &&...args) const
ProductHolderBase * getExistingProduct(BranchID const &branchID)
std::vector< std::string > moduleLabelsRunning_
static HepMC::HEPEVT_Wrapper wrapper
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postModuleDelayedGetSignal_
virtual bool unscheduledFill(std::string const &moduleLabel, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
bool productUnavailable() const