CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
lhef::Pythia8Hadronisation Class Reference
Inheritance diagram for lhef::Pythia8Hadronisation:
lhef::Hadronisation

Classes

class  LHAupLesHouches
 

Public Member Functions

 Pythia8Hadronisation (const edm::ParameterSet &params)
 
 ~Pythia8Hadronisation ()
 
- Public Member Functions inherited from lhef::Hadronisation
virtual std::set< std::string > capabilities () const
 
void clear ()
 
 Hadronisation (const edm::ParameterSet &params)
 
std::auto_ptr< HepMC::GenEvent > hadronize ()
 
void init ()
 
virtual void matchingCapabilities (const std::set< std::string > &capabilities)
 
sigc::signal< void > & onBeforeHadronisation ()
 
sigc::signal< void > & onInit ()
 
sigc::signal< bool, const
boost::shared_ptr
< HepMC::GenEvent > & > & 
onShoweredEvent ()
 
bool setEvent (const boost::shared_ptr< LHEEvent > &event)
 
virtual void statistics ()
 
virtual double totalBranchingRatio (int pdgId) const
 
virtual ~Hadronisation ()
 

Private Member Functions

std::auto_ptr< HepMC::GenEvent > doHadronisation ()
 
void doInit ()
 
void newRunInfo (const boost::shared_ptr< LHERunInfo > &runInfo)
 

Private Attributes

std::auto_ptr< HepMC::I_Pythia8 > conv
 
std::auto_ptr< LHAupLesHoucheslhaUP
 
int maxEventsToPrint
 
std::vector< std::string > paramLines
 
std::auto_ptr< Pythia > pythia
 
const int pythiaPylistVerbosity
 

Additional Inherited Members

- Public Types inherited from lhef::Hadronisation
typedef
edmplugin::PluginFactory
< Hadronisation *(const
edm::ParameterSet &)> 
Factory
 
- Static Public Member Functions inherited from lhef::Hadronisation
static std::auto_ptr
< Hadronisation
create (const edm::ParameterSet &params)
 
- Protected Member Functions inherited from lhef::Hadronisation
const boost::shared_ptr
< LHEEvent > & 
getRawEvent () const
 
bool showeredEvent (const boost::shared_ptr< HepMC::GenEvent > &event)
 
bool wantsShoweredEvent () const
 
bool wantsShoweredEventAsHepMC () const
 

Detailed Description

Definition at line 32 of file Pythia8Hadronisation.cc.

Constructor & Destructor Documentation

lhef::Pythia8Hadronisation::Pythia8Hadronisation ( const edm::ParameterSet params)

Definition at line 127 of file Pythia8Hadronisation.cc.

References filterCSVwithJSON::copy, edm::ParameterSet::getParameter(), geometryCSVtoXML::line, groupFilesInBlocks::lines, and paramLines.

127  :
128  Hadronisation(params),
129  pythiaPylistVerbosity(params.getUntrackedParameter<int>("pythiaPylistVerbosity", 0)),
130  maxEventsToPrint(params.getUntrackedParameter<int>("maxEventsToPrint", 0))
131 {
132  std::vector<std::string> setNames =
133  params.getParameter<std::vector<std::string> >("parameterSets");
134 
135  for(std::vector<std::string>::const_iterator iter = setNames.begin();
136  iter != setNames.end(); ++iter) {
137  std::vector<std::string> lines =
138  params.getParameter< std::vector<std::string> >(*iter);
139 
140  for(std::vector<std::string>::const_iterator line = lines.begin();
141  line != lines.end(); ++line )
142  if (line->substr(0, 14) == "Random:setSeed" ||
143  line->substr(0, 11) == "Random:seed")
144  throw cms::Exception("PythiaError")
145  << "Attempted to set random number"
146  " using Pythia command 'MRPY(1)'."
147  " Please use the"
148  " RandomNumberGeneratorService."
149  << std::endl;
150 
151  std::copy(lines.begin(), lines.end(),
152  std::back_inserter(paramLines));
153  }
154 }
std::vector< std::string > paramLines
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
Hadronisation(const edm::ParameterSet &params)
lhef::Pythia8Hadronisation::~Pythia8Hadronisation ( )

Definition at line 156 of file Pythia8Hadronisation.cc.

157 {
158 }

Member Function Documentation

std::auto_ptr< HepMC::GenEvent > lhef::Pythia8Hadronisation::doHadronisation ( )
privatevirtual

Implements lhef::Hadronisation.

