71 ATH_MSG_DEBUG(
"RHadronsPhysicsTool::ConstructProcess() - start");
72 G4Decay* pythiaDecayProcess =
new G4Decay();
74 G4ParticleTable::G4PTblDicIterator* particleIterator = G4ParticleTable::GetParticleTable()->GetIterator();
75 particleIterator->reset();
79 G4BaryonConstructor::ConstructParticle();
81 G4ProcessManager *templateProcessMgr = G4ParticleTable::GetParticleTable()->FindParticle(4122)->GetProcessManager();
84 G4ParticleDefinition *
particle = G4ParticleTable::GetParticleTable()->FindParticle(
pid );
87 G4ProcessManager *processMgr =
particle->GetProcessManager();
89 ATH_MSG_VERBOSE (
"No process manager found for " <<
particle->GetParticleName() <<
" (" <<
pid <<
"). Copying process manager from 4122 (one we know works) to this particle" );
90 particle->SetProcessManager(
new G4ProcessManager(*templateProcessMgr));
91 processMgr =
particle->GetProcessManager();
94 G4ProcessVector *fullProcessList = processMgr->GetProcessList();
95 std::vector< G4VProcess * > existingDecayProcesses; existingDecayProcesses.reserve(2);
96 for (
unsigned int i=0;
i<fullProcessList->size(); ++
i) {
97 G4VProcess*
process = (*fullProcessList)[
i];
98 if (
process->GetProcessType() == fDecay) {
99 ATH_MSG_VERBOSE (
"Found a pre-existing decay process for " <<
particle->GetParticleName() <<
" (" <<
pid <<
"). Will remove in favour of using RHadronPythiaDecayer." );
100 existingDecayProcesses.push_back(
process);
104 for (G4VProcess*
process : existingDecayProcesses) {
105 processMgr->RemoveProcess(
process);
108 for (
unsigned int i=0;
i<fullProcessList->size(); ++
i) {
109 G4VProcess*
process = (*fullProcessList)[
i];
110 if (
process->GetProcessType() == fDecay) {
111 ATH_MSG_WARNING (
"There is another decay process for " <<
particle->GetParticleName() <<
" (" <<
pid <<
") already defined!" );
112 processMgr->DumpInfo();
115 ATH_MSG_VERBOSE (
"Adding decay process for " <<
particle->GetParticleName() <<
" (" <<
pid <<
") using RHadronPythiaDecayer." );
116 processMgr->AddProcess(pythiaDecayProcess);
117 processMgr->SetProcessOrdering(pythiaDecayProcess, idxPostStep); processMgr->SetProcessOrdering(pythiaDecayProcess, idxAtRest);
125 std::vector<int> handled;
127 while ((*particleIterator)()) {
128 G4ParticleDefinition *
particle = particleIterator->value();
131 if (
find(handled.begin(), handled.end(),
pid) == handled.end()) {
132 handled.push_back(
pid);
133 ATH_MSG_VERBOSE (
particle->GetParticleName() <<
" (" <<
particle->GetPDGEncoding() <<
") " <<
" is a Custom Particle. Attempting to add a decay process." );
134 G4ProcessManager *processMgr =
particle->GetProcessManager();
136 G4ProcessVector *fullProcessList = processMgr->GetProcessList();
137 std::vector< G4VProcess * > existingDecayProcesses; existingDecayProcesses.reserve(2);
138 for (
unsigned int i=0;
i<fullProcessList->size(); ++
i) {
139 G4VProcess*
process = (*fullProcessList)[
i];
140 if (
process->GetProcessType() == fDecay) {
141 ATH_MSG_VERBOSE (
"Found a pre-existing decay process for " <<
particle->GetParticleName() <<
" (" <<
pid <<
"). Will remove in favour of using RHadronPythiaDecayer." );
142 existingDecayProcesses.push_back(
process);
146 for (G4VProcess*
process : existingDecayProcesses) {
147 processMgr->RemoveProcess(
process);
150 for (
unsigned int i=0;
i<fullProcessList->size(); ++
i) {
151 G4VProcess*
process = (*fullProcessList)[
i];
152 if (
process->GetProcessType() == fDecay) {
153 ATH_MSG_WARNING (
"There is another decay process for " <<
particle->GetParticleName() <<
" (" <<
pid <<
") already defined!" );
154 processMgr->DumpInfo();
157 if (
particle->GetParticleType()==
"rhadron" ) {
158 processMgr->AddDiscreteProcess(
new FullModelHadronicProcess());
159 if (pythiaDecayProcess->IsApplicable(*
particle)) {
161 processMgr->AddProcess(pythiaDecayProcess);
163 processMgr->SetProcessOrdering(pythiaDecayProcess, idxPostStep);
164 processMgr->SetProcessOrdering(pythiaDecayProcess, idxAtRest);
169 processMgr->AddProcess(pythiaDecayProcess);
171 processMgr->SetProcessOrdering(pythiaDecayProcess, idxPostStep);
172 processMgr->SetProcessOrdering(pythiaDecayProcess, idxAtRest);
177 processMgr->AddProcess(
new G4hMultipleScattering, -1, 1, 1);
178 processMgr->AddProcess(
new G4hIonisation, -1, 2, 2);
183 processMgr->DumpInfo();
189 ATH_MSG_DEBUG(
"RHadronsPhysicsTool::ConstructProcess() - list of handled RHadrons = " << handled);
190 ATH_MSG_DEBUG(
"RHadronsPhysicsTool::ConstructProcess() - end");