ATLAS Offline Software
Lb2Lll.py
Go to the documentation of this file.
1 
6 
7 #--------------------------------------------------------------
8 # Global job-driving options
9 #--------------------------------------------------------------
10 
11 EvtMax = 1000
12 #EvtMax = MYNOEVENTS
13 
14 antiParticle = False
15 
16 filterLVL1trigger = True
17 filterLVL2trigger = True
18 pTcutLVL1trigger = 6000
19 pTcutLVL2trigger = 4000
20 filterHadrons = True
21 bQuarksBSignalFilter = False
22 
23 fastGeneration = False
24 doNotWritePOOL = False
25 readRndFromFile = False
26 outLevelBChains = DEBUG
27 ntupleType = "AANT"
28 bothLambdaBFinsel = False
29 forceHadronization = False
30 repeatHadronization = 20.
31 oldTypeSetup = False
32 
33 #--------------------------------------------------------------
34 # General application configuration options
35 #--------------------------------------------------------------
36 
37 if oldTypeSetup:
38  theApp.setup( MONTECARLO )
39 else:
40  import AthenaCommon.AtlasUnixGeneratorJob
41 
42 from PartPropSvc.PartPropSvcConf import PartPropSvc
43 svcMgr += PartPropSvc()
44 
45 
46 #--------------------------------------------------------------
47 # Private application configuration options
48 #--------------------------------------------------------------
49 svcMgr.AuditorSvc.Auditors = [ "ChronoAuditor" ]
50 
51 #--------------------------------------------------------------
52 # Algorithms
53 #--------------------------------------------------------------
54 from AthenaCommon.AlgSequence import AlgSequence
55 topAlg=AlgSequence()
56 
57 from PythiaB.PythiaBConf import PythiaB
58 topAlg += PythiaB()
59 PythiaB = topAlg.PythiaB
60 
61 from EvtGen_i.EvtGen_iConf import EvtDecay
62 topAlg += EvtDecay()
63 EvtDecay = topAlg.EvtDecay
64 
65 from GeneratorFilters.GeneratorFiltersConf import BSignalFilter
66 topAlg += BSignalFilter()
67 BSignalFilter = topAlg.BSignalFilter
68 
69 #--------------------------------------------------------------
70 # Number of events to be accepted,
71 # rewritten if use B job submition script
72 # RunNumber, FirstEvent rewritten if use B job submition script
73 #--------------------------------------------------------------
74 
75 if oldTypeSetup:
76  EventSelector = Service ("EventSelector")
77 
78 theApp.EvtMax = EvtMax
79 svcMgr.EventSelector.RunNumber = 18900
80 #EventSelector.RunNumber = MYDSN
81 svcMgr.EventSelector.FirstEvent = 1
82 #EventSelector.FirstEvent = MYSKIP
83 
84 #--------------------------------------------------------------
85 #User random number seeds - re-written if use B job submition script
86 #--------------------------------------------------------------
87 
88 if readRndFromFile:
89  print("ERROR readRndFromFile not currently supported -- ignoring.")
90  pass
91 
92 #--------------------------------------------------------------
93 # Output level (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
94 #--------------------------------------------------------------
95 
96 svcMgr.MessageSvc.OutputLevel = INFO
97 svcMgr.MessageSvc.defaultLimit = 9999999 # all messages
98 
99 #--------------------------------------------------------------
100 # Parameters specific to PythiaB
101 #--------------------------------------------------------------
102 
103 include( "EvtGen_i/StopPytWeakBdecays.py" )
104 
105 # Apply Lambda_b0 user-finsel selection
106 PythiaB.ForceDecayChannel = "LambdabmumuLambda"
107 if antiParticle:
108  PythiaB.DecayChannelParameters = [-1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
109 else:
110  PythiaB.DecayChannelParameters = [+1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
111 
112 if bothLambdaBFinsel:
113  PythiaB.DecayChannelParameters = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
114 
115 #--------------------------------------------------------------
116 # Pythia parameters optimal for beauty production
117 #--------------------------------------------------------------
118 
119 #include( "PythiaB/Btune.py" )
120 
121 # 'msel 5' is only for fast tests! for correct b-producion you should use 'msel 1'
122 if fastGeneration:
123  PythiaB.PythiaCommand += ["pysubs ckin 3 6.", "pysubs msel 5"]
124 else:
125  PythiaB.PythiaCommand += ["pysubs ckin 3 6.", "pysubs msel 1"]
126 
127 # Ignore almost all pythia errors
128 PythiaB.PythiaCommand += [ "pydat1 mstu 22 1000" ]
129 
130 # Selections on b quarks
131 if antiParticle:
132  PythiaB.cutbq = ["0. 0. or 9. 3.5"]
133 else:
134  PythiaB.cutbq = ["9. 3.5 or 0. 0."]
135 #PythiaB.cutbq = ["0. 1000. or 0. 1000."]
136 
137 # Number of repeated hadronization mhadr
138 PythiaB.mhadr = repeatHadronization
139 
140 # Forced hadronizaition to Lambda_b0
141 if forceHadronization:
142  PythiaB.forceHadronization = "Lambdab"
143  if antiParticle:
144  PythiaB.HadronizationParameters = [-1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
145  else:
146  PythiaB.HadronizationParameters = [+1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
147 
148 # For how many events store B-chain in NTUPLE
149 BSignalFilter.OutputLevel = outLevelBChains
150 BSignalFilter.SignaltoNtup = EvtMax
151 
152 # Level 1 Muon Cuts
153 BSignalFilter.LVL1MuonCutOn = False
154 BSignalFilter.LVL1MuonCutPT = pTcutLVL1trigger
155 BSignalFilter.LVL1MuonCutEta = 2.5
156 
157 # Level 2 lepton cuts - these will only function if LVL1 trigger used
158 BSignalFilter.LVL2MuonCutOn = False
159 BSignalFilter.LVL2MuonCutPT = pTcutLVL2trigger
160 BSignalFilter.LVL2MuonCutEta = 2.5
161 
162 # Hadronic tracks cuts
163 BSignalFilter.Cuts_Final_hadrons_switch = False
164 BSignalFilter.Cuts_Final_hadrons_pT = 500.0
165 BSignalFilter.Cuts_Final_hadrons_eta = 2.5
166 
167 # Switches for trigger levels
168 if filterLVL1trigger:
169  BSignalFilter.LVL1MuonCutOn = True
170 if filterLVL2trigger:
171  BSignalFilter.LVL2MuonCutOn = True
172 if filterHadrons:
173  BSignalFilter.Cuts_Final_hadrons_switch = True
174  if antiParticle:
175  BSignalFilter.BParticle_cuts = -5122
176  else:
177  BSignalFilter.BParticle_cuts = 5122
178 
179 if bQuarksBSignalFilter:
180  BSignalFilter.StoreBQuarks = True
181 
182 #--------------------------------------------------------------
183 # Your control of EvtGen
184 #--------------------------------------------------------------
185 
186 # If you do not define a name to your Decay-table file here
187 # then EvtGen will work with a default decay table DECAY.DEC
188 EvtDecay.OutputLevel = outLevelBChains
189 if antiParticle:
190  EvtDecay.userDecayTableName = "MYDECAY_antiLb2Lll.DEC"
191 else:
192  EvtDecay.userDecayTableName = "MYDECAY_Lb2Lll.DEC"
193 
194 #--------------------------------------------------------------
195 # Histogram & Ntuple Persistency
196 #--------------------------------------------------------------
197 
198 if ntupleType == "ROOT":
199  theApp.HistogramPersistency = "ROOT"
200  svcMgr.NTupleSvc = Service( "NTupleSvc" )
201  svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='athena.evgen.ntup' OPT='NEW'" ]
202 
203 if ntupleType == "HBOOK":
204  theApp.Dlls += [ "HbookCnv" ]
205  theApp.HistogramPersistency = "HBOOK"
206  HbookHistSvc = Service( "HbookHistSvc" )
207  HbookHistSvc.NPAWC = 1500000
208  #HbookHistSvc.RecordLength = 1024
209  #HbookHistSvc.IQUEST10 = 65000
210  svcMgr.NTupleSvc = Service( "NTupleSvc" )
211  svcMgr.NTupleSvc.NPAWC = 15000000
212  svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='athena.evgen.ntup' OPT='NEW'" ]
213 
214 if ntupleType == "AANT":
215  theApp.Dlls += [ "AnalysisTools" ]
216  THistSvc = Service ( "THistSvc" )
217  THistSvc.Output = ["AANT DATAFILE='athena.evgen.ntup' OPT='NEW'"]
218  theApp.TopAlg += [ "AANTupleStream" ]
219  AANTupleStream = Algorithm( "AANTupleStream" )
220  AANTupleStream.ExtraRefNames = [ "" ]
221  AANTupleStream.OutputName = 'athena.evgen.ntup'
222  AANTupleStream.ExistDataHeader = False
223  AANTupleStream.OutputLevel = VERBOSE
224 
225 HistogramPersistencySvc = Service( "HistogramPersistencySvc" )
226 HistogramPersistencySvc.OutputFile = "histo.root"
227 
228 #---------------------------------------------------------------
229 # Pool Persistency
230 #---------------------------------------------------------------
231 
232 if not doNotWritePOOL:
233  from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
234  include( "GeneratorObjectsAthenaPool/GeneratorObjectsAthenaPool_joboptions.py" )
235 
236  Stream1 = AthenaPoolOutputStream( "Stream1" )
237  Stream1.OutputFile = "athena.evgen.root"
238  # 2101 = EventInfo
239  # 133273 = MCTruth (HepMC)
240  Stream1.ItemList += [ "2101#*", "133273#*" ]
241  Stream1.AcceptAlgs = [ "BSignalFilter" ]
242 
243  include("AthenaSealSvc/AthenaSealSvc_joboptions.py" )
244  AthenaSealSvc.CheckDictionary = TRUE
245 
246 #==============================================================
247 #
248 # End of job options file
249 #
250 
BSignalFilter
Definition: BSignalFilter.py:1
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
python.FakeAthena.Algorithm
def Algorithm(name)
Definition: FakeAthena.py:41
Lb2Lll.PythiaB
PythiaB
Definition: Lb2Lll.py:59
python.FakeAthena.Service
def Service(name)
Definition: FakeAthena.py:38
Lb2Lll.EvtDecay
EvtDecay
Definition: Lb2Lll.py:63
python.Include.include
include
Definition: Include.py:319
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
python.CreateOutputStreams.AthenaPoolOutputStream
def AthenaPoolOutputStream
backward compat
Definition: CreateOutputStreams.py:144