Public Member Functions | List of all members
larg4::ModularPhysicsList Class Reference

#include <PhysicsList.h>

Inheritance diagram for larg4::ModularPhysicsList:

Public Member Functions

virtual void ConstructProcess ()
 
void RegisterPhysics (G4VPhysicsConstructor *g)
 
const G4VPhysicsConstructor * GetPhysics (G4int index) const
 
const G4VPhysicsConstructor * GetPhysics (const G4String &name) const
 

Detailed Description

Definition at line 62 of file PhysicsList.h.

Member Function Documentation

void larg4::ModularPhysicsList::ConstructProcess ( )
virtual

Definition at line 36 of file PhysicsList.cxx.

37  {
38  // We don't need to modify G4VModularPhysicsList's
39  // AddTransportation method. Just invoke it directly.
40  G4VModularPhysicsList::AddTransportation();
41 
42  ////////////////////////////////////////////////////////////////////////////////////////
43  // This is the "new" code that has to be added to
44  // G4VModularPhysicsList::ConstructProcess() to handle the
45  // parallel geometry.
46 
48  bool DisableWireplanes = lgp->DisableWireplanes();
49 
50  G4ParallelWorldScoringProcess* LArVoxelParallelWorldScoringProcess =
51  new G4ParallelWorldScoringProcess("LArVoxelReadoutScoringProcess");
52 
53  G4ParallelWorldScoringProcess* OpDetParallelWorldScoringProcess =
54  new G4ParallelWorldScoringProcess("OpDetReadoutScoringProcess");
55 
56  // Note that the name below MUST match the name used in the
57  // LArVoxelReadoutGeometry or OpDetReadoutGeometry constructor.
58  LArVoxelParallelWorldScoringProcess->SetParallelWorld("LArVoxelReadoutGeometry");
59  OpDetParallelWorldScoringProcess->SetParallelWorld("OpDetReadoutGeometry");
60 
61  // Tell all the particles in the physics list to recognize the
62  // LAr voxel parallel world. "theParticleIterator" is defined in
63  // G4VUserPhysicsList.hh. Only photons recognise the OpDet parallel
64  // world.
65  static G4ParticleTable* fParticleTable = G4ParticleTable::GetParticleTable();
66  G4ParticleTable::G4PTblDicIterator* theParticleIterator;
67  theParticleIterator = fParticleTable->GetIterator();
68  theParticleIterator->reset();
69  while ((*theParticleIterator)()) {
70  G4ParticleDefinition* particle = theParticleIterator->value();
71 
72  if (particle->GetParticleType() == "opticalphoton") {
73  G4ProcessManager* pmanager = particle->GetProcessManager();
74  pmanager->AddProcess(OpDetParallelWorldScoringProcess);
75  pmanager->SetProcessOrderingToLast(OpDetParallelWorldScoringProcess, idxAtRest);
76  pmanager->SetProcessOrdering(OpDetParallelWorldScoringProcess, idxAlongStep, 1);
77  pmanager->SetProcessOrderingToLast(OpDetParallelWorldScoringProcess, idxPostStep);
78  }
79 
80  // Only apply voxel processing in the LAr TPC if the particles are
81  // charged and they have a significant life-time.
82  else if (particle->GetPDGCharge() != 0 && !particle->IsShortLived()) {
83  G4ProcessManager* pmanager = particle->GetProcessManager();
84  if (!DisableWireplanes) {
85  pmanager->AddProcess(LArVoxelParallelWorldScoringProcess);
86  pmanager->SetProcessOrderingToLast(LArVoxelParallelWorldScoringProcess, idxAtRest);
87  pmanager->SetProcessOrdering(LArVoxelParallelWorldScoringProcess, idxAlongStep, 1);
88  pmanager->SetProcessOrderingToLast(LArVoxelParallelWorldScoringProcess, idxPostStep);
89  }
90 
91  // Do secondary biasing under control of K0Bias switch.
92  G4bool genSecondaries(false);
93  G4bool cE(false);
94  if (((particle->GetParticleName() == G4MuonPlus::MuonPlus()->GetParticleName() ||
95  particle->GetParticleName() == G4MuonMinus::MuonMinus()->GetParticleName()) &&
96  lgp->UseCustomPhysics()) ||
97  ((particle->GetParticleName() == G4Proton::Proton()->GetParticleName() ||
98  particle->GetParticleName() == G4Neutron::Neutron()->GetParticleName() ||
99  particle->GetParticleName() == G4KaonZeroShort::KaonZeroShort()->GetParticleName() ||
100  particle->GetParticleName() == G4KaonZeroLong::KaonZeroLong()->GetParticleName() ||
101  particle->GetParticleName() == G4Lambda::Lambda()->GetParticleName()) &&
102  lgp->UseCustomPhysics())) {
103  std::vector<std::string> EnabledPhysics = lgp->EnabledPhysics();
104  for (std::vector<std::string>::const_iterator it = EnabledPhysics.begin();
105  it != EnabledPhysics.end();
106  it++) {
107  std::string PhysicsName = (*it);
108  if (!PhysicsName.compare("SynchrotronAndGN") && lgp->K0Bias()) {
109  genSecondaries = true;
110  }
111  if (!PhysicsName.compare("ChargeExchange")) { cE = true; }
112  } // end loop over enabled physics
113  } // end if using custom physics
114 
115  if (genSecondaries) {
116  G4int nSecondaries(lgp->K0Bias());
117  G4int fXSBias(lgp->MNXSBias());
118  G4int xSBias(lgp->MNXBias());
119  mf::LogInfo("PhysicsList: ")
120  << "Turning on WrappedMuNuclear for " << particle->GetParticleName() << "s with "
121  << nSecondaries << " appropriately weighted secondaries."
122  << " XSBias is set to " << xSBias
123  << " and the cross-section is increased by a factor of " << fXSBias << ".";
124  G4MuonNuclearProcess* g4MNI = new G4MuonNuclearProcess();
125  MuNuclearSplittingProcessXSecBias* munuclSplitting =
126  new MuNuclearSplittingProcessXSecBias();
127  G4bool active(true);
128 
129  munuclSplitting->SetNSplit(nSecondaries, xSBias, fXSBias);
130  munuclSplitting->SetIsActive(active);
131  munuclSplitting->RegisterProcess(g4MNI);
132  // Middle -1 with no biasing.
133  // The middle +1 enforces AlongStepDoIt active for MuNuclear, I claim.
134  if (xSBias && (fXSBias > 1))
135  pmanager->AddProcess(munuclSplitting, -1, 1, 1);
136  else
137  pmanager->AddProcess(munuclSplitting, -1, -1, 1);
138  } // end if generating secondaries
139 
140  if (cE) {
141  mf::LogInfo("PhysicsList: ")
142  << "Turning on ChargeExchange for " << particle->GetParticleName() << "s.";
143  G4ChargeExchange* model = new G4ChargeExchange();
144  G4ChargeExchangeProcess* p = new G4ChargeExchangeProcess();
145 
146  p->RegisterMe(model);
147  pmanager->AddDiscreteProcess(p);
148 
149  } // end if doing charge exchange
150  } // end if short lived particle
151  } // end loop over particles
152 
153  // End of code "added" to G4VModularPhysicsList::ConstructProcess()
154  ////////////////////////////////////////////////////////////////////////////////////////
155 
156  // This code is also unchanged from
157  // G4VModularPhysicsList::ConstructProcess(); it means "activate
158  // the physics processes and particle combinations we've specified
159  // in physicsVector." The physicsVector is built up by the
160  // pre-supplied Geant4 physics list; see PhysicsList.h for the
161  // name of that list. "physicsVector" is defined in
162  // G4VModularPhysicsList.hh.
164  for (itr = G4MT_physicsVector->begin(); itr != G4MT_physicsVector->end(); ++itr) {
165  (*itr)->ConstructProcess();
166  }
167  } // end ConstructProcess
intermediate_table::iterator iterator
const std::vector< std::string > & EnabledPhysics() const
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Definition: model.py:1
intermediate_table::const_iterator const_iterator
p
Definition: test.py:223
bool UseCustomPhysics() const
#define G4MT_physicsVector
Definition: PhysicsList.cxx:30
bool DisableWireplanes() const
const G4VPhysicsConstructor* larg4::ModularPhysicsList::GetPhysics ( G4int  index) const
inline

Definition at line 76 of file PhysicsList.h.

77  {
78  return G4VModularPhysicsList::GetPhysics(index);
79  }
const G4VPhysicsConstructor* larg4::ModularPhysicsList::GetPhysics ( const G4String &  name) const
inline

Definition at line 81 of file PhysicsList.h.

82  {
83  return G4VModularPhysicsList::GetPhysics(name);
84  }
static QCString name
Definition: declinfo.cpp:673
void larg4::ModularPhysicsList::RegisterPhysics ( G4VPhysicsConstructor *  g)
inline

Definition at line 71 of file PhysicsList.h.

72  {
73  G4VModularPhysicsList::RegisterPhysics(g);
74  }
static constexpr double g
Definition: Units.h:144

The documentation for this class was generated from the following files: