diff --git a/GeneratorInterface/ExternalDecays/src/ExternalDecayDriver.cc b/GeneratorInterface/ExternalDecays/src/ExternalDecayDriver.cc index 3ee1ee032441a..405d8d01d2ec9 100644 --- a/GeneratorInterface/ExternalDecays/src/ExternalDecayDriver.cc +++ b/GeneratorInterface/ExternalDecays/src/ExternalDecayDriver.cc @@ -52,6 +52,12 @@ ExternalDecayDriver::ExternalDecayDriver( const ParameterSet& pset ) exSharedResources.emplace_back(edm::SharedResourceNames::kPhotos); } } + else if (curSet == "Photospp355" ){ + if ( !fPhotosInterface ){ + fPhotosInterface = (PhotosInterfaceBase*)(PhotosFactory::get()->create("Photospp355", pset.getUntrackedParameter< ParameterSet>(curSet))); + exSharedResources.emplace_back(edm::SharedResourceNames::kPhotos); + } + } } } @@ -67,20 +73,17 @@ HepMC::GenEvent* ExternalDecayDriver::decay( HepMC::GenEvent* evt ) if ( !fIsInitialized ) return evt; - if ( fEvtGenInterface ) - { - evt = fEvtGenInterface->decay( evt ); - if ( !evt ) return 0; + if ( fEvtGenInterface ){ + evt = fEvtGenInterface->decay( evt ); + if ( !evt ) return 0; } - if ( fTauolaInterface ) - { + if ( fTauolaInterface ){ evt = fTauolaInterface->decay( evt ); if ( !evt ) return 0; } - if ( fPhotosInterface ) - { + if ( fPhotosInterface ){ evt = fPhotosInterface->apply( evt ); if ( !evt ) return 0; } @@ -93,45 +96,30 @@ void ExternalDecayDriver::init( const edm::EventSetup& es ) if ( fIsInitialized ) return; - if ( fTauolaInterface ) - { + if ( fTauolaInterface ){ fTauolaInterface->init( es ); for ( std::vector::const_iterator i=fTauolaInterface->operatesOnParticles().begin(); i!=fTauolaInterface->operatesOnParticles().end(); i++ ) fPDGs.push_back( *i ); } - if ( fEvtGenInterface ) - { - fEvtGenInterface->init(); - for ( std::vector::const_iterator i=fEvtGenInterface->operatesOnParticles().begin(); - i!=fEvtGenInterface->operatesOnParticles().end(); i++ ) - fPDGs.push_back( *i ); + if ( fEvtGenInterface ){ + fEvtGenInterface->init(); + for ( std::vector::const_iterator i=fEvtGenInterface->operatesOnParticles().begin(); + i!=fEvtGenInterface->operatesOnParticles().end(); i++ ) + fPDGs.push_back( *i ); } - - if ( fPhotosInterface ) - { - fPhotosInterface->init(); -// for tauola++ - if ( fPhotosInterface ) - { - for ( unsigned int iss=0; issspecialSettings().size(); iss++ ) - { - fSpecialSettings.push_back( fPhotosInterface->specialSettings()[iss] ); - } - } - } -// this is specific to old tauola27 only, because it calls up photos automatically -// -// -// if ( fTauolaInterface ) -// { -// // override ! -// fSpecialSettings.clear(); -// fSpecialSettings.push_back( "QED-brem-off:15" ); -// } + if ( fPhotosInterface ){ + fPhotosInterface->init(); + // for tauola++ + if ( fPhotosInterface ){ + for ( unsigned int iss=0; issspecialSettings().size(); iss++ ){ + fSpecialSettings.push_back( fPhotosInterface->specialSettings()[iss] ); + } + } + } fIsInitialized = true; @@ -141,7 +129,8 @@ void ExternalDecayDriver::init( const edm::EventSetup& es ) void ExternalDecayDriver::statistics() const { if ( fTauolaInterface ) fTauolaInterface->statistics(); - // similar for EvtGen and/or Photos, if needs be + if ( fPhotosInterface ) fPhotosInterface->statistics(); + // similar for EvtGen if needed return; } diff --git a/GeneratorInterface/PhotosInterface/plugins/PhotosInterface.h b/GeneratorInterface/PhotosInterface/interface/PhotosInterface.h similarity index 86% rename from GeneratorInterface/PhotosInterface/plugins/PhotosInterface.h rename to GeneratorInterface/PhotosInterface/interface/PhotosInterface.h index 24f112ee28688..4358198db28d0 100644 --- a/GeneratorInterface/PhotosInterface/plugins/PhotosInterface.h +++ b/GeneratorInterface/PhotosInterface/interface/PhotosInterface.h @@ -36,13 +36,7 @@ namespace gen { static double flat(); private: - struct Scaling { - HepMC::ThreeVector weights; - int flag; - Scaling( const HepMC::ThreeVector& vec, int flg ) - : weights(HepMC::ThreeVector(1.,1.,1)), flag(1) { weights=vec; flag=flg; } - }; - + int fOnlyPDG; bool fAvoidTauLeptonicDecays; std::vector fBarcodes; diff --git a/GeneratorInterface/PhotosInterface/interface/PhotosInterfaceBase.h b/GeneratorInterface/PhotosInterface/interface/PhotosInterfaceBase.h index 630f3777c6d18..2ff02b3315107 100644 --- a/GeneratorInterface/PhotosInterface/interface/PhotosInterfaceBase.h +++ b/GeneratorInterface/PhotosInterface/interface/PhotosInterfaceBase.h @@ -24,6 +24,7 @@ namespace gen { virtual void avoidTauLeptonicDecays()=0;; virtual void configureOnlyFor( int )=0; virtual void setRandomEngine(CLHEP::HepRandomEngine* decayRandomEngine)=0; + virtual void statistics(){}; protected: std::vector fSpecialSettings; diff --git a/GeneratorInterface/PhotosInterface/interface/PhotosppInterface.h b/GeneratorInterface/PhotosInterface/interface/PhotosppInterface.h new file mode 100644 index 0000000000000..a0d52180a2b51 --- /dev/null +++ b/GeneratorInterface/PhotosInterface/interface/PhotosppInterface.h @@ -0,0 +1,48 @@ +#ifndef gen_PhotosInterface_PhotosppInterface_h +#define gen_PhotosInterface_PhotosppInterface_h + +// #include "HepPDT/ParticleDataTable.hh" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" + +#include "HepMC/SimpleVector.h" +#include "GeneratorInterface/PhotosInterface/interface/PhotosInterfaceBase.h" + + +namespace HepMC +{ +class GenEvent; +class GenVertex; +} + +namespace gen { + class PhotosppInterface : public PhotosInterfaceBase { + public: + + // ctor & dtor + PhotosppInterface( const edm::ParameterSet& pset); + ~PhotosppInterface() {} + + void init(); + const std::vector& specialSettings() { return fSpecialSettings; } + HepMC::GenEvent* apply( HepMC::GenEvent* ); + void configureOnlyFor( int ); + void avoidTauLeptonicDecays() { fAvoidTauLeptonicDecays=true; return; } + bool isTauLeptonicDecay( HepMC::GenVertex* ); + void setRandomEngine(CLHEP::HepRandomEngine* decayRandomEngine); + static double flat(); + void statistics(); + + private: + int fOnlyPDG; + bool fAvoidTauLeptonicDecays; + bool fIsInitialized; + edm::ParameterSet* fPSet; + + static CLHEP::HepRandomEngine* fRandomEngine; + }; +} + +#endif diff --git a/GeneratorInterface/PhotosInterface/plugins/BuildFile.xml b/GeneratorInterface/PhotosInterface/plugins/BuildFile.xml index c9c08558623d0..8994bbd8add3d 100644 --- a/GeneratorInterface/PhotosInterface/plugins/BuildFile.xml +++ b/GeneratorInterface/PhotosInterface/plugins/BuildFile.xml @@ -9,3 +9,16 @@ + + + + + + + + + + + + + diff --git a/GeneratorInterface/PhotosInterface/plugins/PhotosInterface.cc b/GeneratorInterface/PhotosInterface/plugins/PhotosInterface.cc index f0fbe17290141..d5a94c3d55fe8 100644 --- a/GeneratorInterface/PhotosInterface/plugins/PhotosInterface.cc +++ b/GeneratorInterface/PhotosInterface/plugins/PhotosInterface.cc @@ -1,5 +1,5 @@ #include -#include "PhotosInterface.h" +#include "GeneratorInterface/PhotosInterface/interface/PhotosInterface.h" #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "GeneratorInterface/PhotosInterface/interface/PhotosFactory.h" diff --git a/GeneratorInterface/PhotosInterface/plugins/PhotosppInterface.cc b/GeneratorInterface/PhotosInterface/plugins/PhotosppInterface.cc new file mode 100644 index 0000000000000..f3e38bd78df5b --- /dev/null +++ b/GeneratorInterface/PhotosInterface/plugins/PhotosppInterface.cc @@ -0,0 +1,209 @@ +#include +#include "GeneratorInterface/PhotosInterface/interface/PhotosppInterface.h" +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "GeneratorInterface/PhotosInterface/interface/PhotosFactory.h" + +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "HepMC/GenEvent.h" +#include "HepMC/IO_HEPEVT.h" +#include "HepMC/HEPEVT_Wrapper.h" + +using namespace gen; +using namespace edm; +using namespace std; + +#include "Photos/Photos.h" +#include "Photos/PhotosHepMCEvent.h" + +CLHEP::HepRandomEngine* PhotosppInterface::fRandomEngine = nullptr; + +PhotosppInterface::PhotosppInterface( const edm::ParameterSet& pset) + : fOnlyPDG(-1), + fAvoidTauLeptonicDecays(false), + fIsInitialized(false), + fPSet(0) +{ + fSpecialSettings.push_back("QED-brem-off:all"); + fPSet = new ParameterSet(pset); +} + +void PhotosppInterface::setRandomEngine(CLHEP::HepRandomEngine* decayRandomEngine){fRandomEngine=decayRandomEngine;} + +void PhotosppInterface::configureOnlyFor( int ipdg ){ + fOnlyPDG = ipdg; + fSpecialSettings.clear(); + return; +} + +void PhotosppInterface::init(){ + if ( fIsInitialized ) return; // do init only once + Photospp::Photos::initialize(); + std::vector par = fPSet->getParameter< std::vector >("parameterSets"); + for (unsigned int ip=0; ipgetParameter(curSet)); + if(curSet=="setInfraredCutOff") Photospp::Photos::setInfraredCutOff(fPSet->getParameter(curSet)); + if(curSet=="setAlphaQED") Photospp::Photos::setAlphaQED(fPSet->getParameter(curSet)); + if(curSet=="setInterference") Photospp::Photos::setInterference(fPSet->getParameter(curSet)); + if(curSet=="setDoubleBrem") Photospp::Photos::setDoubleBrem(fPSet->getParameter(curSet)); + if(curSet=="setQuatroBrem") Photospp::Photos::setQuatroBrem(fPSet->getParameter(curSet)); + if(curSet=="setExponentiation") Photospp::Photos::setExponentiation(fPSet->getParameter(curSet)); + if(curSet=="setCorrectionWtForW") Photospp::Photos::setCorrectionWtForW(fPSet->getParameter(curSet)); + if(curSet=="setMeCorrectionWtForScalar") Photospp::Photos::setMeCorrectionWtForScalar(fPSet->getParameter(curSet)); + if(curSet=="setMeCorrectionWtForW") Photospp::Photos::setMeCorrectionWtForW(fPSet->getParameter(curSet)); + if(curSet=="setMeCorrectionWtForZ") Photospp::Photos::setMeCorrectionWtForZ(fPSet->getParameter(curSet)); + if(curSet=="initializeKinematicCorrections") Photospp::Photos::initializeKinematicCorrections(fPSet->getParameter(curSet)); + if(curSet=="forceMassFrom4Vector") Photospp::Photos::forceMassFrom4Vector(fPSet->getParameter(curSet)); + if(curSet=="forceMassFromEventRecord") Photospp::Photos::forceMassFromEventRecord(fPSet->getParameter(curSet)); + if(curSet=="ignoreParticlesOfStatus") Photospp::Photos::ignoreParticlesOfStatus(fPSet->getParameter(curSet)); + if(curSet=="deIgnoreParticlesOfStatus") Photospp::Photos::deIgnoreParticlesOfStatus(fPSet->getParameter(curSet)); + if(curSet=="setMomentumConservationThreshold") Photospp::Photos::setMomentumConservationThreshold(fPSet->getParameter(curSet)); + if(curSet=="suppressAll") if(fPSet->getParameter(curSet)==true)Photospp::Photos::suppressAll(); + + // Now setup more complicated radiation/mass supression and forcing. + if(curSet=="suppressBremForBranch"){ + edm::ParameterSet cfg = fPSet->getParameter(curSet); + std::vector v = cfg.getParameter >("parameterSets"); + for(unsigned int i=0;i vpar = cfg.getParameter >(vs); + if(vpar.size()==1) Photospp::Photos::suppressBremForBranch(0,vpar[0]); + if(vpar.size()==2) Photospp::Photos::suppressBremForBranch(0/*vpar[0]*/,vpar[1]); + if(vpar.size()==3) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2]); + if(vpar.size()==4) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3]); + if(vpar.size()==5) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]); + if(vpar.size()==6) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]); + if(vpar.size()==7) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]); + if(vpar.size()==8) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]); + if(vpar.size()==9) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]); + if(vpar.size()==10) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]); + } + } + if(curSet=="suppressBremForDecay"){ + edm::ParameterSet cfg = fPSet->getParameter(curSet); + std::vector v = cfg.getParameter >("parameterSets"); + for(unsigned int i=0;i vpar = cfg.getParameter >(vs); + if(vpar.size()==1) Photospp::Photos::suppressBremForDecay(0,vpar[0]); + if(vpar.size()==2) Photospp::Photos::suppressBremForDecay(0/*vpar[0]*/,vpar[1]); + if(vpar.size()==3) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2]); + if(vpar.size()==4) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3]); + if(vpar.size()==5) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]); + if(vpar.size()==6) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]); + if(vpar.size()==7) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]); + if(vpar.size()==8) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]); + if(vpar.size()==9) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]); + if(vpar.size()==10) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]); + } + } + + if(curSet=="forceBremForBranch"){ + edm::ParameterSet cfg = fPSet->getParameter(curSet); + std::vector v = cfg.getParameter >("parameterSets"); + for(unsigned int i=0;i vpar = cfg.getParameter >(vs); + if(vpar.size()==1) Photospp::Photos::forceBremForBranch(0,vpar[0]); + if(vpar.size()==2) Photospp::Photos::forceBremForBranch(0/*vpar[0]*/,vpar[1]); + if(vpar.size()==3) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2]); + if(vpar.size()==4) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3]); + if(vpar.size()==5) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]); + if(vpar.size()==6) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]); + if(vpar.size()==7) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]); + if(vpar.size()==8) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]); + if(vpar.size()==9) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]); + if(vpar.size()==10) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]); + } + } + if(curSet=="forceBremForDecay"){ + edm::ParameterSet cfg = fPSet->getParameter(curSet); + std::vector v = cfg.getParameter >("parameterSets"); + for(unsigned int i=0;i vpar = cfg.getParameter >(vs); + if(vpar.size()==1) Photospp::Photos::forceBremForDecay(0,vpar[0]); + if(vpar.size()==2) Photospp::Photos::forceBremForDecay(0/*vpar[0]*/,vpar[1]); + if(vpar.size()==3) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2]); + if(vpar.size()==4) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3]); + if(vpar.size()==5) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]); + if(vpar.size()==6) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]); + if(vpar.size()==7) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]); + if(vpar.size()==8) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]); + if(vpar.size()==9) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]); + if(vpar.size()==10) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]); + } + } + + if(curSet=="forceMass"){ + edm::ParameterSet cfg = fPSet->getParameter(curSet); + std::vector v = cfg.getParameter >("parameterSets"); + for(unsigned int i=0;i vpar = cfg.getParameter >(vs); + if(vpar.size()==2) Photospp::Photos::forceMass((int)vpar[0], vpar[1]); + } + } + } + // implement options set via c++ + if(fOnlyPDG>=0){ + Photospp::Photos::suppressAll(); + Photospp::Photos::forceBremForBranch(0,fOnlyPDG); + Photospp::Photos::forceBremForBranch(0,-1*fOnlyPDG); + } + if(fAvoidTauLeptonicDecays){ + Photospp::Photos::suppressBremForDecay(3, 15, 16, 11, -12); + Photospp::Photos::suppressBremForDecay(3, -15, -16, -11, 12); + Photospp::Photos::suppressBremForDecay(3, 15, 16, 13, -14); + Photospp::Photos::suppressBremForDecay(3, -15, -16, -13, -14); + } + Photospp::Photos::iniInfo(); + fIsInitialized = true; + return; +} + +HepMC::GenEvent* PhotosppInterface::apply( HepMC::GenEvent* evt){ + Photospp::Photos::setRandomGenerator(PhotosppInterface::flat); + if(!fIsInitialized) return evt; + int NPartBefore = evt->particles_size(); + Photospp::PhotosHepMCEvent PhotosEvt(evt); + PhotosEvt.process(); + //Fix the vertices and barcodes based on Julia Yarba's solution from TauolaInterface + for (HepMC::GenEvent::vertex_const_iterator vtx=evt->vertices_begin(); vtx!=evt->vertices_end(); vtx++ ){ + std::vector BCodes; + BCodes.clear(); + if(*vtx){ + for(HepMC::GenVertex::particle_iterator pitr=(*vtx)->particles_begin(HepMC::children);pitr!=(*vtx)->particles_end(HepMC::children);++pitr){ + if((*pitr)->barcode()>10000){ + BCodes.push_back((*pitr)->barcode()); + } + } + } + if(BCodes.size() > 0){ + for(size_t ibc=0; ibcbarcode_to_particle(BCodes[ibc]); + int nbc = p1->barcode() - 10000 + NPartBefore; + p1->suggest_barcode(nbc); + } + } + } + return evt; +} + +double PhotosppInterface::flat(){ + if ( !fRandomEngine ) { + throw cms::Exception("LogicError") + << "PhotosppInterface::flat: Attempt to generate random number when engine pointer is null\n" + << "This might mean that the code was modified to generate a random number outside the\n" + << "event and beginLuminosityBlock methods, which is not allowed.\n"; + } + return fRandomEngine->flat(); +} + +void PhotosppInterface::statistics(){Photospp::Photos::iniInfo();} + +DEFINE_EDM_PLUGIN(PhotosFactory, gen::PhotosppInterface, "Photospp355"); diff --git a/GeneratorInterface/PhotosInterface/test/DYnorad_Tune4C_13TeV_pythia8.py b/GeneratorInterface/PhotosInterface/test/DYnorad_Tune4C_13TeV_pythia8.py new file mode 100644 index 0000000000000..37ab7fea0f2fc --- /dev/null +++ b/GeneratorInterface/PhotosInterface/test/DYnorad_Tune4C_13TeV_pythia8.py @@ -0,0 +1,127 @@ +# A script to produce Z events using pythia8 and with no FSR +# This script is to be used to compare with DYphotospp_Tune4C_13TeV_pythia8.py to demonstrate/test +# the additions of FSR by Photos++ + +import FWCore.ParameterSet.Config as cms + +process = cms.Process('VALIDATION') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.Validation_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10000) +) + +# Input source +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.19 $'), + annotation = cms.untracked.string('Configuration/Generator/python/ThirteenTeV/WToMuNu_M_500_Tune4C_13TeV_pythia8_cfi.py nevts:100000'), + name = cms.untracked.string('Applications') +) + +# Output definition + +process.RAWSIMoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.RAWSIMEventContent.outputCommands, + fileName = cms.untracked.string('DYnorad_Tune4C_13TeV_pythia8_cfi_py_GEN_VALIDATION.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('GEN') + ), + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ) +) + +# Additional output definition + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") +process.mix.playback = True +process.mix.digitizers = cms.PSet() +for a in process.aliases: delattr(process, a) +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '') + +process.generator = cms.EDFilter("Pythia8GeneratorFilter", + ExternalDecays = cms.PSet( + Tauola = cms.untracked.PSet( + UseTauolaPolarization = cms.bool(True), + InputCards = cms.PSet( + mdtau = cms.int32(0), + pjak2 = cms.int32(3), + pjak1 = cms.int32(3) + ) + ), + parameterSets = cms.vstring('Tauola') + ), + UseExternalGenerators = cms.untracked.bool(True), + pythiaPylistVerbosity = cms.untracked.int32(1), + filterEfficiency = cms.untracked.double(1), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000.0), + crossSection = cms.untracked.double(0.2188), + maxEventsToPrint = cms.untracked.int32(1), + PythiaParameters = cms.PSet( + processParameters = cms.vstring('Main:timesAllowErrors = 10000', + 'ParticleDecays:limitTau0 = on', + 'ParticleDecays:tauMax = 10', + 'Tune:ee 3', + 'Tune:pp 5', + 'PartonLevel:FSR = off', + 'WeakSingleBoson:ffbar2gmZ = on', + '23:onMode = off', + '23:onIfAny = 13', + '23:mMin = 50.', + '23:mMax = 120.' + ), + parameterSets = cms.vstring('processParameters') + ) +) + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +# Path and EndPath definitions +process.generation_step = cms.Path(process.pgen) +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.validation_step = cms.EndPath(process.genstepfilter+process.genvalid_all) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.validation_step,process.endjob_step,process.RAWSIMoutput_step) +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + +# customisation of the process. + +# Automatic addition of the customisation function from SimGeneral.MixingModule.fullMixCustomize_cff +from SimGeneral.MixingModule.fullMixCustomize_cff import setCrossingFrameOn + +#call to customisation function setCrossingFrameOn imported from SimGeneral.MixingModule.fullMixCustomize_cff +process = setCrossingFrameOn(process) + +# End of customisation functions diff --git a/GeneratorInterface/PhotosInterface/test/DYphotospp_Tune4C_13TeV_pythia8.py b/GeneratorInterface/PhotosInterface/test/DYphotospp_Tune4C_13TeV_pythia8.py new file mode 100644 index 0000000000000..422746b30164c --- /dev/null +++ b/GeneratorInterface/PhotosInterface/test/DYphotospp_Tune4C_13TeV_pythia8.py @@ -0,0 +1,126 @@ +# A script to produce Z events using pythia8 and with FSR added by Photos++ +# This script is to be used to compare with DYnorad_Tune4C_13TeV_pythia8.py to demonstrate/test +# the additions of FSR by Photos++ + +import FWCore.ParameterSet.Config as cms + +process = cms.Process('VALIDATION') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.Validation_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10000) +) + +# Input source +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.19 $'), + annotation = cms.untracked.string('Configuration/Generator/python/ThirteenTeV/WToMuNu_M_500_Tune4C_13TeV_pythia8_cfi.py nevts:100000'), + name = cms.untracked.string('Applications') +) + +# Output definition + +process.RAWSIMoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.RAWSIMEventContent.outputCommands, + fileName = cms.untracked.string('DYphotospp_Tune4C_13TeV_pythia8_cfi_py_GEN_VALIDATION.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('GEN') + ), + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ) +) + +# Additional output definition + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") +process.mix.playback = True +process.mix.digitizers = cms.PSet() +for a in process.aliases: delattr(process, a) +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '') + +process.generator = cms.EDFilter("Pythia8GeneratorFilter", + ExternalDecays = cms.PSet( + Photospp355 = cms.untracked.PSet( + parameterSets = cms.vstring("setExponentiation","setInfraredCutOff","setMomentumConservationThreshold"), + setExponentiation = cms.bool(True), + setInfraredCutOff = cms.double(0.00011), + setMomentumConservationThreshold = cms.double(20.0) # 0.5GeV + ), + parameterSets = cms.vstring( "Photospp355") + ), + + UseExternalGenerators = cms.untracked.bool(True), + pythiaPylistVerbosity = cms.untracked.int32(1), + filterEfficiency = cms.untracked.double(1), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000.0), + crossSection = cms.untracked.double(0.2188), + maxEventsToPrint = cms.untracked.int32(1), + PythiaParameters = cms.PSet( + processParameters = cms.vstring('Main:timesAllowErrors = 10000', + 'ParticleDecays:limitTau0 = on', + 'ParticleDecays:tauMax = 10', + 'Tune:ee 3', + 'Tune:pp 5', + 'PartonLevel:FSR = off', + 'WeakSingleBoson:ffbar2gmZ = on', + '23:onMode = off', + '23:onIfAny = 13', + '23:mMin = 50.', + '23:mMax = 120.' + ), + parameterSets = cms.vstring('processParameters') + ) +) + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +# Path and EndPath definitions +process.generation_step = cms.Path(process.pgen) +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.validation_step = cms.EndPath(process.genstepfilter+process.genvalid_all) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.validation_step,process.endjob_step,process.RAWSIMoutput_step) +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq + +# customisation of the process. + +# Automatic addition of the customisation function from SimGeneral.MixingModule.fullMixCustomize_cff +from SimGeneral.MixingModule.fullMixCustomize_cff import setCrossingFrameOn + +#call to customisation function setCrossingFrameOn imported from SimGeneral.MixingModule.fullMixCustomize_cff +process = setCrossingFrameOn(process) + +# End of customisation functions