CMS 3D CMS Logo

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