LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
larg4::ModularPhysicsList Class Reference

#include "PhysicsList.h"

Inheritance diagram for larg4::ModularPhysicsList:

Public Member Functions

 ModularPhysicsList ()
 
virtual ~ModularPhysicsList ()
 
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 55 of file PhysicsList.h.

Constructor & Destructor Documentation

larg4::ModularPhysicsList::ModularPhysicsList ( )
explicit

Definition at line 33 of file PhysicsList.cxx.

34  : G4VModularPhysicsList()
35  {}
larg4::ModularPhysicsList::~ModularPhysicsList ( )
virtual

Definition at line 39 of file PhysicsList.cxx.

40  {}

Member Function Documentation

void larg4::ModularPhysicsList::ConstructProcess ( )
virtual

Definition at line 43 of file PhysicsList.cxx.

References sim::LArG4Parameters::DisableWireplanes(), sim::LArG4Parameters::EnabledPhysics(), G4MT_physicsVector, sim::LArG4Parameters::K0Bias(), sim::LArG4Parameters::MNXBias(), sim::LArG4Parameters::MNXSBias(), larg4::MuNuclearSplittingProcessXSecBias::SetIsActive(), larg4::MuNuclearSplittingProcessXSecBias::SetNSplit(), and sim::LArG4Parameters::UseCustomPhysics().

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

Definition at line 72 of file PhysicsList.h.

73  {
74  return G4VModularPhysicsList::GetPhysics(index);
75  }
const G4VPhysicsConstructor* larg4::ModularPhysicsList::GetPhysics ( const G4String name) const
inline

Definition at line 76 of file PhysicsList.h.

77  {
78  return G4VModularPhysicsList::GetPhysics(name);
79  }
void larg4::ModularPhysicsList::RegisterPhysics ( G4VPhysicsConstructor *  g)
inline

Definition at line 68 of file PhysicsList.h.

69  {
70  G4VModularPhysicsList::RegisterPhysics(g);
71  }

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