2 This module contains convenience functions to setup most commonly used physics
3 generators correctly with their default settings. More information can be found
4 in `BELLE2-NOTE-PH-2015-006`_
6 Contact: Torben Ferber (ferber@physics.ubc.ca)
8 .. _BELLE2-NOTE-PH-2015-006: https://docs.belle2.org/record/282
12 from ROOT
import Belle2
18 """Return the default DECAY.dec for Belle2"""
30 MaxChargedTheta=180.0,
37 stableParticles=False):
39 Adds generator preselection.
40 Should be added to the path after the generator.add_abc_generator but before simulation.add_simulation modules
41 It uses all particles from the event generator (i.e. primary, non-virtual, non-initial particles).
42 It checks if the required conditions are fullfilled.
43 If not, the events are given to the emptypath.
44 The main usecase is a reduction of simulation time.
45 Note that you have to multiply the generated cross section by the retention fraction of the preselection.
48 path (basf2.Path): path where the generator should be added
49 emptypath (basf2.Path): path where the skipped events are given to
50 nChargedMin (int): minimum number of charged particles
51 nChargedMax (int): maximum number of charged particles
52 MinChargedP (float): minimum charged momentum [GeV]
53 MinChargedPt (float): minimum charged transverse momentum (pt) [GeV]
54 MinChargedTheta (float): minimum polar angle of charged particle [deg]
55 MaxChargedTheta (float): maximum polar angle of charged particle [deg]
56 nPhotonMin (int): minimum number of photons
57 nPhotonMax (int): maximum number of photons
58 MinPhotonEnergy (float): minimum photon energy [GeV]
59 MinPhotonTheta (float): minimum polar angle of photon [deg]
60 MaxPhotonTheta (float): maximum polar angle of photon [deg]
61 applyInCMS (bool): if true apply the P,Pt,theta, and energy cuts in the center of mass frame
62 stableParticles (bool): if true apply the selection criteria for stable particles in the generator
65 generatorpreselection = path.add_module(
'GeneratorPreselection',
66 nChargedMin=nChargedMin,
67 nChargedMax=nChargedMax,
68 MinChargedP=MinChargedP,
69 MinChargedPt=MinChargedPt,
70 MinChargedTheta=MinChargedTheta,
71 MaxChargedTheta=MaxChargedTheta,
72 nPhotonMin=nPhotonMin,
73 nPhotonMax=nPhotonMax,
74 MinPhotonEnergy=MinPhotonEnergy,
75 MinPhotonTheta=MinPhotonTheta,
76 MaxPhotonTheta=MaxPhotonTheta,
77 stableParticles=stableParticles
81 generatorpreselection.if_value(
'<11', emptypath)
94 Add the default two photon generator for four fermion final states
97 path (basf2.Path): path where the generator should be added
98 finalstate (str): either "e+e-e+e-", "e+e-mu+mu-", "e+e-tau+tau-", "mu+mu-mu+mu-" or "mu+mu-tau+tau-"
99 preselection (bool): if True, select events with at least one medium pt particle in the CDC acceptance
100 enableTauDecays (bool): if True, allow tau leptons to decay (using EvtGen)
103 if finalstate ==
'e+e-e+e-':
106 aafh_subgeneratorWeights = [1.0, 7.986e+01, 5.798e+04, 3.898e+05, 1.0, 1.664e+00, 2.812e+00, 7.321e-01]
108 aafh_subgeneratorWeights = subweights
109 if abs(minmass - 0.5) > 0.01
and not subweights:
110 B2WARNING(
"add_aafh_generator: non default invariant mass cut without updated subweights requested!")
111 elif finalstate ==
'e+e-mu+mu-':
114 aafh_subgeneratorWeights = [1.000e+00, 1.520e+01, 3.106e+03, 6.374e+03, 1.000e+00, 1.778e+00, 6.075e+00, 6.512e+00]
116 aafh_subgeneratorWeights = subweights
117 if abs(minmass - 0.5) > 0.01
and not subweights:
118 B2WARNING(
"add_aafh_generator: non default invariant mass cut without updated subweights requested!")
119 elif finalstate ==
'e+e-tau+tau-':
124 aafh_subgeneratorWeights = [1.000e+00, 2.214e+00, 1.202e+01, 1.536e+01, 1.000e+00, 1.664e+00, 1.680e+01, 6.934e+00]
126 aafh_subgeneratorWeights = subweights
129 f
"You requested a generator preselection for the final state {finalstate}: "
130 "please consider to remove it, since the cross section is small.")
131 elif finalstate ==
'mu+mu-mu+mu-':
136 aafh_subgeneratorWeights = [0.000e+00, 0.000e+00, 1.000e+00, 3.726e+00, 1.000e+00, 1.778e+00, 1.000e+00, 1.094e+00]
138 aafh_subgeneratorWeights = subweights
141 f
"You requested a generator preselection for the final state {finalstate}: "
142 "please consider to remove it, since the cross section is small.")
143 elif finalstate ==
'mu+mu-tau+tau-':
149 aafh_subgeneratorWeights = [0.000e+00, 0.000e+00, 1.000e+00, 1.715e+00, 1.000e+00, 1.778e+00, 1.000e+00, 6.257e-01]
151 aafh_subgeneratorWeights = subweights
154 f
"You requested a generator preselection for the final state {finalstate}: "
155 "please consider to remove it, since the cross section is small.")
156 elif finalstate ==
'tau+tau-tau+tau-':
157 B2FATAL(f
"AAFH is not able to generate the {finalstate} final state. Please use KoralW instead.")
159 B2FATAL(f
"add_aafh_generator final state not supported: {finalstate}")
161 aafh_maxSubgeneratorWeight = maxsubweight
162 aafh_maxFinalWeight = maxfinalweight
168 maxSubgeneratorWeight=aafh_maxSubgeneratorWeight,
169 maxFinalWeight=aafh_maxFinalWeight,
170 subgeneratorWeights=aafh_subgeneratorWeights,
171 suppressionLimits=[1e100] * 4,
176 generator_emptypath = create_path()
179 emptypath=generator_emptypath,
182 MinChargedTheta=17.0,
183 MaxChargedTheta=150.0)
185 if 'tau+tau-' in finalstate:
187 path.add_module(
'EvtGenDecay')
189 B2WARNING(
"The tau decays will not be generated.")
192 def add_kkmc_generator(path, finalstate='', signalconfigfile='', useTauolaBelle=False, tauinputfile=''):
194 Add the default muon pair and tau pair generator KKMC.
195 For tau decays, TauolaBelle and TauolaBelle2 are available.
196 Signal events can be produced setting a configuration file. Please notice that the configuration files for
197 TauolaBelle and TauolaBelle2 has a very different structure (see the examples below generators/examples).
200 path (basf2.Path): path where the generator should be added
201 finalstate(str): either "mu-mu+" or "tau-tau+"
202 signalconfigfile(str): File with configuration of the signal event to generate. It doesn't affect mu-mu+ decays.
203 useTauolaBelle(bool): If true, tau decay is driven by TauolaBelle. Otherwise TauolaBelle2 is used.
204 It doesn't affect mu-mu+ decays.
205 tauinputfile(str) : File to override KK2f_defaults. Only [sometimes] needed when tau decay is driven by TauolaBelle.
212 kkmc_logfile =
'kkmc_tautau.txt'
218 kkmc_tauconfigfile =
''
220 if finalstate ==
'tau+tau-':
221 B2WARNING(
"add_kkmc_generator: please set finalstate as 'tau-tau+'. 'tau+tau-' will be deprecated in the future"
222 " for consistency in the configuration files.")
223 finalstate =
'tau-tau+'
224 if finalstate ==
'mu+mu-':
225 B2WARNING(
"add_kkmc_generator: please set finalstate as 'mu-mu+'. 'mu+mu-' will be deprecated in the future for"
226 " consistency in the configuration files.")
227 finalstate =
'mu-mu+'
229 if finalstate ==
'tau-tau+':
231 B2INFO(
"Generating tau pair events with TauolaBelle")
236 if not signalconfigfile ==
'':
237 B2INFO(f
"Using config file defined by user: {signalconfigfile}")
239 kkmc_tauconfigfile = find_file(signalconfigfile)
241 kkmc_inputfile = find_file(signalconfigfile)
243 if not tauinputfile ==
'':
244 kkmc_inputfile = find_file(tauinputfile)
246 elif finalstate ==
'mu-mu+':
248 kkmc_logfile =
'kkmc_mumu.txt'
251 B2FATAL(
"add_kkmc_generator final state not supported: {}".format(finalstate))
254 kkgeninput = path.add_module(
256 tauinputFile=kkmc_inputfile,
257 KKdefaultFile=kkmc_config,
258 taudecaytableFile=kkmc_tauconfigfile,
259 kkmcoutputfilename=kkmc_logfile,
263 def add_evtgen_generator(path, finalstate='', signaldecfile=None, coherentMixing=True, parentParticle='Upsilon(4S)
'):
265 Add EvtGen for mixed and charged BB
268 path (basf2.Path): path where the generator should be added
269 finalstate (str): Either "charged" for B+/B- or "mixed" for B0/anti-B0
270 coherentMixing: Either True or False. Switches on or off the coherent decay of the B0-B0bar pair.
271 It should always be True, unless you are generating Y(5,6S) -> BBar. In the latter case,
272 setting it False solves the interla limiation of Evtgen that allows to make a
273 coherent decay only starting from the Y(4S).
274 parentParticle (str): initial state (used only if it is not Upsilon(4S).
278 if parentParticle !=
'Upsilon(3S)' and parentParticle !=
'Upsilon(4S)'\
279 and parentParticle !=
'Upsilon(5S)' and parentParticle !=
'Upsilon(6S)':
280 B2FATAL(
"add_evtgen_generator initial state not supported: {}".format(parentParticle))
282 if finalstate ==
'charged':
284 elif finalstate ==
'mixed':
286 elif finalstate ==
'signal':
287 evtgen_userdecfile = signaldecfile
289 B2FATAL(
"add_evtgen_generator final state not supported: {}".format(finalstate))
291 if signaldecfile
and finalstate
in [
'charged',
'mixed']:
292 B2WARNING(
"ignoring decfile: {}".format(signaldecfile))
295 if parentParticle ==
'Upsilon(3S)':
296 if finalstate !=
'signal':
297 B2FATAL(
"add_evtgen_generator initial state {} is supported only with 'signal' final state".format(parentParticle))
299 coherentMixing =
False
300 B2WARNING(
"add_evtgen_generator initial state {} has no BB mixing, now switching coherentMixing OFF"
301 .format(parentParticle))
303 if parentParticle ==
'Upsilon(5S)':
304 if finalstate !=
'signal':
305 B2FATAL(
"add_evtgen_generator initial state {} is supported only with 'signal' final state".format(parentParticle))
307 coherentMixing =
False
309 "add_evtgen_generator initial state {} is supported only with false coherentMixing, now switching it OFF"
310 .format(parentParticle))
313 if parentParticle ==
'Upsilon(6S)':
314 if finalstate !=
'signal':
315 B2FATAL(
"add_evtgen_generator initial state {} is supported only with 'signal' final state".format(parentParticle))
317 coherentMixing =
False
319 "add_evtgen_generator initial state {} is supported only with false coherentMixing, now switching it OFF"
320 .format(parentParticle))
323 evtgen = path.add_module(
325 userDECFile=evtgen_userdecfile,
326 CoherentMixing=coherentMixing,
327 ParentParticle=parentParticle
333 Add the default continuum generators KKMC + PYTHIA including their default decfiles and PYTHIA settings
336 `add_inclusive_continuum_generator()` to add continuum generation with preselected particles
339 path (basf2.Path): path where the generator should be added
340 finalstate (str): uubar, ddbar, ssbar, ccbar
341 userdecfile (str): EvtGen decfile used for particle decays
342 skip_on_failure (bool): If True stop event processing right after
343 fragmentation fails. Otherwise continue normally
350 kkmc_logfile =
'kkmc_uubar.txt'
357 if userdecfile ==
'':
360 B2INFO(
'Replacing default user decfile: {}'.format(userdecfile))
361 decay_user = userdecfile
369 if finalstate ==
'uubar':
371 elif finalstate ==
'ddbar':
373 kkmc_logfile =
'kkmc_ddbar.txt'
374 elif finalstate ==
'ssbar':
376 kkmc_logfile =
'kkmc_ssbar.txt'
377 elif finalstate ==
'ccbar':
380 kkmc_logfile =
'kkmc_ccbar.txt'
382 B2FATAL(
"add_continuum_generator final state not supported: {}".format(finalstate))
385 kkgeninput = path.add_module(
387 tauinputFile=kkmc_inputfile,
388 KKdefaultFile=kkmc_config,
389 taudecaytableFile=
'',
390 kkmcoutputfilename=kkmc_logfile,
395 fragmentation = path.add_module(
397 ParameterFile=pythia_config,
401 UserDecFile=decay_user,
407 generator_emptypath = create_path()
408 fragmentation.if_value(
'<1', generator_emptypath)
412 *, include_conjugates=True, max_iterations=100000):
414 Add continuum generation but require at least one of the given particles be
415 present in the event.
417 For example to only generate ccbar events which contain a "D*+" or an
418 electron one could would use
420 >>> add_inclusive_continuum_generator(path, "ccbar", ["D*+", 11])
422 If you are unsure how the particles are named in Belle II please have a look
423 at the ``b2help-particles`` executable or the `pdg` python module.
426 `add_continuum_generator()` to add continuum generation without preselection
429 finalstate (str): uubar, ddbar, ssbar, ccbar
430 particles (list): A list of particle names or pdg codes. An event is
431 only accepted if at lease one of those particles appears in the event.
432 userdecfile (str): EvtGen decfile used for particle decays
433 include_conjugates (bool): If True (default) accept the event also if a
434 charge conjugate of the given particles is found
435 max_iterations (int): maximum tries per event to generate the requested
436 particle. If exceeded processing will be stopped with a
437 `FATAL <LogLevel.FATAL>` error so for rare particles one might need a
440 loop_path = create_path()
443 loop_path.add_module(
"PruneDataStore", keepMatchedEntries=
False, matchEntries=[
"MCParticles"])
448 loop_path.add_module(
"InclusiveParticleChecker", particles=particles, includeConjugates=include_conjugates)
450 path.do_while(loop_path, max_iterations=max_iterations)
455 Add the high precision QED generator BHWIDE to the path. Settings are the default L1/HLT study settings
456 with a cross section of about 124000 nb (!)
459 path (basf2.Path): path where the generator should be added
460 minangle (float): minimum angle of the outgoing electron/positron in the CMS in degrees
463 if minangle < 0.0
or minangle > 180.0:
464 B2FATAL(
"add_bhwide_generator minimum angle too small (<0.0) or too large (>180): {}".format(minangle))
466 bhwide = path.add_module(
"BHWideInput")
467 bhwide.param(
'ScatteringAngleRangePositron', [minangle, 180.0 - minangle])
468 bhwide.param(
'ScatteringAngleRangeElectron', [minangle, 180.0 - minangle])
469 bhwide.param(
'MaxAcollinearity', 180.0)
470 bhwide.param(
'MinEnergy', 0.10)
471 bhwide.param(
'VacuumPolarization',
'burkhardt')
472 bhwide.param(
'WeakCorrections',
True)
473 bhwide.param(
'WtMax', 3.0)
478 Add the high precision QED generator BabaYaga@NLO to the path.
481 path (basf2.Path): path where the generator should be added.
482 finalstate (str): ee (e+e-) or gg (gammagamma).
483 minenergy (float): minimum particle (leptons for 'ee', photons for 'gg') energy in GeV.
484 minangle (float): angular range from minangle to 180-minangle for primary particles (in degrees).
485 fmax (float): maximum of differential cross section weight. This parameter should be set only by experts.
486 generateInECLAcceptance (bool): if True, the GeneratorPreselection module is used to select only events
487 with both the primary particles within the ECL acceptance.
490 babayaganlo = path.add_module(
'BabayagaNLOInput')
492 if not (fmax == -1.0):
493 B2WARNING(f
'The BabayagaNLOInput parameter "FMax" will be set to {fmax} instead to the default value (-1.0). '
494 'Please do not do this, unless you are extremely sure about this choice.')
496 if finalstate ==
'ee':
497 babayaganlo.param(
'FinalState',
'ee')
498 babayaganlo.param(
'ScatteringAngleRange', [minangle, 180.0 - minangle])
499 babayaganlo.param(
'MinEnergy', minenergy)
500 babayaganlo.param(
'FMax', fmax)
502 elif finalstate ==
'gg':
503 babayaganlo.param(
'FinalState',
'gg')
504 babayaganlo.param(
'ScatteringAngleRange', [minangle, 180.0 - minangle])
505 babayaganlo.param(
'MinEnergy', minenergy)
506 babayaganlo.param(
'FMax', fmax)
509 B2FATAL(f
'add_babayaganlo_generator final state not supported: {finalstate}')
511 if generateInECLAcceptance:
512 B2INFO(f
'The final state {finalstate} is preselected requiring both primary particles within the ECL acceptance.')
517 if finalstate ==
'ee':
518 set_module_parameters(path=path,
519 name=
'GeneratorPreselection',
521 MinChargedTheta=12.4,
522 MaxChargedTheta=155.1,)
523 elif finalstate ==
'gg':
524 set_module_parameters(path=path,
525 name=
'GeneratorPreselection',
528 MaxPhotonTheta=155.1)
533 Add the high precision QED generator PHOKHARA to the path. Almost full
534 acceptance settings for photons and hadrons/muons.
537 path (basf2.Path): path where the generator should be added
538 finalstate (str): One of the possible final state "mu+mu-", "pi+pi-", "pi+pi-pi0"
541 phokhara = path.add_module(
'PhokharaInput')
543 if finalstate ==
'mu+mu-':
544 phokhara.param(
'FinalState', 0)
545 phokhara.param(
'LO', 0)
546 phokhara.param(
'NLO', 1)
547 phokhara.param(
'QED', 0)
549 elif finalstate ==
'pi+pi-':
550 phokhara.param(
'FinalState', 1)
551 phokhara.param(
'LO', 0)
552 phokhara.param(
'NLO', 1)
553 phokhara.param(
'QED', 0)
555 elif finalstate ==
'pi+pi-pi0':
556 phokhara.param(
'FinalState', 8)
557 phokhara.param(
'LO', 0)
558 phokhara.param(
'NLO', 0)
559 phokhara.param(
'QED', 0)
561 B2FATAL(
"add_phokhara_generator final state not supported: {}".format(finalstate))
565 path, final_state_particles, user_decay_file,
566 beam_energy_spread=True):
568 Add combination of PHOKHARA and EvtGen to the path. Phokhara is
569 acting as ISR generator by generating e+ e- -> mu+ mu-, the muon pair is
570 then replaced by a virtual photon. Finally, the virtual photon is
574 path (basf2.Path): Path where the generator should be added.
575 final_state_particles (list): List of final-state particles of
576 the virtual-photon decay. It is necessary to define the correct
577 mass threshold in PHOKHARA. For example, for the process
578 e+ e- -> J/psi eta_c, the list should be ['J/psi', 'eta_c'];
579 it does not depend on subsequent J/psi or eta_c decays.
580 user_decay_file (str): Name of EvtGen user decay file. The initial
581 particle must be the virtual photon (vpho).
586 phokhara = path.add_module(
'PhokharaInput')
589 phokhara.param(
'FinalState', 0)
590 phokhara.param(
'ReplaceMuonsByVirtualPhoton',
True)
594 phokhara.param(
'BeamEnergySpread', beam_energy_spread)
597 phokhara.param(
'Epsilon', 0.0001)
600 phokhara.param(
'SearchMax', 5000)
603 phokhara.param(
'nMaxTrials', 25000)
606 phokhara.param(
'LO', 1)
607 phokhara.param(
'NLO', 1)
610 phokhara.param(
'QED', 0)
613 phokhara.param(
'NLOIFI', 0)
616 phokhara.param(
'Alpha', 1)
619 phokhara.param(
'NarrowRes', 0)
622 phokhara.param(
'ScatteringAngleRangePhoton', [0., 180.])
623 phokhara.param(
'ScatteringAngleRangeFinalStates', [0., 180.])
626 phokhara.param(
'MinInvMassHadronsGamma', 0.)
631 for particle
in final_state_particles:
633 mass = mass + p.Mass()
634 phokhara.param(
'MinInvMassHadrons', mass * mass)
635 phokhara.param(
'ForceMinInvMassHadronsCut',
True)
638 phokhara.param(
'MaxInvMassHadrons', 200.0)
641 phokhara.param(
'MinEnergyGamma', 0.01)
644 evtgen_decay = path.add_module(
'EvtGenDecay')
645 evtgen_decay.param(
'UserDecFile', user_decay_file)
650 Add KoralW generator for radiative four fermion final states (only four leptons final states are currently supported).
653 path (basf2.Path): path where the generator should be added
654 finalstate (str): either 'e+e-e+e-', 'e+e-mu+mu-', 'e+e-tau+tau-', 'mu+mu-mu+mu-', 'mu+mu-tau+tau-' or 'tau+tau-tau+tau-'
655 enableTauDecays (bool): if True, allow tau leptons to decay (using EvtGen)
659 if finalstate ==
'e+e-e+e-':
661 elif finalstate ==
'e+e-mu+mu-':
663 elif finalstate ==
'e+e-tau+tau-':
665 elif finalstate ==
'mu+mu-mu+mu-':
667 elif finalstate ==
'mu+mu-tau+tau-':
669 elif finalstate ==
'tau+tau-tau+tau-':
672 B2FATAL(f
'add_koralw_generator final state not supported: {finalstate}')
674 path.add_module(
'KoralWInput',
675 UserDataFile=decayFile)
677 if 'tau+tau-' in finalstate:
679 path.add_module(
'EvtGenDecay')
681 B2WARNING(
'The tau decays will not be generated.')
685 global_box_size=None, accept_box=None, keep_box=None,
686 geometry_xml_file='geometry/Beast2_phase2.xml',
687 cosmics_data_dir='data/generators/modules/cryinput/',
688 setup_file='generators/scripts/cry.setup',
689 data_taking_period='gcr2017', top_in_counter=False):
691 Add the cosmics generator CRY with the default parameters to the path.
694 Please remember to also change the reconstruction accordingly, if you
695 set "special" parameters here!
698 path (basf2.Path): path where the generator should be added
699 components (list(str)): list of geometry components to add in the
700 geometry module, or None for all components.
701 global_box_size (tuple(float, float, float)): sets global length, width
702 and height (in meters) in which to generate.
703 Default is ``[100, 100, 100]``
704 accept_box (tuple(float, float, float)): sets the size of the accept box in meter.
705 As a default it is set to ``[8.0, 8.0, 8.0]`` (the Belle II detector size).
706 keep_box (tuple(float, float, float)): sets the size of the keep box (keep box >= accept box).
707 geometry_xml_file (str): Name of the xml file to use for the geometry.
708 cosmics_data_dir (str): parameter CosmicDataDir for the cry module (absolute or relative to the basf2 repo).
709 setup_file (str): location of the cry.setup file (absolute or relative to the basf2 repo)
710 data_taking_period (str): The cosmics generation will be added using the
711 parameters, that where used in this period of data taking. The
712 periods can be found in ``cdc/cr/__init__.py``.
713 top_in_counter (bool): time of propagation from the hit point to the PMT in the trigger counter is subtracted
714 (assuming PMT is put at -z of the counter).
717 B2FATAL(
'''The function "add_cosmics_generator()" is outdated and it is currently not working: please replace
719 add_cosmics_generator(path=path)
723 path.add_module('CRYInput')
725 in your steering file (the module parameter "acceptance" has to be set, see the module docummentation).''')
727 import cdc.cr as cosmics_setup
729 if global_box_size
is None:
730 global_box_size = [100, 100, 100]
731 if accept_box
is None:
732 accept_box = [8, 8, 8]
736 cosmics_setup.set_cdc_cr_parameters(data_taking_period)
738 if cosmics_setup.cosmics_period ==
"201607":
739 B2FATAL(
"The data taking period 201607 is very special (geometry setup, PMTs etc). This is not handled "
740 "by this script! Please ask the CDC group, if you want to simulate this.")
742 if 'Gearbox' not in path:
743 override = [(
"/Global/length", str(global_box_size[0]),
"m"),
744 (
"/Global/width", str(global_box_size[1]),
"m"),
745 (
"/Global/height", str(global_box_size[2]),
"m")]
747 if cosmics_setup.globalPhi:
748 override += [(
"/DetectorComponent[@name='CDC']//GlobalPhiRotation", str(cosmics_setup.globalPhi),
"deg")]
750 path.add_module(
'Gearbox', override=override, fileName=geometry_xml_file,)
753 if 'Geometry' not in path:
754 geometry = path.add_module(
'Geometry')
756 geometry.param(
'components', components)
758 cry = path.add_module(
'CRYInput')
767 cry.param(
'acceptLength', accept_box[0])
768 cry.param(
'acceptWidth', accept_box[1])
769 cry.param(
'acceptHeight', accept_box[2])
770 cry.param(
'maxTrials', 100000)
774 cry.param(
'keepLength', keep_box[0])
775 cry.param(
'keepWidth', keep_box[1])
776 cry.param(
'keepHeight', keep_box[2])
779 cry.param(
'kineticEnergyThreshold', 0.01)
782 if cosmics_setup.cosmics_period
not in [
"normal",
"gcr2017"]:
784 cosmics_selector = register_module(
'CDCCosmicSelector',
785 lOfCounter=cosmics_setup.lengthOfCounter,
786 wOfCounter=cosmics_setup.widthOfCounter,
787 xOfCounter=cosmics_setup.triggerPos[0],
788 yOfCounter=cosmics_setup.triggerPos[1],
789 zOfCounter=cosmics_setup.triggerPos[2],
792 propSpeed=cosmics_setup.lightPropSpeed,
797 path.add_module(cosmics_selector)
799 empty_path = create_path()
800 cosmics_selector.if_false(empty_path)
805 Add TREPS generator to produce hadronic two-photon processes.
808 path (basf2.Path): path where the generator should be added
809 finalstate(str): "e+e-pi+pi-", "e+e-K+K-" or "e+e-ppbar"
810 useDiscreteAndSortedW(bool): if True, wListTableFile is used for discrete and sorted W. evtNumList must be set proper value.
813 if finalstate ==
'e+e-pi+pi-':
817 elif finalstate ==
'e+e-K+K-':
821 elif finalstate ==
'e+e-ppbar':
824 'generators/treps/data/differentialCrossSectionFiles/ppbardcs.dat')
827 B2FATAL(
"add_treps_generator final state not supported: {}".format(finalstate))
830 trepsinput = path.add_module(
832 ParameterFile=parameterFile,
833 DifferentialCrossSectionFile=differentialCrossSectionFile,
834 WListTableFile=wListTableFile,
835 UseDiscreteAndSortedW=useDiscreteAndSortedW,
837 MaximalAbsCosTheta=1.01,
838 ApplyCosThetaCutCharged=
True,
839 MinimalTransverseMomentum=0,
840 ApplyTransverseMomentumCutCharged=
True,