9 #ifndef gen_GeneratorFilter_h 10 #define gen_GeneratorFilter_h 27 #include "CLHEP/Random/RandomEngine.h" 41 BeginLuminosityBlockProducer,
42 EndLuminosityBlockProducer,
43 one::WatchLuminosityBlocks,
77 template <
class HAD,
class DEC>
93 std::vector<std::string>
const& sharedResources =
hadronizer_.sharedResources();
94 for(
auto const& resource : sharedResources) {
95 usesResource(resource);
98 if ( ps.
exists(
"ExternalDecays") )
104 std::vector<std::string>
const& sharedResourcesDec = decayer_->sharedResources();
105 for(
auto const& resource : sharedResourcesDec) {
106 usesResource(resource);
112 if(sharedResources.empty() && (!
decayer_ ||
decayer_->sharedResources().empty())) {
116 produces<edm::HepMCProduct>(
"unsmeared");
117 produces<GenEventInfoProduct>();
118 produces<GenLumiInfoHeader, edm::Transition::BeginLuminosityBlock>();
119 produces<GenLumiInfoProduct, edm::Transition::EndLuminosityBlock>();
120 produces<GenRunInfoProduct, edm::Transition::EndRun>();
124 template <
class HAD,
class DEC>
128 template <
class HAD,
class DEC>
134 template <
class HAD,
class DEC>
143 bool passEvtGenSelector =
false;
144 std::unique_ptr<HepMC::GenEvent>
event(
nullptr);
146 while(!passEvtGenSelector)
151 if ( !
hadronizer_.generatePartonsAndHadronize() )
return false;
162 if ( !event.get() )
return false;
170 if(
t != event.get()) {
174 if ( !event.get() )
return false;
176 passEvtGenSelector =
hadronizer_.select( event.get() );
194 if ( !event.get() )
return false;
196 event->set_event_number( ev.
id().
event() );
210 std::unique_ptr<HepMCProduct> bare_product(
new HepMCProduct());
211 bare_product->addHepMCData( event.release() );
217 template <
class HAD,
class DEC>
236 template <
class HAD,
class DEC>
241 template <
class HAD,
class DEC>
249 hadronizer_.randomizeIndex(lumi,randomEngineSentry.randomEngine());
254 <<
"Failed to read settings for the hadronizer " 262 <<
"Failed to declare stable particles in hadronizer " 267 <<
"Failed to declare special settings in hadronizer " 274 <<
"Failed to initialize hadronizer " 276 <<
" for internal parton generation\n";
283 template <
class HAD,
class DEC>
290 template <
class HAD,
class DEC>
298 std::vector<GenLumiInfoProduct::ProcessInfo> GenLumiProcess;
312 GenLumiProcess.push_back(temp);
315 genLumiInfo->setHEPIDWTUP(-1);
316 genLumiInfo->setProcessInfo( GenLumiProcess );
325 #endif // gen_GeneratorFilter_h void setNPassNeg(unsigned int n)
T getParameter(std::string const &) const
EventNumber_t event() const
void setTried(unsigned int n, double sum, double sum2)
void endLuminosityBlock(LuminosityBlock const &, EventSetup const &) override
void setNTotalNeg(unsigned int n)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void setSelected(unsigned int n, double sum, double sum2)
bool filter(Event &e, EventSetup const &es) override
LuminosityBlockIndex index() const
void setKilled(unsigned int n, double sum, double sum2)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
GeneratorFilter(ParameterSet const &ps)
void setAccepted(unsigned int n, double sum, double sum2)
void setAcceptedBr(unsigned int n, double sum, double sum2)
void put(std::unique_ptr< PROD > product)
Put a new product.
~GeneratorFilter() override
void setNTotalPos(unsigned int n)
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
unsigned int nEventsInLumiBlock_
void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &) override
void put(std::unique_ptr< PROD > product)
Put a new product.
void endRunProduce(Run &, EventSetup const &) override
void setLheXSec(double value, double err)
const XSec & internalXSec() const
void preallocThreads(unsigned int iThreads) override
StreamID streamID() const
void endLuminosityBlockProduce(LuminosityBlock &, EventSetup const &) override
void setNPassPos(unsigned int n)
std::string uniqueSharedResourceName()
void beginLuminosityBlockProduce(LuminosityBlock &, EventSetup const &) override