24 #include <phgeom/PHGeomUtility.h>
28 #include <phfield/PHFieldConfig.h>
29 #include <phfield/PHFieldConfigv1.h>
30 #include <phfield/PHFieldConfigv2.h>
31 #include <phfield/PHFieldUtility.h>
51 #include <CLHEP/Random/Random.h>
53 #include <G4HadronicParameters.hh>
54 #include <Geant4/G4Cerenkov.hh>
55 #include <Geant4/G4Element.hh>
56 #include <Geant4/G4EventManager.hh>
57 #include <Geant4/G4HadronicProcessStore.hh>
58 #include <Geant4/G4IonisParamMat.hh>
59 #include <Geant4/G4LossTableManager.hh>
60 #include <Geant4/G4Material.hh>
61 #include <Geant4/G4NistManager.hh>
62 #include <Geant4/G4OpAbsorption.hh>
63 #include <Geant4/G4OpBoundaryProcess.hh>
64 #include <Geant4/G4OpMieHG.hh>
65 #include <Geant4/G4OpRayleigh.hh>
66 #include <Geant4/G4OpWLS.hh>
67 #include <Geant4/G4OpticalPhoton.hh>
68 #include <Geant4/G4ParticleDefinition.hh>
69 #include <Geant4/G4ParticleTable.hh>
70 #include <Geant4/G4PhotoElectricEffect.hh>
71 #include <Geant4/G4ProcessManager.hh>
72 #include <Geant4/G4RunManager.hh>
73 #include <Geant4/G4Scintillation.hh>
74 #include <Geant4/G4StepLimiterPhysics.hh>
75 #include <Geant4/G4String.hh>
76 #include <Geant4/G4SystemOfUnits.hh>
77 #include <Geant4/G4Types.hh>
78 #include <Geant4/G4UIExecutive.hh>
79 #include <Geant4/G4UImanager.hh>
80 #include <Geant4/G4UImessenger.hh>
81 #include <Geant4/G4VModularPhysicsList.hh>
82 #include <Geant4/G4Version.hh>
83 #include <Geant4/G4VisExecutive.hh>
84 #include <Geant4/G4VisManager.hh>
85 #include <Geant4/Randomize.hh>
88 #include <Geant4/FTFP_BERT.hh>
89 #include <Geant4/FTFP_BERT_HP.hh>
90 #include <Geant4/FTFP_INCLXX.hh>
91 #include <Geant4/FTFP_INCLXX_HP.hh>
92 #include <Geant4/QGSP_BERT.hh>
93 #include <Geant4/QGSP_BERT_HP.hh>
94 #include <Geant4/QGSP_BIC.hh>
95 #include <Geant4/QGSP_BIC_HP.hh>
96 #include <Geant4/QGSP_INCLXX.hh>
97 #include <Geant4/QGSP_INCLXX_HP.hh>
105 class G4EmSaturation;
106 class G4TrackingManager;
144 std::cout <<
"========================= PHG4Reco::Init() ================================" << std::endl;
152 std::cout <<
"PHG4Reco::Init - create run manager" << std::endl;
159 G4UImanager *uimanager = G4UImanager::GetUIpointer();
169 G4VModularPhysicsList *myphysicslist =
nullptr;
172 myphysicslist =
new FTFP_BERT(
Verbosity());
176 setenv(
"AllowForHeavyElements",
"1", 1);
177 myphysicslist =
new FTFP_BERT_HP(
Verbosity());
181 myphysicslist =
new FTFP_INCLXX(
Verbosity());
185 setenv(
"AllowForHeavyElements",
"1", 1);
186 myphysicslist =
new FTFP_INCLXX_HP(
Verbosity());
190 myphysicslist =
new QGSP_BERT(
Verbosity());
194 setenv(
"AllowForHeavyElements",
"1", 1);
195 myphysicslist =
new QGSP_BERT_HP(
Verbosity());
199 myphysicslist =
new QGSP_BIC(
Verbosity());
203 setenv(
"AllowForHeavyElements",
"1", 1);
204 myphysicslist =
new QGSP_BIC_HP(
Verbosity());
208 myphysicslist =
new QGSP_INCLXX(
Verbosity());
212 setenv(
"AllowForHeavyElements",
"1", 1);
213 myphysicslist =
new QGSP_INCLXX_HP(
Verbosity());
217 std::cout <<
"Physics List " <<
m_PhysicsList <<
" not implemented" << std::endl;
224 std::cout <<
"Use PYTHIA Decayer" << std::endl;
225 G4HadronicParameters::Instance()->SetEnableBCParticles(
false);
231 myphysicslist->RegisterPhysics(decayer);
236 std::cout <<
"Use EvtGen Decayer" << std::endl;
237 G4HadronicParameters::Instance()->SetEnableBCParticles(
false);
244 myphysicslist->RegisterPhysics(decayer);
249 std::cout <<
"Use GEANT Internal Decayer" << std::endl;
252 myphysicslist->RegisterPhysics(
new G4StepLimiterPhysics());
255 myphysicslist->SetCutsWithDefault();
267 std::cout <<
"===========================================================================" << std::endl;
276 std::cout <<
"PHG4Reco::InitField - create magnetic field setup" << std::endl;
279 std::unique_ptr<PHFieldConfig> default_field_cfg(
nullptr);
298 std::cout <<
"PHG4Reco::InitField - create magnetic field setup" << std::endl;
319 static int InitRunDone = 0;
327 std::cout <<
"========================= PHG4Reco::InitRun() ================================" << std::endl;
346 const int field_ret =
InitField(topNode);
349 std::cout <<
"PHG4Reco::InitRun- Error - Failed field init with status = " << field_ret << std::endl;
358 std::cout <<
"PHG4Reco::InitRun - " << reco->Name() <<
"->InitRun" << std::endl;
360 reco->InitRun(topNode);
368 std::cout <<
"PHG4Reco::Init - create detector" << std::endl;
380 if (g4sub->GetDetector())
389 std::cout <<
"PHG4Reco::InitRun - WARNING - event/track/stepping action disabled! "
390 <<
"This is aimed to reduce resource consumption for G4 running only. E.g. dose analysis. "
391 <<
"Meanwhile, it will disable all Geant4 based analysis. Toggle this feature on/off with PHG4Reco::setDisableUserActions()" << std::endl;
421 std::cout <<
"Adding steppingaction for " << g4sub->Name() << std::endl;
427 if (not m_disableUserActions)
441 std::cout <<
"Adding steppingaction for " << g4sub->Name() << std::endl;
448 if (not m_disableUserActions)
460 if (g4sub->GetTrackingAction())
463 if (G4TrackingManager *trackingManager = G4EventManager::GetEventManager()->GetTrackingManager())
465 g4sub->GetTrackingAction()->SetTrackingManagerPointer(trackingManager);
470 if (not m_disableUserActions)
478 #if G4VERSION_NUMBER >= 1033
479 G4EmSaturation *emSaturation = G4LossTableManager::Instance()->EmSaturation();
482 std::cout <<
PHWHERE <<
"Could not initialize EmSaturation, Birks constants will fail" << std::endl;
488 G4Cerenkov *theCerenkovProcess =
new G4Cerenkov(
"Cerenkov");
490 G4Scintillation *theScintillationProcess =
new G4Scintillation(
"Scintillation");
499 theCerenkovProcess->SetMaxNumPhotonsPerStep(300);
500 theCerenkovProcess->SetMaxBetaChangePerStep(10.0);
501 theCerenkovProcess->SetTrackSecondariesFirst(
false);
502 #if G4VERSION_NUMBER < 1100
503 theScintillationProcess->SetScintillationYieldFactor(1.0);
505 theScintillationProcess->SetTrackSecondariesFirst(
false);
513 G4ParticleTable *theParticleTable = G4ParticleTable::GetParticleTable();
514 G4ParticleTable::G4PTblDicIterator *_theParticleIterator;
515 _theParticleIterator = theParticleTable->GetIterator();
516 _theParticleIterator->reset();
517 while ((*_theParticleIterator)())
519 G4ParticleDefinition *
particle = _theParticleIterator->value();
520 G4String particleName = particle->GetParticleName();
521 G4ProcessManager *pmanager = particle->GetProcessManager();
522 if (theCerenkovProcess->IsApplicable(*particle))
524 pmanager->AddProcess(theCerenkovProcess);
525 pmanager->SetProcessOrdering(theCerenkovProcess, idxPostStep);
527 if (theScintillationProcess->IsApplicable(*particle))
529 pmanager->AddProcess(theScintillationProcess);
530 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
531 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
535 g4sub->AddProcesses(particle);
538 G4ProcessManager *pmanager = G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
540 pmanager->AddDiscreteProcess(
new G4OpAbsorption());
541 pmanager->AddDiscreteProcess(
new G4OpRayleigh());
542 pmanager->AddDiscreteProcess(
new G4OpMieHG());
543 pmanager->AddDiscreteProcess(
new G4OpBoundaryProcess());
544 pmanager->AddDiscreteProcess(
new G4OpWLS());
545 pmanager->AddDiscreteProcess(
new G4PhotoElectricEffect());
555 G4HadronicProcessStore::Instance()->SetVerbose(0);
556 G4LossTableManager::Instance()->SetVerbose(1);
567 std::cout <<
"PHG4Reco::InitRun - export geometry to DST via tmp file " << filename << std::endl;
578 std::cout <<
"===========================================================================" << std::endl;
591 G4RunManager::GetRunManager()->SetRandomNumberStore(
true);
623 char *
args[] = {(
char *) (
"root.exe")};
624 G4UIExecutive *ui =
new G4UIExecutive(1, args,
"qt");
626 m_UImanager->ApplyCommand(
"/control/execute init_gui_vis.mac");
650 G4Random::showEngineStatus();
654 PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
661 std::cout <<
"PHG4Reco::process_event - " << reco->Name() <<
"->process_event" << std::endl;
666 reco->process_event(topNode);
668 catch (
const std::exception &
e)
670 std::cout <<
PHWHERE <<
" caught exception thrown during process_event from "
671 << reco->Name() << std::endl;
672 std::cout <<
"error: " << e.what() << std::endl;
680 std::cout <<
" PHG4Reco::process_event - "
681 <<
"run one event :" << std::endl;
690 std::cout <<
" PHG4Reco::process_event - " << g4sub->Name() <<
"->process_after_geant" << std::endl;
694 g4sub->process_after_geant(topNode);
696 catch (
const std::exception &
e)
698 std::cout <<
PHWHERE <<
" caught exception thrown during process_after_geant from "
699 << g4sub->Name() << std::endl;
700 std::cout <<
"error: " << e.what() << std::endl;
711 reco->ResetEvent(topNode);
720 if (what.empty() || what ==
"ALL" || (reco->Name()).find(what) != std::string::npos)
722 std::cout <<
"Printing " << reco->Name() << std::endl;
724 std::cout <<
"---------------------------" << std::endl;
732 PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
760 CLHEP::HepRandom::setTheSeed(i);
764 G4Random::showEngineStatus();
773 G4String symbol,
name;
775 G4double fractionmass,
a;
776 G4int ncomponents, natoms,
z;
786 G4Material *quartz =
new G4Material(
"Quartz", density = 2.200 *
g /
cm3, ncomponents = 2);
787 quartz->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 1);
788 quartz->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 2);
791 G4Material *cfrp_intt =
new G4Material(
"CFRP_INTT", density = 1.69 *
g /
cm3, ncomponents = 3);
792 cfrp_intt->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 10);
793 cfrp_intt->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 6);
794 cfrp_intt->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 1);
797 G4Material *PropyleneGlycol =
new G4Material(
"Propyleneglycol", 1.036 *
g /
cm3, 3);
798 PropyleneGlycol->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 3);
799 PropyleneGlycol->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 8);
800 PropyleneGlycol->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 2);
802 G4Material *WaterGlycol_INTT =
new G4Material(
"WaterGlycol_INTT", density = (0.997 * 0.7 + 1.036 * 0.3) *
g /
cm3, ncomponents = 2);
803 WaterGlycol_INTT->AddMaterial(PropyleneGlycol, fractionmass = 0.30811936);
804 WaterGlycol_INTT->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_WATER"), fractionmass = 0.69188064);
807 G4Material *rohacell_foam_110 =
new G4Material(
"ROHACELL_FOAM_110", density = 0.110 *
g /
cm3, ncomponents = 4);
808 rohacell_foam_110->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 8);
809 rohacell_foam_110->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 11);
810 rohacell_foam_110->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 2);
811 rohacell_foam_110->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"N"), 1);
815 G4Material *rohacell_foam_51 =
new G4Material(
"ROHACELL_FOAM_51", density = 0.052 *
g /
cm3, ncomponents = 4);
816 rohacell_foam_51->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 8);
817 rohacell_foam_51->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 11);
818 rohacell_foam_51->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 2);
819 rohacell_foam_51->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"N"), 1);
823 G4Material *peek =
new G4Material(
"PEEK", density = 1.32 *
g /
cm3, ncomponents = 3);
824 peek->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 19);
825 peek->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 12);
826 peek->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 3);
828 G4Material *cf =
new G4Material(
"CF", density = 1.62 *
g /
cm3, ncomponents = 1);
829 cf->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 1.);
831 G4Material *cf30_peek70 =
new G4Material(
"CF30_PEEK70", density = (1.32 * 0.7 + 1.62 * 0.3) *
g /
cm3, ncomponents = 2);
832 cf30_peek70->AddMaterial(cf, fractionmass = 0.34468085);
833 cf30_peek70->AddMaterial(peek, fractionmass = 0.65531915);
836 G4Material *StainlessSteel =
837 new G4Material(
"SS304", density = 7.9 *
g /
cm3, ncomponents = 8);
838 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.70105);
839 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Cr"), 0.18);
840 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Ni"), 0.09);
841 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.02);
842 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 0.0007);
843 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"S"), 0.0003);
844 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 0.0075);
845 StainlessSteel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"P"), 0.00045);
848 new G4Material(
"SS310", density = 8.0 *
g /
cm3, ncomponents = 8);
849 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.50455);
850 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Cr"), 0.25);
851 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Ni"), 0.20);
852 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.02);
853 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 0.0025);
854 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"S"), 0.015);
855 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 0.0075);
856 SS310->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"P"), 0.00045);
860 new G4Material(
"SS316", density = 8.0 *
g /
cm3, ncomponents = 9);
861 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.68095);
862 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Cr"), 0.16);
863 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Ni"), 0.11);
864 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.02);
865 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mo"), 0.02);
866 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 0.0008);
867 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"S"), 0.0003);
868 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 0.0075);
869 SS316->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"P"), 0.00045);
872 new G4Material(
"Steel", density = 7.86 *
g /
cm3, ncomponents = 5);
873 Steel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.9834);
874 Steel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.014);
875 Steel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 0.0017);
876 Steel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"S"), 0.00045);
877 Steel->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"P"), 0.00045);
880 G4Material *a36 =
new G4Material(
"Steel_A36", density = 7.85 *
g /
cm3, ncomponents = 5);
881 a36->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.9824);
882 a36->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Cu"), 0.002);
883 a36->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 0.0025);
884 a36->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.0103);
885 a36->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 0.0028);
888 G4Material *steel_1006 =
new G4Material(
"Steel_1006", density = 7.872 *
g /
cm3, ncomponents = 2);
889 steel_1006->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.996);
890 steel_1006->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.004);
893 G4Material *Al5083 =
new G4Material(
"Al5083", density = 2.65 *
g /
cm3, ncomponents = 3);
894 Al5083->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mn"), 0.004);
895 Al5083->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mg"), 0.04);
896 Al5083->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Al"), 0.956);
899 G4Material *Al4046 =
new G4Material(
"Al4046", density = 2.66 *
g /
cm3, ncomponents = 3);
900 Al4046->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Al"), 0.897);
901 Al4046->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 0.1);
902 Al4046->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mg"), 0.003);
905 G4Material *Al6061T6 =
new G4Material(
"Al6061T6", density = 2.70 *
g /
cm3, ncomponents = 4);
906 Al6061T6->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Al"), 0.975);
907 Al6061T6->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), 0.008);
908 Al6061T6->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Mg"), 0.01);
909 Al6061T6->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Fe"), 0.007);
914 G4double density_e864 = (0.99 * 11.34 + 0.01 * 6.697) *
g /
cm3;
915 G4Material *absorber_e864 =
new G4Material(
"E864_Absorber", density_e864, 2);
916 absorber_e864->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Pb"), 0.99);
917 absorber_e864->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Sb"), 0.01);
919 G4Material *FPC =
new G4Material(
"FPC", 1.542 *
g /
cm3, 2);
920 FPC->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Cu"), 0.0162);
921 FPC->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_KAPTON"), 0.9838);
924 G4Material *W_Epoxy =
new G4Material(
"W_Epoxy", density = 10.2 *
g /
cm3, ncomponents = 2);
925 W_Epoxy->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_W"), fractionmass = 0.5);
926 W_Epoxy->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_POLYSTYRENE"), fractionmass = 0.5);
931 G4Material *Epoxy =
new G4Material(
"Epoxy", 1.2 *
g /
cm3, ncomponents = 2);
932 Epoxy->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), natoms = 2);
933 Epoxy->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), natoms = 2);
936 density = 1.86 *
g /
cm3;
937 G4Material *FR4 =
new G4Material(
"FR4", density, ncomponents = 2);
938 FR4->AddMaterial(quartz, fractionmass = 0.528);
939 FR4->AddMaterial(Epoxy, fractionmass = 0.472);
945 density = 29 *
kg /
m3;
946 G4Material *NOMEX =
new G4Material(
"NOMEX", density, ncomponents = 4);
947 NOMEX->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), natoms = 14);
948 NOMEX->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), natoms = 10);
949 NOMEX->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"N"), natoms = 2);
950 NOMEX->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), natoms = 2);
957 G4Material *Spacal_W_Epoxy =
958 new G4Material(
"Spacal_W_Epoxy", density = 12.18 *
g /
cm3, ncomponents = 3);
959 Spacal_W_Epoxy->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 0.029);
960 Spacal_W_Epoxy->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 0.002);
961 Spacal_W_Epoxy->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"W"), 0.969);
968 new G4Material(
"PMMA", density = 1.19 *
g /
cm3, ncomponents = 3);
969 PMMA->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), 3.6 / (3.6 + 5.7 + 1.4));
970 PMMA->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), 5.7 / (3.6 + 5.7 + 1.4));
971 PMMA->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), 1.4 / (3.6 + 5.7 + 1.4));
974 G4Material *Uniplast_scintillator =
new G4Material(
"Uniplast_scintillator", 1.06 *
g /
cm3, ncomponents = 1);
975 Uniplast_scintillator->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_POLYSTYRENE"), fractionmass = 1.);
978 new G4Material(
"G10", density = 1.700 *
g /
cm3, ncomponents = 4);
979 G10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), natoms = 1);
980 G10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), natoms = 2);
981 G10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), natoms = 3);
982 G10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), natoms = 3);
985 new G4Material(
"CsI", density = 4.534 *
g /
cm3, ncomponents = 2);
986 CsI->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Cs"), natoms = 1);
987 CsI->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"I"), natoms = 1);
988 CsI->GetIonisation()->SetMeanExcitationEnergy(553.1 *
eV);
991 new G4Material(
"C4F10", density = 0.00973 *
g /
cm3, ncomponents = 2);
992 C4F10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), natoms = 4);
993 C4F10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"F"), natoms = 10);
995 G4Material *CF4 =
new G4Material(
"CF4", density = 3.72 * mg /
cm3, ncomponents = 2, kStateGas, 288.15 * kelvin, 1 * atmosphere);
996 CF4->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), natoms = 1);
997 CF4->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"F"), natoms = 4);
999 G4Element *elLu =
new G4Element(name =
"Lutetium", symbol =
"Lu", z = 71., a = 174.97 *
g / mole);
1000 G4Material *LSO =
new G4Material(
"LSO",
1001 density = 7.4 *
g /
cm3,
1004 LSO->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Si"), natoms = 1);
1005 LSO->AddElement(elLu, natoms = 2);
1006 LSO->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"O"), natoms = 5);
1009 G4Material *SilverEpoxyGlue_INTT =
new G4Material(
"SilverEpoxyGlue_INTT", density = 3.2 *
g /
cm3, ncomponents = 2);
1010 SilverEpoxyGlue_INTT->AddMaterial(Epoxy, fractionmass = 0.79);
1011 SilverEpoxyGlue_INTT->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Ag"), fractionmass = 0.21);
1014 double G4_Ne_frac = 0.5;
1015 double CF4_frac = 0.5;
1016 const double den_G4_Ne = G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Ne")->GetDensity();
1017 const double den_CF4_2 = CF4->GetDensity();
1018 const double den_sphenix_tpc_gas = den_G4_Ne * G4_Ne_frac + den_CF4_2 * CF4_frac;
1019 G4Material *sPHENIX_tpc_gas =
new G4Material(
"sPHENIX_TPC_Gas", den_sphenix_tpc_gas, ncomponents = 2, kStateGas);
1020 sPHENIX_tpc_gas->AddMaterial(CF4, den_CF4_2 * CF4_frac / den_sphenix_tpc_gas);
1021 sPHENIX_tpc_gas->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Ne"), den_G4_Ne * G4_Ne_frac / den_sphenix_tpc_gas);
1026 double alt_G4_Ar_frac = 0.6;
1027 double alt_CF4_frac = 0.4;
1028 const double alt_den_G4_Ar = G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Ar")->GetDensity();
1029 const double alt_den_CF4 = CF4->GetDensity();
1030 const double alt_den_sphenix_tpc_gas = alt_den_G4_Ar * alt_G4_Ar_frac + alt_den_CF4 * alt_CF4_frac;
1031 G4Material *alt_sPHENIX_tpc_gas =
new G4Material(
"sPHENIX_TPC_Gas_ArCF4", alt_den_sphenix_tpc_gas, ncomponents = 2, kStateGas);
1032 alt_sPHENIX_tpc_gas->AddMaterial(CF4, alt_den_CF4 * alt_CF4_frac / alt_den_sphenix_tpc_gas);
1033 alt_sPHENIX_tpc_gas->AddMaterial(G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Ar"), alt_den_G4_Ar * alt_G4_Ar_frac / alt_den_sphenix_tpc_gas);
1037 new G4Material(
"P10", density = 1.74 * mg /
cm3, ncomponents = 3);
1038 P10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"Ar"), fractionmass = 0.9222);
1039 P10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"C"), fractionmass = 0.0623);
1040 P10->AddElement(G4NistManager::Instance()->FindOrBuildElement(
"H"), fractionmass = 0.0155);
1067 if (subsys->Name() ==
name)
1071 std::cout <<
"Found Subsystem " << name << std::endl;
1076 std::cout <<
"Could not find Subsystem " << name << std::endl;
1103 std::cout <<
"Adding steppingaction for " << g4sub->Name() << std::endl;