18 #include <phgeom/PHGeomUtility.h>
22 #include <phfield/PHFieldUtility.h>
23 #include <phfield/PHFieldConfig_v1.h>
24 #include <phfield/PHFieldConfig_v2.h>
25 #include <phfield/PHFieldConfig_v3.h>
34 #include <phparameter/PHParameters.h>
38 #include <CLHEP/Random/Random.h>
40 #include <Geant4/G4RunManager.hh>
42 #include <Geant4/G4Material.hh>
43 #include <Geant4/G4NistManager.hh>
44 #include <Geant4/G4OpenGLImmediateX.hh>
45 #include <Geant4/G4Region.hh>
46 #include <Geant4/G4RegionStore.hh>
47 #include <Geant4/G4StepLimiterPhysics.hh>
48 #include <Geant4/G4UIExecutive.hh>
49 #include <Geant4/G4UImanager.hh>
50 #include <Geant4/G4VisExecutive.hh>
51 #include <Geant4/G4Cerenkov.hh>
52 #include <Geant4/G4EmProcessOptions.hh>
53 #include <Geant4/G4EmSaturation.hh>
54 #include <Geant4/G4FastSimulationManager.hh>
55 #include <Geant4/G4HadronicProcessStore.hh>
56 #include <Geant4/G4LossTableManager.hh>
57 #include <Geant4/G4OpAbsorption.hh>
58 #include <Geant4/G4OpBoundaryProcess.hh>
59 #include <Geant4/G4OpMieHG.hh>
60 #include <Geant4/G4OpRayleigh.hh>
61 #include <Geant4/G4OpWLS.hh>
62 #include <Geant4/G4OpticalPhoton.hh>
63 #include <Geant4/G4OpticalPhysics.hh>
64 #include <Geant4/G4PAIModel.hh>
65 #include <Geant4/G4PEEffectFluoModel.hh>
66 #include <Geant4/G4EmProcessOptions.hh>
67 #include <Geant4/G4HadronicProcessStore.hh>
68 #include <Geant4/G4StepLimiterPhysics.hh>
69 #include <Geant4/G4ParticleDefinition.hh>
70 #include <Geant4/G4ParticleTable.hh>
71 #include <Geant4/G4ParticleTypes.hh>
72 #include <Geant4/G4ProcessManager.hh>
73 #include <Geant4/G4Scintillation.hh>
74 #include <Geant4/G4SystemOfUnits.hh>
75 #include <Geant4/G4Version.hh>
76 #include <Geant4/globals.hh>
79 #include <Geant4/FTFP_BERT.hh>
80 #include <Geant4/LBE.hh>
81 #include <Geant4/QGSP_BERT.hh>
82 #include <Geant4/QGSP_BIC.hh>
83 #include <Geant4/QGSP_BIC_HP.hh>
85 #if G4VERSION_NUMBER <= 951
87 #include <Geant4/LHEP.hh>
90 #if G4VERSION_NUMBER >= 1001
91 #define HAVE_FTFP_BERT_HP
92 #define HAVE_QGSP_BERT_HP
93 #include <Geant4/FTFP_BERT_HP.hh>
94 #include <Geant4/QGSP_BERT_HP.hh>
121 , magfield_rescale(1.0)
123 , runManager_(nullptr)
124 , uisession_(nullptr)
126 , eventAction_(nullptr)
127 , steppingAction_(nullptr)
128 , trackingAction_(nullptr)
129 , generatorAction_(nullptr)
130 , visManager(nullptr)
134 , worldshape(
"G4Tubs")
135 , worldmaterial(
"G4_AIR")
136 #if G4VERSION_NUMBER >= 1033
137 , physicslist(
"FTFP_BERT")
139 , physicslist(
"QGSP_BERT")
141 , active_decayer_(true)
142 , active_force_decay_(false)
143 , force_decay_type_(
kAll)
144 , save_DST_geometry_(true)
145 , optical_photon_(false)
146 , energy_threshold_(0.0005)
147 , zero_field_line_(99999.)
150 for (
int i = 0; i < 3; i++)
179 cout <<
"========================= PHG4Reco::Init() ================================" << endl;
185 if (
verbosity > 1) cout <<
"PHG4Reco::Init - create run manager" << endl;
191 G4UImanager *uimanager = G4UImanager::GetUIpointer();
201 G4VModularPhysicsList *myphysicslist =
nullptr;
204 myphysicslist =
new FTFP_BERT(
verbosity);
208 myphysicslist =
new QGSP_BERT(
verbosity);
216 setenv(
"AllowForHeavyElements",
"1", 1);
217 myphysicslist =
new QGSP_BIC_HP(
verbosity);
225 #ifdef HAVE_FTFP_BERT_HP
228 setenv(
"AllowForHeavyElements",
"1", 1);
229 myphysicslist =
new FTFP_BERT_HP(
verbosity);
232 #ifdef HAVE_QGSP_BERT_HP
235 setenv(
"AllowForHeavyElements",
"1", 1);
236 myphysicslist =
new QGSP_BERT_HP(
verbosity);
241 cout <<
"Physics List " <<
physicslist <<
" not implemented" << endl;
249 myphysicslist->RegisterPhysics(decayer);
251 myphysicslist->RegisterPhysics(
new G4StepLimiterPhysics());
254 myphysicslist->SetCutsWithDefault();
258 #if G4VERSION_NUMBER >= 1033
259 G4EmSaturation* emSaturation = G4LossTableManager::Instance()->EmSaturation();
262 cout <<
PHWHERE <<
"Could not initialize EmSaturation, Birks constants will fail" << endl;
274 cout <<
"===========================================================================" << endl;
281 if (
verbosity > 1) cout <<
"PHG4Reco::InitField - create magnetic field setup" << endl;
283 unique_ptr<PHFieldConfig> default_field_cfg(
nullptr);
286 std::vector<std::string> fieldmapfiles(std::istream_iterator<std::string>{ssfieldmapfile},
287 std::istream_iterator<std::string>());
289 if (fieldmapfiles.size() == 1)
293 else if (fieldmapfiles.size() == 0)
297 else if (fieldmapfiles.size() == 2)
300 fieldmapfiles[0], fieldmapfiles[1], 1.0, 1.0, 5.0
303 else if (fieldmapfiles.size() == 5)
306 fieldmapfiles[0], fieldmapfiles[1], std::stod(fieldmapfiles[2]), std::stod(fieldmapfiles[3]), std::stod(fieldmapfiles[4])
310 if (
verbosity > 1) cout <<
"PHG4Reco::InitField - create magnetic field setup" << endl;
330 static int InitRunDone = 0;
338 cout <<
"========================= PHG4Reco::InitRun() ================================" << endl;
344 const int field_ret =
InitField(topNode);
347 cout <<
"PHG4Reco::InitRun- Error - Failed field init with status = "<<field_ret<<endl;
355 reco->InitRun(topNode);
359 if (
verbosity > 1) cout <<
"PHG4Reco::Init - create detector" << endl;
374 double z_offset = 0.;
378 cout <<
"Will update the z-positions of the downstream volumes by zOffset = " << z_offset <<
"cm." << endl;
387 double z_in_world = g4sub->GetParams()->get_double_param(
"place_z");
390 g4sub->GetParams()->set_double_param(
"place_z", z_in_world - z_offset);
431 cout <<
"Adding steppingaction for " << g4sub->Name() << endl;
446 if (g4sub->GetTrackingAction())
449 if (G4TrackingManager *trackingManager = G4EventManager::GetEventManager()->GetTrackingManager())
451 g4sub->GetTrackingAction()->SetTrackingManagerPointer(trackingManager);
465 G4Cerenkov *theCerenkovProcess =
new G4Cerenkov(
"Cerenkov");
476 theCerenkovProcess->SetMaxNumPhotonsPerStep(100);
477 theCerenkovProcess->SetMaxBetaChangePerStep(10.0);
478 theCerenkovProcess->SetTrackSecondariesFirst(
true);
488 G4ParticleTable *theParticleTable = G4ParticleTable::GetParticleTable();
489 G4ParticleTable::G4PTblDicIterator *_theParticleIterator;
490 _theParticleIterator = theParticleTable->GetIterator();
491 _theParticleIterator->reset();
492 while ((*_theParticleIterator)())
494 G4ParticleDefinition *particle = _theParticleIterator->value();
495 G4String particleName = particle->GetParticleName();
496 G4ProcessManager *pmanager = particle->GetProcessManager();
497 if (theCerenkovProcess->IsApplicable(*particle))
499 pmanager->AddProcess(theCerenkovProcess);
500 pmanager->SetProcessOrdering(theCerenkovProcess, idxPostStep);
509 G4ProcessManager *pmanager = G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
511 pmanager->AddDiscreteProcess(
new G4OpAbsorption());
512 pmanager->AddDiscreteProcess(
new G4OpRayleigh());
513 pmanager->AddDiscreteProcess(
new G4OpMieHG());
514 pmanager->AddDiscreteProcess(
new G4OpBoundaryProcess());
515 pmanager->AddDiscreteProcess(
new G4OpWLS());
516 pmanager->AddDiscreteProcess(
new G4PhotoElectricEffect());
527 G4HadronicProcessStore::Instance()->SetVerbose(0);
528 G4LossTableManager::Instance()->SetVerbose(1);
538 const string filename =
541 cout <<
"PHG4Reco::InitRun - export geometry to DST via tmp file " << filename << endl;
552 cout <<
"===========================================================================" << endl;
569 int iret =
UImanager->ApplyCommand(cmd.c_str());
604 PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
611 cout <<
"PHG4Reco::process_event - " << reco->Name() <<
"->process_event" << endl;
615 reco->process_event(topNode);
617 catch (
const exception &e)
619 cout <<
PHWHERE <<
" caught exception thrown during process_event from "
620 << reco->Name() << endl;
621 cout <<
"error: " << e.what() << endl;
632 cout <<
" PHG4Reco::process_event - "
633 <<
"run one event :" << endl;
643 cout <<
" PHG4Reco::process_event - " << g4sub->Name() <<
"->process_after_geant" << endl;
646 g4sub->process_after_geant(topNode);
648 catch (
const exception &e)
650 cout <<
PHWHERE <<
" caught exception thrown during process_after_geant from "
651 << g4sub->Name() << endl;
652 cout <<
"error: " << e.what() << endl;
666 reco->ResetEvent(topNode);
682 if (what.empty() || what ==
"ALL" || (reco->Name()).find(what) != string::npos)
684 cout <<
"Printing " << reco->Name() << endl;
686 cout <<
"---------------------------" << endl;
694 PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
727 CLHEP::HepRandom::setTheSeed(i);
734 G4UIExecutive *ui =
new G4UIExecutive(0,
nullptr,
"Xm");
737 if (ui->IsGUI() &&
true)
739 UImanager->ApplyCommand(
"/control/execute gui.mac");
755 G4double fractionmass;
757 G4int ncomponents, natoms;
760 set<G4String> ignoremat;
761 ignoremat.insert(
"G4_Cf");
764 G4NistManager *nist = G4NistManager::Instance();
765 vector<G4String> matnames = nist->GetNistMaterialNames();
766 while (matnames.begin() != matnames.end())
768 G4String mat = matnames.back();
769 if (ignoremat.find(mat) == ignoremat.end())
771 nist->FindOrBuildMaterial(mat);
777 G4Material *quartz =
new G4Material(
"Quartz", density = 2.200 * g / cm3, ncomponents = 2);
778 quartz->AddElement(G4Element::GetElement(
"Si"), 1);
779 quartz->AddElement(G4Element::GetElement(
"O"), 2);
782 G4Material *IsoButane =
new G4Material(
"Isobutane", 0.00265 * g / cm3, 2);
783 IsoButane->AddElement(G4Element::GetElement(
"C"), 4);
784 IsoButane->AddElement(G4Element::GetElement(
"H"), 10);
786 G4Material *MuIDgas =
new G4Material(
"MuIDgas", density = (1.977e-3 * 0.92 + 0.00265 * 0.08) * g / cm3, ncomponents = 2);
787 MuIDgas->AddMaterial(IsoButane, fractionmass = 0.08);
788 MuIDgas->AddMaterial(G4Material::GetMaterial(
"G4_CARBON_DIOXIDE"), fractionmass = 0.92);
791 G4Material *StainlessSteel =
792 new G4Material(
"SS304", density = 7.9 * g / cm3, ncomponents = 8);
793 StainlessSteel->AddElement(G4Element::GetElement(
"Fe"), 0.70105);
794 StainlessSteel->AddElement(G4Element::GetElement(
"Cr"), 0.18);
795 StainlessSteel->AddElement(G4Element::GetElement(
"Ni"), 0.09);
796 StainlessSteel->AddElement(G4Element::GetElement(
"Mn"), 0.02);
797 StainlessSteel->AddElement(G4Element::GetElement(
"C"), 0.0007);
798 StainlessSteel->AddElement(G4Element::GetElement(
"S"), 0.0003);
799 StainlessSteel->AddElement(G4Element::GetElement(
"Si"), 0.0075);
800 StainlessSteel->AddElement(G4Element::GetElement(
"P"), 0.00045);
803 new G4Material(
"SS310", density = 8.0 * g / cm3, ncomponents = 8);
804 SS310->AddElement(G4Element::GetElement(
"Fe"), 0.50455);
805 SS310->AddElement(G4Element::GetElement(
"Cr"), 0.25);
806 SS310->AddElement(G4Element::GetElement(
"Ni"), 0.20);
807 SS310->AddElement(G4Element::GetElement(
"Mn"), 0.02);
808 SS310->AddElement(G4Element::GetElement(
"C"), 0.0025);
809 SS310->AddElement(G4Element::GetElement(
"S"), 0.015);
810 SS310->AddElement(G4Element::GetElement(
"Si"), 0.0075);
811 SS310->AddElement(G4Element::GetElement(
"P"), 0.00045);
814 new G4Material(
"Steel", density = 7.86 * g / cm3, ncomponents = 5);
815 Steel->AddElement(G4Element::GetElement(
"Fe"), 0.9834);
816 Steel->AddElement(G4Element::GetElement(
"Mn"), 0.014);
817 Steel->AddElement(G4Element::GetElement(
"C"), 0.0017);
818 Steel->AddElement(G4Element::GetElement(
"S"), 0.00045);
819 Steel->AddElement(G4Element::GetElement(
"P"), 0.00045);
822 G4Material *a36 =
new G4Material(
"Steel_A36", density = 7.85 * g / cm3, ncomponents = 5);
823 a36->AddElement(G4Element::GetElement(
"Fe"), 0.9824);
824 a36->AddElement(G4Element::GetElement(
"Cu"), 0.002);
825 a36->AddElement(G4Element::GetElement(
"C"), 0.0025);
826 a36->AddElement(G4Element::GetElement(
"Mn"), 0.0103);
827 a36->AddElement(G4Element::GetElement(
"Si"), 0.0028);
830 G4Material *steel_1006 =
new G4Material(
"Steel_1006", density = 7.872 * g / cm3, ncomponents = 2);
831 steel_1006->AddElement(G4Element::GetElement(
"Fe"), 0.996);
832 steel_1006->AddElement(G4Element::GetElement(
"Mn"), 0.004);
835 G4Material *Al5083 =
new G4Material(
"Al5083", density = 2.65 * g / cm3, ncomponents = 3);
836 Al5083->AddElement(G4Element::GetElement(
"Mn"), 0.004);
837 Al5083->AddElement(G4Element::GetElement(
"Mg"), 0.04);
838 Al5083->AddElement(G4Element::GetElement(
"Al"), 0.956);
840 G4Material *FPC =
new G4Material(
"FPC", 1.542 * g / cm3, 2);
841 FPC->AddMaterial(G4Material::GetMaterial(
"G4_Cu"), 0.0162);
842 FPC->AddMaterial(G4Material::GetMaterial(
"G4_KAPTON"), 0.9838);
845 G4Material *W_Epoxy =
new G4Material(
"W_Epoxy", density = 10.2 * g / cm3, ncomponents = 2);
846 W_Epoxy->AddMaterial(G4Material::GetMaterial(
"G4_W"), fractionmass = 0.5);
847 W_Epoxy->AddMaterial(G4Material::GetMaterial(
"G4_POLYSTYRENE"), fractionmass = 0.5);
852 G4Material *Epoxy =
new G4Material(
"Epoxy", 1.2 * g / cm3, ncomponents = 2);
853 Epoxy->AddElement(G4Element::GetElement(
"H"), natoms = 2);
854 Epoxy->AddElement(G4Element::GetElement(
"C"), natoms = 2);
857 density = 1.86 * g / cm3;
858 G4Material *FR4 =
new G4Material(
"FR4", density, ncomponents = 2);
859 FR4->AddMaterial(quartz, fractionmass = 0.528);
860 FR4->AddMaterial(Epoxy, fractionmass = 0.472);
867 G4Material *NOMEX =
new G4Material(
"NOMEX", density, ncomponents = 4);
868 NOMEX->AddElement(G4Element::GetElement(
"C"), natoms = 14);
869 NOMEX->AddElement(G4Element::GetElement(
"H"), natoms = 10);
870 NOMEX->AddElement(G4Element::GetElement(
"N"), natoms = 2);
871 NOMEX->AddElement(G4Element::GetElement(
"O"), natoms = 2);
878 G4Material *Spacal_W_Epoxy =
879 new G4Material(
"Spacal_W_Epoxy", density = 12.18 * g / cm3, ncomponents = 3);
880 Spacal_W_Epoxy->AddElement(G4Element::GetElement(
"C"), 0.029);
881 Spacal_W_Epoxy->AddElement(G4Element::GetElement(
"H"), 0.002);
882 Spacal_W_Epoxy->AddElement(G4Element::GetElement(
"W"), 0.969);
889 new G4Material(
"PMMA", density = 1.19 * g / cm3, ncomponents = 3);
890 PMMA->AddElement(G4Element::GetElement(
"C"), 3.6 / (3.6 + 5.7 + 1.4));
891 PMMA->AddElement(G4Element::GetElement(
"H"), 5.7 / (3.6 + 5.7 + 1.4));
892 PMMA->AddElement(G4Element::GetElement(
"O"), 1.4 / (3.6 + 5.7 + 1.4));
895 new G4Material(
"G10", density = 1.700 * g / cm3, ncomponents = 4);
896 G10->AddElement(G4Element::GetElement(
"Si"), natoms = 1);
897 G10->AddElement(G4Element::GetElement(
"O"), natoms = 2);
898 G10->AddElement(G4Element::GetElement(
"C"), natoms = 3);
899 G10->AddElement(G4Element::GetElement(
"H"), natoms = 3);
902 new G4Material(
"CsI", density = 4.534 * g / cm3, ncomponents = 2);
903 CsI->AddElement(G4Element::GetElement(
"Cs"), natoms = 1);
904 CsI->AddElement(G4Element::GetElement(
"I"), natoms = 1);
905 CsI->GetIonisation()->SetMeanExcitationEnergy(553.1 * eV);
908 new G4Material(
"C4F10", density = 0.00973 * g / cm3, ncomponents = 2);
909 C4F10->AddElement(G4Element::GetElement(
"C"), natoms = 4);
910 C4F10->AddElement(G4Element::GetElement(
"F"), natoms = 10);
912 G4Material *CF4 =
new G4Material(
"CF4", density = 3.72 * mg / cm3, ncomponents = 2, kStateGas, 288.15 * kelvin, 1 * atmosphere);
913 CF4->AddElement(G4Element::GetElement(
"C"), natoms = 1);
914 CF4->AddElement(G4Element::GetElement(
"F"), natoms = 4);
920 const double den_CF4 = CF4->GetDensity() * .1;
921 const double den_G4_Ar = G4Material::GetMaterial(
"G4_Ar")->GetDensity() * .8;
922 const double den_G4_CARBON_DIOXIDE = G4Material::GetMaterial(
"G4_CARBON_DIOXIDE")->GetDensity() * .1;
923 const double den = den_CF4 + den_G4_Ar + den_G4_CARBON_DIOXIDE;
925 G4Material *ePHEINX_TPC_Gas =
new G4Material(
"ePHEINX_TPC_Gas", den,
926 ncomponents = 3, kStateGas);
927 ePHEINX_TPC_Gas->AddMaterial(CF4, den_CF4 / den);
928 ePHEINX_TPC_Gas->AddMaterial(G4Material::GetMaterial(
"G4_Ar"), den_G4_Ar / den);
929 ePHEINX_TPC_Gas->AddMaterial(G4Material::GetMaterial(
"G4_CARBON_DIOXIDE"),
930 den_G4_CARBON_DIOXIDE / den);
933 double G4_Ne_frac = 0.9;
934 double CF4_frac = 0.1;
935 const double den_G4_Ne = G4Material::GetMaterial(
"G4_Ne")->GetDensity();
936 const double den_CF4_2 = CF4->GetDensity();
937 const double den_sphenix_tpc_gas = den_G4_Ne * G4_Ne_frac + den_CF4_2 * CF4_frac;
938 G4Material *sPHENIX_tpc_gas =
new G4Material(
"sPHENIX_TPC_Gas", den_sphenix_tpc_gas, ncomponents = 2, kStateGas);
939 sPHENIX_tpc_gas->AddMaterial(CF4, den_CF4_2 * CF4_frac / den_sphenix_tpc_gas);
940 sPHENIX_tpc_gas->AddMaterial(G4Material::GetMaterial(
"G4_Ne"), den_G4_Ne * G4_Ne_frac / den_sphenix_tpc_gas);
944 const G4int nEntries_CF4 = 50;
946 G4double PhotonEnergy_CF4[nEntries_CF4] =
947 {5.5 * eV, 5.6 * eV, 5.7 * eV, 5.8 * eV, 5.9 * eV,
948 6.0 * eV, 6.1 * eV, 6.2 * eV, 6.3 * eV, 6.4 * eV,
949 6.5 * eV, 6.6 * eV, 6.7 * eV, 6.8 * eV, 6.9 * eV,
950 7.0 * eV, 7.1 * eV, 7.2 * eV, 7.3 * eV, 7.4 * eV,
951 7.5 * eV, 7.6 * eV, 7.7 * eV, 7.8 * eV, 7.9 * eV,
952 8.0 * eV, 8.1 * eV, 8.2 * eV, 8.4 * eV, 8.6 * eV,
953 8.8 * eV, 9.0 * eV, 9.2 * eV, 9.4 * eV, 9.6 * eV,
954 9.8 * eV, 10.0 * eV, 10.2 * eV, 10.4 * eV, 10.6 * eV,
955 10.8 * eV, 11.0 * eV, 11.2 * eV, 11.3 * eV, 11.4 * eV,
956 11.5 * eV, 11.6 * eV, 11.7 * eV, 11.8 * eV, 11.9 * eV};
958 G4double RefractiveIndex_CF4[nEntries_CF4] =
959 {1.000480, 1.000482, 1.000483, 1.000485, 1.000486,
960 1.000488, 1.000490, 1.000491, 1.000493, 1.000495,
961 1.000497, 1.000498, 1.000500, 1.000502, 1.000504,
962 1.000506, 1.000508, 1.000510, 1.000512, 1.000514,
963 1.000517, 1.000519, 1.000521, 1.000524, 1.000526,
964 1.000529, 1.000531, 1.000534, 1.000539, 1.000545,
965 1.000550, 1.000557, 1.000563, 1.000570, 1.000577,
966 1.000584, 1.000592, 1.000600, 1.000608, 1.000617,
967 1.000626, 1.000636, 1.000646, 1.000652, 1.000657,
968 1.000662, 1.000667, 1.000672, 1.000677, 1.000682};
970 G4double Absorption_CF4[nEntries_CF4] =
971 {1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
972 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
973 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
974 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
975 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
976 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
977 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
978 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
979 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
980 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m};
982 G4MaterialPropertiesTable *MPT_CF4 =
new G4MaterialPropertiesTable();
984 MPT_CF4->AddProperty(
"RINDEX", PhotonEnergy_CF4, RefractiveIndex_CF4, nEntries_CF4)
986 MPT_CF4->AddProperty(
"ABSLENGTH", PhotonEnergy_CF4, Absorption_CF4, nEntries_CF4)
989 CF4->SetMaterialPropertiesTable(MPT_CF4);
994 G4Material *g4_lif = nist->FindOrBuildMaterial(
"G4_LITHIUM_FLUORIDE");
995 G4Material *LiF =
new G4Material(
"LiF", density = 2.635 * g / cm3, ncomponents = 2);
996 LiF->AddElement(G4Element::GetElement(
"Li"), natoms = 1);
997 LiF->AddElement(G4Element::GetElement(
"F"), natoms = 1);
1001 cout <<
"g4_lif: " << g4_lif << endl;
1002 cout <<
"LiF: " << LiF << endl;
1005 const G4int nEntries_LiF = 50;
1007 G4double PhotonEnergy_LiF[nEntries_LiF] =
1008 {5.5 * eV, 5.6 * eV, 5.7 * eV, 5.8 * eV, 5.9 * eV,
1009 6.0 * eV, 6.1 * eV, 6.2 * eV, 6.3 * eV, 6.4 * eV,
1010 6.5 * eV, 6.6 * eV, 6.7 * eV, 6.8 * eV, 6.9 * eV,
1011 7.0 * eV, 7.1 * eV, 7.2 * eV, 7.3 * eV, 7.4 * eV,
1012 7.5 * eV, 7.6 * eV, 7.7 * eV, 7.8 * eV, 7.9 * eV,
1013 8.0 * eV, 8.1 * eV, 8.2 * eV, 8.4 * eV, 8.6 * eV,
1014 8.8 * eV, 9.0 * eV, 9.2 * eV, 9.4 * eV, 9.6 * eV,
1015 9.8 * eV, 10.0 * eV, 10.2 * eV, 10.4 * eV, 10.6 * eV,
1016 10.8 * eV, 11.0 * eV, 11.2 * eV, 11.3 * eV, 11.4 * eV,
1017 11.5 * eV, 11.6 * eV, 11.7 * eV, 11.8 * eV, 11.9 * eV};
1019 G4double RefractiveIndex_LiF[nEntries_LiF] =
1020 {1.42709, 1.42870, 1.42998, 1.43177, 1.43368,
1021 1.43520, 1.43736, 1.43907, 1.44088, 1.44279,
1022 1.44481, 1.44694, 1.44920, 1.45161, 1.45329,
1023 1.45595, 1.45781, 1.46077, 1.46285, 1.46503,
1024 1.46849, 1.47093, 1.47349, 1.47618, 1.47901,
1025 1.48198, 1.48511, 1.48841, 1.49372, 1.50152,
1026 1.50799, 1.51509, 1.52290, 1.53152, 1.54108,
1027 1.54805, 1.55954, 1.56799, 1.58202, 1.59243,
1028 1.60382, 1.61632, 1.63010, 1.63753, 1.64536,
1029 1.65363, 1.66236, 1.67159, 1.68139, 1.69178};
1031 G4double Absorption_LiF[nEntries_LiF] =
1032 {1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1033 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1034 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1035 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1036 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1037 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1038 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1039 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1040 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m,
1041 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m, 1.e4 * m};
1043 G4MaterialPropertiesTable *MPT_LiF =
new G4MaterialPropertiesTable();
1045 MPT_LiF->AddProperty(
"RINDEX", PhotonEnergy_LiF, RefractiveIndex_LiF, nEntries_LiF)
1047 MPT_LiF->AddProperty(
"ABSLENGTH", PhotonEnergy_LiF, Absorption_LiF, nEntries_LiF)
1050 LiF->SetMaterialPropertiesTable(MPT_LiF);
1055 const G4int nEntries_CsI = 50;
1057 G4double PhotonEnergy_CsI[nEntries_CsI] =
1058 {5.5 * eV, 5.6 * eV, 5.7 * eV, 5.8 * eV, 5.9 * eV,
1059 6.0 * eV, 6.1 * eV, 6.2 * eV, 6.3 * eV, 6.4 * eV,
1060 6.5 * eV, 6.6 * eV, 6.7 * eV, 6.8 * eV, 6.9 * eV,
1061 7.0 * eV, 7.1 * eV, 7.2 * eV, 7.3 * eV, 7.4 * eV,
1062 7.5 * eV, 7.6 * eV, 7.7 * eV, 7.8 * eV, 7.9 * eV,
1063 8.0 * eV, 8.1 * eV, 8.2 * eV, 8.4 * eV, 8.6 * eV,
1064 8.8 * eV, 9.0 * eV, 9.2 * eV, 9.4 * eV, 9.6 * eV,
1065 9.8 * eV, 10.0 * eV, 10.2 * eV, 10.4 * eV, 10.6 * eV,
1066 10.8 * eV, 11.0 * eV, 11.2 * eV, 11.3 * eV, 11.4 * eV,
1067 11.5 * eV, 11.6 * eV, 11.7 * eV, 11.8 * eV, 11.9 * eV};
1069 G4double RefractiveIndex_CsI[nEntries_CsI] =
1070 {1., 1., 1., 1., 1.,
1079 1., 1., 1., 1., 1.};
1081 G4double Absorption_CsI[nEntries_CsI] =
1082 {0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1083 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1084 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1085 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1086 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1087 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1088 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1089 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1090 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m,
1091 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m, 0.0000001 * m};
1093 G4MaterialPropertiesTable *MPT_CsI =
new G4MaterialPropertiesTable();
1095 MPT_CsI->AddProperty(
"RINDEX", PhotonEnergy_CsI, RefractiveIndex_CsI, nEntries_CsI)
1097 MPT_CsI->AddProperty(
"ABSLENGTH", PhotonEnergy_CsI, Absorption_CsI, nEntries_CsI)
1100 CsI->SetMaterialPropertiesTable(MPT_CsI);
1104 new G4Material(
"P10", density = 1.74 * mg / cm3, ncomponents = 3);
1105 P10->AddElement(G4Element::GetElement(
"Ar"), fractionmass = 0.9222);
1106 P10->AddElement(G4Element::GetElement(
"C"), fractionmass = 0.0623);
1107 P10->AddElement(G4Element::GetElement(
"H"), fractionmass = 0.0155);
1114 const int mRICH_nEntries_Air_Opt=2;
1116 G4double mRICH_PhotonEnergy_Air_Opt[mRICH_nEntries_Air_Opt] = {2.034*eV, 4.136*eV};
1117 G4double mRICH_RefractiveIndex_Air_Opt[mRICH_nEntries_Air_Opt] = {1.00, 1.00};
1119 G4MaterialPropertiesTable* mRICH_Air_Opt_MPT =
new G4MaterialPropertiesTable();
1120 mRICH_Air_Opt_MPT->AddProperty(
"RINDEX", mRICH_PhotonEnergy_Air_Opt, mRICH_RefractiveIndex_Air_Opt, mRICH_nEntries_Air_Opt);
1122 G4Material* mRICH_Air_Opt =
new G4Material(
"mRICH_Air_Opt", density=1.29*mg/cm3, ncomponents=2);
1123 mRICH_Air_Opt->AddElement(G4Element::GetElement(
"N"), fractionmass=70.*perCent);
1124 mRICH_Air_Opt->AddElement(G4Element::GetElement(
"O"), fractionmass=30.*perCent);
1125 mRICH_Air_Opt->SetMaterialPropertiesTable(mRICH_Air_Opt_MPT);
1128 const int mRICH_nEntries1=32;
1131 G4double mRICH_PhotonEnergy[mRICH_nEntries1] =
1132 { 2.034*eV, 2.068*eV, 2.103*eV, 2.139*eV,
1133 2.177*eV, 2.216*eV, 2.256*eV, 2.298*eV,
1134 2.341*eV, 2.386*eV, 2.433*eV, 2.481*eV,
1135 2.532*eV, 2.585*eV, 2.640*eV, 2.697*eV,
1136 2.757*eV, 2.820*eV, 2.885*eV, 2.954*eV,
1137 3.026*eV, 3.102*eV, 3.181*eV, 3.265*eV,
1138 3.353*eV, 3.446*eV, 3.545*eV, 3.649*eV,
1139 3.760*eV, 3.877*eV, 4.002*eV, 4.136*eV };
1141 G4double mRICH_AcRefractiveIndex[mRICH_nEntries1] =
1142 { 1.4902, 1.4907, 1.4913, 1.4918, 1.4924,
1143 1.4930, 1.4936, 1.4942, 1.4948, 1.4954,
1144 1.4960, 1.4965, 1.4971, 1.4977, 1.4983,
1145 1.4991, 1.5002, 1.5017, 1.5017, 1.5017,
1146 1.5017, 1.5017, 1.5017, 1.5017, 1.5017,
1147 1.5017, 1.5017, 1.5017, 1.5017, 1.5017,
1150 G4double mRICH_AcAbsorption[mRICH_nEntries1] =
1151 {25.25*cm, 25.25*cm, 25.25*cm, 25.25*cm,
1152 25.25*cm, 25.25*cm, 25.25*cm, 25.25*cm,
1153 25.25*cm, 25.25*cm, 25.25*cm, 25.25*cm,
1154 25.25*cm, 25.25*cm, 25.25*cm, 25.25*cm,
1155 25.25*cm, 25.25*cm, 25.25*cm, 25.25*cm,
1156 25.25*cm, 00.667*cm, 00.037*cm, 00.333*cm,
1157 00.001*cm, 00.001*cm, 00.001*cm, 00.001*cm,
1158 00.001*cm, 00.001*cm, 00.001*cm, 00.001*cm};
1160 G4MaterialPropertiesTable* mRICH_Ac_myMPT =
new G4MaterialPropertiesTable();
1161 mRICH_Ac_myMPT->AddProperty(
"RINDEX" ,mRICH_PhotonEnergy, mRICH_AcRefractiveIndex,mRICH_nEntries1);
1162 mRICH_Ac_myMPT->AddProperty(
"ABSLENGTH", mRICH_PhotonEnergy, mRICH_AcAbsorption,mRICH_nEntries1);
1164 G4Material* mRICH_Acrylic=
new G4Material(
"mRICH_Acrylic", density=1.19*g/cm3, ncomponents=3);
1165 mRICH_Acrylic->AddElement(G4Element::GetElement(
"C"), natoms=5);
1166 mRICH_Acrylic->AddElement(G4Element::GetElement(
"H"), natoms=8);
1167 mRICH_Acrylic->AddElement(G4Element::GetElement(
"O"), natoms=2);
1168 mRICH_Acrylic->SetMaterialPropertiesTable(mRICH_Ac_myMPT);
1173 G4double mRICH_Agel1RefractiveIndex[mRICH_nEntries1] =
1174 { 1.02435, 1.0244, 1.02445, 1.0245, 1.02455,
1175 1.0246, 1.02465, 1.0247, 1.02475, 1.0248,
1176 1.02485, 1.02492, 1.025, 1.02505, 1.0251,
1177 1.02518, 1.02522, 1.02530, 1.02535, 1.0254,
1178 1.02545, 1.0255, 1.02555, 1.0256, 1.02568,
1179 1.02572, 1.0258, 1.02585, 1.0259, 1.02595,
1182 G4double mRICH_Agel1Absorption[mRICH_nEntries1] =
1183 { 3.448*m, 4.082*m, 6.329*m, 9.174*m, 12.346*m, 13.889*m,
1184 15.152*m, 17.241*m, 18.868*m, 20.000*m, 26.316*m, 35.714*m,
1185 45.455*m, 47.619*m, 52.632*m, 52.632*m, 55.556*m, 52.632*m,
1186 52.632*m, 47.619*m, 45.455*m, 41.667*m, 37.037*m, 33.333*m,
1187 30.000*m, 28.500*m, 27.000*m, 24.500*m, 22.000*m, 19.500*m,
1188 17.500*m, 14.500*m };
1190 G4double mRICH_Agel1Rayleigh[mRICH_nEntries1];
1192 const G4double AerogelTypeAClarity = 0.0020*micrometer*micrometer*micrometer*micrometer/cm;
1193 G4double Cparam = AerogelTypeAClarity*cm/(micrometer*micrometer*micrometer*micrometer);
1194 G4double PhotMomWaveConv = 1239*eV*nm;
1196 if(Cparam != 0.0 ) {
1197 for(
int i=0; i<mRICH_nEntries1; i++ ){
1198 G4double ephoton = mRICH_PhotonEnergy[i];
1200 G4double wphoton=(PhotMomWaveConv/ephoton)/(1000.0*nm);
1201 mRICH_Agel1Rayleigh[i]=(std::pow(wphoton,4))/Cparam;
1205 G4MaterialPropertiesTable* mRICH_Agel1_myMPT =
new G4MaterialPropertiesTable();
1206 mRICH_Agel1_myMPT->AddProperty(
"RINDEX", mRICH_PhotonEnergy, mRICH_Agel1RefractiveIndex, mRICH_nEntries1);
1207 mRICH_Agel1_myMPT->AddProperty(
"ABSLENGTH", mRICH_PhotonEnergy, mRICH_Agel1Absorption,mRICH_nEntries1);
1208 mRICH_Agel1_myMPT->AddProperty(
"RAYLEIGH", mRICH_PhotonEnergy, mRICH_Agel1Rayleigh, mRICH_nEntries1);
1209 mRICH_Agel1_myMPT->AddConstProperty(
"SCINTILLATIONYIELD",0./MeV);
1210 mRICH_Agel1_myMPT->AddConstProperty(
"RESOLUTIONSCALE",1.0);
1212 G4Material* mRICH_Aerogel1 =
new G4Material(
"mRICH_Aerogel1", density=0.02*g/cm3, ncomponents=2);
1213 mRICH_Aerogel1->AddElement(G4Element::GetElement(
"Si"), natoms=1);
1214 mRICH_Aerogel1->AddElement(G4Element::GetElement(
"O"), natoms=2);
1215 mRICH_Aerogel1->SetMaterialPropertiesTable(mRICH_Agel1_myMPT);
1218 const int mRICH_nEntries2=50;
1220 G4double mRICH_Agel2PhotonEnergy[mRICH_nEntries2]=
1221 {1.87855*eV,1.96673*eV,2.05490*eV,2.14308*eV,2.23126*eV,
1222 2.31943*eV,2.40761*eV,2.49579*eV,2.58396*eV,2.67214*eV,
1223 2.76032*eV,2.84849*eV,2.93667*eV,3.02485*eV,3.11302*eV,
1224 3.20120*eV,3.28938*eV,3.37755*eV,3.46573*eV,3.55391*eV,
1225 3.64208*eV,3.73026*eV,3.81844*eV,3.90661*eV,3.99479*eV,
1226 4.08297*eV,4.17114*eV,4.25932*eV,4.34750*eV,4.43567*eV,
1227 4.52385*eV,4.61203*eV,4.70020*eV,4.78838*eV,4.87656*eV,
1228 4.96473*eV,5.05291*eV,5.14109*eV,5.22927*eV,5.31744*eV,
1229 5.40562*eV,5.49380*eV,5.58197*eV,5.67015*eV,5.75833*eV,
1230 5.84650*eV,5.93468*eV,6.02286*eV,6.11103*eV,6.19921*eV };
1232 G4double mRICH_Agel2RefractiveIndex[mRICH_nEntries2] =
1233 {1.02825,1.02829,1.02834,1.02839,1.02844,
1234 1.02849,1.02854,1.02860,1.02866,1.02872,
1235 1.02878,1.02885,1.02892,1.02899,1.02906,
1236 1.02914,1.02921,1.02929,1.02938,1.02946,
1237 1.02955,1.02964,1.02974,1.02983,1.02993,
1238 1.03003,1.03014,1.03025,1.03036,1.03047,
1239 1.03059,1.03071,1.03084,1.03096,1.03109,
1240 1.03123,1.03137,1.03151,1.03166,1.03181,
1241 1.03196,1.03212,1.03228,1.03244,1.03261,
1242 1.03279,1.03297,1.03315,1.03334,1.03354};
1244 G4double mRICH_Agel2Absorption[mRICH_nEntries2] =
1245 {17.5000*cm,17.7466*cm,17.9720*cm,18.1789*cm,18.3694*cm,
1246 18.5455*cm,18.7086*cm,18.8602*cm,19.0015*cm,19.1334*cm,
1247 19.2569*cm,19.3728*cm,19.4817*cm,19.5843*cm,19.6810*cm,
1248 19.7725*cm,19.8590*cm,19.9410*cm,20.0188*cm,20.0928*cm,
1249 18.4895*cm,16.0174*cm,13.9223*cm,12.1401*cm,10.6185*cm,
1250 9.3147*cm,8.1940*cm,7.2274*cm,6.3913*cm,5.6659*cm,
1251 5.0347*cm,4.4841*cm,4.0024*cm,3.5801*cm,3.2088*cm,
1252 2.8817*cm,2.5928*cm,2.3372*cm,2.1105*cm,1.9090*cm,
1253 1.7296*cm,1.5696*cm,1.4266*cm,1.2986*cm,1.1837*cm,
1254 1.0806*cm,0.9877*cm,0.9041*cm,0.8286*cm,0.7603*cm };
1256 G4double mRICH_Agel2Rayleigh[mRICH_nEntries2] =
1257 {35.1384*cm, 29.24805*cm, 24.5418*cm, 20.7453*cm, 17.6553*cm,
1258 15.1197*cm, 13.02345*cm, 11.2782*cm, 9.81585*cm, 8.58285*cm,
1259 7.53765*cm, 6.6468*cm, 5.88375*cm, 5.22705*cm, 4.6596*cm,
1260 4.167*cm, 3.73785*cm, 3.36255*cm, 3.03315*cm, 2.7432*cm,
1261 2.487*cm, 2.26005*cm, 2.05845*cm, 1.87875*cm, 1.71825*cm,
1262 1.57455*cm, 1.44555*cm, 1.3296*cm, 1.2249*cm, 1.1304*cm,
1263 1.04475*cm, 0.9672*cm, 0.89655*cm, 0.83235*cm, 0.77385*cm,
1264 0.7203*cm, 0.67125*cm, 0.6264*cm, 0.58515*cm, 0.54735*cm,
1265 0.51255*cm, 0.48045*cm, 0.45075*cm, 0.4233*cm, 0.39795*cm,
1266 0.37455*cm, 0.3528*cm, 0.33255*cm, 0.3138*cm, 0.29625*cm};
1268 G4MaterialPropertiesTable* mRICH_Agel2MPT =
new G4MaterialPropertiesTable();
1269 mRICH_Agel2MPT->AddProperty(
"RINDEX", mRICH_Agel2PhotonEnergy, mRICH_Agel2RefractiveIndex, mRICH_nEntries2);
1270 mRICH_Agel2MPT->AddProperty(
"ABSLENGTH", mRICH_Agel2PhotonEnergy, mRICH_Agel2Absorption,mRICH_nEntries2);
1271 mRICH_Agel2MPT->AddProperty(
"RAYLEIGH", mRICH_Agel2PhotonEnergy, mRICH_Agel2Rayleigh, mRICH_nEntries2);
1272 mRICH_Agel2MPT->AddConstProperty(
"SCINTILLATIONYIELD",0./MeV);
1273 mRICH_Agel2MPT->AddConstProperty(
"RESOLUTIONSCALE",1.0);
1275 G4Material* mRICH_Aerogel2 =
new G4Material(
"mRICH_Aerogel2", density=0.02*g/cm3, ncomponents=2);
1276 mRICH_Aerogel2->AddElement(G4Element::GetElement(
"Si"), natoms=1);
1277 mRICH_Aerogel2->AddElement(G4Element::GetElement(
"O"), natoms=2);
1278 mRICH_Aerogel2->SetMaterialPropertiesTable(mRICH_Agel2MPT);
1283 G4double mRICH_glassRefractiveIndex[mRICH_nEntries1] =
1284 { 1.47, 1.47, 1.47, 1.47, 1.47,
1285 1.47, 1.47, 1.47, 1.47, 1.47,
1286 1.47, 1.47, 1.47, 1.47, 1.47,
1287 1.47, 1.47, 1.47, 1.47, 1.47,
1288 1.47, 1.47, 1.47, 1.47, 1.47,
1289 1.47, 1.47, 1.47, 1.47, 1.47,
1292 G4double mRICH_glassAbsorption[mRICH_nEntries1] =
1293 {4.25*cm, 4.25*cm, 4.25*cm, 4.25*cm,
1294 4.25*cm, 4.25*cm, 4.25*cm, 4.25*cm,
1295 4.25*cm, 4.25*cm, 4.25*cm, 4.25*cm,
1296 4.25*cm, 4.25*cm, 4.25*cm, 4.25*cm,
1297 4.25*cm, 4.25*cm, 4.25*cm, 4.25*cm,
1298 4.25*cm, 00.667*cm, 00.037*cm, 00.333*cm,
1299 00.001*cm, 00.001*cm, 00.001*cm, 00.001*cm,
1300 00.001*cm, 00.001*cm, 00.001*cm, 00.001*cm};
1302 G4MaterialPropertiesTable* mRICH_glass_myMPT =
new G4MaterialPropertiesTable();
1304 mRICH_glass_myMPT->AddProperty(
"RINDEX", mRICH_PhotonEnergy, mRICH_glassRefractiveIndex, mRICH_nEntries1);
1305 mRICH_glass_myMPT->AddProperty(
"ABSLENGTH", mRICH_PhotonEnergy, mRICH_glassAbsorption, mRICH_nEntries1);
1307 const G4Material *G4_Pyrex_Glass = nist->FindOrBuildMaterial(
"G4_Pyrex_Glass");
1308 G4Material *mRICH_Borosilicate=
new G4Material(
"mRICH_Borosilicate",G4_Pyrex_Glass->GetDensity(),G4_Pyrex_Glass,G4_Pyrex_Glass->GetState(),G4_Pyrex_Glass->GetTemperature(),G4_Pyrex_Glass->GetPressure());
1309 mRICH_Borosilicate->SetMaterialPropertiesTable(mRICH_glass_myMPT);
1314 G4double mRICH_AirRefractiveIndex[mRICH_nEntries1] =
1315 { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1316 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1317 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1318 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1319 1.00, 1.00, 1.00, 1.00 };
1321 G4MaterialPropertiesTable* mRICH_Air_myMPT =
new G4MaterialPropertiesTable();
1322 mRICH_Air_myMPT->AddProperty(
"RINDEX", mRICH_PhotonEnergy, mRICH_AirRefractiveIndex , mRICH_nEntries1);
1323 const G4Material *G4_AIR = G4Material::GetMaterial(
"G4_AIR");
1324 G4Material *mRICH_Air=
new G4Material(
"mRICH_Air",G4_AIR->GetDensity(),G4_AIR,G4_AIR->GetState(),G4_AIR->GetTemperature(),G4_AIR->GetPressure());
1325 mRICH_Air->SetMaterialPropertiesTable(mRICH_Air_myMPT);
1328 G4Element* eleD =
new G4Element(
"eleD",
"eleD", 1.0, 2.014);
1330 G4Material* SQ_LH2 =
new G4Material(
"SQ_LH2", density = 0.07066*g/cm3, ncomponents = 1);
1331 SQ_LH2->AddElement(G4Element::GetElement(
"H"), natoms = 2);
1333 G4Material* SQ_LD2 =
new G4Material(
"SQ_LD2", density = 0.15707*g/cm3, ncomponents = 1);
1334 SQ_LD2->AddElement(eleD, natoms = 2);
1336 G4Material* SQ_NH3 =
new G4Material(
"SQ_NH3", density = 0.917*g/cm3, ncomponents = 2);
1337 SQ_NH3->AddElement(G4Element::GetElement(
"N"), natoms = 1);
1338 SQ_NH3->AddElement(G4Element::GetElement(
"H"), natoms = 3);
1340 G4Material* SQ_ND3 =
new G4Material(
"SQ_ND3", density = 0.987*g/cm3, ncomponents = 2);
1341 SQ_ND3->AddElement(G4Element::GetElement(
"N"), natoms = 1);
1342 SQ_ND3->AddElement(eleD, natoms = 3);
1344 G4Material* SQ_boratedPoly =
new G4Material(
"SQ_boratedPoly", density = 0.95000146*g/cm3, ncomponents = 3);
1345 SQ_boratedPoly->AddElement(G4Element::GetElement(
"B"), fractionmass = 0.7032045573308*perCent);
1346 SQ_boratedPoly->AddElement(G4Element::GetElement(
"C"), fractionmass = 4.0128564211902*perCent);
1347 SQ_boratedPoly->AddElement(G4Element::GetElement(
"H"), fractionmass = 95.283939021478*perCent);
1349 G4Material* SQ_Scintillator =
new G4Material(
"SQ_Scintillator", density = 1.02300158*g/cm3, ncomponents = 2);
1350 SQ_Scintillator->AddElement(G4Element::GetElement(
"C"), fractionmass = 47.368421052631*perCent);
1351 SQ_Scintillator->AddElement(G4Element::GetElement(
"H"), fractionmass = 52.631578947368*perCent);
1353 G4Material* SQ_ArCO2 =
new G4Material(
"SQ_ArCO2", density = 0.001822, ncomponents = 3);
1354 SQ_ArCO2->AddElement(G4Element::GetElement(
"Ar"), fractionmass = 77.651981*perCent);
1355 SQ_ArCO2->AddElement(G4Element::GetElement(
"C"), fractionmass = 5.83366*perCent);
1356 SQ_ArCO2->AddElement(G4Element::GetElement(
"O"), fractionmass = 16.514359*perCent);
1358 G4Material* SQ_P08CF4 =
new G4Material(
"SQ_P08CF4", density = 0.00177504, ncomponents = 4);
1359 SQ_P08CF4->AddElement(G4Element::GetElement(
"Ar"), fractionmass = 89.121162862311*perCent);
1360 SQ_P08CF4->AddElement(G4Element::GetElement(
"C"), fractionmass = 3.2270886143930*perCent);
1361 SQ_P08CF4->AddElement(G4Element::GetElement(
"H"), fractionmass = 0.7168203310375*perCent);
1362 SQ_P08CF4->AddElement(G4Element::GetElement(
"F"), fractionmass = 6.9349281922577*perCent);
1368 const G4RegionStore* theRegionStore = G4RegionStore::GetInstance();
1369 G4ProductionCuts *gcuts =
new G4ProductionCuts(*(theRegionStore->GetRegion(
"DefaultRegionForTheWorld")->GetProductionCuts()));
1370 G4Region *tpcregion =
new G4Region(
"REGION_TPCGAS");
1371 tpcregion->SetProductionCuts(gcuts);
1372 #if G4VERSION_NUMBER >= 1033
1377 G4EmParameters *g4emparams = G4EmParameters::Instance();
1378 g4emparams->AddPAIModel(
"all",
"REGION_TPCGAS",
"PAI");
1389 if (subsys->Name() == name)
1393 cout <<
"Found Subsystem " << name << endl;
1398 cout <<
"Could not find Subsystem " << name << endl;
PHG4PrimaryGeneratorAction * generatorAction_
event generator (read from PHG4INEVENT node)
int End(PHCompositeNode *)
end of run method
G4VisManager * visManager
int verbosity
The verbosity level. 0 means not verbose at all.
PHTimer server for accessing external information.
SubsystemList subsystems_
PHNode * findFirst(const std::string &, const std::string &)
static bool RemoveGeometryFile(const std::string &file_name)
delete the geometry file after use
int ResetEvent(PHCompositeNode *)
Clean up after each event.
PHBoolean addNode(PHNode *)
void g4guithread(void *ptr)
void SetWorldSizeX(const G4double sx)
int InitField(PHCompositeNode *topNode)
PHFieldConfig_v3 implements field configuration information for input a field map file...
static void Dump_GDML(const std::string &filename, G4VPhysicalVolume *vol, PHCompositeNode *topNode=nullptr)
save the current Geant4 geometry to GDML file. Reading PHG4GDMLConfig from topNode ...
PHFieldConfig store field configuration information.
void AddAction(PHG4TrackingAction *action)
register an action. This is called in PHG4Reco::Init based on which actions are found on the tree ...
void SetWorldShape(const std::string &s)
PHG4PhenixSteppingAction * steppingAction_
pointer to main stepping action
void G4Verbosity(const int i)
static int ImportGeomFile(PHCompositeNode *topNode, const std::string &geometry_file)
TGeo ROOT/GDML/Macro file -> DST node with automatic file type discrimination based on file names...
transient DST object for field storage and access
PHG4Reco(const std::string &name="PHG4RECO")
constructor
void Dump_GDML(const std::string &filename)
static recoConsts * instance()
std::string worldmaterial
void AddAction(PHG4SteppingAction *action)
register an action. This is called in PHG4Reco::Init based on which actions are found on the tree ...
static void G4Seed(const unsigned int i)
void SetForceDecay(EDecayType force_decay_type)
PHG4UIsession * uisession_
pointer to geant ui session
void SetWorldSizeZ(const G4double sz)
void stop()
stops the counter
virtual ~PHG4Reco()
destructor
G4RunManager * runManager_
pointer to geant run manager
EDecayType force_decay_type_
static PHField * GetFieldMapNode(const PHFieldConfig *default_config=nullptr, PHCompositeNode *topNode=nullptr, const int verbosity=0)
Get transient PHField from DST nodes. If not found, make a new one based on default_config.
int Init(PHCompositeNode *)
full initialization
PHG4PhenixEventAction * eventAction_
pointer to main event action
PHG4PhenixDetector * detector_
pointer to detector
void SetZeroFieldManager(G4FieldManager *man)
void restart()
Restart timer.
void SetWorldSizeY(const G4double sy)
PHTimeServer::timer _timer
module timer.
virtual int Verbosity() const
Gets the verbosity of this module.
PHFieldConfig_v2 implements field configuration information for uniform field model.
static void SetPseudoRapidityCoverage(const double eta)
PHG4Subsystem * getSubsystem(const std::string &name)
PHG4PhenixTrackingAction * trackingAction_
pointer to main tracking action
static std::string GenerateGeometryFileName(const std::string &filename_extension="gdml")
static TThread * gui_thread
G4VPhysicalVolume * GetPhysicalVolume(void)
bool optical_photon_
speed up options
void SetInEvent(PHG4InEvent *const inevt)
set top node (from where particle list is retrieved for passing to geant
int InitRun(PHCompositeNode *topNode)
int process_event(PHCompositeNode *)
event processing method
void SetZeroFieldStartZ(const G4double z)
PHFieldConfig::FieldConfigTypes mapdim
void set_rapidity_coverage(const double eta)
void Print(const std::string &what=std::string()) const
print info
void AddAction(PHG4EventAction *action)
register an action. This is called in PHG4Reco::Init based on which actions are found on the tree ...
void AddDetector(PHG4Detector *detector, int zero_field=0)
register a detector. This is called in PHG4Reco::Init based on which detectors are found on the tree ...
PHFieldConfig_v1 implements field configuration information for input a field map file...
int StartGui()
start the gui
this is the main detector construction class, passed to geant to construct the entire phenix detector...
int setupInputEventNodeReader(PHCompositeNode *)
G4TBMagneticFieldSetup * field_
magnetic field
int ApplyCommand(const std::string &cmd)
interface to G4 cmd interpreter
void setGeneratorAction(G4VUserPrimaryGeneratorAction *action)
virtual void identify(std::ostream &os=std::cout) const
virtual void set_FloatFlag(const std::string &name, const float flag)
void set_energy_threshold(double t)
G4FieldManager * GetDummyFieldManager()
void SetWorldMaterial(const std::string &s)