CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::ConcurrentGeneratorFilter< HAD, DEC > Class Template Reference

#include <ConcurrentGeneratorFilter.h>

Inheritance diagram for edm::ConcurrentGeneratorFilter< HAD, DEC >:
edm::global::EDFilter< EndRunProducer, BeginLuminosityBlockProducer, EndLuminosityBlockProducer, RunCache< gen::GenRunCache >, LuminosityBlockSummaryCache< gen::GenLumiSummary >, StreamCache< gen::GenStreamCache< HAD, DEC > > > edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef DEC Decayer
 
typedef HAD Hadronizer
 
- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

std::unique_ptr< gen::GenStreamCache< HAD, DEC > > beginStream (StreamID) const override
 
 ConcurrentGeneratorFilter (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::GenLumiSummaryglobalBeginLuminosityBlockSummary (LuminosityBlock const &, EventSetup const &) const override
 
std::shared_ptr< gen::GenRunCacheglobalBeginRun (Run const &, EventSetup const &) const override
 
void globalEndLuminosityBlockProduce (LuminosityBlock &, EventSetup const &, gen::GenLumiSummary const *) const override
 
void globalEndLuminosityBlockSummary (LuminosityBlock const &, EventSetup const &, gen::GenLumiSummary *) const override
 
void globalEndRun (Run const &, EventSetup const &) const override
 
void globalEndRunProduce (Run &, EventSetup const &) const override
 
void streamBeginLuminosityBlock (StreamID, LuminosityBlock const &, EventSetup const &) const override
 
void streamEndLuminosityBlock (StreamID, LuminosityBlock const &, EventSetup const &) const override
 
void streamEndLuminosityBlockSummary (StreamID, LuminosityBlock const &, EventSetup const &, gen::GenLumiSummary *) const override
 
void streamEndRun (StreamID, Run const &, EventSetup const &) const override
 
- Public Member Functions inherited from edm::global::EDFilter< EndRunProducer, BeginLuminosityBlockProducer, EndLuminosityBlockProducer, RunCache< gen::GenRunCache >, LuminosityBlockSummaryCache< gen::GenLumiSummary >, StreamCache< gen::GenStreamCache< HAD, DEC > > >
 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
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () override
 
- Public Member Functions inherited from edm::ProducerBase
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
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () 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
 
EDConsumerBaseoperator= (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)
 

Private Member Functions

void initLumi (gen::GenStreamCache< HAD, DEC > *cache, LuminosityBlock const &index, EventSetup const &es) const
 

Private Attributes

ParameterSet config_
 
std::atomic< gen::GenStreamCache< HAD, DEC > * > useInLumi_ { 0 }
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
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)
 

Detailed Description

template<class HAD, class DEC>
class edm::ConcurrentGeneratorFilter< HAD, DEC >

Definition at line 76 of file ConcurrentGeneratorFilter.h.

Member Typedef Documentation

template<class HAD , class DEC >
typedef DEC edm::ConcurrentGeneratorFilter< HAD, DEC >::Decayer

Definition at line 84 of file ConcurrentGeneratorFilter.h.

template<class HAD , class DEC >
typedef HAD edm::ConcurrentGeneratorFilter< HAD, DEC >::Hadronizer

Definition at line 83 of file ConcurrentGeneratorFilter.h.

Constructor & Destructor Documentation

template<class HAD , class DEC >
edm::ConcurrentGeneratorFilter< HAD, DEC >::ConcurrentGeneratorFilter ( ParameterSet const &  ps)
explicit

Definition at line 122 of file ConcurrentGeneratorFilter.h.

122  : config_(ps) {
123  // TODO:
124  // Put the list of types produced by the filters here.
125  // The current design calls for:
126  // * LHEGeneratorInfo
127  // * LHEEvent
128  // * HepMCProduct
129  // But I can not find the LHEGeneratorInfo class; it might need to
130  // be invented.
131 
132  this->template produces<HepMCProduct>("unsmeared");
133  this->template produces<GenEventInfoProduct>();
134  this->template produces<GenLumiInfoHeader, edm::Transition::BeginLuminosityBlock>();
135  this->template produces<GenLumiInfoProduct, edm::Transition::EndLuminosityBlock>();
136  this->template produces<GenRunInfoProduct, edm::Transition::EndRun>();
137  }