Definition at line 192 of file Pythia8Hadronisation.cc.

References conv, gather_cfg::cout, event(), lhef::Hadronisation::getRawEvent(), lhef::getStatus(), lhaUP, maxEventsToPrint, pythia, and pythiaPylistVerbosity.

193 {
194  lhaUP->loadEvent(getRawEvent());
195  if (!pythia->next())
196  throw cms::Exception("PythiaError")
197  << "Pythia did not want to process event."
198  << std::endl;
199 
200  std::auto_ptr<HepMC::GenEvent> event(new HepMC::GenEvent);
201  conv->fill_next_event(pythia->event, event.get());
202 
203  for(HepMC::GenEvent::particle_iterator iter = event->particles_begin();
204  iter != event->particles_end(); iter++)
205  (*iter)->set_status(getStatus(*iter));
206 
207  event->set_signal_process_id(pythia->info.code());
208  event->set_event_scale(pythia->info.pTHat());
209 
210  if (maxEventsToPrint > 0) {
213  pythia->event.list(std::cout);
214  }
215 
216  return event;
217 }
std::auto_ptr< Pythia > pythia
std::auto_ptr< LHAupLesHouches > lhaUP
static int getStatus(const HepMC::GenParticle *p)
const boost::shared_ptr< LHEEvent > & getRawEvent() const
Definition: Hadronisation.h:59
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::auto_ptr< HepMC::I_Pythia8 > conv
tuple cout
Definition: gather_cfg.py:121
void lhef::Pythia8Hadronisation::doInit ( )
privatevirtual

Implements lhef::Hadronisation.

Definition at line 160 of file Pythia8Hadronisation.cc.

References conv, lhaUP, edm::RandomNumberGenerator::mySeed(), paramLines, and pythia.

161 {
162  pythia.reset(new Pythia);
163  lhaUP.reset(new LHAupLesHouches(this));
164  conv.reset(new HepMC::I_Pythia8);
165 
166  for(std::vector<std::string>::const_iterator iter = paramLines.begin();
167  iter != paramLines.end(); ++iter)
168  if (!pythia->readString(*iter))
169  throw cms::Exception("PythiaError")
170  << "Pythia did not accept \""
171  << *iter << "\"." << std::endl;
172 
174  std::ostringstream ss;
175  ss << "Random:seed = " << rng->mySeed();
176  pythia->readString(ss.str());
177  pythia->readString("Random:setSeed = on");
178 }
std::vector< std::string > paramLines
std::auto_ptr< Pythia > pythia
std::auto_ptr< LHAupLesHouches > lhaUP
std::auto_ptr< HepMC::I_Pythia8 > conv
virtual uint32_t mySeed() const =0
Exists for backward compatibility.
void lhef::Pythia8Hadronisation::newRunInfo ( const boost::shared_ptr< LHERunInfo > &  runInfo)
privatevirtual

Reimplemented from lhef::Hadronisation.

Definition at line 219 of file Pythia8Hadronisation.cc.

References lhaUP, and pythia.

221 {
222  lhaUP->loadRunInfo(runInfo);
223  pythia->init(lhaUP.get());
224 }
std::auto_ptr< Pythia > pythia
std::auto_ptr< LHAupLesHouches > lhaUP

Member Data Documentation

std::auto_ptr<HepMC::I_Pythia8> lhef::Pythia8Hadronisation::conv
private

Definition at line 50 of file Pythia8Hadronisation.cc.

Referenced by doHadronisation(), and doInit().

std::auto_ptr<LHAupLesHouches> lhef::Pythia8Hadronisation::lhaUP
private

Definition at line 49 of file Pythia8Hadronisation.cc.

Referenced by doHadronisation(), doInit(), and newRunInfo().

int lhef::Pythia8Hadronisation::maxEventsToPrint
private

Definition at line 43 of file Pythia8Hadronisation.cc.

Referenced by doHadronisation().

std::vector<std::string> lhef::Pythia8Hadronisation::paramLines
private

Definition at line 44 of file Pythia8Hadronisation.cc.

Referenced by doInit(), and Pythia8Hadronisation().

std::auto_ptr<Pythia> lhef::Pythia8Hadronisation::pythia
private

Definition at line 46 of file Pythia8Hadronisation.cc.

Referenced by doHadronisation(), doInit(), and newRunInfo().

const int lhef::Pythia8Hadronisation::pythiaPylistVerbosity
private

Definition at line 42 of file Pythia8Hadronisation.cc.

Referenced by doHadronisation().