File indexing completed on 2025-02-23 09:22:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "Par02DetectorConstruction.hh"
0031
0032 #include "G4AutoDelete.hh"
0033 #include "G4GDMLParser.hh"
0034 #include "G4GlobalMagFieldMessenger.hh"
0035 #include "G4ProductionCuts.hh"
0036 #include "G4RegionStore.hh"
0037 #include "G4SystemOfUnits.hh"
0038
0039
0040
0041 Par02DetectorConstruction::Par02DetectorConstruction() = default;
0042
0043
0044
0045 Par02DetectorConstruction::~Par02DetectorConstruction() = default;
0046
0047
0048
0049 G4VPhysicalVolume* Par02DetectorConstruction::Construct()
0050 {
0051 G4GDMLParser parser;
0052 parser.Read("Par02FullDetector.gdml");
0053 G4cout << "Geometry loaded from file .......Par02FullDetector.gdml " << G4endl;
0054
0055
0056
0057
0058 const G4GDMLAuxMapType* aAuxMap = parser.GetAuxMap();
0059 for (G4GDMLAuxMapType::const_iterator iter = aAuxMap->begin(); iter != aAuxMap->end(); ++iter) {
0060 for (G4GDMLAuxListType::const_iterator vit = (*iter).second.begin();
0061 vit != (*iter).second.end(); ++vit)
0062 {
0063 if ((*vit).type == "FastSimModel") {
0064 G4LogicalVolume* myvol = (*iter).first;
0065 if ((myvol->GetName()).find("Tracker") != std::string::npos) {
0066 fTrackerList.push_back(new G4Region(myvol->GetName()));
0067 fTrackerList.back()->AddRootLogicalVolume(myvol);
0068 G4cout << G4endl << "tracker !!!" << G4endl;
0069 }
0070 else if ((myvol->GetName()).find("HCal") != std::string::npos) {
0071 fHCalList.push_back(new G4Region(myvol->GetName()));
0072 fHCalList.back()->AddRootLogicalVolume(myvol);
0073 G4cout << G4endl << "hcal !!!" << G4endl;
0074 }
0075 else if ((myvol->GetName()).find("ECal") != std::string::npos) {
0076 fECalList.push_back(new G4Region(myvol->GetName()));
0077 fECalList.back()->AddRootLogicalVolume(myvol);
0078 G4cout << G4endl << "ecal !!!" << G4endl;
0079 }
0080 else if ((myvol->GetName()).find("Muon") != std::string::npos) {
0081 fMuonList.push_back(new G4Region(myvol->GetName()));
0082 fMuonList.back()->AddRootLogicalVolume(myvol);
0083 }
0084 else {
0085 G4cout << G4endl << "NOT A KNOWN DETECTOR !!!" << G4endl;
0086 }
0087 }
0088 }
0089 }
0090 for (G4int iterTracker = 0; iterTracker < G4int(fTrackerList.size()); iterTracker++) {
0091 fTrackerList[iterTracker]->SetProductionCuts(new G4ProductionCuts());
0092 fTrackerList[iterTracker]->GetProductionCuts()->SetProductionCut(
0093 1.0
0094 * ((*fTrackerList[iterTracker]->GetRootLogicalVolumeIterator())->GetMaterial()->GetRadlen()));
0095 fTrackerList[iterTracker]->GetProductionCuts()->SetProductionCut(1.0 * m, idxG4GammaCut);
0096 }
0097 for (G4int iterECal = 0; iterECal < G4int(fECalList.size()); iterECal++) {
0098 fECalList[iterECal]->SetProductionCuts(new G4ProductionCuts());
0099 fECalList[iterECal]->GetProductionCuts()->SetProductionCut(
0100 0.5 * ((*fECalList[iterECal]->GetRootLogicalVolumeIterator())->GetMaterial()->GetRadlen()));
0101 fECalList[iterECal]->GetProductionCuts()->SetProductionCut(0.1 * m, idxG4GammaCut);
0102 }
0103 for (G4int iterHCal = 0; iterHCal < G4int(fHCalList.size()); iterHCal++) {
0104 fHCalList[iterHCal]->SetProductionCuts(new G4ProductionCuts());
0105 fHCalList[iterHCal]->GetProductionCuts()->SetProductionCut(
0106 0.5 * ((*fHCalList[iterHCal]->GetRootLogicalVolumeIterator())->GetMaterial()->GetRadlen()));
0107 fHCalList[iterHCal]->GetProductionCuts()->SetProductionCut(1.0 * m, idxG4GammaCut);
0108 }
0109
0110
0111 return parser.GetWorldVolume();
0112 }
0113
0114
0115
0116 void Par02DetectorConstruction::ConstructSDandField()
0117 {
0118 for (G4int iterTracker = 0; iterTracker < G4int(fTrackerList.size()); iterTracker++) {
0119
0120
0121 Par02FastSimModelTracker* fastSimModelTracker = new Par02FastSimModelTracker(
0122 "fastSimModelTracker", fTrackerList[iterTracker], Par02DetectorParametrisation::eCMS);
0123
0124
0125 G4AutoDelete::Register(fastSimModelTracker);
0126 }
0127 for (G4int iterECal = 0; iterECal < G4int(fECalList.size()); iterECal++) {
0128
0129
0130 Par02FastSimModelEMCal* fastSimModelEMCal = new Par02FastSimModelEMCal(
0131 "fastSimModelEMCal", fECalList[iterECal], Par02DetectorParametrisation::eCMS);
0132
0133
0134 G4AutoDelete::Register(fastSimModelEMCal);
0135 }
0136 for (G4int iterHCal = 0; iterHCal < G4int(fHCalList.size()); iterHCal++) {
0137
0138
0139 Par02FastSimModelHCal* fastSimModelHCal = new Par02FastSimModelHCal(
0140 "fastSimModelHCal", fHCalList[iterHCal], Par02DetectorParametrisation::eCMS);
0141
0142
0143 G4AutoDelete::Register(fastSimModelHCal);
0144 }
0145
0146
0147
0148
0149
0150
0151 G4ThreeVector fieldValue = G4ThreeVector();
0152 fMagFieldMessenger = new G4GlobalMagFieldMessenger(fieldValue);
0153 fMagFieldMessenger->SetVerboseLevel(1);
0154 }
0155
0156