All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 38 of file PhysicsList.cxx.

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

Definition at line 71 of file PhysicsList.h.

72  {
73  G4VModularPhysicsList::RegisterPhysics(g);
74  }
BEGIN_PROLOG g

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