|
std::unique_ptr< gen::StreamCache< HAD, DEC > > | beginStream (edm::StreamID) const override |
|
| ConcurrentHadronizerFilter (ParameterSet const &ps) |
|
bool | filter (StreamID id, Event &e, EventSetup const &es) const override |
|
void | globalBeginLuminosityBlockProduce (LuminosityBlock &, EventSetup const &) const override |
|
std::shared_ptr< gen::LumiSummary > | globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &) const override |
|
std::shared_ptr< gen::RunCache > | globalBeginRun (edm::Run const &, edm::EventSetup const &) const override |
|
void | globalEndLuminosityBlockProduce (LuminosityBlock &, EventSetup const &, gen::LumiSummary const *) const override |
|
void | globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, gen::LumiSummary *) const override |
|
void | globalEndRun (edm::Run const &, edm::EventSetup const &) const override |
|
void | globalEndRunProduce (Run &, EventSetup const &) const override |
|
void | streamBeginLuminosityBlock (StreamID, LuminosityBlock const &, EventSetup const &) const override |
|
void | streamBeginRun (StreamID, Run const &, EventSetup const &) const override |
|
void | streamEndLuminosityBlockSummary (StreamID, LuminosityBlock const &, EventSetup const &, gen::LumiSummary *) const override |
|
void | streamEndRun (StreamID, Run const &, EventSetup const &) const override |
|
| EDFilter ()=default |
|
bool | hasAbilityToProduceInLumis () const final |
|
bool | hasAbilityToProduceInRuns () const final |
|
bool | wantsGlobalLuminosityBlocks () const final |
|
bool | wantsGlobalRuns () const final |
|
bool | wantsStreamLuminosityBlocks () const final |
|
bool | wantsStreamRuns () const final |
|
| EDFilterBase () |
|
ModuleDescription const & | moduleDescription () const |
|
| ~EDFilterBase () override |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
std::vector< edm::ProductResolverIndex > const & | indiciesForPutProducts (BranchType iBranchType) const |
|
| ProducerBase () |
|
std::vector< edm::ProductResolverIndex > const & | putTokenIndexToProductResolverIndex () const |
|
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
|
std::function< void(BranchDescription const &)> | registrationCallback () const |
| used by the fwk to register list of products More...
|
|
void | resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel) |
|
| ~ProducerBase () noexcept(false) override |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
ESProxyIndex const * | esGetTokenIndices (edm::Transition iTrans) const |
|
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
|
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
|
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
|
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
ProductResolverIndexAndSkipBit | uncheckedIndexFrom (EDGetToken) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
void | updateLookup (eventsetup::ESRecordsToProxyIndices const &) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
static const std::string & | baseType () |
|
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
|
static void | prevalidate (ConfigurationDescriptions &descriptions) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
|
ConsumesCollector | consumesCollector () |
| Use a ConsumesCollector to gather consumes information from helper functions. More...
|
|
template<typename ProductType , BranchType B = InEvent> |
void | consumesMany () |
|
void | consumesMany (const TypeToGet &id) |
|
template<BranchType B> |
void | consumesMany (const TypeToGet &id) |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes () |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes (ESInputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<class HAD, class DEC>
class edm::ConcurrentHadronizerFilter< HAD, DEC >
Definition at line 79 of file ConcurrentHadronizerFilter.h.
template<class HAD , class DEC >
Implements edm::global::EDFilterBase.
Definition at line 196 of file ConcurrentHadronizerFilter.h.
References utilities::cache(), edm::EventID::event(), event(), edm::ConcurrentHadronizerFilter< HAD, DEC >::eventProductToken_, particlelevel_cff::genEventInfo, edm::Event::getByToken(), edm::EventBase::id(), eostools::move(), edm::ConcurrentHadronizerFilter< HAD, DEC >::nAttempts_, edm::Event::put(), edm::Event::streamID(), and protons_cff::t.
Referenced by edm::ConcurrentHadronizerFilter< HAD, DEC >::streamEndLuminosityBlockSummary().
197 auto cache = this->streamCache(
id);
198 RandomEngineSentry<HAD> randomEngineSentry(&
cache->hadronizer_,
ev.streamID());
199 RandomEngineSentry<DEC> randomEngineSentryDecay(
cache->decayer_.get(),
ev.streamID());
201 cache->hadronizer_.setEDMEvent(
ev);
208 std::unique_ptr<HepMC::GenEvent> finalEvent;
209 std::unique_ptr<GenEventInfoProduct> finalGenEventInfo;
214 unsigned int naccept = 0;
216 for (
unsigned int itry = 0; itry <
nAttempts_; ++itry) {
217 cache->hadronizer_.setLHEEvent(std::make_unique<lhef::LHEEvent>(
cache->hadronizer_.getLHERunInfo(), *product));
220 if (!
cache->hadronizer_.hadronize())
229 if (!
cache->hadronizer_.decay())
232 std::unique_ptr<HepMC::GenEvent>
event(
cache->hadronizer_.getGenEvent());
239 if (
cache->decayer_) {
240 auto lheEvent =
cache->hadronizer_.getLHEEvent();
241 auto t =
cache->decayer_->decay(
event.get(), lheEvent.get());
255 if (!
cache->hadronizer_.residualDecay())
258 cache->hadronizer_.finalizeEvent();
260 event =
cache->hadronizer_.getGenEvent();
264 event->set_event_number(
ev.id().event());
266 std::unique_ptr<GenEventInfoProduct>
genEventInfo(
cache->hadronizer_.getGenEventInfo());
288 if (nAttempts_ > 1) {
289 double multihadweight = double(naccept) / double(nAttempts_);
292 finalGenEventInfo->weights()[0] *= multihadweight;
295 finalEvent->weights()[0] *= multihadweight;
300 std::unique_ptr<HepMCProduct> bare_product(
new HepMCProduct());
301 bare_product->addHepMCData(finalEvent.release());
EDGetTokenT< LHEEventProduct > eventProductToken_
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
template<class HAD , class DEC >
Definition at line 393 of file ConcurrentHadronizerFilter.h.
References edm::errors::Configuration, edmIntegrityCheck::d, edm::gen::StreamCache< HAD, DEC >::decayer_, Exception, edm::gen::StreamCache< HAD, DEC >::filter_, edm::LuminosityBlock::get(), h, edm::gen::StreamCache< HAD, DEC >::hadronizer_, edm::LuminosityBlock::index(), edm::gen::StreamCache< HAD, DEC >::initialized_, and lhef::LHERunInfo::initLumi().
Referenced by edm::ConcurrentHadronizerFilter< HAD, DEC >::globalBeginLuminosityBlockProduce(), and edm::ConcurrentHadronizerFilter< HAD, DEC >::streamBeginLuminosityBlock().
401 auto enginePtr = rng->cloneEngine(
lumi.index());
402 cache->hadronizer_.setRandomEngine(enginePtr.get());
403 cache->decayer_->setRandomEngine(enginePtr.get());
405 auto unsetH = [](HAD*
h) {
h->setRandomEngine(
nullptr); };
406 auto unsetD = [](DEC*
d) {
d->setRandomEngine(
nullptr); };
408 std::unique_ptr<HAD, decltype(unsetH)> randomEngineSentry(&
cache->hadronizer_, unsetH);
409 std::unique_ptr<DEC, decltype(unsetD)> randomEngineSentryDecay(
cache->decayer_.get(), unsetD);
411 cache->hadronizer_.randomizeIndex(
lumi, enginePtr.get());
413 if (!
cache->hadronizer_.readSettings(1))
415 <<
"Failed to read settings for the hadronizer " <<
cache->hadronizer_.classname() <<
" \n";
417 if (
cache->decayer_) {
418 cache->decayer_->init(es);
419 if (!
cache->hadronizer_.declareStableParticles(
cache->decayer_->operatesOnParticles()))
421 <<
"Failed to declare stable particles in hadronizer " <<
cache->hadronizer_.classname()
422 <<
" for internal parton generation\n";
423 if (!
cache->hadronizer_.declareSpecialSettings(
cache->decayer_->specialSettings()))
425 <<
"Failed to declare special settings in hadronizer " <<
cache->hadronizer_.classname() <<
"\n";
428 if (
cache->filter_) {
429 cache->filter_->resetStatistics();
432 if (!
cache->hadronizer_.initializeForExternalPartons())
434 <<
"Failed to initialize hadronizer " <<
cache->hadronizer_.classname()
435 <<
" for external parton generation\n";
437 cache->initialized_ =
true;
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
template<class HAD , class DEC >
Definition at line 452 of file ConcurrentHadronizerFilter.h.
References lhef::LHERunInfo::Process::accepted(), lhef::LHERunInfo::Process::acceptedBr(), lhef::LHERunInfo::XSec::error(), edm::ConcurrentHadronizerFilter< HAD, DEC >::filter(), edm::gen::LumiSummary::filterInfo_, lhef::LHERunInfo::getHEPRUP(), lhef::LHERunInfo::Process::getLHEXSec(), lhef::LHERunInfo::getLumiProcesses(), edm::ConcurrentHadronizerFilter< HAD, DEC >::hasFilter_, mps_fire::i, lhef::HEPRUP::IDWTUP, lhef::LHERunInfo::Process::killed(), edm::gen::LumiSummary::lumiInfo_, eostools::move(), lhef::LHERunInfo::Counter::n(), lhef::LHERunInfo::Process::nPassNeg(), lhef::LHERunInfo::Process::nPassPos(), lhef::LHERunInfo::Process::nTotalNeg(), lhef::LHERunInfo::Process::nTotalPos(), lhef::LHERunInfo::Process::process(), lhef::LHERunInfo::Process::selected(), GenLumiInfoProduct::ProcessInfo::setAccepted(), GenLumiInfoProduct::ProcessInfo::setAcceptedBr(), GenLumiInfoProduct::setHEPIDWTUP(), GenLumiInfoProduct::ProcessInfo::setKilled(), GenLumiInfoProduct::ProcessInfo::setLheXSec(), GenLumiInfoProduct::ProcessInfo::setNPassNeg(), GenLumiInfoProduct::ProcessInfo::setNPassPos(), GenLumiInfoProduct::ProcessInfo::setNTotalNeg(), GenLumiInfoProduct::ProcessInfo::setNTotalPos(), GenLumiInfoProduct::ProcessInfo::setProcess(), GenLumiInfoProduct::setProcessInfo(), GenLumiInfoProduct::ProcessInfo::setSelected(), GenLumiInfoProduct::ProcessInfo::setTried(), lhef::LHERunInfo::Counter::sum(), lhef::LHERunInfo::Counter::sum2(), groupFilesInBlocks::temp, lhef::LHERunInfo::Process::tried(), edm::ConcurrentHadronizerFilter< HAD, DEC >::useInLumi_, and lhef::LHERunInfo::XSec::value().
456 const lhef::LHERunInfo* lheRunInfo = this->streamCache(
id)->hadronizer_.getLHERunInfo().get();
458 std::vector<lhef::LHERunInfo::Process> LHELumiProcess = lheRunInfo->
getLumiProcesses();
459 std::vector<GenLumiInfoProduct::ProcessInfo> GenLumiProcess;
460 for (
unsigned int i = 0;
i < LHELumiProcess.size();
i++) {
475 GenLumiProcess.push_back(temp);
481 if (iSummary->lumiInfo_) {
483 iSummary->lumiInfo_->mergeProduct(genLumiInfo);
485 iSummary->lumiInfo_ = std::make_unique<GenLumiInfoProduct>(
std::move(genLumiInfo));
490 auto filter = this->streamCache(
id)->filter_.get();
492 filter->numEventsPassNeg(),
493 filter->numEventsTotalPos(),
494 filter->numEventsTotalNeg(),
499 if (not iSummary->filterInfo_) {
500 iSummary->filterInfo_ = std::make_unique<GenFilterInfo>(
std::move(thisProduct));
506 gen::StreamCache<HAD, DEC>* expected =
nullptr;
508 useInLumi_.compare_exchange_strong(expected, this->streamCache(
id));
void setNPassNeg(unsigned int n)
unsigned int nTotalPos() const
void setTried(unsigned int n, double sum, double sum2)
void setNTotalNeg(unsigned int n)
void setSelected(unsigned int n, double sum, double sum2)
void setKilled(unsigned int n, double sum, double sum2)
const std::vector< Process > & getLumiProcesses() const
bool mergeProduct(GenFilterInfo const &other)
void setAccepted(unsigned int n, double sum, double sum2)
std::atomic< gen::StreamCache< HAD, DEC > * > useInLumi_
void setAcceptedBr(unsigned int n, double sum, double sum2)
void setNTotalPos(unsigned int n)
unsigned int nTotalNeg() const
unsigned int nPassPos() const
const HEPRUP * getHEPRUP() const
void setLheXSec(double value, double err)
void setHEPIDWTUP(const int id)
Counter acceptedBr() const
void setNPassPos(unsigned int n)
unsigned int nPassNeg() const
bool filter(StreamID id, Event &e, EventSetup const &es) const override
void setProcessInfo(const std::vector< ProcessInfo > &processes)