forked from cms-pepr/production_tests
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGSD_ttbar.py
55 lines (43 loc) · 2 KB
/
GSD_ttbar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# coding: utf-8
import os
import math
import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
from reco_prodtools.templates.GSD_fragment import process
# option parsing
options = VarParsing('python')
options.setDefault('outputFile', 'file:TTbar.root')
options.setDefault('maxEvents', 1)
options.register("pileup", 0, VarParsing.multiplicity.singleton, VarParsing.varType.int,
"pileup")
options.register("seed", 1, VarParsing.multiplicity.singleton, VarParsing.varType.int,
"random seed")
options.register("nThreads", 1, VarParsing.multiplicity.singleton, VarParsing.varType.int,
"number of threads")
options.parseArguments()
process.maxEvents.input = cms.untracked.int32(options.maxEvents)
seed = int(options.seed)+1
# random seeds
process.RandomNumberGeneratorService.generator.initialSeed = cms.untracked.uint32(seed)
process.RandomNumberGeneratorService.VtxSmeared.initialSeed = cms.untracked.uint32(seed)
process.RandomNumberGeneratorService.mix.initialSeed = cms.untracked.uint32(seed)
# Input source
process.source.firstLuminosityBlock = cms.untracked.uint32(seed)
# Output definition
process.FEVTDEBUGoutput.fileName = cms.untracked.string(
options.__getattr__("outputFile", noTags=True))
process.FEVTDEBUGoutput.outputCommands.append("keep *_*G4*_*_*")
process.FEVTDEBUGoutput.outputCommands.append("keep SimClustersedmAssociation_mix_*_*")
process.FEVTDEBUGoutput.outputCommands.append("keep CaloParticlesedmAssociation_mix_*_*")
# helper
def calculate_rho(z, eta):
return z * math.tan(2 * math.atan(math.exp(-eta)))
process.options.numberOfThreads=cms.untracked.uint32(options.nThreads)
#load and configure the appropriate pileup modules
if options.pileup == 0:
process.load("SimGeneral.MixingModule.mixNoPU_cfi")
process.mix.digitizers = cms.PSet(process.theDigitizersValid)
# I don't think this matters, but just to be safe...
process.mix.bunchspace = cms.int32(25)
process.mix.minBunch = cms.int32(-3)
process.mix.maxBunch = cms.int32(3)