1 |
# Import configurations
|
2 |
import FWCore.ParameterSet.Config as cms
|
3 |
process = cms.Process("Demo")
|
4 |
|
5 |
###############################
|
6 |
####### Parameters ############
|
7 |
###############################
|
8 |
from FWCore.ParameterSet.VarParsing import VarParsing
|
9 |
options = VarParsing ('standard') ### For a simple set of parameters
|
10 |
#options = VarParsing ('analysis') ### For a complete set of parameters
|
11 |
|
12 |
options.register ('st1',
|
13 |
0,
|
14 |
VarParsing.multiplicity.singleton,
|
15 |
VarParsing.varType.int,
|
16 |
'Mass for the Stop1')
|
17 |
|
18 |
options.register ('st2',
|
19 |
0,
|
20 |
VarParsing.multiplicity.singleton,
|
21 |
VarParsing.varType.int,
|
22 |
'Mass for the Stop2')
|
23 |
|
24 |
options.register ('use',
|
25 |
'',
|
26 |
VarParsing.multiplicity.singleton,
|
27 |
VarParsing.varType.string,
|
28 |
'Stop1 decay in')
|
29 |
options.parseArguments()
|
30 |
print options
|
31 |
|
32 |
###############################
|
33 |
########## Gen Setup ##########
|
34 |
###############################
|
35 |
|
36 |
## Maximal Number of Events
|
37 |
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
|
38 |
## Report every ..
|
39 |
process.load("FWCore.MessageService.MessageLogger_cfi")
|
40 |
process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(2000)
|
41 |
|
42 |
## Source
|
43 |
stop2 = str(options.st2) # Convert it into string only for inputfile names
|
44 |
stop1 = str(options.st1)
|
45 |
process.source = cms.Source("PoolSource",
|
46 |
fileNames = cms.untracked.vstring(
|
47 |
##### For normal process
|
48 |
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'_tlbsm_53x_v2_mc_1.root',
|
49 |
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'_tlbsm_53x_v2_mc_2.root',
|
50 |
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'_tlbsm_53x_v2_mc_3.root',
|
51 |
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'_tlbsm_53x_v2_mc_4.root'
|
52 |
|
53 |
)
|
54 |
)
|
55 |
|
56 |
## Output Dir
|
57 |
output_Dir='/uscms_data/d3/algomez/files/stops/GenPlots/st2_h_bb_st1_'+options.use+'_'+stop2+'_'+stop1+'/'
|
58 |
|
59 |
|
60 |
###############################
|
61 |
########## Gen Setup ##########
|
62 |
###############################
|
63 |
|
64 |
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
|
65 |
|
66 |
|
67 |
############################# The following EDAnalyzer are usefull for simple analysis,
|
68 |
############################# but I am not using them for the current GenAnalysis.
|
69 |
## Print Tree
|
70 |
process.printGenParticle = cms.EDAnalyzer("ParticleListDrawer",
|
71 |
#src = cms.InputTag("prunedGenParticles"),
|
72 |
src = cms.InputTag("genParticles"),
|
73 |
maxEventsToPrint = cms.untracked.int32(1)
|
74 |
)
|
75 |
|
76 |
|
77 |
## Some selections
|
78 |
process.genPartonClone = cms.EDFilter("CandViewShallowCloneProducer",
|
79 |
src = cms.InputTag("prunedGenParticles"),
|
80 |
cut = cms.string("(abs(pdgId) = 1 | abs(pdgId) = 2 | abs(pdgId) = 3 | abs(pdgId)=4) & status=3")
|
81 |
)
|
82 |
|
83 |
|
84 |
process.genBClone = cms.EDFilter("CandViewShallowCloneProducer",
|
85 |
src = cms.InputTag("prunedGenParticles"),
|
86 |
cut = cms.string("abs(pdgId) = 5 & status=3")
|
87 |
)
|
88 |
|
89 |
process.genPartonPlusBClone = cms.EDFilter("CandViewShallowCloneProducer",
|
90 |
src = cms.InputTag("prunedGenParticles"),
|
91 |
cut = cms.string("(abs(pdgId) = 1 | abs(pdgId) = 2 | abs(pdgId) = 3 | abs(pdgId)=4 | abs(pdgId)=5) & status=3")
|
92 |
)
|
93 |
|
94 |
## Simple Histos
|
95 |
process.partonHistos= cms.EDAnalyzer("CandViewHistoAnalyzer",
|
96 |
src = cms.InputTag("genPartonClone"),
|
97 |
histograms = cms.VPSet(
|
98 |
cms.PSet(
|
99 |
min = cms.untracked.double(0.0),
|
100 |
max = cms.untracked.double(300.0),
|
101 |
nbins = cms.untracked.int32(30),
|
102 |
name = cms.untracked.string("jets_Pt"),
|
103 |
description = cms.untracked.string("jets pt [GeV/c^{2}]"),
|
104 |
plotquantity = cms.untracked.string("pt")
|
105 |
)
|
106 |
)
|
107 |
)
|
108 |
|
109 |
process.bHistos= cms.EDAnalyzer("CandViewHistoAnalyzer",
|
110 |
src = cms.InputTag("genBClone"),
|
111 |
histograms = cms.VPSet(
|
112 |
cms.PSet(
|
113 |
min = cms.untracked.double(0.0),
|
114 |
max = cms.untracked.double(300.0),
|
115 |
nbins = cms.untracked.int32(30),
|
116 |
name = cms.untracked.string("b_Pt"),
|
117 |
description = cms.untracked.string("b pt [GeV/c^{2}]"),
|
118 |
plotquantity = cms.untracked.string("pt")
|
119 |
)
|
120 |
)
|
121 |
)
|
122 |
|
123 |
process.partonPlusBHistos= cms.EDAnalyzer("CandViewHistoAnalyzer",
|
124 |
src = cms.InputTag("genPartonPlusBClone"),
|
125 |
histograms = cms.VPSet(
|
126 |
cms.PSet(
|
127 |
min = cms.untracked.double(0.0),
|
128 |
max = cms.untracked.double(300.0),
|
129 |
nbins = cms.untracked.int32(30),
|
130 |
name = cms.untracked.string("jets_b_Pt"),
|
131 |
description = cms.untracked.string("jets + b pt [GeV/c^{2}]"),
|
132 |
plotquantity = cms.untracked.string("pt")
|
133 |
)
|
134 |
)
|
135 |
)
|
136 |
|
137 |
dummyprocess = -999
|
138 |
if options.use=='bj': dummyprocess = 1
|
139 |
else: dummyprocess = 0
|
140 |
############################
|
141 |
###### My Analyzer ########
|
142 |
############################
|
143 |
process.genHistos = cms.EDAnalyzer('GenAnalyzer',
|
144 |
#src = cms.InputTag("prunedGenParticles"),
|
145 |
src = cms.InputTag("genParticles"),
|
146 |
stop1Mass = cms.double(options.st1),
|
147 |
stop2Mass = cms.double(options.st2),
|
148 |
st1decay = cms.double(dummyprocess)
|
149 |
)
|
150 |
|
151 |
#############################
|
152 |
###### Output module #######
|
153 |
#############################
|
154 |
process.TFileService = cms.Service("TFileService",
|
155 |
fileName = cms.string (output_Dir+options.output)
|
156 |
)
|
157 |
|
158 |
|
159 |
#############################
|
160 |
########## Run ##############
|
161 |
#############################
|
162 |
process.p = cms.Path(process.printGenParticle*process.genHistos)
|
163 |
#process.p = cms.Path(process.genPartonClone*process.partonHistos*process.genBClone*process.bHistos*process.genPartonPlusBClone*process.partonPlusBHistos*process.genHistos)
|
164 |
|
165 |
#process.outpath = cms.EndPath(process.out)
|