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()) {
149 std::unique_ptr<WrapperBase> edp,
154 if(edp.get() ==
nullptr) {
156 <<
"put: Cannot put because ptr to product is null."
164 phb->
putProduct(std::move(edp), productProvenance);
170 std::unique_ptr<WrapperBase> edp,
179 phb->
putProduct(std::move(edp), productProvenance);
195 std::shared_ptr<void> guard(
nullptr,[
this,mcc](
const void*){
213 <<
"get by product ID: invalid ProductID supplied\n";
222 <<
"branchIDToProductID: invalid BranchID supplied\n";
225 typedef BIDToIndexMap::const_iterator Iter;
226 typedef std::pair<Iter, Iter> IndexRange;
229 for(Iter it = range.first; it != range.second; ++it) {
235 return ProductID(processIndex+1, productIndex+1);
249 exception<<
"get by product ID: The product with given id: "<<pid
250 <<
"\ntype: "<<phb->productType()
251 <<
"\nproduct instance name: "<<phb->productInstanceName()
252 <<
"\nprocess name: "<<phb->processName()
253 <<
"\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.";
265 <<
"get by product ID: no product with given id: " << pid <<
"\n";
271 if(phb->productWasDeleted()) {
276 if(phb->onDemand()) {
280 <<
"get by ProductID: could not get product with id: " << pid <<
"\n"
281 <<
"Unscheduled execution not allowed to get via ProductID.\n";
286 phb->resolveProduct(status,
false,
nullptr);
304 associatedBranches != iEnd; ++associatedBranches) {
308 if(thinnedAssociation ==
nullptr)
continue;
314 unsigned int thinnedIndex = 0;
327 if(wrapperBase !=
nullptr) {
342 std::vector<WrapperBase const*>& foundContainers,
343 std::vector<unsigned int>&
keys)
const {
350 associatedBranches != iEnd; ++associatedBranches) {
354 if(thinnedAssociation ==
nullptr)
continue;
360 unsigned nKeys = keys.size();
362 std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
364 for(
unsigned k = 0;
k < nKeys; ++
k) {
366 if(foundContainers[
k] !=
nullptr)
continue;
368 if(keys[
k] == doNotLookForThisIndex)
continue;
387 for(
unsigned k = 0;
k < nKeys; ++
k) {
388 if(foundContainers[
k] ==
nullptr)
continue;
389 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
390 keys[
k] = thinnedIndexes[
k];
393 for(
unsigned k = 0;
k < nKeys; ++
k) {
394 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
395 keys[
k] = thinnedIndexes[
k];
396 foundContainers[
k] = bhThinned.
wrapper();
413 std::shared_ptr<UnscheduledHandler>
435 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductHolder cannot be found\n"
436 <<
"This should never happen. Contact a Framework developer";
439 ProductData const* productData = phb->resolveProduct(status,
false,
nullptr);
440 if (productData ==
nullptr) {
446 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
461 std::vector<std::string>::const_iterator
i =
466 <<
"Hit circular dependency while trying to run an unscheduled module.\n"
467 <<
"The last module on the stack shown above requested data from the\n"
468 <<
"module with label: '" << moduleLabel <<
"'.\n"
469 <<
"This is illegal because this module is already running (it is in the\n"
470 <<
"stack shown above, it might or might not be asking for data from itself).\n"
471 <<
"More information related to resolving circular dependences can be found here:\n"
472 <<
"https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideUnscheduledExecution#Circular_Dependence_Errors.";
480 <<
"EventPrincipal::unscheduledFill, Attempting to run unscheduled production\n"
481 <<
"with a null pointer to the ModuleCalling Context. This should never happen.\n"
482 <<
"Contact a Framework developer";
485 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