test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
embeddingCommandLineOptions Namespace Reference

Functions

def parseCommandLineOptions
 

Function Documentation

def embeddingCommandLineOptions.parseCommandLineOptions (   process)

Definition at line 6 of file embeddingCommandLineOptions.py.

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