4 from McParticleTools.McParticleToolsConf
import EtaPtFilterTool
5 from McParticleTools.McParticleToolsConf
import TruthParticleCnvTool
7 from McParticleAlgs.McParticleAlgsConf
import TruthParticleBuilder
13 name = "McAodBuilder" ):
14 super( test_McAodBuilder, self ).
__init__( name )
19 if not hasattr(handle,
'FilterTool'):
25 handle.FilterTool = EtaPtFilterTool()
26 handle.FilterTool.McEvents =
"GEN_EVENT"
27 handle.FilterTool.McEventsOutput =
"GEN_AOD"
30 if not hasattr(handle,
'CnvTool'):
36 handle.CnvTool = TruthParticleCnvTool()
42 from McParticleTools.McParticleToolsConf
import GenAodValidationTool
43 from McParticleTools.McParticleToolsConf
import HepMcWriterTool
44 from McParticleAlgs.McParticleAlgsConf
import McAodValidationAlg
50 def __init__( self, name = "McAodValidation" ):
51 super( test_McAodValidation, self ).
__init__( name )
57 handle.ValidationTools = [
58 "GenAodValidationTool/GenAodValidation",
59 "SpclMcValidationTool/SpclMcValidation",
62 if not hasattr(handle,
"GenAodValidation"):
63 genAodValidation = GenAodValidationTool(
"GenAodValidation" )
64 genAodValidation.RefMcEvents =
"GEN_EVENT"
65 genAodValidation += HepMcWriterTool(
"RefHepMcWriterTool")
66 genAodValidation += HepMcWriterTool(
"CheckHepMcWriterTool")
68 handle += genAodValidation
73 from McParticleTools.McParticleToolsConf
import McVtxFilterTool
74 from McParticleAlgs.McParticleAlgsConf
import McAodFilter
81 super( test_McAodFilter, self ).
__init__( name )
86 handle.DoGenAod =
True
87 handle.McVtxFilterTool = McVtxFilterTool()
88 handle.McVtxFilterTool.McEvents =
"GEN_EVENT"
89 handle.McVtxFilterTool.McEventsOutput =
"MyGEN_EVENT"
90 handle.McVtxFilterTool.DoSignalProcessVtx =
True
92 handle.DoTruthParticles =
True
93 handle.TruthParticleCnvTool = TruthParticleCnvTool()
94 handle.TruthParticleCnvTool.McEvents =
"MyGEN_EVENT"
95 handle.TruthParticleCnvTool.TruthParticlesOutput =
"MySpclMC"
102 ## -- Generator helper
103 from Pythia_i.Pythia_iConf import Pythia
104 from Herwig_i.Herwig_iConf import Herwig
105 from Herwig_i.Herwig_iConf import Jimmy
107 def makeGenEvents( genName = "Pythia",
108 genProcess = "ttbar",
109 cfgGenName = "EvGen" ):
110 Little helper method to provide a quick way to produce Mc-events
112 if genName.lower() not in [ "pythia", "jimmy", "herwig" ]:
113 raise RuntimeError, "Unknown GENERATOR [%s]" % str(genName)
114 if genProcess not in ["ttbar", "HiggsTo4Leptons", "Z+j"]:
115 raise RuntimeError, "Unknown PROCESS [%s]" % str(genProcess)
117 if genName.lower() == "pythia":
118 genAlg = Pythia(cfgGenName)
119 if genProcess == "Z+j":
120 genAlg.PythiaCommand = [ "pysubs msel 13",
123 elif genProcess == "ttbar":
124 # semi-leptonic decay of a ttbar pair (lepton=e,mu)
125 genAlg.PythiaCommand = [
129 # Customisation of subprocess generation
130 "pysubs msub 81 1", # qqbar -> QQbar
131 "pysubs msub 82 1", # gq -> QQbar
132 "pysubs msub 96 1", # SemiHard QCD 2 -> 2
134 "pydat3 mdme 41 1 0", # gt
135 "pydat3 mdme 42 1 0", # gamma t
136 "pydat3 mdme 43 1 0", # Z0 t
137 "pydat3 mdme 44 1 0", # W+ d
138 "pydat3 mdme 45 1 0", # W+ s
139 "pydat3 mdme 46 1 1", # W+ b
140 "pydat3 mdme 47 1 0", # W+ b'
141 "pydat3 mdme 48 1 0", # h0 t
142 "pydat3 mdme 49 1 0", # H+ b
143 "pydat3 mdme 50 1 0", # ~chi_10 ~t_1
144 "pydat3 mdme 51 1 0", # ~chi_20 ~t_1
145 "pydat3 mdme 52 1 0", # ~chi_30 ~t_1
146 "pydat3 mdme 53 1 0", # ~chi_40 ~t_1
147 "pydat3 mdme 54 1 0", # ~g ~t_1
148 "pydat3 mdme 55 1 0", # ~gravitino ~t_1
150 "pydat3 mdme 190 1 2", # dbar u
151 "pydat3 mdme 191 1 2", # dbar c
152 "pydat3 mdme 192 1 2", # dbar t
153 "pydat3 mdme 193 1 0", # dbar t'
154 "pydat3 mdme 194 1 2", # sbar u
155 "pydat3 mdme 195 1 2", # sbar c
156 "pydat3 mdme 196 1 2", # sbar t
157 "pydat3 mdme 197 1 0", # sbar t'
158 "pydat3 mdme 198 1 2", # bbar u
159 "pydat3 mdme 199 1 2", # bbar c
160 "pydat3 mdme 200 1 2", # bbar t
161 "pydat3 mdme 201 1 0", # bbar t'
162 "pydat3 mdme 202 1 0", # b'bar u
163 "pydat3 mdme 203 1 0", # b'bar c
164 "pydat3 mdme 204 1 0", # b'bar t
165 "pydat3 mdme 205 1 0", # b'bar t'
166 "pydat3 mdme 206 1 0", # e+ nu_e
167 "pydat3 mdme 207 1 3", # mu+ nu_mu
168 "pydat3 mdme 208 1 0", # tau+ nu_tau
169 "pydat3 mdme 209 1 0" # tau'+ nu'_tau
171 elif genProcess == "HiggsTo4Leptons":
172 genAlg.PythiaCommand = [
174 "pydat2 pmas 25 1 150.",
175 # Select Higgs production
178 "pydat3 mdme 210 1 0",
179 "pydat3 mdme 211 1 0",
180 "pydat3 mdme 212 1 0",
181 "pydat3 mdme 213 1 0",
182 "pydat3 mdme 214 1 0",
183 "pydat3 mdme 215 1 0",
184 "pydat3 mdme 218 1 0",
185 "pydat3 mdme 219 1 0",
186 "pydat3 mdme 220 1 0",
187 "pydat3 mdme 222 1 0",
188 "pydat3 mdme 223 1 0",
189 "pydat3 mdme 224 1 0",
190 "pydat3 mdme 225 1 1",
191 "pydat3 mdme 226 1 0",
194 "pydat3 mdme 174 1 0",
195 "pydat3 mdme 175 1 0",
196 "pydat3 mdme 176 1 0",
197 "pydat3 mdme 177 1 0",
198 "pydat3 mdme 178 1 0",
199 "pydat3 mdme 179 1 0",
200 "pydat3 mdme 180 1 0",
201 "pydat3 mdme 181 1 0",
202 "pydat3 mdme 182 1 1",
203 "pydat3 mdme 183 1 0",
204 "pydat3 mdme 184 1 1",
205 "pydat3 mdme 185 1 0",
206 "pydat3 mdme 186 1 0",
207 "pydat3 mdme 187 1 0",
208 "pydat3 mdme 188 1 0",
209 "pydat3 mdme 189 1 0"
212 raise RuntimeError, "Unknown PROCESS [%s]" % str(genProcess)
214 # Some ISR,FSR,MultipleInteractions and Hadronization parameters
215 genAlg.PythiaCommand += [
216 "pypars mstp 61 1", # ISR
217 "pypars mstp 71 1", # FSR
218 "pypars mstp 81 1", # MultInt
219 "pypars mstp 111 1", # Hadronization
222 # Pythia listing documentation level (0-1-2)
223 Pythia.PythiaCommand += [ "pypars mstp 125 2" ]
226 elif genName.lower() == "jimmy":
227 genAlg = Jimmy(cfgGenName)
228 if genProcess == "Z+j":
229 genAlg.JimmyCommand = [
236 elif genProcess == "ttbar":
238 osCmd = commands.getoutput( "get_files inparmMcAtNlo.dat" )
239 # osCmd = commands.getoutput( "get_files tt.events" )
240 genAlg.JimmyCommand = [
242 "modpdf 10042", "autpdf HWLHAPDF",
249 raise RuntimeError, "Unknown PROCESS [%s]" % std(genProcess)
251 elif genName.lower() == "Herwig":
252 genAlg = Herwig(cfgGenName)
253 if genProcess == "Z+j":
254 genAlg.HerwigCommand = [
260 elif genProcess == "ttbar":
261 genAlg.HerwigCommand = [
268 raise RuntimeError, "Unknown PROCESS [%s]" % str(genProcess)
271 raise RuntimeError, "Unknown GENERATOR [%s]" % str(genName)