diff --git a/GeneratorInterface/Configuration/python/GeneratorInterface_EventContent_cff.py b/GeneratorInterface/Configuration/python/GeneratorInterface_EventContent_cff.py index 9e514216844d4..68e8e97e7de85 100644 --- a/GeneratorInterface/Configuration/python/GeneratorInterface_EventContent_cff.py +++ b/GeneratorInterface/Configuration/python/GeneratorInterface_EventContent_cff.py @@ -15,6 +15,7 @@ 'keep LHERunInfoProduct_*_*_*', 'keep LHEEventProduct_*_*_*', 'keep GenRunInfoProduct_generator_*_*', + 'keep GenLumiInfoHeader_generator_*_*', 'keep GenLumiInfoProduct_generator_*_*', 'keep GenEventInfoProduct_generator_*_*', 'keep edmHepMCProduct_generator_*_*', @@ -29,6 +30,7 @@ 'keep LHERunInfoProduct_*_*_*', 'keep LHEEventProduct_*_*_*', 'keep GenRunInfoProduct_generator_*_*', + 'keep GenLumiInfoHeader_generator_*_*', 'keep GenLumiInfoProduct_generator_*_*', 'keep GenEventInfoProduct_generator_*_*', 'keep edmHepMCProduct_generator_*_*', @@ -43,6 +45,7 @@ 'keep LHERunInfoProduct_*_*_*', 'keep LHEEventProduct_*_*_*', 'keep GenRunInfoProduct_generator_*_*', + 'keep GenLumiInfoHeader_generator_*_*', 'keep GenLumiInfoProduct_generator_*_*', 'keep GenEventInfoProduct_generator_*_*', 'keep GenFilterInfo_*_*_*', diff --git a/GeneratorInterface/Core/BuildFile.xml b/GeneratorInterface/Core/BuildFile.xml index 9300e65937915..e3f8e7dc6b11a 100644 --- a/GeneratorInterface/Core/BuildFile.xml +++ b/GeneratorInterface/Core/BuildFile.xml @@ -1,6 +1,7 @@ + diff --git a/GeneratorInterface/Core/interface/BaseHadronizer.h b/GeneratorInterface/Core/interface/BaseHadronizer.h index 58049765859ab..18bd325948683 100644 --- a/GeneratorInterface/Core/interface/BaseHadronizer.h +++ b/GeneratorInterface/Core/interface/BaseHadronizer.h @@ -20,6 +20,7 @@ #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" +#include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h" #include "SimDataFormats/GeneratorProducts/interface/LHERunInfoProduct.h" #include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h" @@ -27,6 +28,10 @@ #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h" #include "GeneratorInterface/LHEInterface/interface/LHEEvent.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/LuminosityBlock.h" + +#include "CLHEP/Random/RandomEngine.h" + // foward declarations namespace edm { @@ -48,7 +53,8 @@ namespace gen { GenRunInfoProduct &getGenRunInfo() { return genRunInfo_; } HepMC::GenEvent *getGenEvent() { return genEvent_.release(); } GenEventInfoProduct *getGenEventInfo() { return genEventInfo_.release(); } - + virtual GenLumiInfoHeader *getGenLumiInfoHeader() const; + void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); } void resetEventInfo(GenEventInfoProduct *eventInfo) { genEventInfo_.reset(eventInfo); } @@ -66,6 +72,14 @@ namespace gen { void setRandomEngine(CLHEP::HepRandomEngine* v) { doSetRandomEngine(v); } std::vector const& sharedResources() const { return doSharedResources(); } + + int randomIndex() const { return randomIndex_; } + const std::string &randomInitConfigDescription() const { return randomInitConfigDescriptions_[randomIndex_]; } + const std::string &gridpackPath() const { return gridpackPaths_[std::max(randomIndex_,0)]; } + + void randomizeIndex(edm::LuminosityBlock const& lumi, CLHEP::HepRandomEngine* rengine); + void generateLHE(edm::LuminosityBlock const& lumi, CLHEP::HepRandomEngine* rengine); + void cleanLHE(); protected: GenRunInfoProduct& runInfo() { return genRunInfo_; } @@ -74,6 +88,8 @@ namespace gen { lhef::LHEEvent* lheEvent() { return lheEvent_.get(); } lhef::LHERunInfo *lheRunInfo() { return lheRunInfo_.get(); } + int randomIndex_; + std::string lheFile_; private: @@ -91,6 +107,11 @@ namespace gen { edm::Event *edmEvent_; static const std::vector theSharedResources; + + std::vector randomInitWeights_; + std::vector randomInitConfigDescriptions_; + std::vector gridpackPaths_; + }; } // namespace gen diff --git a/GeneratorInterface/Core/interface/GeneratorFilter.h b/GeneratorInterface/Core/interface/GeneratorFilter.h index 9e130c2b5f182..dab324e1aba01 100644 --- a/GeneratorInterface/Core/interface/GeneratorFilter.h +++ b/GeneratorInterface/Core/interface/GeneratorFilter.h @@ -24,18 +24,21 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/RandomEngineSentry.h" #include "FWCore/Utilities/interface/EDMException.h" +#include "CLHEP/Random/RandomEngine.h" // #include "GeneratorInterface/ExternalDecays/interface/ExternalDecayDriver.h" //#include "GeneratorInterface/LHEInterface/interface/LHEEvent.h" #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h" +#include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h" #include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" namespace edm { template class GeneratorFilter : public one::EDFilter @@ -53,6 +56,7 @@ namespace edm virtual bool filter(Event& e, EventSetup const& es) override; virtual void endRunProduce(Run &, EventSetup const&) override; virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) override; + virtual void beginLuminosityBlockProduce(LuminosityBlock&, EventSetup const&) override; virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&) override; virtual void endLuminosityBlockProduce(LuminosityBlock &, EventSetup const&) override; @@ -99,6 +103,7 @@ namespace edm usesResource(resource); } } + // This handles the case where there are no shared resources, because you // have to declare something when the SharedResources template parameter was used. if(sharedResources.empty() && (!decayer_ || decayer_->sharedResources().empty())) { @@ -107,6 +112,7 @@ namespace edm produces(); produces(); + produces(); produces(); produces(); @@ -186,6 +192,7 @@ namespace edm // create GenEventInfoProduct from HepMC event in case hadronizer didn't provide one genEventInfo.reset(new GenEventInfoProduct(event.get())); } + ev.put(genEventInfo); std::auto_ptr bare_product(new HepMCProduct()); @@ -215,11 +222,19 @@ namespace edm template void GeneratorFilter::beginLuminosityBlock( LuminosityBlock const& lumi, EventSetup const& es ) + {} + + template + void + GeneratorFilter::beginLuminosityBlockProduce( LuminosityBlock &lumi, EventSetup const& es ) { nEventsInLumiBlock_ = 0; RandomEngineSentry randomEngineSentry(&hadronizer_, lumi.index()); RandomEngineSentry randomEngineSentryDecay(decayer_, lumi.index()); + hadronizer_.randomizeIndex(lumi,randomEngineSentry.randomEngine()); + hadronizer_.generateLHE(lumi,randomEngineSentry.randomEngine()); + if ( !hadronizer_.readSettings(0) ) throw edm::Exception(errors::Configuration) << "Failed to read settings for the hadronizer " @@ -245,12 +260,18 @@ namespace edm << "Failed to initialize hadronizer " << hadronizer_.classname() << " for internal parton generation\n"; + + std::auto_ptr genLumiInfoHeader(hadronizer_.getGenLumiInfoHeader()); + lumi.put(genLumiInfoHeader); + } template void GeneratorFilter::endLuminosityBlock(LuminosityBlock const&, EventSetup const&) - {} + { + hadronizer_.cleanLHE(); + } template void @@ -279,6 +300,7 @@ namespace edm std::auto_ptr genLumiInfo(new GenLumiInfoProduct()); genLumiInfo->setHEPIDWTUP(-1); genLumiInfo->setProcessInfo( GenLumiProcess ); + lumi.put(genLumiInfo); nEventsInLumiBlock_ = 0; diff --git a/GeneratorInterface/Core/interface/HadronizerFilter.h b/GeneratorInterface/Core/interface/HadronizerFilter.h index 1ae6bab9c2a04..6c9157826b650 100644 --- a/GeneratorInterface/Core/interface/HadronizerFilter.h +++ b/GeneratorInterface/Core/interface/HadronizerFilter.h @@ -28,6 +28,7 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/TypeID.h" #include "DataFormats/Provenance/interface/BranchDescription.h" +#include "CLHEP/Random/RandomEngine.h" // #include "GeneratorInterface/ExternalDecays/interface/ExternalDecayDriver.h" @@ -44,6 +45,7 @@ #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h" +#include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h" #include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" @@ -51,6 +53,7 @@ namespace edm { template class HadronizerFilter : public one::EDFilter(); produces(); + produces(); produces(); produces(); if(filter_) @@ -269,7 +274,6 @@ namespace edm finalEvent->weights()[0] *= multihadweight; } - ev.put(finalGenEventInfo); std::auto_ptr bare_product(new HepMCProduct()); @@ -338,13 +342,20 @@ namespace edm template void HadronizerFilter::beginLuminosityBlock(LuminosityBlock const& lumi, EventSetup const& es) + {} + + template + void + HadronizerFilter::beginLuminosityBlockProduce(LuminosityBlock &lumi, EventSetup const& es) { lhef::LHERunInfo* lheRunInfo = hadronizer_.getLHERunInfo().get(); lheRunInfo->initLumi(); RandomEngineSentry randomEngineSentry(&hadronizer_, lumi.index()); RandomEngineSentry randomEngineSentryDecay(decayer_, lumi.index()); - + + hadronizer_.randomizeIndex(lumi,randomEngineSentry.randomEngine()); + if ( !hadronizer_.readSettings(1) ) throw edm::Exception(errors::Configuration) << "Failed to read settings for the hadronizer " @@ -374,6 +385,10 @@ namespace edm << "Failed to initialize hadronizer " << hadronizer_.classname() << " for external parton generation\n"; + + std::auto_ptr genLumiInfoHeader(hadronizer_.getGenLumiInfoHeader()); + lumi.put(genLumiInfoHeader); + } template @@ -410,6 +425,7 @@ namespace edm std::auto_ptr genLumiInfo(new GenLumiInfoProduct()); genLumiInfo->setHEPIDWTUP(lheRunInfo->getHEPRUP()->IDWTUP); genLumiInfo->setProcessInfo( GenLumiProcess ); + lumi.put(genLumiInfo); diff --git a/GeneratorInterface/Core/src/BaseHadronizer.cc b/GeneratorInterface/Core/src/BaseHadronizer.cc index 6f5f1938e3dff..cd2b6b21ebf43 100644 --- a/GeneratorInterface/Core/src/BaseHadronizer.cc +++ b/GeneratorInterface/Core/src/BaseHadronizer.cc @@ -1,20 +1,155 @@ #include "GeneratorInterface/Core/interface/BaseHadronizer.h" +#include "FWCore/ParameterSet/interface/Registry.h" + +#include +#include namespace gen { const std::vector BaseHadronizer::theSharedResources; -BaseHadronizer::BaseHadronizer( edm::ParameterSet const& ps ) -{ + BaseHadronizer::BaseHadronizer( edm::ParameterSet const& ps ) : + randomIndex_(-1), + gridpackPaths_(1) + { + + if (ps.exists("RandomizedParameters")) { + std::vector randomizedParameters = ps.getParameter >("RandomizedParameters"); + randomInitWeights_.resize(randomizedParameters.size()); + randomInitConfigDescriptions_.resize(randomizedParameters.size()); + gridpackPaths_.resize(randomizedParameters.size()); + for (unsigned int irand = 0; irand("ConfigWeight"); + if (randomizedParameters[irand].exists("ConfigDescription")) { + randomInitConfigDescriptions_[irand] = randomizedParameters[irand].getParameter("ConfigDescription"); + } + if (randomizedParameters[irand].exists("GridpackPath")) { + gridpackPaths_[irand] = randomizedParameters[irand].getParameter("GridpackPath"); + } + } + } + else { + if (ps.exists("GridpackPath")) { + gridpackPaths_[0] = ps.getParameter("GridpackPath"); + } + } + + runInfo().setFilterEfficiency( + ps.getUntrackedParameter("filterEfficiency", -1.) ); + runInfo().setExternalXSecLO( + GenRunInfoProduct::XSec(ps.getUntrackedParameter("crossSection", -1.)) ); + runInfo().setExternalXSecNLO( + GenRunInfoProduct::XSec(ps.getUntrackedParameter("crossSectionNLO", -1.)) ); - runInfo().setFilterEfficiency( - ps.getUntrackedParameter("filterEfficiency", -1.) ); - runInfo().setExternalXSecLO( - GenRunInfoProduct::XSec(ps.getUntrackedParameter("crossSection", -1.)) ); - runInfo().setExternalXSecNLO( - GenRunInfoProduct::XSec(ps.getUntrackedParameter("crossSectionNLO", -1.)) ); + } + + GenLumiInfoHeader *BaseHadronizer::getGenLumiInfoHeader() const { + + GenLumiInfoHeader *genLumiInfoHeader = new GenLumiInfoHeader(); + + //fill information on randomized configs for parameter scans + genLumiInfoHeader->setRandomConfigIndex(randomIndex_); + if (randomIndex_>=0) { + genLumiInfoHeader->setConfigDescription(randomInitConfigDescription()); + } + + return genLumiInfoHeader; + + } -} + void BaseHadronizer::randomizeIndex(edm::LuminosityBlock const& lumi, CLHEP::HepRandomEngine* rengine) { + if (randomInitWeights_.size()>0) { + //randomly select from a list of provided configuration sets (for parameter scans) + + //seeds std 32-bit mersene twister with HepRandomEngine state plus run and lumi section numbers + //(random engine state will be the same for every lumi section in a job) + std::vector seeds = rengine->put(); + seeds.push_back(lumi.id().run()); + seeds.push_back(lumi.id().luminosityBlock()); + std::seed_seq seedseq(seeds.begin(),seeds.end()); + std::mt19937 randgen(seedseq); + std::discrete_distribution randdist(randomInitWeights_.begin(),randomInitWeights_.end()); + + randomIndex_ = randdist(randgen); + } + } + + void BaseHadronizer::generateLHE(edm::LuminosityBlock const& lumi, CLHEP::HepRandomEngine* rengine) { + + if (gridpackPath().empty()) { + return; + } + + //get random seed from HepRandomEngine state plus run and lumi section numbers + //(random engine state will be the same for every lumi section in a job) + std::vector seeds = rengine->put(); + seeds.push_back(lumi.id().run()); + seeds.push_back(lumi.id().luminosityBlock()); + std::seed_seq seedseq(seeds.begin(),seeds.end()); + std::array lheseed; + seedseq.generate(lheseed.begin(),lheseed.end()); + + constexpr unsigned int maxseed = 30081*30081; //madgraph cannot handle seeds larger than this + unsigned int seedval = lheseed[0]%(maxseed+1); + + unsigned int nevents = edm::pset::Registry::instance()->getMapped(lumi.processHistory().rbegin()->parameterSetID())->getParameter("@main_input").getUntrackedParameter("numberEventsInLuminosityBlock"); + + std::ostringstream nevStream; + nevStream << nevents; + + std::ostringstream randomStream; + randomStream << seedval; + + edm::FileInPath script("GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh"); + const char *outfilename = "cmsgrid_final.lhe"; + + char *args[5]; + args[0] = strdup(script.fullPath().c_str()); + args[1] = strdup(gridpackPath().c_str()); + args[2] = strdup(nevStream.str().c_str()); + args[3] = strdup(randomStream.str().c_str()); + args[4] = NULL; + + pid_t pid = fork(); + + if (pid == -1) { + // error, failed to fork() + throw cms::Exception("BaseHadronizer::generateLHE") << "Unable to fork a child"; + } + else if (pid==0) { + //child + execvp(args[0],args); + _exit(1); // exec never returns + } + else { + //parent + int status; + waitpid(pid, &status, 0); + if (status) { + throw cms::Exception("BaseHadronizer::generateLHE") << "Failed to execute script"; + } + } + FILE* lhef = std::fopen(outfilename, "r"); + if (!lhef) { + throw cms::Exception("BaseHadronizer::generateLHE") << "Output file " << outfilename << " not found."; + } + std::fclose(lhef); + + lheFile_ = outfilename; + + for (int iarg=0; iarg<4; ++iarg) { + delete[] args[iarg]; + } + + } + + void BaseHadronizer::cleanLHE() { + if (lheFile_.empty()) { + return; + } + + std::remove(lheFile_.c_str()); + } } diff --git a/GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh b/GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh index b058b3d76f769..5fdd706b91236 100755 --- a/GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh +++ b/GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh @@ -7,6 +7,9 @@ # on frontier) #J.Bendavid +#exit on first error +set -e + echo " ______________________________________ " echo " Running Generic Tarball/Gridpack " echo " ______________________________________ " diff --git a/GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h b/GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h index 657afbcd383b1..ad8885b1b9635 100644 --- a/GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h +++ b/GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h @@ -23,6 +23,7 @@ #include "GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/LuminosityBlock.h" #include #include @@ -42,33 +43,16 @@ namespace gen { public: Py8GunBase( edm::ParameterSet const& ps ); ~Py8GunBase() {} - - // GenRunInfo and GenEvent passing - GenRunInfoProduct &getGenRunInfo() { return genRunInfo_; } - HepMC::GenEvent *getGenEvent() { return genEvent_.release(); } - GenEventInfoProduct *getGenEventInfo() { return genEventInfo_.release(); } - - void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); } - void resetEventInfo(GenEventInfoProduct *eventInfo) { genEventInfo_.reset(eventInfo); } - - // interface for accessing the EDM information from the hadronizer - void setEDMEvent(edm::Event &event) { edmEvent_ = &event; } - edm::Event &getEDMEvent() const { return *edmEvent_; } - virtual bool select(HepMC::GenEvent*) const { return true;} virtual bool residualDecay(); // common func bool initializeForInternalPartons(); void finalizeEvent(); void statistics(); - + void setRandomEngine(CLHEP::HepRandomEngine* v) { p8SetRandomEngine(v); } std::vector const& sharedResources() const { return p8SharedResources; } - protected: - GenRunInfoProduct& runInfo() { return genRunInfo_; } - std::auto_ptr& event() { return genEvent_; } - std::auto_ptr& eventInfo() { return genEventInfo_; } - + protected: // (some of) PGun parameters // std::vector fPartIDs ; @@ -76,12 +60,6 @@ namespace gen { double fMaxPhi ; private: - GenRunInfoProduct genRunInfo_; - std::auto_ptr genEvent_; - std::auto_ptr genEventInfo_; - - edm::Event *edmEvent_; - static const std::vector p8SharedResources; }; diff --git a/GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h b/GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h index 697c2ec694d61..3f44ac32e5d29 100644 --- a/GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h +++ b/GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h @@ -6,6 +6,7 @@ #include "GeneratorInterface/Core/interface/ParameterCollector.h" #include "GeneratorInterface/Pythia8Interface/interface/P8RndmEngine.h" +#include "GeneratorInterface/Core/interface/BaseHadronizer.h" #include "HepMC/IO_AsciiParticles.h" @@ -20,7 +21,7 @@ namespace CLHEP { namespace gen { - class Py8InterfaceBase { + class Py8InterfaceBase : public BaseHadronizer { public: @@ -45,7 +46,8 @@ namespace gen { std::auto_ptr fMasterGen; std::auto_ptr fDecayer; HepMC::Pythia8ToHepMC toHepMC; - ParameterCollector fParameters; +// ParameterCollector fParameters; + edm::ParameterSet fParameters; unsigned int pythiaPylistVerbosity; bool pythiaHepMCVerbosity; @@ -56,10 +58,13 @@ namespace gen { // EvtGen plugin // bool useEvtGen; - EvtGenDecays* evtgenDecays; + std::auto_ptr evtgenDecays; std::string evtgenDecFile; std::string evtgenPdlFile; - + std::vector evtgenUserFiles; + + std::string slhafile_; + private: P8RndmEngine p8RndmEngine_; diff --git a/GeneratorInterface/Pythia8Interface/plugins/PowhegHooksBB4L.h b/GeneratorInterface/Pythia8Interface/plugins/PowhegHooksBB4L.h index bb6c0de767ab2..781d162c497bb 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/PowhegHooksBB4L.h +++ b/GeneratorInterface/Pythia8Interface/plugins/PowhegHooksBB4L.h @@ -1,5 +1,4 @@ // PowhegHooksBB4L.h -// Copyright (C) 2017 Tomas Jezo, Markus Seidel, Ben Nachman // Author: Tomas Jezo, Markus Seidel and Ben Nachman based on // PowhegHooks.h by Richard Corke @@ -58,15 +57,15 @@ class PowhegHooksBB4L : public UserHooks { // No radiating resonance found scale = 0.8; } - else if (abs(event[iRes].id()) == 6) { + else if (std::abs(event[iRes].id()) == 6) { // Find top daughters int idw = -1, idb = -1, idg = -1; for (int i = 0; i < nDau; i++) { int iDau = event[iRes].daughterList()[i]; - if (abs(event[iDau].id()) == 24) idw = iDau; - if (abs(event[iDau].id()) == 5) idb = iDau; - if (abs(event[iDau].id()) == 21) idg = iDau; + if (std::abs(event[iDau].id()) == 24) idw = iDau; + if (std::abs(event[iDau].id()) == 5) idb = iDau; + if (std::abs(event[iDau].id()) == 21) idg = iDau; } // Get daughter 4-vectors in resonance frame @@ -133,6 +132,7 @@ class PowhegHooksBB4L : public UserHooks { inline double getdechardness(int topcharge, const Event &e){ + // construct pdg ids of top and its decay products int tid = 6*topcharge, wid = 24*topcharge, bid = 5*topcharge, gid = 21, wildcard = 0; // find last top in the record int i_top = -1; @@ -254,7 +254,7 @@ class PowhegHooksBB4L : public UserHooks { // find the top resonance the radiator originates from int iTop = e[iRadBef].mother1(); int distance = 1; - while (abs(e[iTop].id()) != 6 && iTop > 0) { + while (std::abs(e[iTop].id()) != 6 && iTop > 0) { iTop = e[iTop].mother1(); distance ++; } @@ -272,7 +272,7 @@ class PowhegHooksBB4L : public UserHooks { if (e[iRadBef].id() == 21) scale = gSplittingScale(pt, pr, pe); // quark emitting a gluon - else if (abs(e[iRadBef].id()) <= 5) + else if (std::abs(e[iRadBef].id()) <= 5) scale = qSplittingScale(pt, pr, pe); // other stuff (which we should not veto) else { diff --git a/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc b/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc index 531bcbb7346a1..0117b24d290d7 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc @@ -96,7 +96,7 @@ bool Py8EGun::generatePartonsAndHadronize() if ( !fMasterGen->next() ) return false; - if (evtgenDecays) evtgenDecays->decay(); + if (evtgenDecays.get()) evtgenDecays->decay(); event().reset(new HepMC::GenEvent); return toHepMC.fill_next_event( fMasterGen->event, event().get() ); diff --git a/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc b/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc index adb83242060d9..6d66b40991249 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc @@ -53,7 +53,6 @@ using namespace Pythia8; #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h" -#include "GeneratorInterface/Core/interface/BaseHadronizer.h" #include "GeneratorInterface/Core/interface/GeneratorFilter.h" #include "GeneratorInterface/Core/interface/HadronizerFilter.h" @@ -70,7 +69,7 @@ namespace CLHEP { using namespace gen; -class Pythia8Hadronizer : public BaseHadronizer, public Py8InterfaceBase { +class Pythia8Hadronizer : public Py8InterfaceBase { public: @@ -90,7 +89,9 @@ class Pythia8Hadronizer : public BaseHadronizer, public Py8InterfaceBase { void statistics() override; const char *classname() const override { return "Pythia8Hadronizer"; } - + + GenLumiInfoHeader *getGenLumiInfoHeader() const override; + private: virtual void doSetRandomEngine(CLHEP::HepRandomEngine* v) override { p8SetRandomEngine(v); } @@ -109,35 +110,35 @@ class Pythia8Hadronizer : public BaseHadronizer, public Py8InterfaceBase { double fBeam2PZ; //helper class to allow multiple user hooks simultaneously - MultiUserHook *fMultiUserHook; + std::auto_ptr fMultiUserHook; // Reweight user hooks // - UserHooks* fReweightUserHook; - UserHooks* fReweightRapUserHook; - UserHooks* fReweightPtHatRapUserHook; + std::auto_ptr fReweightUserHook; + std::auto_ptr fReweightRapUserHook; + std::auto_ptr fReweightPtHatRapUserHook; // PS matching prototype // - JetMatchingHook* fJetMatchingHook; - Pythia8::JetMatchingMadgraph *fJetMatchingPy8InternalHook; - Pythia8::amcnlo_unitarised_interface *fMergingHook; + std::auto_ptr fJetMatchingHook; + std::auto_ptr fJetMatchingPy8InternalHook; + std::auto_ptr fMergingHook; // Emission Veto Hooks // - PowhegHooks* fEmissionVetoHook; - EmissionVetoHook1* fEmissionVetoHook1; + std::auto_ptr fEmissionVetoHook; + std::auto_ptr fEmissionVetoHook1; // Resonance scale hook - PowhegResHook* fPowhegResHook; - PowhegHooksBB4L* fPowhegHooksBB4L; + std::auto_ptr fPowhegResHook; + std::auto_ptr fPowhegHooksBB4L; //resonance decay filter hook - ResonanceDecayFilterHook *fResonanceDecayFilterHook; - + std::auto_ptr fResonanceDecayFilterHook; + //PT filter hook - PTFilterHook *fPTFilterHook; - + std::auto_ptr fPTFilterHook; + int EV1_nFinal; bool EV1_vetoOn; int EV1_maxVetoCount; @@ -149,8 +150,6 @@ class Pythia8Hadronizer : public BaseHadronizer, public Py8InterfaceBase { static const std::vector p8SharedResources; - std::string slhafile_; - vector DJR; int nME; int nMEFiltered; @@ -158,22 +157,17 @@ class Pythia8Hadronizer : public BaseHadronizer, public Py8InterfaceBase { int nISRveto; int nFSRveto; int nFSRvetoBB4L; - - int NHooks; - + }; const std::vector Pythia8Hadronizer::p8SharedResources = { edm::SharedResourceNames::kPythia8 }; Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet ¶ms) : - BaseHadronizer(params), Py8InterfaceBase(params), + Py8InterfaceBase(params), comEnergy(params.getParameter("comEnergy")), LHEInputFileName(params.getUntrackedParameter("LHEInputFileName","")), fInitialState(PP), - fMultiUserHook(new MultiUserHook), fReweightUserHook(0),fReweightRapUserHook(0),fReweightPtHatRapUserHook(0), - fJetMatchingHook(0),fJetMatchingPy8InternalHook(0), fMergingHook(0), - fEmissionVetoHook(0), fEmissionVetoHook1(0), fResonanceDecayFilterHook(0), fPTFilterHook(0), nME(-1), nMEFiltered(-1), nISRveto(0), nFSRveto(0), nFSRvetoBB4L(0), - NHooks(0) + nME(-1), nMEFiltered(-1), nISRveto(0), nFSRveto(0), nFSRvetoBB4L(0) { // J.Y.: the following 3 parameters are hacked "for a reason" @@ -212,84 +206,24 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet ¶ms) : throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") <<" UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n"; } - - if( params.exists( "SLHAFileForPythia8" ) ) { - std::string slhafilenameshort = params.getParameter("SLHAFileForPythia8"); - edm::FileInPath f1( slhafilenameshort ); - - fMasterGen->settings.mode("SLHA:readFrom", 2); - fMasterGen->settings.word("SLHA:file", f1.fullPath()); - - for ( ParameterCollector::const_iterator line = fParameters.begin(); - line != fParameters.end(); ++line ) { - if (line->find("SLHA:file") != std::string::npos) - throw cms::Exception("PythiaError") << "Attempted to set SLHA file name twice, " - << "using Pythia8 card SLHA:file and Pythia8Interface card SLHAFileForPythia8" - << std::endl; - } - } - else if( params.exists( "SLHATableForPythia8" ) ) { - std::string slhatable = params.getParameter("SLHATableForPythia8"); - - char tempslhaname[] = "pythia8SLHAtableXXXXXX"; - int fd = mkstemp(tempslhaname); - write(fd,slhatable.c_str(),slhatable.size()); - close(fd); - - slhafile_ = tempslhaname; - - fMasterGen->settings.mode("SLHA:readFrom", 2); - fMasterGen->settings.word("SLHA:file", slhafile_); - - for ( ParameterCollector::const_iterator line = fParameters.begin(); - line != fParameters.end(); ++line ) { - if (line->find("SLHA:file") != std::string::npos) - throw cms::Exception("PythiaError") << "Attempted to set SLHA file name twice, " - << "using Pythia8 card SLHA:file and Pythia8Interface card SLHATableForPythia8" - << std::endl; - } - } - - //add settings for resonance decay filter - fMasterGen->settings.addFlag("ResonanceDecayFilter:filter",false); - fMasterGen->settings.addFlag("ResonanceDecayFilter:exclusive",false); - fMasterGen->settings.addFlag("ResonanceDecayFilter:eMuAsEquivalent",false); - fMasterGen->settings.addFlag("ResonanceDecayFilter:eMuTauAsEquivalent",false); - fMasterGen->settings.addFlag("ResonanceDecayFilter:allNuAsEquivalent",false); - fMasterGen->settings.addFlag("ResonanceDecayFilter:udscAsEquivalent",false); - fMasterGen->settings.addFlag("ResonanceDecayFilter:udscbAsEquivalent",false); - fMasterGen->settings.addMVec("ResonanceDecayFilter:mothers",std::vector(),false,false,0,0); - fMasterGen->settings.addMVec("ResonanceDecayFilter:daughters",std::vector(),false,false,0,0); - - //add settings for PT filter - fMasterGen->settings.addFlag("PTFilter:filter",false); - fMasterGen->settings.addMode("PTFilter:quarkToFilter", 5 ,true,true,3, 6); - fMasterGen->settings.addParm("PTFilter:scaleToFilter", 0.4,true,true,0.0, 10.); - fMasterGen->settings.addParm("PTFilter:quarkRapidity",10.0,true,true,0.0, 10.); - fMasterGen->settings.addParm("PTFilter:quarkPt", -.1,true,true,-.1,100.); - - //add settings for powheg resonance scale calculation - fMasterGen->settings.addFlag("POWHEGres:calcScales",false); - fMasterGen->settings.addFlag("POWHEG:bb4l",false); - fMasterGen->settings.addFlag("POWHEG:bb4l:onlyDistance1",false); - fMasterGen->settings.addFlag("POWHEG:bb4l:useScaleResonanceInstead",false); // Reweight user hook // if( params.exists( "reweightGen" ) ) - fReweightUserHook = new PtHatReweightUserHook(); + fReweightUserHook.reset(new PtHatReweightUserHook()); if( params.exists( "reweightGenRap" ) ) { edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenRap"; edm::ParameterSet rgrParams = params.getParameter("reweightGenRap"); - fReweightRapUserHook = + fReweightRapUserHook.reset( new RapReweightUserHook(rgrParams.getParameter("yLabSigmaFunc"), rgrParams.getParameter("yLabPower"), rgrParams.getParameter("yCMSigmaFunc"), rgrParams.getParameter("yCMPower"), rgrParams.getParameter("pTHatMin"), - rgrParams.getParameter("pTHatMax")); + rgrParams.getParameter("pTHatMax")) + ); edm::LogInfo("Pythia8Interface") << "End setup for reweightGenRap"; } if( params.exists( "reweightGenPtHatRap" ) ) @@ -297,13 +231,14 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet ¶ms) : edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenPtHatRap"; edm::ParameterSet rgrParams = params.getParameter("reweightGenPtHatRap"); - fReweightPtHatRapUserHook = + fReweightPtHatRapUserHook.reset( new PtHatRapReweightUserHook(rgrParams.getParameter("yLabSigmaFunc"), rgrParams.getParameter("yLabPower"), rgrParams.getParameter("yCMSigmaFunc"), rgrParams.getParameter("yCMPower"), rgrParams.getParameter("pTHatMin"), - rgrParams.getParameter("pTHatMax")); + rgrParams.getParameter("pTHatMax")) + ); edm::LogInfo("Pythia8Interface") << "End setup for reweightGenPtHatRap"; } @@ -320,7 +255,7 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet ¶ms) : std::string scheme = jmParams.getParameter("scheme"); if ( scheme == "Madgraph" || scheme == "MadgraphFastJet" ) { - fJetMatchingHook = new JetMatchingHook( jmParams, &fMasterGen->info ); + fJetMatchingHook.reset(new JetMatchingHook( jmParams, &fMasterGen->info )); } } @@ -347,45 +282,16 @@ Pythia8Hadronizer::Pythia8Hadronizer(const edm::ParameterSet ¶ms) : if(params.exists("EV1_pTdefMode")) EV1_pTdefMode = params.getParameter("EV1_pTdefMode"); EV1_MPIvetoOn = false; if(params.exists("EV1_MPIvetoOn")) EV1_MPIvetoOn = params.getParameter("EV1_MPIvetoOn"); - fEmissionVetoHook1 = new EmissionVetoHook1(EV1_nFinal, EV1_vetoOn, + fEmissionVetoHook1.reset(new EmissionVetoHook1(EV1_nFinal, EV1_vetoOn, EV1_maxVetoCount, EV1_pThardMode, EV1_pTempMode, - EV1_emittedMode, EV1_pTdefMode, EV1_MPIvetoOn, 0); + EV1_emittedMode, EV1_pTdefMode, EV1_MPIvetoOn, 0)); } - - if(fReweightUserHook) NHooks++; - if(fReweightRapUserHook) NHooks++; - if(fReweightPtHatRapUserHook) NHooks++; - if(fJetMatchingHook) NHooks++; - if(fEmissionVetoHook1) NHooks++; - if(NHooks > 1) - throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") - <<" Too many User Hooks. \n Please choose one from: reweightGen, reweightGenRap, reweightGenPtHatRap, jetMatching, emissionVeto1 \n"; - if(fReweightUserHook) fMultiUserHook->addHook(fReweightUserHook); - if(fReweightRapUserHook) fMultiUserHook->addHook(fReweightRapUserHook); - if(fReweightPtHatRapUserHook) fMultiUserHook->addHook(fReweightPtHatRapUserHook); - if(fJetMatchingHook) fMultiUserHook->addHook(fJetMatchingHook); - if(fEmissionVetoHook1) { - edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface"; - fMultiUserHook->addHook(fEmissionVetoHook1); - } - + } Pythia8Hadronizer::~Pythia8Hadronizer() { -// do we need to delete UserHooks/JetMatchingHook here ??? - if(fEmissionVetoHook) {delete fEmissionVetoHook; fEmissionVetoHook=0;} - if(fEmissionVetoHook1) {delete fEmissionVetoHook1; fEmissionVetoHook1=0;} - if (fMultiUserHook) { - delete fMultiUserHook; - fMultiUserHook = 0; - } - - //clean up temp file - if (!slhafile_.empty()) { - std::remove(slhafile_.c_str()); - } } @@ -394,74 +300,123 @@ bool Pythia8Hadronizer::initializeForInternalPartons() bool status = false, status1 = false; - if ( fInitialState == PP ) // default - { - fMasterGen->settings.mode("Beams:idA", 2212); - fMasterGen->settings.mode("Beams:idB", 2212); + if (lheFile_.empty()) { + if ( fInitialState == PP ) // default + { + fMasterGen->settings.mode("Beams:idA", 2212); + fMasterGen->settings.mode("Beams:idB", 2212); + } + else if ( fInitialState == PPbar ) + { + fMasterGen->settings.mode("Beams:idA", 2212); + fMasterGen->settings.mode("Beams:idB", -2212); + } + else if ( fInitialState == ElectronPositron ) + { + fMasterGen->settings.mode("Beams:idA", 11); + fMasterGen->settings.mode("Beams:idB", -11); + } + else + { + // throw on unknown initial state ! + throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") + <<" UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n"; + } + fMasterGen->settings.parm("Beams:eCM", comEnergy); } - else if ( fInitialState == PPbar ) - { - fMasterGen->settings.mode("Beams:idA", 2212); - fMasterGen->settings.mode("Beams:idB", -2212); + else { + fMasterGen->settings.mode("Beams:frameType", 4); + fMasterGen->settings.word("Beams:LHEF", lheFile_); } - else if ( fInitialState == ElectronPositron ) - { - fMasterGen->settings.mode("Beams:idA", 11); - fMasterGen->settings.mode("Beams:idB", -11); - } - else - { - // throw on unknown initial state ! - throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") - <<" UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n"; + + fMultiUserHook.reset(new MultiUserHook); + + if(fReweightUserHook.get()) fMultiUserHook->addHook(fReweightUserHook.get()); + if(fReweightRapUserHook.get()) fMultiUserHook->addHook(fReweightRapUserHook.get()); + if(fReweightPtHatRapUserHook.get()) fMultiUserHook->addHook(fReweightPtHatRapUserHook.get()); + if(fJetMatchingHook.get()) fMultiUserHook->addHook(fJetMatchingHook.get()); + if(fEmissionVetoHook1.get()) { + edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface"; + fMultiUserHook->addHook(fEmissionVetoHook1.get()); } - if((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !fEmissionVetoHook) { + if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) { - if(fJetMatchingHook || fEmissionVetoHook1) + if(fJetMatchingHook.get() || fEmissionVetoHook1.get()) throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") <<" Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible are : jetMatching, emissionVeto1 \n"; - fEmissionVetoHook = new PowhegHooks(); + fEmissionVetoHook.reset(new PowhegHooks()); edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code"; - fMultiUserHook->addHook(fEmissionVetoHook); - + fMultiUserHook->addHook(fEmissionVetoHook.get()); } bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales"); if (PowhegRes) { edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface"; - fPowhegResHook = new PowhegResHook(); - fMultiUserHook->addHook(fPowhegResHook); + fPowhegResHook.reset(new PowhegResHook()); + fMultiUserHook->addHook(fPowhegResHook.get()); } bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l"); if (PowhegBB4L) { edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface"; - fPowhegHooksBB4L = new PowhegHooksBB4L(); - fMultiUserHook->addHook(fPowhegHooksBB4L); + fPowhegHooksBB4L.reset(new PowhegHooksBB4L()); + fMultiUserHook->addHook(fPowhegHooksBB4L.get()); + } + + //adapted from main89.cc in pythia8 examples + bool internalMatching = fMasterGen->settings.flag("JetMatching:merge"); + bool internalMerging = !(fMasterGen->settings.word("Merging:Process").compare("void")==0); + + if (internalMatching && internalMerging) { + throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") + <<" Only one jet matching/merging scheme can be used at a time. \n"; + } + + if (internalMatching) { + fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph); + fMultiUserHook->addHook(fJetMatchingPy8InternalHook.get()); + } + + if (internalMerging) { + int scheme = ( fMasterGen->settings.flag("Merging:doUMEPSTree") + || fMasterGen->settings.flag("Merging:doUMEPSSubt")) ? + 1 : + ( ( fMasterGen->settings.flag("Merging:doUNLOPSTree") + || fMasterGen->settings.flag("Merging:doUNLOPSSubt") + || fMasterGen->settings.flag("Merging:doUNLOPSLoop") + || fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO")) ? + 2 : + 0 ); + fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme)); + fMultiUserHook->addHook(fMergingHook.get()); } bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter"); - if (resonanceDecayFilter && !fResonanceDecayFilterHook) { - fResonanceDecayFilterHook = new ResonanceDecayFilterHook; - fMultiUserHook->addHook(fResonanceDecayFilterHook); + if (resonanceDecayFilter) { + fResonanceDecayFilterHook.reset(new ResonanceDecayFilterHook); + fMultiUserHook->addHook(fResonanceDecayFilterHook.get()); } - + bool PTFilter = fMasterGen->settings.flag("PTFilter:filter"); - if (PTFilter && !fPTFilterHook) { - fPTFilterHook = new PTFilterHook; - fMultiUserHook->addHook(fPTFilterHook); + if (PTFilter) { + fPTFilterHook.reset(new PTFilterHook); + fMultiUserHook->addHook(fPTFilterHook.get()); } - + if (fMultiUserHook->nHooks()>0) { - fMasterGen->setUserHooksPtr(fMultiUserHook); + fMasterGen->setUserHooksPtr(fMultiUserHook.get()); } - fMasterGen->settings.parm("Beams:eCM", comEnergy); edm::LogInfo("Pythia8Interface") << "Initializing MasterGen"; status = fMasterGen->init(); + + //clean up temp file + if (!slhafile_.empty()) { + std::remove(slhafile_.c_str()); + } if ( pythiaPylistVerbosity > 10 ) { @@ -480,8 +435,13 @@ bool Pythia8Hadronizer::initializeForInternalPartons() if (useEvtGen) { edm::LogInfo("Pythia8Interface") << "Creating and initializing pythia8 EvtGen plugin"; - evtgenDecays = new EvtGenDecays(fMasterGen.get(), evtgenDecFile.c_str(), evtgenPdlFile.c_str()); - evtgenDecays->readDecayFile("evtgen_userfile.dec"); + evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile.c_str(), evtgenPdlFile.c_str())); + + for (unsigned int i=0; ireadDecayFile(evtgenUserFile.fullPath().c_str()); + } + } return (status&&status1); @@ -495,33 +455,43 @@ bool Pythia8Hadronizer::initializeForExternalPartons() bool status = false, status1 = false; - if((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !fEmissionVetoHook) { + fMultiUserHook.reset(new MultiUserHook); + + if(fReweightUserHook.get()) fMultiUserHook->addHook(fReweightUserHook.get()); + if(fReweightRapUserHook.get()) fMultiUserHook->addHook(fReweightRapUserHook.get()); + if(fReweightPtHatRapUserHook.get()) fMultiUserHook->addHook(fReweightPtHatRapUserHook.get()); + if(fJetMatchingHook.get()) fMultiUserHook->addHook(fJetMatchingHook.get()); + if(fEmissionVetoHook1.get()) { + edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface"; + fMultiUserHook->addHook(fEmissionVetoHook1.get()); + } + + if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) { - if(fJetMatchingHook || fEmissionVetoHook1) + if(fJetMatchingHook.get() || fEmissionVetoHook1.get()) throw edm::Exception(edm::errors::Configuration,"Pythia8Interface") <<" Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible are : jetMatching, emissionVeto1 \n"; - fEmissionVetoHook = new PowhegHooks(); + fEmissionVetoHook.reset(new PowhegHooks()); edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code"; - fMultiUserHook->addHook(fEmissionVetoHook); - + fMultiUserHook->addHook(fEmissionVetoHook.get()); } bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales"); if (PowhegRes) { edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface"; - fPowhegResHook = new PowhegResHook(); - fMultiUserHook->addHook(fPowhegResHook); + fPowhegResHook.reset(new PowhegResHook()); + fMultiUserHook->addHook(fPowhegResHook.get()); } - + bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l"); if (PowhegBB4L) { edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface"; - fPowhegHooksBB4L = new PowhegHooksBB4L(); - fMultiUserHook->addHook(fPowhegHooksBB4L); + fPowhegHooksBB4L.reset(new PowhegHooksBB4L()); + fMultiUserHook->addHook(fPowhegHooksBB4L.get()); } - + //adapted from main89.cc in pythia8 examples bool internalMatching = fMasterGen->settings.flag("JetMatching:merge"); bool internalMerging = !(fMasterGen->settings.word("Merging:Process").compare("void")==0); @@ -531,12 +501,12 @@ bool Pythia8Hadronizer::initializeForExternalPartons() <<" Only one jet matching/merging scheme can be used at a time. \n"; } - if (internalMatching && !fJetMatchingPy8InternalHook) { - fJetMatchingPy8InternalHook = new Pythia8::JetMatchingMadgraph; - fMultiUserHook->addHook(fJetMatchingPy8InternalHook); + if (internalMatching) { + fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph); + fMultiUserHook->addHook(fJetMatchingPy8InternalHook.get()); } - if (internalMerging && !fMergingHook) { + if (internalMerging) { int scheme = ( fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt")) ? 1 : @@ -546,24 +516,24 @@ bool Pythia8Hadronizer::initializeForExternalPartons() || fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO")) ? 2 : 0 ); - fMergingHook = new Pythia8::amcnlo_unitarised_interface(scheme); - fMultiUserHook->addHook(fMergingHook); + fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme)); + fMultiUserHook->addHook(fMergingHook.get()); } bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter"); - if (resonanceDecayFilter && !fResonanceDecayFilterHook) { - fResonanceDecayFilterHook = new ResonanceDecayFilterHook; - fMultiUserHook->addHook(fResonanceDecayFilterHook); + if (resonanceDecayFilter) { + fResonanceDecayFilterHook.reset(new ResonanceDecayFilterHook); + fMultiUserHook->addHook(fResonanceDecayFilterHook.get()); } - + bool PTFilter = fMasterGen->settings.flag("PTFilter:filter"); - if (PTFilter && !fPTFilterHook) { - fPTFilterHook = new PTFilterHook; - fMultiUserHook->addHook(fPTFilterHook); + if (PTFilter) { + fPTFilterHook.reset(new PTFilterHook); + fMultiUserHook->addHook(fPTFilterHook.get()); } - + if (fMultiUserHook->nHooks()>0) { - fMasterGen->setUserHooksPtr(fMultiUserHook); + fMasterGen->setUserHooksPtr(fMultiUserHook.get()); } if(LHEInputFileName != std::string()) { @@ -581,7 +551,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons() lhaUP->setScalesFromLHEF(fMasterGen->settings.flag("Beams:setProductionScalesFromLHEF")); lhaUP->loadRunInfo(lheRunInfo()); - if ( fJetMatchingHook ) + if ( fJetMatchingHook.get() ) { fJetMatchingHook->init ( lheRunInfo() ); } @@ -592,6 +562,11 @@ bool Pythia8Hadronizer::initializeForExternalPartons() status = fMasterGen->init(); } + //clean up temp file + if (!slhafile_.empty()) { + std::remove(slhafile_.c_str()); + } + if ( pythiaPylistVerbosity > 10 ) { if ( pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13 ) @@ -610,8 +585,13 @@ bool Pythia8Hadronizer::initializeForExternalPartons() edm::LogInfo("Pythia8Interface") << "Creating and initializing pythia8 EvtGen plugin"; std::string evtgenpath(getenv("EVTGENDATA")); - evtgenDecays = new EvtGenDecays(fMasterGen.get(), evtgenDecFile.c_str(), evtgenPdlFile.c_str()); - evtgenDecays->readDecayFile("evtgen_userfile.dec"); + evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile.c_str(), evtgenPdlFile.c_str())); + + for (unsigned int i=0; ireadDecayFile(evtgenUserFile.fullPath().c_str()); + } + } return (status&&status1); @@ -622,13 +602,14 @@ void Pythia8Hadronizer::statistics() { fMasterGen->stat(); - if(fEmissionVetoHook) { + if(fEmissionVetoHook.get()) { edm::LogPrint("Pythia8Interface") << "\n" << "Number of ISR vetoed = " << nISRveto; edm::LogPrint("Pythia8Interface") << "Number of FSR vetoed = " << nFSRveto; } - if(fPowhegHooksBB4L) { + + if(fPowhegHooksBB4L.get()) { edm::LogInfo("Pythia8Interface") << "\n" << "BB4L: Number of FSR vetoed = " << nFSRvetoBB4L; } @@ -644,9 +625,43 @@ void Pythia8Hadronizer::statistics() bool Pythia8Hadronizer::generatePartonsAndHadronize() { + DJR.resize(0); + nME = -1; + nMEFiltered = -1; + + if ( fJetMatchingHook.get() ) + { + fJetMatchingHook->resetMatchingStatus(); + fJetMatchingHook->beforeHadronization( lheEvent() ); + } + if (!fMasterGen->next()) return false; - if (evtgenDecays) evtgenDecays->decay(); + double mergeweight = fMasterGen.get()->info.mergingWeightNLO(); + if (fMergingHook.get()) { + mergeweight *= fMergingHook->getNormFactor(); + } + + //protect against 0-weight from ckkw or similar + if (std::abs(mergeweight)==0.) + { + event().reset(); + return false; + } + + if (fJetMatchingPy8InternalHook.get()) { + const std::vector djrmatch = fJetMatchingPy8InternalHook->getDJR(); + //cap size of djr vector to save storage space (keep only up to first 6 elements) + unsigned int ndjr = std::min(djrmatch.size(), std::vector::size_type(6)); + for (unsigned int idjr=0; idjrnMEpartons().first; + nMEFiltered=fJetMatchingPy8InternalHook->nMEpartons().second; + } + + if (evtgenDecays.get()) evtgenDecays->decay(); event().reset(new HepMC::GenEvent); bool py8hepmc = toHepMC.fill_next_event( *(fMasterGen.get()), event().get()); @@ -655,24 +670,44 @@ bool Pythia8Hadronizer::generatePartonsAndHadronize() return false; } - //fill compresse lhe weights for systematic uncertainties - if (fMasterGen->info.getWeightsCompressedSize() > 0) { - for (unsigned int i = 0; i < fMasterGen->info.getWeightsCompressedSize(); i++) { - double wgt = fMasterGen->info.getWeightsCompressedValue(i); - event()->weights().push_back(wgt); - } + //add ckkw/umeps/unlops merging weight + if (mergeweight!=1.) { + event()->weights()[0] *= mergeweight; } - - if (fEmissionVetoHook) { + + if (fEmissionVetoHook.get()) { nISRveto += fEmissionVetoHook->getNISRveto(); nFSRveto += fEmissionVetoHook->getNFSRveto(); } - if (fPowhegHooksBB4L) { + if (fPowhegHooksBB4L.get()) { nFSRvetoBB4L += fPowhegHooksBB4L->getNFSRveto(); } - return true; + //fill additional weights for systematic uncertainties + if (fMasterGen->info.getWeightsDetailedSize() > 0) { + for (const string &key : fMasterGen->info.initrwgt->weightsKeys) { + double wgt = (*fMasterGen->info.weights_detailed)[key]; + event()->weights().push_back(wgt); + } + } + else if (fMasterGen->info.getWeightsCompressedSize() > 0) { + for (unsigned int i = 0; i < fMasterGen->info.getWeightsCompressedSize(); i++) { + double wgt = fMasterGen->info.getWeightsCompressedValue(i); + event()->weights().push_back(wgt); + } + } + + // fill shower weights + // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html + if( fMasterGen->info.nWeights() > 1 ){ + for(int i = 0; i < fMasterGen->info.nWeights(); ++i) { + double wgt = fMasterGen->info.weight(i); + event()->weights().push_back(wgt); + } + } + return true; + } @@ -683,7 +718,7 @@ bool Pythia8Hadronizer::hadronize() nMEFiltered = -1; if(LHEInputFileName == std::string()) lhaUP->loadEvent(lheEvent()); - if ( fJetMatchingHook ) + if ( fJetMatchingHook.get() ) { fJetMatchingHook->resetMatchingStatus(); fJetMatchingHook->beforeHadronization( lheEvent() ); @@ -692,7 +727,7 @@ bool Pythia8Hadronizer::hadronize() bool py8next = fMasterGen->next(); double mergeweight = fMasterGen.get()->info.mergingWeightNLO(); - if (fMergingHook) { + if (fMergingHook.get()) { mergeweight *= fMergingHook->getNormFactor(); } @@ -705,7 +740,7 @@ bool Pythia8Hadronizer::hadronize() return false; } - if (fJetMatchingPy8InternalHook) { + if (fJetMatchingPy8InternalHook.get()) { const std::vector djrmatch = fJetMatchingPy8InternalHook->getDJR(); //cap size of djr vector to save storage space (keep only up to first 6 elements) unsigned int ndjr = std::min(djrmatch.size(), std::vector::size_type(6)); @@ -721,7 +756,7 @@ bool Pythia8Hadronizer::hadronize() // lheEvent()->count( lhef::LHERunInfo::kAccepted, 1.0, mergeweight ); - if (evtgenDecays) evtgenDecays->decay(); + if (evtgenDecays.get()) evtgenDecays->decay(); event().reset(new HepMC::GenEvent); bool py8hepmc = toHepMC.fill_next_event( *(fMasterGen.get()), event().get()); @@ -733,8 +768,8 @@ bool Pythia8Hadronizer::hadronize() if (mergeweight!=1.) { event()->weights()[0] *= mergeweight; } - - if (fEmissionVetoHook) { + + if (fEmissionVetoHook.get()) { nISRveto += fEmissionVetoHook->getNISRveto(); nFSRveto += fEmissionVetoHook->getNFSRveto(); } @@ -838,6 +873,56 @@ void Pythia8Hadronizer::finalizeEvent() } } +GenLumiInfoHeader *Pythia8Hadronizer::getGenLumiInfoHeader() const { + GenLumiInfoHeader *genLumiInfoHeader = BaseHadronizer::getGenLumiInfoHeader(); + + //fill lhe headers + //*FIXME* initrwgt header is corrupt due to pythia bug + for (const std::string &key : fMasterGen->info.headerKeys()) { + genLumiInfoHeader->lheHeaders().emplace_back(key,fMasterGen->info.header(key)); + } + + //check, if it is not only nominal weight + int weights_number = fMasterGen->info.nWeights(); + if (fMasterGen->info.initrwgt) weights_number += fMasterGen->info.initrwgt->weightsKeys.size(); + if(weights_number > 1){ + genLumiInfoHeader->weightNames().reserve(weights_number + 1); + genLumiInfoHeader->weightNames().push_back("nominal"); + } + + //fill weight names + if (fMasterGen->info.initrwgt) { + for (const std::string &key : fMasterGen->info.initrwgt->weightsKeys) { + std::string weightgroupname; + for (const auto &wgtgrp : fMasterGen->info.initrwgt->weightgroups) { + const auto &wgtgrpwgt = wgtgrp.second.weights.find(key); + if (wgtgrpwgt != wgtgrp.second.weights.end()) { + weightgroupname = wgtgrp.first; + } + } + + std::ostringstream weightname; + weightname << "LHE, id = " << key << ", "; + if (!weightgroupname.empty()) { + weightname << "group = " << weightgroupname << ", "; + } + weightname<< fMasterGen->info.initrwgt->weights[key].contents; + genLumiInfoHeader->weightNames().push_back(weightname.str()); + } + } + + //fill shower labels + // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html + // http://home.thep.lu.se/~torbjorn/doxygen/classPythia8_1_1Info.html + if( fMasterGen->info.nWeights() > 1 ){ + for(int i = 0; i < fMasterGen->info.nWeights(); ++i) { + genLumiInfoHeader->weightNames().push_back( fMasterGen->info.weightLabel(i) ); + } + } + + return genLumiInfoHeader; +} + typedef edm::GeneratorFilter Pythia8GeneratorFilter; DEFINE_FWK_MODULE(Pythia8GeneratorFilter); diff --git a/GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc b/GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc index 932a19cadeeea..90298b5bdead5 100644 --- a/GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc +++ b/GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc @@ -15,14 +15,6 @@ namespace gen { Py8GunBase::Py8GunBase( edm::ParameterSet const& ps ) : Py8InterfaceBase(ps) { - - runInfo().setFilterEfficiency( - ps.getUntrackedParameter("filterEfficiency", -1.) ); - runInfo().setExternalXSecLO( - GenRunInfoProduct::XSec(ps.getUntrackedParameter("crossSection", -1.)) ); - runInfo().setExternalXSecNLO( - GenRunInfoProduct::XSec(ps.getUntrackedParameter("crossSectionNLO", -1.)) ); - // PGun specs // edm::ParameterSet pgun_params = @@ -60,8 +52,12 @@ bool Py8GunBase::initializeForInternalPartons() if (useEvtGen) { edm::LogInfo("Pythia8Interface") << "Creating and initializing pythia8 EvtGen plugin"; - evtgenDecays = new EvtGenDecays(fMasterGen.get(), evtgenDecFile.c_str(), evtgenPdlFile.c_str()); - evtgenDecays->readDecayFile("evtgen_userfile.dec"); + evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile.c_str(), evtgenPdlFile.c_str())); + + for (unsigned int i=0; ireadDecayFile(evtgenUserFile.fullPath().c_str()); + } } return true; diff --git a/GeneratorInterface/Pythia8Interface/src/Py8InterfaceBase.cc b/GeneratorInterface/Pythia8Interface/src/Py8InterfaceBase.cc index 2c86a61a71f49..64a6c6b185c98 100644 --- a/GeneratorInterface/Pythia8Interface/src/Py8InterfaceBase.cc +++ b/GeneratorInterface/Pythia8Interface/src/Py8InterfaceBase.cc @@ -12,18 +12,10 @@ using namespace Pythia8; namespace gen { Py8InterfaceBase::Py8InterfaceBase( edm::ParameterSet const& ps ) : +BaseHadronizer(ps), useEvtGen(false), evtgenDecays(0) -{ - fMasterGen.reset(new Pythia); - fDecayer.reset(new Pythia); - - fMasterGen->readString("Next:numberShowEvent = 0"); - fDecayer->readString("Next:numberShowEvent = 0"); - - fMasterGen->setRndmEnginePtr( &p8RndmEngine_ ); - fDecayer->setRndmEnginePtr( &p8RndmEngine_ ); - - fParameters = ps.getParameter("PythiaParameters"); +{ + fParameters = ps; pythiaPylistVerbosity = ps.getUntrackedParameter("pythiaPylistVerbosity", 0); pythiaHepMCVerbosity = ps.getUntrackedParameter("pythiaHepMCVerbosity", false); @@ -47,6 +39,9 @@ useEvtGen(false), evtgenDecays(0) if ( ps.exists( "evtgenPdlFile" ) ) evtgenPdlFile = ps.getParameter("evtgenPdlFile"); + if ( ps.exists( "evtgenUserFile" ) ) + evtgenUserFiles = ps.getParameter< std::vector >("evtgenUserFile"); + } } @@ -54,8 +49,52 @@ useEvtGen(false), evtgenDecays(0) bool Py8InterfaceBase::readSettings( int ) { - for ( ParameterCollector::const_iterator line = fParameters.begin(); - line != fParameters.end(); ++line ) + fMasterGen.reset(new Pythia); + fDecayer.reset(new Pythia); + + //add settings for resonance decay filter + fMasterGen->settings.addFlag("ResonanceDecayFilter:filter",false); + fMasterGen->settings.addFlag("ResonanceDecayFilter:exclusive",false); + fMasterGen->settings.addFlag("ResonanceDecayFilter:eMuAsEquivalent",false); + fMasterGen->settings.addFlag("ResonanceDecayFilter:eMuTauAsEquivalent",false); + fMasterGen->settings.addFlag("ResonanceDecayFilter:allNuAsEquivalent",false); + fMasterGen->settings.addFlag("ResonanceDecayFilter:udscAsEquivalent",false); + fMasterGen->settings.addFlag("ResonanceDecayFilter:udscbAsEquivalent",false); + fMasterGen->settings.addMVec("ResonanceDecayFilter:mothers",std::vector(),false,false,0,0); + fMasterGen->settings.addMVec("ResonanceDecayFilter:daughters",std::vector(),false,false,0,0); + + //add settings for PT filter + fMasterGen->settings.addFlag("PTFilter:filter",false); + fMasterGen->settings.addMode("PTFilter:quarkToFilter", 5 ,true,true,3, 6); + fMasterGen->settings.addParm("PTFilter:scaleToFilter", 0.4,true,true,0.0, 10.); + fMasterGen->settings.addParm("PTFilter:quarkRapidity",10.0,true,true,0.0, 10.); + fMasterGen->settings.addParm("PTFilter:quarkPt", -.1,true,true,-.1,100.); + + //add settings for powheg resonance scale calculation + fMasterGen->settings.addFlag("POWHEGres:calcScales",false); + fMasterGen->settings.addFlag("POWHEG:bb4l",false); + fMasterGen->settings.addFlag("POWHEG:bb4l:onlyDistance1",false); + fMasterGen->settings.addFlag("POWHEG:bb4l:useScaleResonanceInstead",false); + + fMasterGen->setRndmEnginePtr( &p8RndmEngine_ ); + fDecayer->setRndmEnginePtr( &p8RndmEngine_ ); + + fMasterGen->readString("Next:numberShowEvent = 0"); + fDecayer->readString("Next:numberShowEvent = 0"); + + edm::ParameterSet currentParameters; + if (randomIndex()>=0) { + std::vector randomizedParameters = fParameters.getParameter >("RandomizedParameters"); + currentParameters = randomizedParameters[randomIndex()]; + } + else { + currentParameters = fParameters; + } + + ParameterCollector pCollector = currentParameters.getParameter("PythiaParameters"); + + for ( ParameterCollector::const_iterator line = pCollector.begin(); + line != pCollector.end(); ++line ) { if (line->find("Random:") != std::string::npos) throw cms::Exception("PythiaError") << "Attempted to set random number " @@ -75,6 +114,29 @@ bool Py8InterfaceBase::readSettings( int ) } + slhafile_.clear(); + + if( currentParameters.exists( "SLHAFileForPythia8" ) ) { + std::string slhafilenameshort = currentParameters.getParameter("SLHAFileForPythia8"); + edm::FileInPath f1( slhafilenameshort ); + + fMasterGen->settings.mode("SLHA:readFrom", 2); + fMasterGen->settings.word("SLHA:file", f1.fullPath()); + } + else if( currentParameters.exists( "SLHATableForPythia8" ) ) { + std::string slhatable = currentParameters.getParameter("SLHATableForPythia8"); + + char tempslhaname[] = "pythia8SLHAtableXXXXXX"; + int fd = mkstemp(tempslhaname); + write(fd,slhatable.c_str(),slhatable.size()); + close(fd); + + slhafile_ = tempslhaname; + + fMasterGen->settings.mode("SLHA:readFrom", 2); + fMasterGen->settings.word("SLHA:file", slhafile_); + } + return true; } diff --git a/GeneratorInterface/Pythia8Interface/src/ResonanceDecayFilterHook.cc b/GeneratorInterface/Pythia8Interface/src/ResonanceDecayFilterHook.cc index 3710b5bfe4e63..c7abb3933f31a 100644 --- a/GeneratorInterface/Pythia8Interface/src/ResonanceDecayFilterHook.cc +++ b/GeneratorInterface/Pythia8Interface/src/ResonanceDecayFilterHook.cc @@ -36,6 +36,7 @@ bool ResonanceDecayFilterHook::initAfterBeams() { if ( (did == 2 || did==3 || did==4 || did==5 ) && udscbAsEquivalent_) { did = 1; } + ++requestedDaughters_[std::abs(did)]; } @@ -64,13 +65,14 @@ bool ResonanceDecayFilterHook::checkVetoResonanceDecays(const Event& process) { } if ( (did == 14 || did == 16) && allNuAsEquivalent_) { did = 12; - } + } if ( (did == 2 || did==3 || did==4 ) && udscAsEquivalent_) { did = 1; } if ( (did == 2 || did==3 || did==4 || did==5 ) && udscbAsEquivalent_) { did = 1; } + int mid = p.mother1()>0 ? std::abs(process[p.mother1()].id()) : 0; //if no list of mothers is provided, then all particles diff --git a/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHA.py b/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHA.py new file mode 100644 index 0000000000000..dabf08ec42476 --- /dev/null +++ b/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHA.py @@ -0,0 +1,565 @@ +#example gen fragment where a randomized parameter scan is performed over parameters +#in the SLHA table + +#since the randomization occurs only at lumi section boundaries, test with command like +#cmsDriver.py randomizedParametersSLHA.py -s GEN --conditions auto:mc -n -1 --filein file:cmsgrid_final.lhe --eventcontent AODSIM --no_exec --customise_command "process.source.numberEventsInLuminosityBlock = cms.untracked.uint32(200)" + + +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * + +basePythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CUEP8M1SettingsBlock, + JetMatchingParameters = cms.vstring( + 'JetMatching:setMad = off', + 'JetMatching:scheme = 1', + 'JetMatching:merge = on', + 'JetMatching:jetAlgorithm = 2', + 'JetMatching:etaJetMax = 5.', + 'JetMatching:coneRadius = 1.', + 'JetMatching:slowJetPower = 1', + 'JetMatching:qCut = 58', #this is the actual merging scale + 'JetMatching:nQmatch = 5', #4 corresponds to 4-flavour scheme (no matching of b-quarks), 5 for 5-flavour scheme + 'JetMatching:nJetMax = 2', #number of partons in born matrix element for highest multiplicity + 'JetMatching:doShowerKt = off', #off for MLM matching, turn on for shower-kT matching + ), + parameterSets = cms.vstring('pythia8CommonSettings', + 'pythia8CUEP8M1Settings', + 'JetMatchingParameters' + ) +) + +baseSLHATable=""" +###################################################################### +## PARAM_CARD AUTOMATICALY GENERATED BY MG5 #### +###################################################################### +################################### +## INFORMATION FOR HMIX +################################### +BLOCK HMIX Q= 1.000000e+00 # + 1 3.576810e+02 # rmuh + 2 9.748624e+00 # tb + 4 1.664391e+05 # ma2 + 3 2.449353e+02 # higgs vev(Q) MSSM DRb +################################### +## INFORMATION FOR MASS +################################### +BLOCK MASS # + 5 0.000000e+00 # mb + 6 1.730000e+02 # mt + 15 1.777000e+00 # mta + 23 9.118760e+01 # mz + 24 80.419002 # mw + 25 1.25e02 # mh01 + 35 1.00e05 # mh02 + 36 1.00e05 # ma0 + 37 1.00e05 # mh + 1000001 1.00e05 # set of param :1*msd1, 1*msd2 + 1000002 1.00e05 # set of param :1*msu1, 1*msu2 + 1000005 4.70e02 # msd3 + 1000006 1.00e05 # msu3 + 1000011 1.00e05 # set of param :1*msl1, 1*msl2 + 1000012 1.00e05 # set of param :1*msn1, 1*msn2 + 1000015 1.00e05 # msl3 + 1000016 1.00e05 # msn3 + 1000021 1.00e05 # mgo + 1000022 %MLSP% # mneu1 + 1000023 %MNLSP% # mneu2 + 1000024 1.00e05 # mch1 + 1000025 -1.00e05 # mneu3 + 1000035 1.00e05 # mneu4 + 1000037 1.00e05 # mch2 + 2000001 1.00e05 # set of param :1*msd4, 1*msd5 + 2000002 1.00e05 # set of param :1*msu4, 1*msu5 + 2000005 1.00e05 # msd6 + 2000006 1.00e05 # msu6 + 2000011 1.00e05 # set of param :1*msl4, 1*msl5 + 2000015 1.0005 # msl6 + 1 0.000000e00 # d : 0.0 + 2 0.000000e00 # u : 0.0 + 3 0.000000e00 # s : 0.0 + 4 0.000000e00 # c : 0.0 + 11 0.000000e00 # e- : 0.0 + 12 0.000000e00 # ve : 0.0 + 13 0.000000e00 # mu- : 0.0 + 14 0.000000e00 # vm : 0.0 + 16 0.000000e00 # vt : 0.0 + 21 0.000000e00 # g : 0.0 + 22 0.000000e00 # a : 0.0 + 1000014 1.00e05 # svm : msn1 + 1000013 1.00e05 # mul- : msl1 + 2000013 1.00e05 # mur- : msl4 + 1000004 1.00e05 # cl : msu1 + 2000004 1.00e05 # cr : msu4 + 1000003 1.00e05 # sl : msd1 + 2000003 1.00e05 # sr : msd4 +################################### +## INFORMATION FOR MSOFT +################################### +BLOCK MSOFT Q= 1.000000e+00 # + 1 1.013965e+02 # rmx1 + 2 1.915042e+02 # rmx2 + 3 5.882630e+02 # rmx3 + 21 3.233749e+04 # mhd2 + 22 -1.288001e+05 # mhu2 + 31 1.953348e+02 # set of param :1*rml21x1, 1*rml22x2 + 32 1.953348e+02 # mg5 will not use this value use instead 1*mdl_rml21x1 + 33 1.944960e+02 # rml23x3 + 34 1.364941e+02 # set of param :1*rme21x1, 1*rme22x2 + 35 1.364941e+02 # mg5 will not use this value use instead 1*mdl_rme21x1 + 36 1.340434e+02 # rme23x3 + 41 5.475735e+02 # set of param :1*rmq21x1, 1*rmq22x2 + 42 5.475735e+02 # mg5 will not use this value use instead 1*mdl_rmq21x1 + 43 4.987639e+02 # rmq23x3 + 44 5.295112e+02 # set of param :1*rmu21x1, 1*rmu22x2 + 45 5.295112e+02 # mg5 will not use this value use instead 1*mdl_rmu21x1 + 46 4.232459e+02 # rmu23x3 + 47 5.231488e+02 # set of param :1*rmd21x1, 1*rmd22x2 + 48 5.231488e+02 # mg5 will not use this value use instead 1*mdl_rmd21x1 + 49 5.198673e+02 # rmd23x3 +################################### +## INFORMATION FOR NMIX +################################### +BLOCK NMIX # + 1 1 9.863644e-01 # rnn1x1 + 1 2 -5.311036e-02 # rnn1x2 + 1 3 1.464340e-01 # rnn1x3 + 1 4 -5.311861e-02 # rnn1x4 + 2 1 9.935054e-02 # rnn2x1 + 2 2 9.449493e-01 # rnn2x2 + 2 3 -2.698467e-01 # rnn2x3 + 2 4 1.561507e-01 # rnn2x4 + 3 1 -6.033880e-02 # rnn3x1 + 3 2 8.770049e-02 # rnn3x2 + 3 3 6.958775e-01 # rnn3x3 + 3 4 7.102270e-01 # rnn3x4 + 4 1 -1.165071e-01 # rnn4x1 + 4 2 3.107390e-01 # rnn4x2 + 4 3 6.492260e-01 # rnn4x3 + 4 4 -6.843778e-01 # rnn4x4 +################################### +## INFORMATION FOR SMINPUTS +################################### +BLOCK SMINPUTS # + 1 1.279340e+02 # aewm1 + 3 1.180000e-01 # as + 6 1.750000e+02 # mt + 7 1.777000e+00 # mta + 4 9.118760e+01 # mz + 2 1.166370e-05 # G_F [GeV^-2] +################################### +## INFORMATION FOR UMIX +################################### +BLOCK UMIX # + 1 1 9.168349e-01 # ruu1x1 + 1 2 -3.992666e-01 # ruu1x2 + 2 1 3.992666e-01 # ruu2x1 + 2 2 9.168349e-01 # ruu2x2 +################################### +## INFORMATION FOR VMIX +################################### +BLOCK VMIX # + 1 1 9.725578e-01 # rvv1x1 + 1 2 -2.326612e-01 # rvv1x2 + 2 1 2.326612e-01 # rvv2x1 + 2 2 9.725578e-01 # rvv2x2 +################################### +## INFORMATION FOR YD +################################### +BLOCK YD Q= 1.000000e+00 # + 3 3 0.000000e+00 # ryd3x3 +################################### +## INFORMATION FOR YE +################################### +BLOCK YE Q= 1.000000e+00 # + 3 3 1.008908e-01 # rye3x3 +################################### +## INFORMATION FOR YU +################################### +BLOCK YU Q= 1.000000e+00 # + 3 3 8.928445e-01 # ryu3x3 +################################### +## INFORMATION FOR DECAY +################################### +DECAY 6 1.491500E+00 # wt +DECAY 23 2.441404e+00 # wz +DECAY 24 2.047600e+00 # ww +DECAY 25 6.382339e-03 # wh01 +DECAY 35 5.748014e-01 # wh02 +DECAY 36 6.321785e-01 # wa0 +DECAY 37 5.469628e-01 # wh +DECAY 1000001 5.312788e+00 # wsd1 +DECAY 1000002 5.477195e+00 # wsu1 +DECAY 1000003 5.312788e+00 # wsd2 +DECAY 1000004 5.477195e+00 # wsu2 +DECAY 1000005 1.000000e+00 # wsd3 + 1.00000000E+00 2 1000023 5 +DECAY 1000006 2.021596e+00 # wsu3 +DECAY 1000011 2.136822e-01 # wsl1 +DECAY 1000012 1.498816e-01 # wsn1 +DECAY 1000013 2.136822e-01 # wsl2 +DECAY 1000014 1.498816e-01 # wsn2 +DECAY 1000015 1.483273e-01 # wsl3 +DECAY 1000016 1.475190e-01 # wsn3 +DECAY 1000021 5.506754e+00 # wgo +DECAY 1000023 1.000000e-01 # wneu2 + 1.00000000E+00 2 1000022 25 +DECAY 1000024 1.704145e-02 # wch1 +DECAY 1000025 1.915985e+00 # wneu3 +DECAY 1000035 2.585851e+00 # wneu4 +DECAY 1000037 2.486895e+00 # wch2 +DECAY 2000001 2.858123e-01 # wsd4 +DECAY 2000002 1.152973e+00 # wsu4 +DECAY 2000003 2.858123e-01 # wsd5 +DECAY 2000004 1.152973e+00 # wsu5 +DECAY 2000005 8.015663e-01 # wsd6 +DECAY 2000006 7.373133e+00 # wsu6 +DECAY 2000011 2.161216e-01 # wsl4 +DECAY 2000013 2.161216e-01 # wsl5 +DECAY 2000015 2.699061e-01 # wsl6 +DECAY 1 0.000000e+00 # d : 0.0 +DECAY 2 0.000000e+00 # u : 0.0 +DECAY 3 0.000000e+00 # s : 0.0 +DECAY 4 0.000000e+00 # c : 0.0 +DECAY 5 0.000000e+00 # b : 0.0 +DECAY 11 0.000000e+00 # e- : 0.0 +DECAY 12 0.000000e+00 # ve : 0.0 +DECAY 13 0.000000e+00 # mu- : 0.0 +DECAY 14 0.000000e+00 # vm : 0.0 +DECAY 15 0.000000e+00 # ta- : 0.0 +DECAY 16 0.000000e+00 # vt : 0.0 +DECAY 21 0.000000e+00 # g : 0.0 +DECAY 22 0.000000e+00 # a : 0.0 +DECAY 1000022 0.000000e+00 # n1 : 0.0 +################################### +## INFORMATION FOR QNUMBERS 1000022 +################################### +BLOCK QNUMBERS 1000022 # n1 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000023 +################################### +BLOCK QNUMBERS 1000023 # n2 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000025 +################################### +BLOCK QNUMBERS 1000025 # n3 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000035 +################################### +BLOCK QNUMBERS 1000035 # n4 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000024 +################################### +BLOCK QNUMBERS 1000024 # x1+ + 1 3 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000037 +################################### +BLOCK QNUMBERS 1000037 # x2+ + 1 3 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000021 +################################### +BLOCK QNUMBERS 1000021 # go + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 8 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 35 +################################### +BLOCK QNUMBERS 35 # h2 + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 36 +################################### +BLOCK QNUMBERS 36 # h3 + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 37 +################################### +BLOCK QNUMBERS 37 # h+ + 1 3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000012 +################################### +BLOCK QNUMBERS 1000012 # sve + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000014 +################################### +BLOCK QNUMBERS 1000014 # svm + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000016 +################################### +BLOCK QNUMBERS 1000016 # svt + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000011 +################################### +BLOCK QNUMBERS 1000011 # el- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000013 +################################### +BLOCK QNUMBERS 1000013 # mul- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000015 +################################### +BLOCK QNUMBERS 1000015 # ta1- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000011 +################################### +BLOCK QNUMBERS 2000011 # er- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000013 +################################### +BLOCK QNUMBERS 2000013 # mur- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000015 +################################### +BLOCK QNUMBERS 2000015 # ta2- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000002 +################################### +BLOCK QNUMBERS 1000002 # ul + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000004 +################################### +BLOCK QNUMBERS 1000004 # cl + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000006 +################################### +BLOCK QNUMBERS 1000006 # t1 + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000002 +################################### +BLOCK QNUMBERS 2000002 # ur + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000004 +################################### +BLOCK QNUMBERS 2000004 # cr + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000006 +################################### +BLOCK QNUMBERS 2000006 # t2 + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000001 +################################### +BLOCK QNUMBERS 1000001 # dl + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000003 +################################### +BLOCK QNUMBERS 1000003 # sl + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000005 +################################### +BLOCK QNUMBERS 1000005 # b1 + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000001 +################################### +BLOCK QNUMBERS 2000001 # dr + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000003 +################################### +BLOCK QNUMBERS 2000003 # sr + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000005 +################################### +BLOCK QNUMBERS 2000005 # b2 + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR MODSEL +################################### +BLOCK MODSEL # + 1 1 # +################################### +## INFORMATION FOR STOPMIX +################################### +BLOCK STOPMIX # + 1 1 5.536450e-01 # rru3x3 + 1 2 8.327528e-01 # rru3x6 + 2 1 8.327528e-01 # rru6x3 + 2 2 -5.536450e-01 # rru6x6 +################################### +## INFORMATION FOR SBOTMIX +################################### +BLOCK SBOTMIX # + 1 1 9.387379e-01 # rrd3x3 + 1 2 3.446319e-01 # rrd3x6 + 2 1 -3.446319e-01 # rrd6x3 + 2 2 9.387379e-01 # rrd6x6 +################################### +## INFORMATION FOR STAUMIX +################################### +BLOCK STAUMIX # + 1 1 2.824872e-01 # rrl3x3 + 1 2 9.592711e-01 # rrl3x6 + 2 1 9.592711e-01 # rrl6x3 + 2 2 -2.824872e-01 # rrl6x6 +################################### +## INFORMATION FOR ALPHA +################################### +BLOCK ALPHA # + -1.138252e-01 # alp +################################### +## INFORMATION FOR AE +################################### +BLOCK AE Q= 1.000000e+00 # + 3 3 -2.517769e+02 # A_tau(Q) DRbar + 1 1 0.000000e+00 # A_e(Q) DRbar + 2 2 0.000000e+00 # A_mu(Q) DRbar +################################### +## INFORMATION FOR AU +################################### +BLOCK AU Q= 1.000000e+00 # + 3 3 -4.981299e+02 # A_t(Q) DRbar + 1 1 0.000000e+00 # A_u(Q) DRbar + 2 2 0.000000e+00 # A_c(Q) DRbar +################################### +## INFORMATION FOR AD +################################### +BLOCK AD Q= 1.000000e+00 # + 3 3 0.000000e+00 # A_b(Q) DRbar + 1 1 0.000000e+00 # A_d(Q) DRbar + 2 2 0.000000e+00 # A_s(Q) DRbar +""" + +generator = cms.EDFilter("Pythia8HadronizerFilter", + maxEventsToPrint = cms.untracked.int32(1), + pythiaPylistVerbosity = cms.untracked.int32(1), + filterEfficiency = cms.untracked.double(1.0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000.), + RandomizedParameters = cms.VPSet(), +) + +for i in range(10): + mlsp = 100. + i*5.0 + mnlsp = 230. + i*10.0 + + slhatable = baseSLHATable.replace('%MLSP%','%e' % mlsp) + slhatable = slhatable.replace('%MNLSP%','%e' % mnlsp) + + generator.RandomizedParameters.append( + cms.PSet( + ConfigWeight = cms.double(1.0), + ConfigDescription = cms.string('MLSP = %e, MNLSP = %e' % (mlsp,mnlsp)), + SLHATableForPythia8 = cms.string('%s' % slhatable), + PythiaParameters = basePythiaParameters, + ), + ) diff --git a/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHALHE.py b/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHALHE.py new file mode 100644 index 0000000000000..0d85dc4ce8c26 --- /dev/null +++ b/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHALHE.py @@ -0,0 +1,572 @@ +#example gen fragment where a randomized parameter scan is performed over parameters +#in the SLHA table + +#since the randomization occurs only at lumi section boundaries, test with command like +#cmsDriver.py randomizedParametersSLHA.py -s GEN --conditions auto:mc -n 1000 --eventcontent AODSIM --no_exec --customise_command "process.source.numberEventsInLuminosityBlock = cms.untracked.uint32(200)" + +#or for full chain with fastsim +#cmsDriver.py randomizedParametersSLHAwmLHE.py -s GEN,SIM,RECOBEFMIX,DIGIPREMIX_S2,DATAMIX,L1,L1Reco,RECO,HLT:@relval25ns --datamix PreMix --conditions auto:run2_mc --pileup_input dbs:/RelValFS_PREMIXUP15_PU25/CMSSW_8_0_0_pre2-PU25ns_76X_mcRun2_asymptotic_v12_FastSim-v1/GEN-SIM-DIGI-RAW --fast --era Run2_25ns --eventcontent AODSIM --datatier AODSIM --beamspot Realistic50ns13TeVCollision --customise SimGeneral/DataMixingModule/customiseForPremixingInput.customiseForPreMixingInput --no_exec --customise_command "process.source.numberEventsInLuminosityBlock = cms.untracked.uint32(200)" -n 1000 + + +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * + +basePythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CUEP8M1SettingsBlock, + JetMatchingParameters = cms.vstring( + 'JetMatching:setMad = off', + 'JetMatching:scheme = 1', + 'JetMatching:merge = on', + 'JetMatching:jetAlgorithm = 2', + 'JetMatching:etaJetMax = 5.', + 'JetMatching:coneRadius = 1.', + 'JetMatching:slowJetPower = 1', + 'JetMatching:qCut = 58', #this is the actual merging scale + 'JetMatching:nQmatch = 5', #4 corresponds to 4-flavour scheme (no matching of b-quarks), 5 for 5-flavour scheme + 'JetMatching:nJetMax = 2', #number of partons in born matrix element for highest multiplicity + 'JetMatching:doShowerKt = off', #off for MLM matching, turn on for shower-kT matching + ), + parameterSets = cms.vstring('pythia8CommonSettings', + 'pythia8CUEP8M1Settings', + 'JetMatchingParameters' + ) +) + +baseSLHATable=""" +###################################################################### +## PARAM_CARD AUTOMATICALY GENERATED BY MG5 #### +###################################################################### +################################### +## INFORMATION FOR HMIX +################################### +BLOCK HMIX Q= 1.000000e+00 # + 1 3.576810e+02 # rmuh + 2 9.748624e+00 # tb + 4 1.664391e+05 # ma2 + 3 2.449353e+02 # higgs vev(Q) MSSM DRb +################################### +## INFORMATION FOR MASS +################################### +BLOCK MASS # + 5 0.000000e+00 # mb + 6 1.730000e+02 # mt + 15 1.777000e+00 # mta + 23 9.118760e+01 # mz + 24 80.419002 # mw + 25 1.25e02 # mh01 + 35 1.00e05 # mh02 + 36 1.00e05 # ma0 + 37 1.00e05 # mh + 1000001 1.00e05 # set of param :1*msd1, 1*msd2 + 1000002 1.00e05 # set of param :1*msu1, 1*msu2 + 1000005 4.70e02 # msd3 + 1000006 1.00e05 # msu3 + 1000011 1.00e05 # set of param :1*msl1, 1*msl2 + 1000012 1.00e05 # set of param :1*msn1, 1*msn2 + 1000015 1.00e05 # msl3 + 1000016 1.00e05 # msn3 + 1000021 1.00e05 # mgo + 1000022 %MLSP% # mneu1 + 1000023 %MNLSP% # mneu2 + 1000024 1.00e05 # mch1 + 1000025 -1.00e05 # mneu3 + 1000035 1.00e05 # mneu4 + 1000037 1.00e05 # mch2 + 2000001 1.00e05 # set of param :1*msd4, 1*msd5 + 2000002 1.00e05 # set of param :1*msu4, 1*msu5 + 2000005 1.00e05 # msd6 + 2000006 1.00e05 # msu6 + 2000011 1.00e05 # set of param :1*msl4, 1*msl5 + 2000015 1.0005 # msl6 + 1 0.000000e00 # d : 0.0 + 2 0.000000e00 # u : 0.0 + 3 0.000000e00 # s : 0.0 + 4 0.000000e00 # c : 0.0 + 11 0.000000e00 # e- : 0.0 + 12 0.000000e00 # ve : 0.0 + 13 0.000000e00 # mu- : 0.0 + 14 0.000000e00 # vm : 0.0 + 16 0.000000e00 # vt : 0.0 + 21 0.000000e00 # g : 0.0 + 22 0.000000e00 # a : 0.0 + 1000014 1.00e05 # svm : msn1 + 1000013 1.00e05 # mul- : msl1 + 2000013 1.00e05 # mur- : msl4 + 1000004 1.00e05 # cl : msu1 + 2000004 1.00e05 # cr : msu4 + 1000003 1.00e05 # sl : msd1 + 2000003 1.00e05 # sr : msd4 +################################### +## INFORMATION FOR MSOFT +################################### +BLOCK MSOFT Q= 1.000000e+00 # + 1 1.013965e+02 # rmx1 + 2 1.915042e+02 # rmx2 + 3 5.882630e+02 # rmx3 + 21 3.233749e+04 # mhd2 + 22 -1.288001e+05 # mhu2 + 31 1.953348e+02 # set of param :1*rml21x1, 1*rml22x2 + 32 1.953348e+02 # mg5 will not use this value use instead 1*mdl_rml21x1 + 33 1.944960e+02 # rml23x3 + 34 1.364941e+02 # set of param :1*rme21x1, 1*rme22x2 + 35 1.364941e+02 # mg5 will not use this value use instead 1*mdl_rme21x1 + 36 1.340434e+02 # rme23x3 + 41 5.475735e+02 # set of param :1*rmq21x1, 1*rmq22x2 + 42 5.475735e+02 # mg5 will not use this value use instead 1*mdl_rmq21x1 + 43 4.987639e+02 # rmq23x3 + 44 5.295112e+02 # set of param :1*rmu21x1, 1*rmu22x2 + 45 5.295112e+02 # mg5 will not use this value use instead 1*mdl_rmu21x1 + 46 4.232459e+02 # rmu23x3 + 47 5.231488e+02 # set of param :1*rmd21x1, 1*rmd22x2 + 48 5.231488e+02 # mg5 will not use this value use instead 1*mdl_rmd21x1 + 49 5.198673e+02 # rmd23x3 +################################### +## INFORMATION FOR NMIX +################################### +BLOCK NMIX # + 1 1 9.863644e-01 # rnn1x1 + 1 2 -5.311036e-02 # rnn1x2 + 1 3 1.464340e-01 # rnn1x3 + 1 4 -5.311861e-02 # rnn1x4 + 2 1 9.935054e-02 # rnn2x1 + 2 2 9.449493e-01 # rnn2x2 + 2 3 -2.698467e-01 # rnn2x3 + 2 4 1.561507e-01 # rnn2x4 + 3 1 -6.033880e-02 # rnn3x1 + 3 2 8.770049e-02 # rnn3x2 + 3 3 6.958775e-01 # rnn3x3 + 3 4 7.102270e-01 # rnn3x4 + 4 1 -1.165071e-01 # rnn4x1 + 4 2 3.107390e-01 # rnn4x2 + 4 3 6.492260e-01 # rnn4x3 + 4 4 -6.843778e-01 # rnn4x4 +################################### +## INFORMATION FOR SMINPUTS +################################### +BLOCK SMINPUTS # + 1 1.279340e+02 # aewm1 + 3 1.180000e-01 # as + 6 1.750000e+02 # mt + 7 1.777000e+00 # mta + 4 9.118760e+01 # mz + 2 1.166370e-05 # G_F [GeV^-2] +################################### +## INFORMATION FOR UMIX +################################### +BLOCK UMIX # + 1 1 9.168349e-01 # ruu1x1 + 1 2 -3.992666e-01 # ruu1x2 + 2 1 3.992666e-01 # ruu2x1 + 2 2 9.168349e-01 # ruu2x2 +################################### +## INFORMATION FOR VMIX +################################### +BLOCK VMIX # + 1 1 9.725578e-01 # rvv1x1 + 1 2 -2.326612e-01 # rvv1x2 + 2 1 2.326612e-01 # rvv2x1 + 2 2 9.725578e-01 # rvv2x2 +################################### +## INFORMATION FOR YD +################################### +BLOCK YD Q= 1.000000e+00 # + 3 3 0.000000e+00 # ryd3x3 +################################### +## INFORMATION FOR YE +################################### +BLOCK YE Q= 1.000000e+00 # + 3 3 1.008908e-01 # rye3x3 +################################### +## INFORMATION FOR YU +################################### +BLOCK YU Q= 1.000000e+00 # + 3 3 8.928445e-01 # ryu3x3 +################################### +## INFORMATION FOR DECAY +################################### +DECAY 6 1.491500E+00 # wt +DECAY 23 2.441404e+00 # wz +DECAY 24 2.047600e+00 # ww +DECAY 25 6.382339e-03 # wh01 +DECAY 35 5.748014e-01 # wh02 +DECAY 36 6.321785e-01 # wa0 +DECAY 37 5.469628e-01 # wh +DECAY 1000001 5.312788e+00 # wsd1 +DECAY 1000002 5.477195e+00 # wsu1 +DECAY 1000003 5.312788e+00 # wsd2 +DECAY 1000004 5.477195e+00 # wsu2 +DECAY 1000005 1.000000e+00 # wsd3 + 1.00000000E+00 2 1000023 5 +DECAY 1000006 2.021596e+00 # wsu3 +DECAY 1000011 2.136822e-01 # wsl1 +DECAY 1000012 1.498816e-01 # wsn1 +DECAY 1000013 2.136822e-01 # wsl2 +DECAY 1000014 1.498816e-01 # wsn2 +DECAY 1000015 1.483273e-01 # wsl3 +DECAY 1000016 1.475190e-01 # wsn3 +DECAY 1000021 5.506754e+00 # wgo +DECAY 1000023 1.000000e-01 # wneu2 + 1.00000000E+00 2 1000022 25 +DECAY 1000024 1.704145e-02 # wch1 +DECAY 1000025 1.915985e+00 # wneu3 +DECAY 1000035 2.585851e+00 # wneu4 +DECAY 1000037 2.486895e+00 # wch2 +DECAY 2000001 2.858123e-01 # wsd4 +DECAY 2000002 1.152973e+00 # wsu4 +DECAY 2000003 2.858123e-01 # wsd5 +DECAY 2000004 1.152973e+00 # wsu5 +DECAY 2000005 8.015663e-01 # wsd6 +DECAY 2000006 7.373133e+00 # wsu6 +DECAY 2000011 2.161216e-01 # wsl4 +DECAY 2000013 2.161216e-01 # wsl5 +DECAY 2000015 2.699061e-01 # wsl6 +DECAY 1 0.000000e+00 # d : 0.0 +DECAY 2 0.000000e+00 # u : 0.0 +DECAY 3 0.000000e+00 # s : 0.0 +DECAY 4 0.000000e+00 # c : 0.0 +DECAY 5 0.000000e+00 # b : 0.0 +DECAY 11 0.000000e+00 # e- : 0.0 +DECAY 12 0.000000e+00 # ve : 0.0 +DECAY 13 0.000000e+00 # mu- : 0.0 +DECAY 14 0.000000e+00 # vm : 0.0 +DECAY 15 0.000000e+00 # ta- : 0.0 +DECAY 16 0.000000e+00 # vt : 0.0 +DECAY 21 0.000000e+00 # g : 0.0 +DECAY 22 0.000000e+00 # a : 0.0 +DECAY 1000022 0.000000e+00 # n1 : 0.0 +################################### +## INFORMATION FOR QNUMBERS 1000022 +################################### +BLOCK QNUMBERS 1000022 # n1 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000023 +################################### +BLOCK QNUMBERS 1000023 # n2 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000025 +################################### +BLOCK QNUMBERS 1000025 # n3 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000035 +################################### +BLOCK QNUMBERS 1000035 # n4 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000024 +################################### +BLOCK QNUMBERS 1000024 # x1+ + 1 3 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000037 +################################### +BLOCK QNUMBERS 1000037 # x2+ + 1 3 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000021 +################################### +BLOCK QNUMBERS 1000021 # go + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 8 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 35 +################################### +BLOCK QNUMBERS 35 # h2 + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 36 +################################### +BLOCK QNUMBERS 36 # h3 + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 37 +################################### +BLOCK QNUMBERS 37 # h+ + 1 3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000012 +################################### +BLOCK QNUMBERS 1000012 # sve + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000014 +################################### +BLOCK QNUMBERS 1000014 # svm + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000016 +################################### +BLOCK QNUMBERS 1000016 # svt + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000011 +################################### +BLOCK QNUMBERS 1000011 # el- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000013 +################################### +BLOCK QNUMBERS 1000013 # mul- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000015 +################################### +BLOCK QNUMBERS 1000015 # ta1- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000011 +################################### +BLOCK QNUMBERS 2000011 # er- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000013 +################################### +BLOCK QNUMBERS 2000013 # mur- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000015 +################################### +BLOCK QNUMBERS 2000015 # ta2- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000002 +################################### +BLOCK QNUMBERS 1000002 # ul + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000004 +################################### +BLOCK QNUMBERS 1000004 # cl + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000006 +################################### +BLOCK QNUMBERS 1000006 # t1 + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000002 +################################### +BLOCK QNUMBERS 2000002 # ur + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000004 +################################### +BLOCK QNUMBERS 2000004 # cr + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000006 +################################### +BLOCK QNUMBERS 2000006 # t2 + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000001 +################################### +BLOCK QNUMBERS 1000001 # dl + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000003 +################################### +BLOCK QNUMBERS 1000003 # sl + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000005 +################################### +BLOCK QNUMBERS 1000005 # b1 + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000001 +################################### +BLOCK QNUMBERS 2000001 # dr + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000003 +################################### +BLOCK QNUMBERS 2000003 # sr + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000005 +################################### +BLOCK QNUMBERS 2000005 # b2 + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR MODSEL +################################### +BLOCK MODSEL # + 1 1 # +################################### +## INFORMATION FOR STOPMIX +################################### +BLOCK STOPMIX # + 1 1 5.536450e-01 # rru3x3 + 1 2 8.327528e-01 # rru3x6 + 2 1 8.327528e-01 # rru6x3 + 2 2 -5.536450e-01 # rru6x6 +################################### +## INFORMATION FOR SBOTMIX +################################### +BLOCK SBOTMIX # + 1 1 9.387379e-01 # rrd3x3 + 1 2 3.446319e-01 # rrd3x6 + 2 1 -3.446319e-01 # rrd6x3 + 2 2 9.387379e-01 # rrd6x6 +################################### +## INFORMATION FOR STAUMIX +################################### +BLOCK STAUMIX # + 1 1 2.824872e-01 # rrl3x3 + 1 2 9.592711e-01 # rrl3x6 + 2 1 9.592711e-01 # rrl6x3 + 2 2 -2.824872e-01 # rrl6x6 +################################### +## INFORMATION FOR ALPHA +################################### +BLOCK ALPHA # + -1.138252e-01 # alp +################################### +## INFORMATION FOR AE +################################### +BLOCK AE Q= 1.000000e+00 # + 3 3 -2.517769e+02 # A_tau(Q) DRbar + 1 1 0.000000e+00 # A_e(Q) DRbar + 2 2 0.000000e+00 # A_mu(Q) DRbar +################################### +## INFORMATION FOR AU +################################### +BLOCK AU Q= 1.000000e+00 # + 3 3 -4.981299e+02 # A_t(Q) DRbar + 1 1 0.000000e+00 # A_u(Q) DRbar + 2 2 0.000000e+00 # A_c(Q) DRbar +################################### +## INFORMATION FOR AD +################################### +BLOCK AD Q= 1.000000e+00 # + 3 3 0.000000e+00 # A_b(Q) DRbar + 1 1 0.000000e+00 # A_d(Q) DRbar + 2 2 0.000000e+00 # A_s(Q) DRbar +""" + +generator = cms.EDFilter("Pythia8GeneratorFilter", + maxEventsToPrint = cms.untracked.int32(1), + pythiaPylistVerbosity = cms.untracked.int32(1), + filterEfficiency = cms.untracked.double(1.0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000.), + RandomizedParameters = cms.VPSet(), +) + +sbottomMasses = [250, 300, 350, 470] + +for sbottomMass in sbottomMasses: + for i in range(10): + mlsp = 100. + i*5.0 + mnlsp = 230. + i*10.0 + + slhatable = baseSLHATable.replace('%MLSP%','%e' % mlsp) + slhatable = slhatable.replace('%MNLSP%','%e' % mnlsp) + + generator.RandomizedParameters.append( + cms.PSet( + ConfigWeight = cms.double(1.0), + GridpackPath = cms.string('/afs/cern.ch/user/b/bendavid/work/cmspublic/gridpackexample/T2bH-Hgg-sbm%i-sbw1-chi2m230-chi2w0p1-chi1m100_tarball.tar.xz' % sbottomMass), + ConfigDescription = cms.string('MLSP = %e, MNLSP = %e' % (mlsp,mnlsp)), + SLHATableForPythia8 = cms.string('%s' % slhatable), + PythiaParameters = basePythiaParameters, + ), + ) diff --git a/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHAwmLHE.py b/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHAwmLHE.py new file mode 100644 index 0000000000000..4903acba1366b --- /dev/null +++ b/GeneratorInterface/Pythia8Interface/test/randomizedParametersSLHAwmLHE.py @@ -0,0 +1,576 @@ +#example gen fragment where a randomized parameter scan is performed over parameters +#in the SLHA table + +#since the randomization occurs only at lumi section boundaries, test with command like +#cmsDriver.py randomizedParametersSLHAwmLHE.py -s LHE,GEN --conditions auto:run2_mc -n 1000 --eventcontent LHE,RAWSIM --datatier LHE,GEN-SIM --no_exec --customise_command "process.source.numberEventsInLuminosityBlock = cms.untracked.uint32(200)" + +#or for full chain with fastsim +#cmsDriver.py randomizedParametersSLHAwmLHE.py -s LHE,GEN,SIM,RECOBEFMIX,DIGIPREMIX_S2,DATAMIX,L1,L1Reco,RECO,HLT:@relval25ns --datamix PreMix --conditions auto:run2_mc --pileup_input dbs:/RelValFS_PREMIXUP15_PU25/CMSSW_8_0_0_pre2-PU25ns_76X_mcRun2_asymptotic_v12_FastSim-v1/GEN-SIM-DIGI-RAW --fast --era Run2_25ns --eventcontent AODSIM,LHE --datatier AODSIM,LHE --beamspot Realistic50ns13TeVCollision --customise SimGeneral/DataMixingModule/customiseForPremixingInput.customiseForPreMixingInput --no_exec --customise_command "process.source.numberEventsInLuminosityBlock = cms.untracked.uint32(200)" -n 1000 + + +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * + +basePythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CUEP8M1SettingsBlock, + JetMatchingParameters = cms.vstring( + 'JetMatching:setMad = off', + 'JetMatching:scheme = 1', + 'JetMatching:merge = on', + 'JetMatching:jetAlgorithm = 2', + 'JetMatching:etaJetMax = 5.', + 'JetMatching:coneRadius = 1.', + 'JetMatching:slowJetPower = 1', + 'JetMatching:qCut = 58', #this is the actual merging scale + 'JetMatching:nQmatch = 5', #4 corresponds to 4-flavour scheme (no matching of b-quarks), 5 for 5-flavour scheme + 'JetMatching:nJetMax = 2', #number of partons in born matrix element for highest multiplicity + 'JetMatching:doShowerKt = off', #off for MLM matching, turn on for shower-kT matching + ), + parameterSets = cms.vstring('pythia8CommonSettings', + 'pythia8CUEP8M1Settings', + 'JetMatchingParameters' + ) +) + +baseSLHATable=""" +###################################################################### +## PARAM_CARD AUTOMATICALY GENERATED BY MG5 #### +###################################################################### +################################### +## INFORMATION FOR HMIX +################################### +BLOCK HMIX Q= 1.000000e+00 # + 1 3.576810e+02 # rmuh + 2 9.748624e+00 # tb + 4 1.664391e+05 # ma2 + 3 2.449353e+02 # higgs vev(Q) MSSM DRb +################################### +## INFORMATION FOR MASS +################################### +BLOCK MASS # + 5 0.000000e+00 # mb + 6 1.730000e+02 # mt + 15 1.777000e+00 # mta + 23 9.118760e+01 # mz + 24 80.419002 # mw + 25 1.25e02 # mh01 + 35 1.00e05 # mh02 + 36 1.00e05 # ma0 + 37 1.00e05 # mh + 1000001 1.00e05 # set of param :1*msd1, 1*msd2 + 1000002 1.00e05 # set of param :1*msu1, 1*msu2 + 1000005 4.70e02 # msd3 + 1000006 1.00e05 # msu3 + 1000011 1.00e05 # set of param :1*msl1, 1*msl2 + 1000012 1.00e05 # set of param :1*msn1, 1*msn2 + 1000015 1.00e05 # msl3 + 1000016 1.00e05 # msn3 + 1000021 1.00e05 # mgo + 1000022 %MLSP% # mneu1 + 1000023 %MNLSP% # mneu2 + 1000024 1.00e05 # mch1 + 1000025 -1.00e05 # mneu3 + 1000035 1.00e05 # mneu4 + 1000037 1.00e05 # mch2 + 2000001 1.00e05 # set of param :1*msd4, 1*msd5 + 2000002 1.00e05 # set of param :1*msu4, 1*msu5 + 2000005 1.00e05 # msd6 + 2000006 1.00e05 # msu6 + 2000011 1.00e05 # set of param :1*msl4, 1*msl5 + 2000015 1.0005 # msl6 + 1 0.000000e00 # d : 0.0 + 2 0.000000e00 # u : 0.0 + 3 0.000000e00 # s : 0.0 + 4 0.000000e00 # c : 0.0 + 11 0.000000e00 # e- : 0.0 + 12 0.000000e00 # ve : 0.0 + 13 0.000000e00 # mu- : 0.0 + 14 0.000000e00 # vm : 0.0 + 16 0.000000e00 # vt : 0.0 + 21 0.000000e00 # g : 0.0 + 22 0.000000e00 # a : 0.0 + 1000014 1.00e05 # svm : msn1 + 1000013 1.00e05 # mul- : msl1 + 2000013 1.00e05 # mur- : msl4 + 1000004 1.00e05 # cl : msu1 + 2000004 1.00e05 # cr : msu4 + 1000003 1.00e05 # sl : msd1 + 2000003 1.00e05 # sr : msd4 +################################### +## INFORMATION FOR MSOFT +################################### +BLOCK MSOFT Q= 1.000000e+00 # + 1 1.013965e+02 # rmx1 + 2 1.915042e+02 # rmx2 + 3 5.882630e+02 # rmx3 + 21 3.233749e+04 # mhd2 + 22 -1.288001e+05 # mhu2 + 31 1.953348e+02 # set of param :1*rml21x1, 1*rml22x2 + 32 1.953348e+02 # mg5 will not use this value use instead 1*mdl_rml21x1 + 33 1.944960e+02 # rml23x3 + 34 1.364941e+02 # set of param :1*rme21x1, 1*rme22x2 + 35 1.364941e+02 # mg5 will not use this value use instead 1*mdl_rme21x1 + 36 1.340434e+02 # rme23x3 + 41 5.475735e+02 # set of param :1*rmq21x1, 1*rmq22x2 + 42 5.475735e+02 # mg5 will not use this value use instead 1*mdl_rmq21x1 + 43 4.987639e+02 # rmq23x3 + 44 5.295112e+02 # set of param :1*rmu21x1, 1*rmu22x2 + 45 5.295112e+02 # mg5 will not use this value use instead 1*mdl_rmu21x1 + 46 4.232459e+02 # rmu23x3 + 47 5.231488e+02 # set of param :1*rmd21x1, 1*rmd22x2 + 48 5.231488e+02 # mg5 will not use this value use instead 1*mdl_rmd21x1 + 49 5.198673e+02 # rmd23x3 +################################### +## INFORMATION FOR NMIX +################################### +BLOCK NMIX # + 1 1 9.863644e-01 # rnn1x1 + 1 2 -5.311036e-02 # rnn1x2 + 1 3 1.464340e-01 # rnn1x3 + 1 4 -5.311861e-02 # rnn1x4 + 2 1 9.935054e-02 # rnn2x1 + 2 2 9.449493e-01 # rnn2x2 + 2 3 -2.698467e-01 # rnn2x3 + 2 4 1.561507e-01 # rnn2x4 + 3 1 -6.033880e-02 # rnn3x1 + 3 2 8.770049e-02 # rnn3x2 + 3 3 6.958775e-01 # rnn3x3 + 3 4 7.102270e-01 # rnn3x4 + 4 1 -1.165071e-01 # rnn4x1 + 4 2 3.107390e-01 # rnn4x2 + 4 3 6.492260e-01 # rnn4x3 + 4 4 -6.843778e-01 # rnn4x4 +################################### +## INFORMATION FOR SMINPUTS +################################### +BLOCK SMINPUTS # + 1 1.279340e+02 # aewm1 + 3 1.180000e-01 # as + 6 1.750000e+02 # mt + 7 1.777000e+00 # mta + 4 9.118760e+01 # mz + 2 1.166370e-05 # G_F [GeV^-2] +################################### +## INFORMATION FOR UMIX +################################### +BLOCK UMIX # + 1 1 9.168349e-01 # ruu1x1 + 1 2 -3.992666e-01 # ruu1x2 + 2 1 3.992666e-01 # ruu2x1 + 2 2 9.168349e-01 # ruu2x2 +################################### +## INFORMATION FOR VMIX +################################### +BLOCK VMIX # + 1 1 9.725578e-01 # rvv1x1 + 1 2 -2.326612e-01 # rvv1x2 + 2 1 2.326612e-01 # rvv2x1 + 2 2 9.725578e-01 # rvv2x2 +################################### +## INFORMATION FOR YD +################################### +BLOCK YD Q= 1.000000e+00 # + 3 3 0.000000e+00 # ryd3x3 +################################### +## INFORMATION FOR YE +################################### +BLOCK YE Q= 1.000000e+00 # + 3 3 1.008908e-01 # rye3x3 +################################### +## INFORMATION FOR YU +################################### +BLOCK YU Q= 1.000000e+00 # + 3 3 8.928445e-01 # ryu3x3 +################################### +## INFORMATION FOR DECAY +################################### +DECAY 6 1.491500E+00 # wt +DECAY 23 2.441404e+00 # wz +DECAY 24 2.047600e+00 # ww +DECAY 25 6.382339e-03 # wh01 +DECAY 35 5.748014e-01 # wh02 +DECAY 36 6.321785e-01 # wa0 +DECAY 37 5.469628e-01 # wh +DECAY 1000001 5.312788e+00 # wsd1 +DECAY 1000002 5.477195e+00 # wsu1 +DECAY 1000003 5.312788e+00 # wsd2 +DECAY 1000004 5.477195e+00 # wsu2 +DECAY 1000005 1.000000e+00 # wsd3 + 1.00000000E+00 2 1000023 5 +DECAY 1000006 2.021596e+00 # wsu3 +DECAY 1000011 2.136822e-01 # wsl1 +DECAY 1000012 1.498816e-01 # wsn1 +DECAY 1000013 2.136822e-01 # wsl2 +DECAY 1000014 1.498816e-01 # wsn2 +DECAY 1000015 1.483273e-01 # wsl3 +DECAY 1000016 1.475190e-01 # wsn3 +DECAY 1000021 5.506754e+00 # wgo +DECAY 1000023 1.000000e-01 # wneu2 + 1.00000000E+00 2 1000022 25 +DECAY 1000024 1.704145e-02 # wch1 +DECAY 1000025 1.915985e+00 # wneu3 +DECAY 1000035 2.585851e+00 # wneu4 +DECAY 1000037 2.486895e+00 # wch2 +DECAY 2000001 2.858123e-01 # wsd4 +DECAY 2000002 1.152973e+00 # wsu4 +DECAY 2000003 2.858123e-01 # wsd5 +DECAY 2000004 1.152973e+00 # wsu5 +DECAY 2000005 8.015663e-01 # wsd6 +DECAY 2000006 7.373133e+00 # wsu6 +DECAY 2000011 2.161216e-01 # wsl4 +DECAY 2000013 2.161216e-01 # wsl5 +DECAY 2000015 2.699061e-01 # wsl6 +DECAY 1 0.000000e+00 # d : 0.0 +DECAY 2 0.000000e+00 # u : 0.0 +DECAY 3 0.000000e+00 # s : 0.0 +DECAY 4 0.000000e+00 # c : 0.0 +DECAY 5 0.000000e+00 # b : 0.0 +DECAY 11 0.000000e+00 # e- : 0.0 +DECAY 12 0.000000e+00 # ve : 0.0 +DECAY 13 0.000000e+00 # mu- : 0.0 +DECAY 14 0.000000e+00 # vm : 0.0 +DECAY 15 0.000000e+00 # ta- : 0.0 +DECAY 16 0.000000e+00 # vt : 0.0 +DECAY 21 0.000000e+00 # g : 0.0 +DECAY 22 0.000000e+00 # a : 0.0 +DECAY 1000022 0.000000e+00 # n1 : 0.0 +################################### +## INFORMATION FOR QNUMBERS 1000022 +################################### +BLOCK QNUMBERS 1000022 # n1 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000023 +################################### +BLOCK QNUMBERS 1000023 # n2 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000025 +################################### +BLOCK QNUMBERS 1000025 # n3 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000035 +################################### +BLOCK QNUMBERS 1000035 # n4 + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000024 +################################### +BLOCK QNUMBERS 1000024 # x1+ + 1 3 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000037 +################################### +BLOCK QNUMBERS 1000037 # x2+ + 1 3 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000021 +################################### +BLOCK QNUMBERS 1000021 # go + 1 0 # 3 times electric charge + 2 2 # number of spin states (2s+1) + 3 8 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 35 +################################### +BLOCK QNUMBERS 35 # h2 + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 36 +################################### +BLOCK QNUMBERS 36 # h3 + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 0 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 37 +################################### +BLOCK QNUMBERS 37 # h+ + 1 3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000012 +################################### +BLOCK QNUMBERS 1000012 # sve + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000014 +################################### +BLOCK QNUMBERS 1000014 # svm + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000016 +################################### +BLOCK QNUMBERS 1000016 # svt + 1 0 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000011 +################################### +BLOCK QNUMBERS 1000011 # el- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000013 +################################### +BLOCK QNUMBERS 1000013 # mul- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000015 +################################### +BLOCK QNUMBERS 1000015 # ta1- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000011 +################################### +BLOCK QNUMBERS 2000011 # er- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000013 +################################### +BLOCK QNUMBERS 2000013 # mur- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000015 +################################### +BLOCK QNUMBERS 2000015 # ta2- + 1 -3 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 1 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000002 +################################### +BLOCK QNUMBERS 1000002 # ul + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000004 +################################### +BLOCK QNUMBERS 1000004 # cl + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000006 +################################### +BLOCK QNUMBERS 1000006 # t1 + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000002 +################################### +BLOCK QNUMBERS 2000002 # ur + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000004 +################################### +BLOCK QNUMBERS 2000004 # cr + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000006 +################################### +BLOCK QNUMBERS 2000006 # t2 + 1 2 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000001 +################################### +BLOCK QNUMBERS 1000001 # dl + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000003 +################################### +BLOCK QNUMBERS 1000003 # sl + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 1000005 +################################### +BLOCK QNUMBERS 1000005 # b1 + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000001 +################################### +BLOCK QNUMBERS 2000001 # dr + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000003 +################################### +BLOCK QNUMBERS 2000003 # sr + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR QNUMBERS 2000005 +################################### +BLOCK QNUMBERS 2000005 # b2 + 1 -1 # 3 times electric charge + 2 1 # number of spin states (2s+1) + 3 3 # colour rep (1: singlet, 3: triplet, 8: octet) + 4 1 # particle/antiparticle distinction (0=own anti) +################################### +## INFORMATION FOR MODSEL +################################### +BLOCK MODSEL # + 1 1 # +################################### +## INFORMATION FOR STOPMIX +################################### +BLOCK STOPMIX # + 1 1 5.536450e-01 # rru3x3 + 1 2 8.327528e-01 # rru3x6 + 2 1 8.327528e-01 # rru6x3 + 2 2 -5.536450e-01 # rru6x6 +################################### +## INFORMATION FOR SBOTMIX +################################### +BLOCK SBOTMIX # + 1 1 9.387379e-01 # rrd3x3 + 1 2 3.446319e-01 # rrd3x6 + 2 1 -3.446319e-01 # rrd6x3 + 2 2 9.387379e-01 # rrd6x6 +################################### +## INFORMATION FOR STAUMIX +################################### +BLOCK STAUMIX # + 1 1 2.824872e-01 # rrl3x3 + 1 2 9.592711e-01 # rrl3x6 + 2 1 9.592711e-01 # rrl6x3 + 2 2 -2.824872e-01 # rrl6x6 +################################### +## INFORMATION FOR ALPHA +################################### +BLOCK ALPHA # + -1.138252e-01 # alp +################################### +## INFORMATION FOR AE +################################### +BLOCK AE Q= 1.000000e+00 # + 3 3 -2.517769e+02 # A_tau(Q) DRbar + 1 1 0.000000e+00 # A_e(Q) DRbar + 2 2 0.000000e+00 # A_mu(Q) DRbar +################################### +## INFORMATION FOR AU +################################### +BLOCK AU Q= 1.000000e+00 # + 3 3 -4.981299e+02 # A_t(Q) DRbar + 1 1 0.000000e+00 # A_u(Q) DRbar + 2 2 0.000000e+00 # A_c(Q) DRbar +################################### +## INFORMATION FOR AD +################################### +BLOCK AD Q= 1.000000e+00 # + 3 3 0.000000e+00 # A_b(Q) DRbar + 1 1 0.000000e+00 # A_d(Q) DRbar + 2 2 0.000000e+00 # A_s(Q) DRbar +""" + +externalLHEProducer = cms.EDProducer("ExternalLHEProducer", + args = cms.vstring('/afs/cern.ch/user/b/bendavid/work/cmspublic/gridpackexample/T2bH-Hgg-sbm470-sbw1-chi2m230-chi2w0p1-chi1m100_tarball.tar.xz'), + nEvents = cms.untracked.uint32(5000), + numberOfParameters = cms.uint32(1), + outputFile = cms.string('cmsgrid_final.lhe'), + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') +) + +generator = cms.EDFilter("Pythia8HadronizerFilter", + maxEventsToPrint = cms.untracked.int32(1), + pythiaPylistVerbosity = cms.untracked.int32(1), + filterEfficiency = cms.untracked.double(1.0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000.), + RandomizedParameters = cms.VPSet(), +) + +for i in range(10): + mlsp = 100. + i*5.0 + mnlsp = 230. + i*10.0 + + slhatable = baseSLHATable.replace('%MLSP%','%e' % mlsp) + slhatable = slhatable.replace('%MNLSP%','%e' % mnlsp) + + generator.RandomizedParameters.append( + cms.PSet( + ConfigWeight = cms.double(1.0), + ConfigDescription = cms.string('MLSP = %e, MNLSP = %e' % (mlsp,mnlsp)), + SLHATableForPythia8 = cms.string('%s' % slhatable), + PythiaParameters = basePythiaParameters, + ), + ) diff --git a/GeneratorInterface/Pythia8Interface/test/resonanceDecayFilter.py b/GeneratorInterface/Pythia8Interface/test/resonanceDecayFilter.py index 82b036e2441cb..dc886e2097753 100644 --- a/GeneratorInterface/Pythia8Interface/test/resonanceDecayFilter.py +++ b/GeneratorInterface/Pythia8Interface/test/resonanceDecayFilter.py @@ -42,9 +42,9 @@ '23:mMin = 0.05', 'ResonanceDecayFilter:filter = on', 'ResonanceDecayFilter:exclusive = off', #off: require at least the specified number of daughters, on: require exactly the specified number of daughters - 'ResonanceDecayFilter:eMuAsEquivalent = off', #on: treat electrons and muons as equivalent - 'ResonanceDecayFilter:eMuTauAsEquivalent = on', #on: treat electrons, muons , and taus as equivalent - 'ResonanceDecayFilter:allNuAsEquivalent = on', #on: treat all three neutrino flavours as equivalent + 'ResonanceDecayFilter:eMuAsEquivalent = off', #on: treat electrons and muons as equivalent + 'ResonanceDecayFilter:eMuTauAsEquivalent = on', #on: treat electrons, muons , and taus as equivalent + 'ResonanceDecayFilter:allNuAsEquivalent = on', #on: treat all three neutrino flavours as equivalent 'ResonanceDecayFilter:udscAsEquivalent = off', #on: treat u,d,s,c quarks as equivalent 'ResonanceDecayFilter:udscbAsEquivalent = off', #on: treat u,d,s,c,b quarks as equivalent #'ResonanceDecayFilter:mothers =', #list of mothers not specified -> count all particles in hard process+resonance decays (better to avoid specifying mothers when including leptons from the lhe in counting, since intermediate resonances are not gauranteed to appear in general diff --git a/SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h b/SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h new file mode 100644 index 0000000000000..5ab6bcc015ede --- /dev/null +++ b/SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h @@ -0,0 +1,37 @@ +#ifndef SimDataFormats_GeneratorProducts_GenLumiInfoHeader_h +#define SimDataFormats_GeneratorProducts_GenLumiInfoHeader_h + +#include +#include +#include + +/** \class GenLumiInfoHeader + * + */ + +class GenLumiInfoHeader { + public: + + GenLumiInfoHeader() : randomConfigIndex_(-1) {}; + + int randomConfigIndex() const { return randomConfigIndex_; } + void setRandomConfigIndex(int idx) { randomConfigIndex_ = idx; } + + const std::string &configDescription() const { return configDescription_; } + void setConfigDescription(const std::string &str) { configDescription_ = str; } + + const std::vector > &lheHeaders() const { return lheHeaders_; } + std::vector > &lheHeaders() { return lheHeaders_; } + + const std::vector &weightNames() const { return weightNames_; } + std::vector &weightNames() { return weightNames_; } + + private: + int randomConfigIndex_; + std::string configDescription_; + std::vector > lheHeaders_; //header name, header content + std::vector weightNames_; + +}; + +#endif // SimDataFormats_GeneratorProducts_GenLumiInfoHeader_h diff --git a/SimDataFormats/GeneratorProducts/src/GenLumiInfoHeader.cc b/SimDataFormats/GeneratorProducts/src/GenLumiInfoHeader.cc new file mode 100644 index 0000000000000..0e3661aa15688 --- /dev/null +++ b/SimDataFormats/GeneratorProducts/src/GenLumiInfoHeader.cc @@ -0,0 +1 @@ +#include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h" diff --git a/SimDataFormats/GeneratorProducts/src/classes.h b/SimDataFormats/GeneratorProducts/src/classes.h index c6c613b283396..b883945fb95c1 100644 --- a/SimDataFormats/GeneratorProducts/src/classes.h +++ b/SimDataFormats/GeneratorProducts/src/classes.h @@ -16,6 +16,7 @@ #include "SimDataFormats/GeneratorProducts/interface/GenFilterInfo.h" #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" #include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoProduct.h" +#include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoHeader.h" #include namespace SimDataFormats_GeneratorProducts { @@ -58,6 +59,7 @@ namespace SimDataFormats_GeneratorProducts { edm::Wrapper wgenfilterinfo; edm::Wrapper wgeneventinfo; edm::Wrapper wgenlumiinfo; + edm::Wrapper wgenlumiinfoh; // LHE products edm::Wrapper wcommon; diff --git a/SimDataFormats/GeneratorProducts/src/classes_def.xml b/SimDataFormats/GeneratorProducts/src/classes_def.xml index be7743a60301a..6d5cb8a502cfb 100644 --- a/SimDataFormats/GeneratorProducts/src/classes_def.xml +++ b/SimDataFormats/GeneratorProducts/src/classes_def.xml @@ -134,6 +134,9 @@ + + + @@ -145,6 +148,7 @@ +