Belle II Software development
Belle2PhysicsList.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <simulation/physicslist/Belle2PhysicsList.h>
10#include "G4SystemOfUnits.hh"
11#include "G4RegionStore.hh"
12#include "G4ProductionCuts.hh"
13
14// EM and decay physics
15#include "G4EmStandardPhysics.hh"
16#include "G4EmStandardPhysics_option1.hh"
17#include "G4OpticalPhysics.hh"
18#include "G4DecayPhysics.hh"
19#include <simulation/physicslist/Geant4ePhysics.h>
20
21// Hadronic physics
22#include <simulation/physicslist/ProtonPhysics.h>
23#include <simulation/physicslist/NeutronPhysics.h>
24#include <simulation/physicslist/PionPhysics.h>
25#include <simulation/physicslist/KaonPhysics.h>
26#include <simulation/physicslist/HyperonPhysics.h>
27#include <simulation/physicslist/AntiBaryonPhysics.h>
28#include <simulation/physicslist/IonPhysics.h>
29#include <simulation/physicslist/GammaLeptoNuclearPhysics.h>
30
31// Particles
32#include "G4BosonConstructor.hh"
33#include "G4LeptonConstructor.hh"
34#include "G4MesonConstructor.hh"
35#include "G4BaryonConstructor.hh"
36#include "G4IonConstructor.hh"
37#include "G4ShortLivedConstructor.hh"
38
39// Long lived
40#include "simulation/longlivedneutral/G4LongLivedNeutralPhysics.h"
41#include <framework/logging/Logger.h>
42
43#define g4ePDGcode 0
44
45using namespace Belle2;
46using namespace Simulation;
47
48
49Belle2PhysicsList::Belle2PhysicsList(const G4String& physicsListName, const G4int hadronicVerbosityLevel)
50 : G4VModularPhysicsList(), m_globalCutValue(0.07)
51{
52 B2INFO("Using " << physicsListName << " physics list");
53
60
61 // Decay
62 RegisterPhysics(new G4DecayPhysics());
63
64 // Hadronic physics
65 RegisterPhysics(new ProtonPhysics());
66 RegisterPhysics(new NeutronPhysics());
67 RegisterPhysics(new PionPhysics());
68 RegisterPhysics(new KaonPhysics());
69 RegisterPhysics(new HyperonPhysics());
70 RegisterPhysics(new AntiBaryonPhysics());
71 RegisterPhysics(new IonPhysics());
72 RegisterPhysics(new GammaLeptoNuclearPhysics(hadronicVerbosityLevel));
73 RegisterPhysics(new Geant4ePhysics());
74
75 m_regionCuts = new G4ProductionCuts;
76}
77
78
80{
81 delete m_regionCuts;
82}
83
84
86{
87 G4BosonConstructor pBosonConstructor;
88 pBosonConstructor.ConstructParticle();
89
90 G4LeptonConstructor pLeptonConstructor;
91 pLeptonConstructor.ConstructParticle();
92
93 G4MesonConstructor pMesonConstructor;
94 pMesonConstructor.ConstructParticle();
95
96 G4BaryonConstructor pBaryonConstructor;
97 pBaryonConstructor.ConstructParticle();
98
99 G4IonConstructor pIonConstructor;
100 pIonConstructor.ConstructParticle();
101
102 G4ShortLivedConstructor pShortLivedConstructor;
103 pShortLivedConstructor.ConstructParticle();
104
106}
107
108
110{
111 static G4ParticleDefinition* g4eParticle = NULL;
112
113 if (g4eParticle == NULL) {
114 // Bohr Magneton for positron and positive muon
115 G4double muBpositron = 0.5 * CLHEP::eplus * CLHEP::hbar_Planck / (0.51099906 * CLHEP::MeV / CLHEP::c_squared);
116 G4double muBmuon = 0.5 * CLHEP::eplus * CLHEP::hbar_Planck / (0.1056584 * CLHEP::GeV / CLHEP::c_squared);
117 G4double muNucleon = CLHEP::eplus * CLHEP::hbar_Planck / 2. / (CLHEP::proton_mass_c2 / CLHEP::c_squared);
118 // Copied from G4Gamma.cc
119 g4eParticle = new G4ParticleDefinition(
120 "g4e_gamma", 0.0 * CLHEP::MeV, 0.0 * CLHEP::MeV, 0.0,
121 2, -1, -1,
122 0, 0, 0,
123 "gamma", 0, 0, g4ePDGcode,
124 true, 0.0, NULL,
125 false, "photon", g4ePDGcode
126 );
127 // Copied from G4Electron.cc
128 new G4ParticleDefinition(
129 "g4e_e-", 0.51099906 * CLHEP::MeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
130 1, 0, 0,
131 0, 0, 0,
132 "lepton", 1, 0, g4ePDGcode,
133 true, -1.0, NULL,
134 false, "e", g4ePDGcode, -1.0011596521859 * muBpositron
135 );
136 // Copied from G4Positron.cc
137 new G4ParticleDefinition(
138 "g4e_e+", 0.51099906 * CLHEP::MeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
139 1, 0, 0,
140 0, 0, 0,
141 "lepton", -1, 0, g4ePDGcode,
142 true, -1.0, NULL,
143 false, "e", g4ePDGcode, 1.0011596521859 * muBpositron
144 );
145 // Copied from G4MuonPlus.cc
146 new G4ParticleDefinition(
147 "g4e_mu+", 0.1056584 * CLHEP::GeV, 2.99591e-16 * CLHEP::MeV, +1.0 * CLHEP::eplus,
148 1, 0, 0,
149 0, 0, 0,
150 "lepton", -1, 0, g4ePDGcode,
151 true, -1.0, NULL,
152 false, "mu", g4ePDGcode, 1.0011659208 * muBmuon
153 );
154 // Copied from G4MuonMinus.cc
155 new G4ParticleDefinition(
156 "g4e_mu-", 0.1056584 * CLHEP::GeV, 2.99591e-16 * CLHEP::MeV, -1.0 * CLHEP::eplus,
157 1, 0, 0,
158 0, 0, 0,
159 "lepton", 1, 0, g4ePDGcode,
160 true, -1.0, NULL,
161 false, "mu", g4ePDGcode, -1.0011659208 * muBmuon
162 );
163 // Copied from G4PionPlus.cc
164 new G4ParticleDefinition(
165 "g4e_pi+", 0.1395700 * CLHEP::GeV, 2.5284e-14 * CLHEP::MeV, +1.0 * CLHEP::eplus,
166 0, -1, 0,
167 2, +2, -1,
168 "meson", 0, 0, g4ePDGcode,
169 true, -1.0, NULL,
170 false, "pi", g4ePDGcode
171 );
172 // Copied from G4PionMinus.cc
173 new G4ParticleDefinition(
174 "g4e_pi-", 0.1395700 * CLHEP::GeV, 2.5284e-14 * CLHEP::MeV, -1.0 * CLHEP::eplus,
175 0, -1, 0,
176 2, -2, -1,
177 "meson", 0, 0, g4ePDGcode,
178 true, -1.0, NULL,
179 false, "pi", g4ePDGcode
180 );
181 // Copied from G4KaonPlus.cc
182 new G4ParticleDefinition(
183 "g4e_kaon+", 0.493677 * CLHEP::GeV, 5.315e-14 * CLHEP::MeV, +1.0 * CLHEP::eplus,
184 0, -1, 0,
185 1, +1, 0,
186 "meson", 0, 0, g4ePDGcode,
187 true, -1.0, NULL,
188 false, "kaon", g4ePDGcode
189 );
190 // Copied from G4KaonMinus.cc
191 new G4ParticleDefinition(
192 "g4e_kaon-", 0.493677 * CLHEP::GeV, 5.315e-14 * CLHEP::MeV, -1.0 * CLHEP::eplus,
193 0, -1, 0,
194 1, -1, 0,
195 "meson", 0, 0, g4ePDGcode,
196 true, -1.0, NULL,
197 false, "kaon", g4ePDGcode
198 );
199 // Copied from G4Proton.cc except use G4ParticleDefinition instead of G4Ions
200 new G4ParticleDefinition(
201 "g4e_proton", 0.9382723 * CLHEP::GeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
202 1, +1, 0,
203 1, +1, 0,
204 "baryon", 0, +1, g4ePDGcode,
205 true, -1.0, NULL,
206 false, "nucleon", g4ePDGcode, 2.792847351 * muNucleon
207 );
208 // Copied from G4AntiProton.cc except use G4ParticleDefinition instead of G4Ions
209 new G4ParticleDefinition(
210 "g4e_anti_proton", 0.9382723 * CLHEP::GeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
211 1, +1, 0,
212 1, -1, 0,
213 "baryon", 0, -1, g4ePDGcode,
214 true, -1.0, NULL,
215 false, "nucleon", g4ePDGcode, -2.792847351 * muNucleon
216 );
217 // copied from G4Deuteron.hh except use G4ParticleDefinition instead of G4Ions
218 new G4ParticleDefinition(
219 "g4e_deuteron", 1.875613 * CLHEP::GeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
220 2, +1, 0,
221 0, 0, 0,
222 "nucleus", 0, +2, g4ePDGcode,
223 true, -1.0, NULL,
224 false, "static", g4ePDGcode, 0.857438230 * muNucleon
225 );
226 // copied from G4AntiDeuteron.hh except use G4ParticleDefinition instead of G4Ions
227 new G4ParticleDefinition(
228 "g4e_anti_deuteron", 1.875613 * CLHEP::GeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
229 2, +1, 0,
230 0, 0, 0,
231 "anti_nucleus", 0, -2, g4ePDGcode,
232 true, -1.0, NULL,
233 false, "static", g4ePDGcode, -0.857438230 * muNucleon
234 );
235 }
236}
237
238void Belle2PhysicsList::setRegionCuts(const std::string& name, const std::vector<std::string>& regions, double cutValue)
239{
240 G4RegionStore* theRegionStore = G4RegionStore::GetInstance();
241 if (cutValue == 0) {
242 cutValue = m_globalCutValue;
243 } else {
244 B2INFO("Set production cut for detector region" << LogVar("detector", name) << LogVar("production_cut", cutValue));
245 }
246 m_regionCuts->SetProductionCut(cutValue * cm);
247 for (const auto& regionName : regions) {
248 auto* region = theRegionStore->GetRegion(regionName, false);
249 if (!region) {
250 B2WARNING("Cannot find Geant4 region for sub detector. Probably detector not present?"
251 << LogVar("detector", name) << LogVar("region", regionName));
252 continue;
253 }
254 region->SetProductionCuts(m_regionCuts);
255 }
256}
257
258
260{
261 // Belle2 assumes input units are cm
262 B2INFO("Setting global Geant4 production cut" << LogVar("cutValue", m_globalCutValue));
263
264 SetCutValue(m_globalCutValue * cm, "proton");
265 SetCutValue(m_globalCutValue * cm, "e-");
266 SetCutValue(m_globalCutValue * cm, "e+");
267 SetCutValue(m_globalCutValue * cm, "gamma");
268
269 setRegionCuts("PXD", {"PXDEnvelope"}, m_pxdCutValue);
270 setRegionCuts("SVD", {"SVDEnvelope"}, m_svdCutValue);
271 setRegionCuts("CDC", {"CDCEnvelope"}, m_cdcCutValue);
272 setRegionCuts("ARICH", {"ARICHEnvelope"}, m_arichtopCutValue);
273 setRegionCuts("TOP", {"TOPEnvelope"}, m_arichtopCutValue);
274 setRegionCuts("ECL", {"ECLForwardEnvelope", "ECLBarrelSector", "ECLBackwardEnvelope"}, m_eclCutValue);
275 setRegionCuts("KLM", {"BKLMEnvelope", "EKLMEnvelope"}, m_klmCutValue);
276}
277
278
280{
281 SetVerboseLevel(verb);
282}
283
284
286{
287 m_globalCutValue = value;
288}
289
290
292{
293 m_pxdCutValue = value;
294}
295
296
298{
299 m_svdCutValue = value;
300}
301
302
304{
305 m_cdcCutValue = value;
306}
307
308
310{
311 m_arichtopCutValue = value;
312}
313
314
316{
317 m_eclCutValue = value;
318}
319
320
322{
323 m_klmCutValue = value;
324}
325
326
328{
329 if (yesno) {
330 RegisterPhysics(new G4EmStandardPhysics());
331 } else {
332 RegisterPhysics(new G4EmStandardPhysics_option1());
333 }
334}
335
336
338{
339 if (yesno) RegisterPhysics(new G4OpticalPhysics());
340}
341
342
344{
345 if (yesno) G4cout << " High precision neutron option not yet ready " << G4endl;
346}
347
349{
350 G4LongLivedNeutralPhysics* pLongLivedNeutral = new G4LongLivedNeutralPhysics();
351 RegisterPhysics(pLongLivedNeutral);
352 pLongLivedNeutral->ConstructParticle();
353}
LongLivedNeutral physics Class – to be registered in the physics list.
virtual void ConstructParticle()
Adds monopole and anti-monopole to GEANT4 with a pdg of +/-99666 and parameters taken from current cl...
Anti-baryon hadronic physics constructor for Belle II physics list.
void SetSVDProductionCutValue(G4double)
Set cut value for SVD envelope.
void SetProductionCutValue(G4double)
Use parameter to set global cut value.
void SetARICHTOPProductionCutValue(G4double)
Set cut value for ARICH and TOP envelopes.
G4ProductionCuts * m_regionCuts
Global pointer for the region cuts to avoid memory leak and side effects when deleting the pointer.
void ConstructG4eParticles()
Construct parallel particle types needed for reco.
G4double m_klmCutValue
threshold for BKLM and EKLM
void setRegionCuts(const std::string &name, const std::vector< std::string > &regions, double cutValue)
Set the produciton cuts to the given value for a list of regions belonging to a sub detector.
void SetECLProductionCutValue(G4double)
Set cut value for ECL barrel, forward and backward envelopes.
G4double m_globalCutValue
Secondary production thresholds.
virtual void SetCuts()
Set the secondary particle production thresholds.
void UseHighPrecisionNeutrons(G4bool)
Use high precision neutron models below 20 MeV.
void SetPXDProductionCutValue(G4double)
Set cut value for PXD envelope.
void UseLongLivedNeutralParticles()
Simulate neutral long-lived particles with given pdg and mass value.
void UseOpticalPhysics(G4bool)
Add optical photon physics.
G4double m_pxdCutValue
threshold for PXD
G4double m_svdCutValue
threshold for SVD
G4double m_arichtopCutValue
threshold for ARICH and TOP
void SetVerbosity(G4int verb)
Run/event verbosity level.
void SetCDCProductionCutValue(G4double)
Set cut value for CDC envelope.
virtual void ConstructParticle()
Build all particle types used in physics list.
void SetKLMProductionCutValue(G4double)
Set cut value for BKLM and EKLM envelopes.
void UseStandardEMPhysics(G4bool)
Use standard EM physics instead of EM option1.
G4double m_eclCutValue
threshold for ECL
G4double m_cdcCutValue
threshold for CDC
Gamma-nuclear, electro-nuclear and muon-nuclear physics constructor for Belle II physics list.
Define geant4e-specific physics.
Hyperon hadronic physics constructor for Belle II physics list.
Ion hadronic physics constructor for Belle II physics list.
Definition: IonPhysics.h:33
Kaon hadronic physics constructor for Belle II physics list.
Definition: KaonPhysics.h:31
Neutron hadronic physics constructor for Belle II physics list.
Pion hadronic physics constructor for Belle II physics list.
Definition: PionPhysics.h:31
Proton hadronic physics constructor for Belle II physics list.
Definition: ProtonPhysics.h:31
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.