9 #include <boost/shared_ptr.hpp>
11 #include <HepMC/GenEvent.h>
12 #include <HepMC/GenParticle.h>
16 #include <HepMCInterface.h>
28 using namespace Pythia8;
39 std::auto_ptr<HepMC::GenEvent> doHadronisation();
40 void newRunInfo(
const boost::shared_ptr<LHERunInfo> &runInfo);
48 std::auto_ptr<Pythia>
pythia;
49 std::auto_ptr<LHAupLesHouches>
lhaUP;
50 std::auto_ptr<HepMC::I_Pythia8>
conv;
56 hadronisation(hadronisation) {}
58 void loadRunInfo(
const boost::shared_ptr<LHERunInfo> &runInfo)
59 { this->runInfo = runInfo; }
62 { this->
event =
event; }
67 bool setEvent(
int idProcIn);
71 boost::shared_ptr<LHEEvent>
event;
74 bool Pythia8Hadronisation::LHAupLesHouches::setInit()
78 const HEPRUP &heprup = *runInfo->getHEPRUP();
84 setStrategy(heprup.
IDWTUP);
86 for(
int i = 0;
i < heprup.
NPRUP;
i++)
90 hadronisation->onInit().emit();
96 bool Pythia8Hadronisation::LHAupLesHouches::setEvent(
int inProcId)
100 const HEPEUP &hepeup = *
event->getHEPEUP();
105 for(
int i = 0;
i < hepeup.
NUP;
i++)
116 this->setPdf(pdf->
id.first, pdf->
id.second,
117 pdf->
x.first, pdf->
x.second,
119 pdf->
xPDF.first, pdf->
xPDF.second,
true);
121 hadronisation->onBeforeHadronisation().emit();
132 std::vector<std::string> setNames =
133 params.
getParameter<std::vector<std::string> >(
"parameterSets");
135 for(std::vector<std::string>::const_iterator iter = setNames.begin();
136 iter != setNames.end(); ++iter) {
137 std::vector<std::string>
lines =
140 for(std::vector<std::string>::const_iterator
line = lines.begin();
142 if (
line->substr(0, 14) ==
"Random:setSeed" ||
143 line->substr(0, 11) ==
"Random:seed")
145 <<
"Attempted to set random number"
146 " using Pythia command 'MRPY(1)'."
148 " RandomNumberGeneratorService."
164 conv.reset(
new HepMC::I_Pythia8);
166 for(std::vector<std::string>::const_iterator iter =
paramLines.begin();
168 if (!
pythia->readString(*iter))
170 <<
"Pythia did not accept \""
171 << *iter <<
"\"." << std::endl;
174 std::ostringstream ss;
175 ss <<
"Random:seed = " << rng->
mySeed();
176 pythia->readString(ss.str());
177 pythia->readString(
"Random:setSeed = on");
186 else if (status > -30 && status < 0)
197 <<
"Pythia did not want to process event."
200 std::auto_ptr<HepMC::GenEvent>
event(
new HepMC::GenEvent);
201 conv->fill_next_event(
pythia->event, event.get());
203 for(HepMC::GenEvent::particle_iterator iter = event->particles_begin();
204 iter !=
event->particles_end(); iter++)
207 event->set_signal_process_id(
pythia->info.code());
208 event->set_event_scale(
pythia->info.pTHat());
220 const boost::shared_ptr<LHERunInfo> &runInfo)
222 lhaUP->loadRunInfo(runInfo);
std::vector< std::string > paramLines
T getParameter(std::string const &) const
std::auto_ptr< Pythia > pythia
std::pair< double, double > EBMUP
std::pair< double, double > x
DEFINE_LHE_HADRONISATION_PLUGIN(Pythia8Hadronisation)
boost::shared_ptr< LHERunInfo > runInfo
void loadRunInfo(const boost::shared_ptr< LHERunInfo > &runInfo)
Hadronisation * hadronisation
std::vector< double > VTIMUP
std::pair< int, int > IDBMUP
void newRunInfo(const boost::shared_ptr< LHERunInfo > &runInfo)
std::auto_ptr< LHAupLesHouches > lhaUP
static int getStatus(const HepMC::GenParticle *p)
std::pair< double, double > xPDF
std::pair< int, int > PDFGUP
std::vector< std::pair< int, int > > MOTHUP
const boost::shared_ptr< LHEEvent > & getRawEvent() const
void loadEvent(const boost::shared_ptr< LHEEvent > &event)
std::vector< FiveVector > PUP
std::vector< double > SPINUP
tuple pythiaPylistVerbosity
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::vector< double > XERRUP
std::vector< double > XMAXUP
const int pythiaPylistVerbosity
std::auto_ptr< HepMC::I_Pythia8 > conv
std::pair< int, int > PDFSUP
std::auto_ptr< HepMC::GenEvent > doHadronisation()
std::vector< double > XSECUP
boost::shared_ptr< LHEEvent > event
LHAupLesHouches(Hadronisation *hadronisation)
virtual uint32_t mySeed() const =0
Exists for backward compatibility.
std::vector< std::pair< int, int > > ICOLUP