Member Function Documentation

template<class HAD , class DEC >
std::unique_ptr< gen::GenStreamCache< HAD, DEC > > edm::ConcurrentGeneratorFilter< HAD, DEC >::beginStream ( StreamID  ) const
override

Definition at line 140 of file ConcurrentGeneratorFilter.h.

References utilities::cache(), edm::ConcurrentGeneratorFilter< HAD, DEC >::config_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and edm::ConcurrentGeneratorFilter< HAD, DEC >::useInLumi_.

140  {
141  auto cache = std::make_unique<gen::GenStreamCache<HAD, DEC>>(config_);
142 
143  if (config_.exists("ExternalDecays")) {
144  ParameterSet ps1 = config_.getParameter<ParameterSet>("ExternalDecays");
145  cache->decayer_.reset(new Decayer(ps1));
146  }
147 
148  // We need a hadronizer during globalBeginLumiProduce, doesn't matter which one
149  gen::GenStreamCache<HAD, DEC>* expected = nullptr;
150  useInLumi_.compare_exchange_strong(expected, cache.get());
151 
152  return cache;
153  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::atomic< gen::GenStreamCache< HAD, DEC > * > useInLumi_
def cache(function)
Definition: utilities.py:3
template<class HAD , class DEC >
bool edm::ConcurrentGeneratorFilter< HAD, DEC >::filter ( StreamID  id,
Event e,
EventSetup const &  es 
) const
overridevirtual

Implements edm::global::EDFilterBase.

Definition at line 211 of file ConcurrentGeneratorFilter.h.

References utilities::cache(), edm::EventID::event(), event(), particlelevel_cff::genEventInfo, edm::EventBase::id(), eostools::move(), edm::Event::put(), edm::Event::streamID(), and protons_cff::t.

211  {
212  auto cache = this->streamCache(id);
213  RandomEngineSentry<HAD> randomEngineSentry(&cache->hadronizer_, ev.streamID());
214  RandomEngineSentry<DEC> randomEngineSentryDecay(cache->decayer_.get(), ev.streamID());
215 
216  cache->hadronizer_.setEDMEvent(ev);
217 
218  bool passEvtGenSelector = false;
219  std::unique_ptr<HepMC::GenEvent> event(nullptr);
220 
221  while (!passEvtGenSelector) {
222  event.reset();
223  cache->hadronizer_.setEDMEvent(ev);
224 
225  if (!cache->hadronizer_.generatePartonsAndHadronize())
226  return false;
227 
228  // this is "fake" stuff
229  // in principle, decays are done as part of full event generation,
230  // except for particles that are marked as to be kept stable
231  // but we currently keep in it the design, because we might want
232  // to use such feature for other applications
233  //
234  if (!cache->hadronizer_.decay())
235  return false;
236 
237  event = cache->hadronizer_.getGenEvent();
238  if (!event.get())
239  return false;
240 
241  //
242  // The external decay driver is being added to the system, it should be called here
243  //
244  if (cache->decayer_) {
245  auto t = cache->decayer_->decay(event.get());
246  if (t != event.get()) {
247  event.reset(t);
248  }
249  }
250  if (!event.get())
251  return false;
252 
253  passEvtGenSelector = cache->hadronizer_.select(event.get());
254  }
255 
256  // check and perform if there're any unstable particles after
257  // running external decay packages
258  //
259  // fisrt of all, put back modified event tree (after external decay)
260  //
261  cache->hadronizer_.resetEvent(std::move(event));
262 
263  //
264  // now run residual decays
265  //
266  if (!cache->hadronizer_.residualDecay())
267  return false;
268 
269  cache->hadronizer_.finalizeEvent();
270 
271  event = cache->hadronizer_.getGenEvent();
272  if (!event.get())
273  return false;
274 
275  event->set_event_number(ev.id().event());
276 
277  //
278  // finally, form up EDM products !
279  //
280  std::unique_ptr<GenEventInfoProduct> genEventInfo(cache->hadronizer_.getGenEventInfo());
281  if (!genEventInfo.get()) {
282  // create GenEventInfoProduct from HepMC event in case hadronizer didn't provide one
283  genEventInfo = std::make_unique<GenEventInfoProduct>(event.get());
284  }
285 
286  ev.put(std::move(genEventInfo));
287 
288  std::unique_ptr<HepMCProduct> bare_product(new HepMCProduct());
289  bare_product->addHepMCData(event.release());
290  ev.put(std::move(bare_product), "unsmeared");
291  cache->nEventsInLumiBlock_++;
292  return true;
293  }
bool ev
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
def cache(function)
Definition: utilities.py:3
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::globalBeginLuminosityBlockProduce ( LuminosityBlock lumi,
EventSetup const &  es 
) const
override

Definition at line 296 of file ConcurrentGeneratorFilter.h.

References genWeightsTable_cfi::genLumiInfoHeader, edm::ConcurrentGeneratorFilter< HAD, DEC >::initLumi(), eostools::move(), edm::LuminosityBlock::put(), and edm::ConcurrentGeneratorFilter< HAD, DEC >::useInLumi_.

297  {
298  // need one of the streams to finish
299  while (useInLumi_.load() == nullptr) {
300  }
301  initLumi(useInLumi_, lumi, es);
302  std::unique_ptr<GenLumiInfoHeader> genLumiInfoHeader(useInLumi_.load()->hadronizer_.getGenLumiInfoHeader());
303  lumi.put(std::move(genLumiInfoHeader));
304  }
void initLumi(gen::GenStreamCache< HAD, DEC > *cache, LuminosityBlock const &index, EventSetup const &es) const
std::atomic< gen::GenStreamCache< HAD, DEC > * > useInLumi_
def move(src, dest)
Definition: eostools.py:511
template<class HAD , class DEC >
std::shared_ptr< gen::GenLumiSummary > edm::ConcurrentGeneratorFilter< HAD, DEC >::globalBeginLuminosityBlockSummary ( LuminosityBlock const &  ,
EventSetup const &   
) const
override

Definition at line 162 of file ConcurrentGeneratorFilter.h.

163  {
164  return std::make_shared<gen::GenLumiSummary>();
165  }
template<class HAD , class DEC >
std::shared_ptr< gen::GenRunCache > edm::ConcurrentGeneratorFilter< HAD, DEC >::globalBeginRun ( Run const &  ,
EventSetup const &   
) const
override

Definition at line 156 of file ConcurrentGeneratorFilter.h.

157  {
158  return std::make_shared<gen::GenRunCache>();
159  }
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::globalEndLuminosityBlockProduce ( LuminosityBlock lumi,
EventSetup const &  ,
gen::GenLumiSummary const *  iSummary 
) const
override

Definition at line 375 of file ConcurrentGeneratorFilter.h.

References edm::gen::GenLumiSummary::lumiInfo_, eostools::move(), and edm::LuminosityBlock::put().

377  {
378  lumi.put(std::move(iSummary->lumiInfo_));
379  }
def move(src, dest)
Definition: eostools.py:511
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::globalEndLuminosityBlockSummary ( LuminosityBlock const &  ,
EventSetup const &  ,
gen::GenLumiSummary  
) const
override

Definition at line 370 of file ConcurrentGeneratorFilter.h.

372  {}
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::globalEndRun ( Run const &  ,
EventSetup const &   
) const
override

Definition at line 407 of file ConcurrentGeneratorFilter.h.

407 {}
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::globalEndRunProduce ( Run run,
EventSetup const &   
) const
override

Definition at line 410 of file ConcurrentGeneratorFilter.h.

References edm::Run::index(), edm::Run::put(), and fetchall_from_DQM_v2::release.

410  {
411  run.put(this->runCache(run.index())->release());
412  }
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::initLumi ( gen::GenStreamCache< HAD, DEC > *  cache,
LuminosityBlock const &  index,
EventSetup const &  es 
) const
private

Definition at line 168 of file ConcurrentGeneratorFilter.h.

References edm::errors::Configuration, edmIntegrityCheck::d, edm::gen::GenStreamCache< HAD, DEC >::decayer_, Exception, edm::LuminosityBlock::get(), h, edm::gen::GenStreamCache< HAD, DEC >::hadronizer_, edm::LuminosityBlock::index(), edm::gen::GenStreamCache< HAD, DEC >::initialized_, and edm::gen::GenStreamCache< HAD, DEC >::nEventsInLumiBlock_.

Referenced by edm::ConcurrentGeneratorFilter< HAD, DEC >::globalBeginLuminosityBlockProduce(), and edm::ConcurrentGeneratorFilter< HAD, DEC >::streamBeginLuminosityBlock().

170  {
171  cache->nEventsInLumiBlock_ = 0;
172 
173  // We need all copies to see same random # for begin lumi
175  auto enginePtr = rng->cloneEngine(lumi.index());
176  cache->hadronizer_.setRandomEngine(enginePtr.get());
177  cache->decayer_->setRandomEngine(enginePtr.get());
178 
179  auto unsetH = [](HAD* h) { h->setRandomEngine(nullptr); };
180  auto unsetD = [](DEC* d) { d->setRandomEngine(nullptr); };
181 
182  std::unique_ptr<HAD, decltype(unsetH)> randomEngineSentry(&cache->hadronizer_, unsetH);
183  std::unique_ptr<DEC, decltype(unsetD)> randomEngineSentryDecay(cache->decayer_.get(), unsetD);
184 
185  cache->hadronizer_.randomizeIndex(lumi, enginePtr.get());
186 
187  if (!cache->hadronizer_.readSettings(0))
189  << "Failed to read settings for the hadronizer " << cache->hadronizer_.classname() << " \n";
190 
191  if (cache->decayer_) {
192  cache->decayer_->init(es);
193  if (!cache->hadronizer_.declareStableParticles(cache->decayer_->operatesOnParticles()))
195  << "Failed to declare stable particles in hadronizer " << cache->hadronizer_.classname()
196  << " for internal parton generation\n";
197  if (!cache->hadronizer_.declareSpecialSettings(cache->decayer_->specialSettings()))
199  << "Failed to declare special settings in hadronizer " << cache->hadronizer_.classname() << "\n";
200  }
201 
202  if (!cache->hadronizer_.initializeForInternalPartons())
204  << "Failed to initialize hadronizer " << cache->hadronizer_.classname()
205  << " for internal parton generation\n";
206 
207  cache->initialized_ = true;
208  }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
def cache(function)
Definition: utilities.py:3
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::streamBeginLuminosityBlock ( StreamID  id,
LuminosityBlock const &  lumi,
EventSetup const &  es 
) const
override

Definition at line 307 of file ConcurrentGeneratorFilter.h.

References edm::ConcurrentGeneratorFilter< HAD, DEC >::initLumi(), and edm::ConcurrentGeneratorFilter< HAD, DEC >::useInLumi_.

309  {
310  if (useInLumi_ != this->streamCache(id)) {
311  initLumi(this->streamCache(id), lumi, es);
312  } else {
313  useInLumi_.store(nullptr);
314  }
315  }
void initLumi(gen::GenStreamCache< HAD, DEC > *cache, LuminosityBlock const &index, EventSetup const &es) const
std::atomic< gen::GenStreamCache< HAD, DEC > * > useInLumi_
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::streamEndLuminosityBlock ( StreamID  id,
LuminosityBlock const &  ,
EventSetup const &   
) const
override

Definition at line 318 of file ConcurrentGeneratorFilter.h.

320  {
321  this->streamCache(id)->hadronizer_.cleanLHE();
322  }
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::streamEndLuminosityBlockSummary ( StreamID  id,
LuminosityBlock const &  ,
EventSetup const &  ,
gen::GenLumiSummary iSummary 
) const
override

Definition at line 325 of file ConcurrentGeneratorFilter.h.

References utilities::cache(), GenRunInfoProduct::XSec::error(), GenRunInfoProduct::internalXSec(), edm::gen::GenLumiSummary::lumiInfo_, eostools::move(), 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(), groupFilesInBlocks::temp, edm::ConcurrentGeneratorFilter< HAD, DEC >::useInLumi_, and GenRunInfoProduct::XSec::value().

328  {
329  auto cache = this->streamCache(id);
330  cache->hadronizer_.statistics();
331  if (cache->decayer_)
332  cache->decayer_->statistics();
333 
334  GenRunInfoProduct genRunInfo = GenRunInfoProduct(cache->hadronizer_.getGenRunInfo());
335  std::vector<GenLumiInfoProduct::ProcessInfo> GenLumiProcess;
336  const GenRunInfoProduct::XSec& xsec = genRunInfo.internalXSec();
338  unsigned int nEvtInLumiBlock_ = cache->nEventsInLumiBlock_;
339  temp.setProcess(0);
340  temp.setLheXSec(xsec.value(), xsec.error()); // Pythia gives error of -1
341  temp.setNPassPos(nEvtInLumiBlock_);
342  temp.setNPassNeg(0);
343  temp.setNTotalPos(nEvtInLumiBlock_);
344  temp.setNTotalNeg(0);
345  temp.setTried(nEvtInLumiBlock_, nEvtInLumiBlock_, nEvtInLumiBlock_);
346  temp.setSelected(nEvtInLumiBlock_, nEvtInLumiBlock_, nEvtInLumiBlock_);
347  temp.setKilled(nEvtInLumiBlock_, nEvtInLumiBlock_, nEvtInLumiBlock_);
348  temp.setAccepted(0, -1, -1);
349  temp.setAcceptedBr(0, -1, -1);
350  GenLumiProcess.push_back(temp);
351 
352  GenLumiInfoProduct genLumiInfo;
353  genLumiInfo.setHEPIDWTUP(-1);
354  genLumiInfo.setProcessInfo(GenLumiProcess);
355 
356  if (iSummary->lumiInfo_) {
357  iSummary->lumiInfo_->mergeProduct(genLumiInfo);
358  } else {
359  iSummary->lumiInfo_ = std::make_unique<GenLumiInfoProduct>(std::move(genLumiInfo));
360  }
361 
362  cache->nEventsInLumiBlock_ = 0;
363 
364  gen::GenStreamCache<HAD, DEC>* expected = nullptr;
365  //make it available for beginLuminosityBlockProduce
366  useInLumi_.compare_exchange_strong(expected, this->streamCache(id));
367  }
void setTried(unsigned int n, double sum, double sum2)
void setSelected(unsigned int n, double sum, double sum2)
void setKilled(unsigned int n, double sum, double sum2)
std::atomic< gen::GenStreamCache< HAD, DEC > * > useInLumi_
void setAccepted(unsigned int n, double sum, double sum2)
void setAcceptedBr(unsigned int n, double sum, double sum2)
void setLheXSec(double value, double err)
void setHEPIDWTUP(const int id)
const XSec & internalXSec() const
def cache(function)
Definition: utilities.py:3
void setProcessInfo(const std::vector< ProcessInfo > &processes)
def move(src, dest)
Definition: eostools.py:511
template<class HAD , class DEC >
void edm::ConcurrentGeneratorFilter< HAD, DEC >::streamEndRun ( StreamID  id,
Run const &  run,
EventSetup const &   
) const
override

Definition at line 382 of file ConcurrentGeneratorFilter.h.

References utilities::cache(), and edm::Run::index().

382  {
383  auto rCache = this->runCache(run.index());
384  auto cache = this->streamCache(id);
385 
386  // If relevant, record the integrated luminosity for this run
387  // here. To do so, we would need a standard function to invoke on
388  // the contained hadronizer that would report the integrated
389  // luminosity.
390 
391  if (cache->initialized_) {
392  cache->hadronizer_.statistics();
393  if (cache->decayer_)
394  cache->decayer_->statistics();
395  }
396  GenRunInfoProduct& genRunInfo = cache->hadronizer_.getGenRunInfo();
397  GenRunInfoProduct* expect = nullptr;
398 
399  std::unique_ptr<GenRunInfoProduct> griproduct(new GenRunInfoProduct(genRunInfo));
400  // All the GenRunInfoProducts for all streams shoule be identical, therefore we only need one
401  if (rCache->product_.compare_exchange_strong(expect, griproduct.get())) {
402  griproduct.release();
403  }
404  }
def cache(function)
Definition: utilities.py:3

Member Data Documentation

template<class HAD , class DEC >
ParameterSet edm::ConcurrentGeneratorFilter< HAD, DEC >::config_
private
template<class HAD , class DEC >
std::atomic<gen::GenStreamCache<HAD, DEC>*> edm::ConcurrentGeneratorFilter< HAD, DEC >::useInLumi_ { 0 }
mutableprivate