31 std::shared_ptr<ProductRegistry const> reg,
32 std::shared_ptr<BranchIDListHelper const> branchIDListHelper,
33 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper,
36 unsigned int streamIndex) :
39 luminosityBlockPrincipal_(),
41 unscheduledHandler_(),
42 moduleLabelsRunning_(),
44 branchIDListHelper_(branchIDListHelper),
45 thinnedAssociationsHelper_(thinnedAssociationsHelper),
47 branchListIndexToProcessIndex_(),
48 streamID_(streamIndex) {
100 <<
"EventPrincipal::fillEventPrincipal, Invalid event number provided in EventAuxiliary, It is illegal for the event number to be 0\n";
121 for(
auto const&
prod : *
this) {
122 if (
prod->singleProduct()) {
127 auto const & bd =
prod->branchDescription();
156 std::unique_ptr<WrapperBase> edp,
161 if(edp.get() ==
nullptr) {
163 <<
"put: Cannot put because ptr to product is null."
171 phb->
putProduct(std::move(edp), productProvenance);
177 std::unique_ptr<WrapperBase> edp,
186 phb->
putProduct(std::move(edp), productProvenance);
202 std::shared_ptr<void> guard(
nullptr,[
this,mcc](
const void*){
220 <<
"get by product ID: invalid ProductID supplied\n";
229 <<
"branchIDToProductID: invalid BranchID supplied\n";
232 typedef BIDToIndexMap::const_iterator Iter;
233 typedef std::pair<Iter, Iter> IndexRange;
236 for(Iter it = range.first; it != range.second; ++it) {
242 return ProductID(processIndex+1, productIndex+1);
256 exception<<
"get by product ID: The product with given id: "<<pid
257 <<
"\ntype: "<<phb->productType()
258 <<
"\nproduct instance name: "<<phb->productInstanceName()
259 <<
"\nprocess name: "<<phb->processName()
260 <<
"\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.";
272 <<
"get by product ID: no product with given id: " << pid <<
"\n";
278 if(phb->productWasDeleted()) {
283 if(phb->onDemand()) {
287 <<
"get by ProductID: could not get product with id: " << pid <<
"\n"
288 <<
"Unscheduled execution not allowed to get via ProductID.\n";
293 phb->resolveProduct(status,
false,
nullptr);
311 associatedBranches != iEnd; ++associatedBranches) {
315 if(thinnedAssociation ==
nullptr)
continue;
321 unsigned int thinnedIndex = 0;
334 if(wrapperBase !=
nullptr) {
349 std::vector<WrapperBase const*>& foundContainers,
350 std::vector<unsigned int>&
keys)
const {
357 associatedBranches != iEnd; ++associatedBranches) {
361 if(thinnedAssociation ==
nullptr)
continue;
367 unsigned nKeys = keys.size();
369 std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
371 for(
unsigned k = 0;
k < nKeys; ++
k) {
373 if(foundContainers[
k] !=
nullptr)
continue;
375 if(keys[
k] == doNotLookForThisIndex)
continue;
394 for(
unsigned k = 0;
k < nKeys; ++
k) {
395 if(foundContainers[
k] ==
nullptr)
continue;
396 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
397 keys[
k] = thinnedIndexes[
k];
400 for(
unsigned k = 0;
k < nKeys; ++
k) {
401 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
402 keys[
k] = thinnedIndexes[
k];
403 foundContainers[
k] = bhThinned.
wrapper();
420 std::shared_ptr<UnscheduledHandler>
442 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductHolder cannot be found\n"
443 <<
"This should never happen. Contact a Framework developer";
446 ProductData const* productData = phb->resolveProduct(status,
false,
nullptr);
447 if (productData ==
nullptr) {
453 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
468 std::vector<std::string>::const_iterator
i =
473 <<
"Hit circular dependency while trying to run an unscheduled module.\n"
474 <<
"The last module on the stack shown above requested data from the\n"
475 <<
"module with label: '" << moduleLabel <<
"'.\n"
476 <<
"This is illegal because this module is already running (it is in the\n"
477 <<
"stack shown above, it might or might not be asking for data from itself).\n"
478 <<
"More information related to resolving circular dependences can be found here:\n"
479 <<
"https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideUnscheduledExecution#Circular_Dependence_Errors.";
487 <<
"EventPrincipal::unscheduledFill, Attempting to run unscheduled production\n"
488 <<
"with a null pointer to the ModuleCalling Context. This should never happen.\n"
489 <<
"Contact a Framework developer";
492 std::shared_ptr<void> guard(
nullptr,[
this,mcc](
const void*){
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
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 bool unscheduledFill(std::string const &moduleLabel, ModuleCallingContext const *mcc) const override
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
WrapperBase const * wrapper() const
std::shared_ptr< WrapperBase > wrapper_
virtual WrapperBase const * getIt(ProductID const &pid) const override
T const * getProduct(RefCore const &ref)
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
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_
bool productUnavailable() const