From a646876c1706276f3b72773acc8805a7dbafd230 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 4 Dec 2013 18:39:18 +0100 Subject: [PATCH 1/2] Pythia8Int fix2, use m0 instead of mass, fix examples and a test --- GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc | 3 +-- GeneratorInterface/Pythia8Interface/plugins/Py8JetGun.cc | 3 +-- GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc b/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc index 0205a027d75b5..15f3d3478abd3 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Py8EGun.cc @@ -64,8 +64,7 @@ bool Py8EGun::generatePartonsAndHadronize() double eta = (fMaxEta-fMinEta) * randomEngine->flat() + fMinEta; double the = 2.*atan(exp(-eta)); - double mass = (fMasterGen->particleData).mass( particleID ); -// double mass = (pythia->particleData).m0( particleID ); + double mass = (fMasterGen->particleData).m0( particleID ); double pp = sqrt( ee*ee - mass*mass ); double px = pp * sin(the) * cos(phi); diff --git a/GeneratorInterface/Pythia8Interface/plugins/Py8JetGun.cc b/GeneratorInterface/Pythia8Interface/plugins/Py8JetGun.cc index eeab8e94c1d1f..4f2e478782d9a 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Py8JetGun.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Py8JetGun.cc @@ -75,8 +75,7 @@ bool Py8JetGun::generatePartonsAndHadronize() // ee = (fMaxE-fMinE)*randomEngine->flat() + fMinE; - double mass = (fMasterGen->particleData).mass( particleID ); -// double mass = (pythia->particleData).m0( particleID ); + double mass = (fMasterGen->particleData).m0( particleID ); pp = sqrt( ee*ee - mass*mass ); diff --git a/GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc b/GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc index d3c81090ef86c..09b5b29d96b52 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc @@ -65,8 +65,7 @@ bool Py8PtGun::generatePartonsAndHadronize() double pt = (fMaxPt-fMinPt) * randomEngine->flat() + fMinPt; - double mass = (fMasterGen->particleData).mass( particleID ); -// double mass = (pythia->particleData).m0( particleID ); + double mass = (fMasterGen->particleData).m0( particleID ); double pp = pt / sin(the); // sqrt( ee*ee - mass*mass ); double ee = sqrt( pp*pp + mass*mass ); From 78dc05484045fc17a96ee926a5b0cb9f5d80b123 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 4 Dec 2013 18:39:29 +0100 Subject: [PATCH 2/2] Pythia8Int fix2, use m0 instead of mass, fix examples and a test --- .../Pythia8Interface/test/Py8Had_MGFastJet_cfg.py | 8 +++----- .../Pythia8Interface/test/Py8Had_mgmatching_cfg.py | 8 +++----- .../test/analyserhepmc/LeptonAnalyserHepMC.cc | 7 +++++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/GeneratorInterface/Pythia8Interface/test/Py8Had_MGFastJet_cfg.py b/GeneratorInterface/Pythia8Interface/test/Py8Had_MGFastJet_cfg.py index b42cb926721ed..4aa3332073bc8 100644 --- a/GeneratorInterface/Pythia8Interface/test/Py8Had_MGFastJet_cfg.py +++ b/GeneratorInterface/Pythia8Interface/test/Py8Had_MGFastJet_cfg.py @@ -67,11 +67,9 @@ #) process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", - moduleSeeds = cms.PSet( - generator = cms.untracked.uint32(123456), - g4SimHits = cms.untracked.uint32(123456788), - VtxSmeared = cms.untracked.uint32(123456789) - ), + generator = cms.PSet( + initialSeed = cms.untracked.uint32(123456789), + ) ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) diff --git a/GeneratorInterface/Pythia8Interface/test/Py8Had_mgmatching_cfg.py b/GeneratorInterface/Pythia8Interface/test/Py8Had_mgmatching_cfg.py index 3b18c1d54ac4a..77eaf881454d1 100644 --- a/GeneratorInterface/Pythia8Interface/test/Py8Had_mgmatching_cfg.py +++ b/GeneratorInterface/Pythia8Interface/test/Py8Had_mgmatching_cfg.py @@ -68,11 +68,9 @@ #) process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", - moduleSeeds = cms.PSet( - generator = cms.untracked.uint32(123456), - g4SimHits = cms.untracked.uint32(123456788), - VtxSmeared = cms.untracked.uint32(123456789) - ), + generator = cms.PSet( + initialSeed = cms.untracked.uint32(123456789), + ) ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) diff --git a/GeneratorInterface/Pythia8Interface/test/analyserhepmc/LeptonAnalyserHepMC.cc b/GeneratorInterface/Pythia8Interface/test/analyserhepmc/LeptonAnalyserHepMC.cc index 52584f094ad9d..73f46cfbed4ed 100644 --- a/GeneratorInterface/Pythia8Interface/test/analyserhepmc/LeptonAnalyserHepMC.cc +++ b/GeneratorInterface/Pythia8Interface/test/analyserhepmc/LeptonAnalyserHepMC.cc @@ -30,7 +30,7 @@ std::vector double eta0 = (*part)->momentum().eta(); double phi0 = (*part)->momentum().phi(); - double pti, dist, etai, phii; + double pti, dist, etai, phii, dphi; bool isol = true; for(part1 = pEv->particles_begin(); part1 != part && part1 != pEv->particles_end(); @@ -39,7 +39,10 @@ std::vector pti = (*part1)->momentum().perp(); etai = (*part1)->momentum().eta(); phii = (*part1)->momentum().phi(); - dist = sqrt( (eta0-etai)*(eta0-etai) + (phi0-phii)*(phi0-phii) ); + dphi = phi0-phii; + if(fabs(phi0-phii-6.2832) < fabs(dphi)) dphi = phi0-phii-6.2832; + if(fabs(phi0-phii+6.2832) < fabs(dphi)) dphi = phi0-phii+6.2832; + dist = sqrt( (eta0-etai)*(eta0-etai) + dphi*dphi ); if(dist < RConeIsol && pti > MaxPtIsol ) { isol = false; break;} } }