Skip to content

Commit

Permalink
Add QCD to possible physics processes. (cms-sw#73)
Browse files Browse the repository at this point in the history
* Add qcd to possible physics processes, forward ptMin and ptMax as phase space cuts.
* Reuse tresholdMin/Max parameters to set physproc gun pt cuts.
* Update threshold defaults, set max to min when negative.
* Explain that thresholdMax = thresholdMin for thresholdMax < 0
  • Loading branch information
riga authored and clelange committed Aug 7, 2019
1 parent d06b55c commit 316a522
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The production tools allow you to generate a plethora of processes (links lead t
* Higgs -> gamma gamma (`hgg`)
* W -> qq' (`wqq`)
* ttbar (`ttbar`)
* qcd (`qcd`)

## Details

Expand All @@ -86,7 +87,7 @@ To produce `NEVENTS` GEN-SIM-DIGI events with `NPART` sets of particles (per eve
--tag MYTAG
```

Here, one can produce a custom set of particles by providing `PART_PDGID` as a set of comma-separated single PDG IDs. To simulate the decay of unstable particles, e.g. quarks, gluons or taus, an alternative particle gun based on Pythia8 can be used by setting `--gunMode pythia8`. The Pythia8 gun can also be either a 'Pt' or 'E' gun.
Here, one can produce a custom set of particles by providing `PART_PDGID` as a set of comma-separated single PDG IDs. To simulate the decay of unstable particles, e.g. quarks, gluons or taus, an alternative particle gun based on PYTHIA8 can be used by setting `--gunMode pythia8`. The Pythia8 gun can also be either a 'Pt' or 'E' gun. Mind that if `--thresholdMax PTMAX` is not provided (or is negative), it will be set to the value of `thresholdMin` (and therefore produce events with a fixed p_T/energy).

To produce `NEVENTS` GEN-SIM-DIGI events with pair of particles within given angular distance ΔR(η,φ) (per event), where the first particle is of type `PART_PDGID` and in the p_T range from `PTMIN` to `PTMAX`, and the second one is of type `INCONE_PART_PDGID` and at distance from `DRMIN` to `DRMAX` and with p_T in range from `PTRATIO_MIN` to `PTRATIO_MAX` relative to the first particle, one should run:

Expand Down Expand Up @@ -182,6 +183,11 @@ In addition to setting the physics process only, you can add a filter path to ha

which in this case means at least two jets with pT > 100 GeV in the `ak8GenJetsNoNu` collection.

A more efficient way to apply phase space cuts is to directly configure Pythia8 via process parameters. Currently supported cuts:

* `PhaseSpace:pTHatMin`: set via `--thresholdMin`, ignored when negative.
* `PhaseSpace:pTHatMax`: set via `--thresholdMax`, ignored when negative.

### RECO step

To run RECO stage on the produced GEN-SIM-DIGI samples, stored under `partGun_[MYTAG]_[DATE]` (locally or on the CMG EOS area), one should run:
Expand Down
6 changes: 3 additions & 3 deletions SubmitHGCalPGun.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def parseOptions():
parser.add_option('-c', '--cfg', dest='CONFIGFILE', type='string', default='',help='CMSSW config template name, if empty string the deafult one will be used')
parser.add_option('-p', '--partID', dest='PARTID', type='string', default='', help='string of particle PDG IDs separated by comma, if empty string - run on all supported (11,12,13,14,15,16,22,111,211,130) and corresponding negative values, default is empty string (all)')
parser.add_option('', '--nPart', dest='NPART', type=int, default=1, help='number of times particles of type(s) PARTID will be generated per event, default is 1')
parser.add_option('', '--thresholdMin', dest='thresholdMin', type=float, default=1.0, help='min. threshold value')
parser.add_option('', '--thresholdMax', dest='thresholdMax', type=float, default=35.0, help='max. threshold value')
parser.add_option('', '--thresholdMin', dest='thresholdMin', type=float, default=-1.0, help='min. threshold value, used as min. pt phase space cut for physproc gunmode when >= 0')
parser.add_option('', '--thresholdMax', dest='thresholdMax', type=float, default=-1.0, help='max. threshold value, used as max. pt phase space cut for physproc gunmode when >= 0')
parser.add_option('', '--etaMin', dest='etaMin', type=float, default=1.479, help='min. eta value')
parser.add_option('', '--etaMax', dest='etaMax', type=float, default=3.0, help='max. eta value')
parser.add_option('', '--zMin', dest='zMin', type=float, default=321.6, help='min. z value start of EE at V10')
Expand Down Expand Up @@ -355,7 +355,7 @@ def submitHGCalProduction():

s_template=s_template.replace('DUMMYIDs',nParticles)
s_template=s_template.replace('DUMMYTHRESHMIN',str(opt.thresholdMin))
s_template=s_template.replace('DUMMYTHRESHMAX',str(opt.thresholdMax))
s_template=s_template.replace('DUMMYTHRESHMAX',str(opt.thresholdMax if opt.thresholdMax >= 0 else opt.thresholdMin))
s_template=s_template.replace('DUMMYETAMIN',str(opt.etaMin))
s_template=s_template.replace('DUMMYETAMAX',str(opt.etaMax))
s_template=s_template.replace('GUNPRODUCERTYPE',str(partGunType))
Expand Down
6 changes: 5 additions & 1 deletion templates/partGun_GSD_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@
proc_cfg = physicsProcess.split(':')
proc = proc_cfg[0]

# phase space cuts
ptMin = DUMMYTHRESHMIN
ptMax = DUMMYTHRESHMAX

from reco_prodtools.templates.hgcBiasedGenProcesses_cfi import *

#define the process
print 'Setting process to', proc
defineProcessGenerator(process, proc=proc)
defineProcessGenerator(process, proc=proc, ptMin=ptMin, ptMax=ptMax)

#set a filter path if it's available
if len(proc_cfg)==4:
Expand Down
13 changes: 11 additions & 2 deletions templates/python/hgcBiasedGenProcesses_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import *


def defineProcessGenerator(process,proc='minbias'):

def defineProcessGenerator(process, proc='minbias', ptMin=-1., ptMax=-1.):
"""
wraps up a couple of interesting processes for HGCal studies
- minbias (minimum bias),
Expand Down Expand Up @@ -42,9 +41,19 @@ def defineProcessGenerator(process,proc='minbias'):
'Top:qqbar2ttbar = on',
'6:m0 = 172.5', # top mass'
)
elif proc == 'qcd':
processParameters = cms.vstring(
'HardQCD:all = on',
)
else:
raise ValueError('Process \"{}\" not defined.'.format(proc))

# extend by common phase space cuts
if ptMin >= 0:
processParameters.append('PhaseSpace:pTHatMin = {}'.format(ptMin))
if ptMax >= 0:
processParameters.append('PhaseSpace:pTHatMax = {}'.format(ptMax))

process.generator = cms.EDFilter(
"Pythia8GeneratorFilter",
maxEventsToPrint = cms.untracked.int32(1),
Expand Down

0 comments on commit 316a522

Please sign in to comment.