3 import FWCore.ParameterSet.Config
as cms
8 import FWCore.ParameterSet.VarParsing
as VarParsing
10 options.register(
'ZmumuCollection',
11 'goldenZmumuCandidatesGe2IsoMuons',
12 VarParsing.VarParsing.multiplicity.singleton,
13 VarParsing.VarParsing.varType.int,
14 "collection of selected Z->mumu candidates")
16 options.register(
'mdtau',
18 VarParsing.VarParsing.multiplicity.singleton,
19 VarParsing.VarParsing.varType.int,
20 "mdtau value passed to TAUOLA for selecting tau decay modes")
22 options.register(
'transformationMode',
24 VarParsing.VarParsing.multiplicity.singleton,
25 VarParsing.VarParsing.varType.int,
26 "transformation mode: 0=mumu->mumu, 1=mumu->tautau")
28 options.register(
'embeddingMode',
30 VarParsing.VarParsing.multiplicity.singleton,
31 VarParsing.VarParsing.varType.int,
32 "embedding mode: 0=PF, 1=RH")
34 options.register(
'minVisibleTransverseMomentum',
36 VarParsing.VarParsing.multiplicity.singleton,
37 VarParsing.VarParsing.varType.string,
38 "generator level cut on visible transverse momentum (typeN:pT,[...];[...])")
40 options.register(
'useJson',
42 VarParsing.VarParsing.multiplicity.singleton,
43 VarParsing.VarParsing.varType.int,
44 "should I enable event selection by JSON file ?")
46 options.register(
'overrideBeamSpot',
48 VarParsing.VarParsing.multiplicity.singleton,
49 VarParsing.VarParsing.varType.int,
50 "should I override beamspot in globaltag ?")
52 options.register(
'doNotSkimEvents',
54 VarParsing.VarParsing.multiplicity.singleton,
55 VarParsing.VarParsing.varType.int,
56 "should I disable all event selection cuts ?")
59 if not hasattr(process,
"doNotParse"):
61 if hasattr(sys,
"argv") ==
True:
62 if not sys.argv[0].endswith(
'cmsDriver.py'):
63 options.parseArguments()
66 print "CL parsing disabled!"
69 process.options[
'mdtau'] = options.mdtau
70 process.options[
'transformationMode'] = options.transformationMode
71 process.options[
'embeddingMode'] = options.embeddingMode
72 process.options[
'minVisibleTransverseMomentum'] = options.minVisibleTransverseMomentum
73 if options.useJson != 0:
74 process.options[
'useJson'] =
True
76 process.options[
'useJson'] =
False
77 if options.overrideBeamSpot != 0:
78 process.options[
'overrideBeamSpot'] =
True
80 process.options[
'overrideBeamSpot'] =
False
81 if options.doNotSkimEvents != 0:
82 process.options[
'doNotSkimEvents'] =
True
84 process.options[
'doNotSkimEvents'] =
False
def parseCommandLineOptions