ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/algomez/GenAnalyzer/genanalyzer_cfg.py
Revision: 1.2
Committed: Tue Jun 4 18:53:46 2013 UTC (11 years, 11 months ago) by algomez
Content type: text/x-python
Branch: MAIN
Changes since 1.1: +23 -14 lines
Log Message:
*** empty log message ***

File Contents

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