1 |
algomez |
1.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 ('stop1mass',
|
13 |
|
|
0,
|
14 |
|
|
VarParsing.multiplicity.singleton,
|
15 |
|
|
VarParsing.varType.int,
|
16 |
|
|
'Mass for the Stop1')
|
17 |
|
|
|
18 |
|
|
options.register ('stop2mass',
|
19 |
|
|
0,
|
20 |
|
|
VarParsing.multiplicity.singleton,
|
21 |
|
|
VarParsing.varType.int,
|
22 |
|
|
'Mass for the Stop2')
|
23 |
|
|
|
24 |
|
|
#options.register ('useData',
|
25 |
|
|
# False,
|
26 |
|
|
# VarParsing.multiplicity.singleton,
|
27 |
|
|
# VarParsing.varType.int,
|
28 |
|
|
# 'Run this on real data')
|
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(100)
|
41 |
|
|
|
42 |
|
|
## Source
|
43 |
|
|
process.source = cms.Source("PoolSource",
|
44 |
|
|
fileNames = cms.untracked.vstring(
|
45 |
|
|
# 'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_bj_250_100/st2_h_bb_st1_bj_250_100_tlbsm_53x_v2_mcst2_h_bb_st1_bj_250_100_1_tlbsm_53x_v2_mc.root',
|
46 |
|
|
# 'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_bj_250_100/st2_h_bb_st1_bj_250_100_tlbsm_53x_v2_mcst2_h_bb_st1_bj_250_100_2_tlbsm_53x_v2_mc.root',
|
47 |
|
|
# 'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_bj_250_100/st2_h_bb_st1_bj_250_100_tlbsm_53x_v2_mcst2_h_bb_st1_bj_250_100_3_tlbsm_53x_v2_mc.root',
|
48 |
|
|
# 'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_bj_250_100/st2_h_bb_st1_bj_250_100_tlbsm_53x_v2_mcst2_h_bb_st1_bj_250_100_4_tlbsm_53x_v2_mc.root'
|
49 |
|
|
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_jj_250_100/st2_h_bb_st1_jj_250_100_tlbsm_53x_v2_mc_2.root',
|
50 |
|
|
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_jj_250_100/st2_h_bb_st1_jj_250_100_tlbsm_53x_v2_mc_3.root',
|
51 |
|
|
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_jj_250_100/st2_h_bb_st1_jj_250_100_tlbsm_53x_v2_mc_4.root',
|
52 |
|
|
'file:/eos/uscms/store/user/algomez/Stops/PATTuples/st2_h_bb_st1_jj_250_100/st2_h_bb_st1_jj_250_100_tlbsm_53x_v2_mc.root'
|
53 |
|
|
|
54 |
|
|
)
|
55 |
|
|
)
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
###############################
|
59 |
|
|
########## Gen Setup ##########
|
60 |
|
|
###############################
|
61 |
|
|
|
62 |
|
|
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
## Print Tree
|
66 |
|
|
process.printGenParticle = cms.EDAnalyzer("ParticleListDrawer",
|
67 |
|
|
src = cms.InputTag("prunedGenParticles"),
|
68 |
|
|
maxEventsToPrint = cms.untracked.int32(1)
|
69 |
|
|
)
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
## Some selections
|
73 |
|
|
process.genPartonClone = cms.EDFilter("CandViewShallowCloneProducer",
|
74 |
|
|
src = cms.InputTag("prunedGenParticles"),
|
75 |
|
|
cut = cms.string("(abs(pdgId) = 1 | abs(pdgId) = 2 | abs(pdgId) = 3 | abs(pdgId)=4) & status=3")
|
76 |
|
|
)
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
process.genBClone = cms.EDFilter("CandViewShallowCloneProducer",
|
80 |
|
|
src = cms.InputTag("prunedGenParticles"),
|
81 |
|
|
cut = cms.string("abs(pdgId) = 5 & status=3")
|
82 |
|
|
)
|
83 |
|
|
|
84 |
|
|
process.genPartonPlusBClone = cms.EDFilter("CandViewShallowCloneProducer",
|
85 |
|
|
src = cms.InputTag("prunedGenParticles"),
|
86 |
|
|
cut = cms.string("(abs(pdgId) = 1 | abs(pdgId) = 2 | abs(pdgId) = 3 | abs(pdgId)=4 | abs(pdgId)=5) & status=3")
|
87 |
|
|
)
|
88 |
|
|
|
89 |
|
|
## Simple Histos
|
90 |
|
|
process.partonHistos= cms.EDAnalyzer("CandViewHistoAnalyzer",
|
91 |
|
|
src = cms.InputTag("genPartonClone"),
|
92 |
|
|
histograms = cms.VPSet(
|
93 |
|
|
cms.PSet(
|
94 |
|
|
min = cms.untracked.double(0.0),
|
95 |
|
|
max = cms.untracked.double(300.0),
|
96 |
|
|
nbins = cms.untracked.int32(30),
|
97 |
|
|
name = cms.untracked.string("jets_Pt"),
|
98 |
|
|
description = cms.untracked.string("jets pt [GeV/c^{2}]"),
|
99 |
|
|
plotquantity = cms.untracked.string("pt")
|
100 |
|
|
)
|
101 |
|
|
)
|
102 |
|
|
)
|
103 |
|
|
|
104 |
|
|
process.bHistos= cms.EDAnalyzer("CandViewHistoAnalyzer",
|
105 |
|
|
src = cms.InputTag("genBClone"),
|
106 |
|
|
histograms = cms.VPSet(
|
107 |
|
|
cms.PSet(
|
108 |
|
|
min = cms.untracked.double(0.0),
|
109 |
|
|
max = cms.untracked.double(300.0),
|
110 |
|
|
nbins = cms.untracked.int32(30),
|
111 |
|
|
name = cms.untracked.string("b_Pt"),
|
112 |
|
|
description = cms.untracked.string("b pt [GeV/c^{2}]"),
|
113 |
|
|
plotquantity = cms.untracked.string("pt")
|
114 |
|
|
)
|
115 |
|
|
)
|
116 |
|
|
)
|
117 |
|
|
|
118 |
|
|
process.partonPlusBHistos= cms.EDAnalyzer("CandViewHistoAnalyzer",
|
119 |
|
|
src = cms.InputTag("genPartonPlusBClone"),
|
120 |
|
|
histograms = cms.VPSet(
|
121 |
|
|
cms.PSet(
|
122 |
|
|
min = cms.untracked.double(0.0),
|
123 |
|
|
max = cms.untracked.double(300.0),
|
124 |
|
|
nbins = cms.untracked.int32(30),
|
125 |
|
|
name = cms.untracked.string("jets_b_Pt"),
|
126 |
|
|
description = cms.untracked.string("jets + b pt [GeV/c^{2}]"),
|
127 |
|
|
plotquantity = cms.untracked.string("pt")
|
128 |
|
|
)
|
129 |
|
|
)
|
130 |
|
|
)
|
131 |
|
|
|
132 |
|
|
############################
|
133 |
|
|
###### My Analyzer ########
|
134 |
|
|
############################
|
135 |
|
|
process.genHistos = cms.EDAnalyzer('GenAnalyzer',
|
136 |
|
|
src = cms.InputTag("prunedGenParticles"),
|
137 |
|
|
stop1Mass = cms.double(options.stop1mass),
|
138 |
|
|
stop2Mass = cms.double(options.stop2mass)
|
139 |
|
|
)
|
140 |
|
|
|
141 |
|
|
#############################
|
142 |
|
|
###### Output module #######
|
143 |
|
|
#############################
|
144 |
|
|
process.TFileService = cms.Service("TFileService",
|
145 |
|
|
fileName = cms.string (options.output)
|
146 |
|
|
)
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
#############################
|
150 |
|
|
########## Run ##############
|
151 |
|
|
#############################
|
152 |
|
|
process.p = cms.Path(process.printGenParticle*process.genHistos)
|
153 |
|
|
#process.p = cms.Path(process.genPartonClone*process.partonHistos*process.genBClone*process.bHistos*process.genPartonPlusBClone*process.partonPlusBHistos*process.genHistos)
|
154 |
|
|
|
155 |
|
|
#process.outpath = cms.EndPath(process.out)
|