10 using namespace Pythia8;
16 useEvtGen(
false), evtgenDecays(0)
25 if(pythiaHepMCVerbosityParticles)
28 if ( ps.
exists(
"useEvtGenPlugin") ) {
32 string evtgenpath(getenv(
"EVTGENDATA"));
36 if ( ps.
exists(
"evtgenDecFile" ) )
39 if ( ps.
exists(
"evtgenPdlFile" ) )
42 if ( ps.
exists(
"evtgenUserFile" ) )
56 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:filter",
false);
57 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:exclusive",
false);
58 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:eMuAsEquivalent",
false);
59 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:eMuTauAsEquivalent",
false);
60 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:allNuAsEquivalent",
false);
61 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:udscAsEquivalent",
false);
62 fMasterGen->settings.addFlag(
"ResonanceDecayFilter:udscbAsEquivalent",
false);
63 fMasterGen->settings.addMVec(
"ResonanceDecayFilter:mothers",std::vector<int>(),
false,
false,0,0);
64 fMasterGen->settings.addMVec(
"ResonanceDecayFilter:daughters",std::vector<int>(),
false,
false,0,0);
67 fMasterGen->settings.addFlag(
"PTFilter:filter",
false);
68 fMasterGen->settings.addMode(
"PTFilter:quarkToFilter", 5 ,
true,
true,3, 6);
69 fMasterGen->settings.addParm(
"PTFilter:scaleToFilter", 0.4,
true,
true,0.0, 10.);
70 fMasterGen->settings.addParm(
"PTFilter:quarkRapidity",10.0,
true,
true,0.0, 10.);
71 fMasterGen->settings.addParm(
"PTFilter:quarkPt", -.1,
true,
true,-.1,100.);
74 fMasterGen->settings.addFlag(
"POWHEGres:calcScales",
false);
75 fMasterGen->settings.addFlag(
"POWHEG:bb4l",
false);
76 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:onlyDistance1",
false);
77 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:veto",
false);
78 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:dryRun",
false);
79 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:vetoAtPL",
false);
80 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:vetoQED",
false);
81 fMasterGen->settings.addFlag(
"POWHEG:bb4l:PartonLevel:veto",
false);
82 fMasterGen->settings.addFlag(
"POWHEG:bb4l:PartonLevel:excludeFSRConflicting",
false);
83 fMasterGen->settings.addFlag(
"POWHEG:bb4l:DEBUG",
false);
84 fMasterGen->settings.addFlag(
"POWHEG:bb4l:ScaleResonance:veto",
false);
85 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:vetoDipoleFrame",
false);
86 fMasterGen->settings.addFlag(
"POWHEG:bb4l:FSREmission:pTpythiaVeto",
false);
87 fMasterGen->settings.addParm(
"POWHEG:bb4l:pTminVeto",10.0,
true,
true,0.0, 10.);
92 fMasterGen->readString(
"Next:numberShowEvent = 0");
93 fDecayer->readString(
"Next:numberShowEvent = 0");
97 std::vector<edm::ParameterSet> randomizedParameters =
fParameters.
getParameter<std::vector<edm::ParameterSet> >(
"RandomizedParameters");
98 currentParameters = randomizedParameters[
randomIndex()];
109 if (
line->find(
"Random:") != std::string::npos)
110 throw cms::Exception(
"PythiaError") <<
"Attempted to set random number "
111 "using Pythia commands. Please use " "the RandomNumberGeneratorService."
115 <<
"Pythia 8 did not accept \""
116 << *
line <<
"\"." << std::endl;
118 if (
line->find(
"ParticleDecays:") != std::string::npos) {
121 <<
"Pythia 8 Decayer did not accept \""
122 << *
line <<
"\"." << std::endl;
129 if( currentParameters.
exists(
"SLHAFileForPythia8" ) ) {
133 fMasterGen->settings.mode(
"SLHA:readFrom", 2);
134 fMasterGen->settings.word(
"SLHA:file", f1.fullPath());
136 else if( currentParameters.
exists(
"SLHATableForPythia8" ) ) {
139 char tempslhaname[] =
"pythia8SLHAtableXXXXXX";
140 int fd = mkstemp(tempslhaname);
141 write(fd,slhatable.c_str(),slhatable.size());
146 fMasterGen->settings.mode(
"SLHA:readFrom", 2);
157 for (
size_t i=0;
i<pdgIds.size();
i++ )
165 int PyID = pdgIds[
i];
166 std::ostringstream pyCard ;
167 pyCard << PyID <<
":mayDecay=false";
169 if (
fMasterGen->particleData.isParticle( PyID ) ) {
174 <<
"recognize particle id = "
175 << PyID << std::endl;
188 for (
unsigned int iss=0; iss<settings.size(); iss++ ){
189 if ( settings[iss].
find(
"QED-brem-off") != std::string::npos ){
190 fMasterGen->readString(
"TimeShower:QEDshowerByL=off" );
193 size_t fnd1 = settings[iss].find(
"Pythia8:");
194 if ( fnd1 != std::string::npos ){
bool declareSpecialSettings(const std::vector< std::string > &)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void statistics()
std::auto_ptr< Pythia8::Pythia > fMasterGen
HepMC::IO_AsciiParticles * ascii_io
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool pythiaHepMCVerbosityParticles
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::string > evtgenUserFiles
P8RndmEngine p8RndmEngine_
unsigned int pythiaPylistVerbosity
bool declareStableParticles(const std::vector< int > &)
std::string evtgenPdlFile
unsigned int maxEventsToPrint
std::auto_ptr< Pythia8::Pythia > fDecayer
bool pythiaHepMCVerbosity
const_iterator end() const
std::string evtgenDecFile
const_iterator begin() const
volatile std::atomic< bool > shutdown_flag false
edm::ParameterSet fParameters