Belle II Software  release-06-01-15
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 
45 using namespace Belle2;
46 using namespace Simulation;
47 
48 
49 Belle2PhysicsList::Belle2PhysicsList(const G4String& physicsListName)
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());
73  RegisterPhysics(new Geant4ePhysics());
74 }
75 
76 
78 {}
79 
80 
82 {
83  G4BosonConstructor pBosonConstructor;
84  pBosonConstructor.ConstructParticle();
85 
86  G4LeptonConstructor pLeptonConstructor;
87  pLeptonConstructor.ConstructParticle();
88 
89  G4MesonConstructor pMesonConstructor;
90  pMesonConstructor.ConstructParticle();
91 
92  G4BaryonConstructor pBaryonConstructor;
93  pBaryonConstructor.ConstructParticle();
94 
95  G4IonConstructor pIonConstructor;
96  pIonConstructor.ConstructParticle();
97 
98  G4ShortLivedConstructor pShortLivedConstructor;
99  pShortLivedConstructor.ConstructParticle();
100 
102 }
103 
104 
106 {
107  static G4ParticleDefinition* g4eParticle = NULL;
108 
109  if (g4eParticle == NULL) {
110  // Bohr Magneton for positron and positive muon
111  G4double muBpositron = 0.5 * CLHEP::eplus * CLHEP::hbar_Planck / (0.51099906 * CLHEP::MeV / CLHEP::c_squared);
112  G4double muBmuon = 0.5 * CLHEP::eplus * CLHEP::hbar_Planck / (0.1056584 * CLHEP::GeV / CLHEP::c_squared);
113  G4double muNucleon = CLHEP::eplus * CLHEP::hbar_Planck / 2. / (CLHEP::proton_mass_c2 / CLHEP::c_squared);
114  // Copied from G4Gamma.cc
115  g4eParticle = new G4ParticleDefinition(
116  "g4e_gamma", 0.0 * CLHEP::MeV, 0.0 * CLHEP::MeV, 0.0,
117  2, -1, -1,
118  0, 0, 0,
119  "gamma", 0, 0, g4ePDGcode,
120  true, 0.0, NULL,
121  false, "photon", g4ePDGcode
122  );
123  // Copied from G4Electron.cc
124  new G4ParticleDefinition(
125  "g4e_e-", 0.51099906 * CLHEP::MeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
126  1, 0, 0,
127  0, 0, 0,
128  "lepton", 1, 0, g4ePDGcode,
129  true, -1.0, NULL,
130  false, "e", g4ePDGcode, -1.0011596521859 * muBpositron
131  );
132  // Copied from G4Positron.cc
133  new G4ParticleDefinition(
134  "g4e_e+", 0.51099906 * CLHEP::MeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
135  1, 0, 0,
136  0, 0, 0,
137  "lepton", -1, 0, g4ePDGcode,
138  true, -1.0, NULL,
139  false, "e", g4ePDGcode, 1.0011596521859 * muBpositron
140  );
141  // Copied from G4MuonPlus.cc
142  new G4ParticleDefinition(
143  "g4e_mu+", 0.1056584 * CLHEP::GeV, 2.99591e-16 * CLHEP::MeV, +1.0 * CLHEP::eplus,
144  1, 0, 0,
145  0, 0, 0,
146  "lepton", -1, 0, g4ePDGcode,
147  true, -1.0, NULL,
148  false, "mu", g4ePDGcode, 1.0011659208 * muBmuon
149  );
150  // Copied from G4MuonMinus.cc
151  new G4ParticleDefinition(
152  "g4e_mu-", 0.1056584 * CLHEP::GeV, 2.99591e-16 * CLHEP::MeV, -1.0 * CLHEP::eplus,
153  1, 0, 0,
154  0, 0, 0,
155  "lepton", 1, 0, g4ePDGcode,
156  true, -1.0, NULL,
157  false, "mu", g4ePDGcode, -1.0011659208 * muBmuon
158  );
159  // Copied from G4PionPlus.cc
160  new G4ParticleDefinition(
161  "g4e_pi+", 0.1395700 * CLHEP::GeV, 2.5284e-14 * CLHEP::MeV, +1.0 * CLHEP::eplus,
162  0, -1, 0,
163  2, +2, -1,
164  "meson", 0, 0, g4ePDGcode,
165  true, -1.0, NULL,
166  false, "pi", g4ePDGcode
167  );
168  // Copied from G4PionMinus.cc
169  new G4ParticleDefinition(
170  "g4e_pi-", 0.1395700 * CLHEP::GeV, 2.5284e-14 * CLHEP::MeV, -1.0 * CLHEP::eplus,
171  0, -1, 0,
172  2, -2, -1,
173  "meson", 0, 0, g4ePDGcode,
174  true, -1.0, NULL,
175  false, "pi", g4ePDGcode
176  );
177  // Copied from G4KaonPlus.cc
178  new G4ParticleDefinition(
179  "g4e_kaon+", 0.493677 * CLHEP::GeV, 5.315e-14 * CLHEP::MeV, +1.0 * CLHEP::eplus,
180  0, -1, 0,
181  1, +1, 0,
182  "meson", 0, 0, g4ePDGcode,
183  true, -1.0, NULL,
184  false, "kaon", g4ePDGcode
185  );
186  // Copied from G4KaonMinus.cc
187  new G4ParticleDefinition(
188  "g4e_kaon-", 0.493677 * CLHEP::GeV, 5.315e-14 * CLHEP::MeV, -1.0 * CLHEP::eplus,
189  0, -1, 0,
190  1, -1, 0,
191  "meson", 0, 0, g4ePDGcode,
192  true, -1.0, NULL,
193  false, "kaon", g4ePDGcode
194  );
195  // Copied from G4Proton.cc except use G4ParticleDefinition instead of G4Ions
196  new G4ParticleDefinition(
197  "g4e_proton", 0.9382723 * CLHEP::GeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
198  1, +1, 0,
199  1, +1, 0,
200  "baryon", 0, +1, g4ePDGcode,
201  true, -1.0, NULL,
202  false, "nucleon", g4ePDGcode, 2.792847351 * muNucleon
203  );
204  // Copied from G4AntiProton.cc except use G4ParticleDefinition instead of G4Ions
205  new G4ParticleDefinition(
206  "g4e_anti_proton", 0.9382723 * CLHEP::GeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
207  1, +1, 0,
208  1, -1, 0,
209  "baryon", 0, -1, g4ePDGcode,
210  true, -1.0, NULL,
211  false, "nucleon", g4ePDGcode, -2.792847351 * muNucleon
212  );
213  // copied from G4Deuteron.hh except use G4ParticleDefinition instead of G4Ions
214  new G4ParticleDefinition(
215  "g4e_deuteron", 1.875613 * CLHEP::GeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
216  2, +1, 0,
217  0, 0, 0,
218  "nucleus", 0, +2, g4ePDGcode,
219  true, -1.0, NULL,
220  false, "static", g4ePDGcode, 0.857438230 * muNucleon
221  );
222  // copied from G4AntiDeuteron.hh except use G4ParticleDefinition instead of G4Ions
223  new G4ParticleDefinition(
224  "g4e_anti_deuteron", 1.875613 * CLHEP::GeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
225  2, +1, 0,
226  0, 0, 0,
227  "anti_nucleus", 0, -2, g4ePDGcode,
228  true, -1.0, NULL,
229  false, "static", g4ePDGcode, -0.857438230 * muNucleon
230  );
231  }
232 }
233 
234 void Belle2PhysicsList::setRegionCuts(const std::string& name, const std::vector<std::string>& regions, double cutValue)
235 {
236  G4RegionStore* theRegionStore = G4RegionStore::GetInstance();
237  if (cutValue == 0) {
238  cutValue = m_globalCutValue;
239  } else {
240  B2INFO("Set production cut for detector region" << LogVar("detector", name) << LogVar("production_cut", cutValue));
241  }
242  auto* regionCuts = new G4ProductionCuts;
243  regionCuts->SetProductionCut(cutValue * cm);
244  bool foundOne{false};
245  for (const auto& regionName : regions) {
246  auto* region = theRegionStore->GetRegion(regionName, false);
247  if (!region) {
248  B2WARNING("Cannot find Geant4 region for sub detector. Probably detector not present?"
249  << LogVar("detector", name) << LogVar("region", regionName));
250  continue;
251  }
252  region->SetProductionCuts(regionCuts);
253  foundOne = true;
254  }
255  if (!foundOne) delete regionCuts;
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.
Belle2PhysicsList(const G4String &physicsListName)
Constructor.
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.
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.