Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 /// \file Par02DetectorConstruction.cc 28 /// \brief Implementation of the Par02Detector 29 30 #include "Par02DetectorConstruction.hh" 31 32 #include "G4AutoDelete.hh" 33 #include "G4GDMLParser.hh" 34 #include "G4GlobalMagFieldMessenger.hh" 35 #include "G4ProductionCuts.hh" 36 #include "G4RegionStore.hh" 37 #include "G4SystemOfUnits.hh" 38 39 //....oooOO0OOooo........oooOO0OOooo........oo 40 41 Par02DetectorConstruction::Par02DetectorConstr 42 43 //....oooOO0OOooo........oooOO0OOooo........oo 44 45 Par02DetectorConstruction::~Par02DetectorConst 46 47 //....oooOO0OOooo........oooOO0OOooo........oo 48 49 G4VPhysicalVolume* Par02DetectorConstruction:: 50 { 51 G4GDMLParser parser; 52 parser.Read("Par02FullDetector.gdml"); 53 G4cout << "Geometry loaded from file ...... 54 55 // This GDML detector description uses the a 56 // information regarding which Geant4 volume 57 58 const G4GDMLAuxMapType* aAuxMap = parser.Get 59 for (G4GDMLAuxMapType::const_iterator iter = 60 for (G4GDMLAuxListType::const_iterator vit 61 vit != (*iter).second.end(); ++vit) 62 { 63 if ((*vit).type == "FastSimModel") { 64 G4LogicalVolume* myvol = (*iter).first 65 if ((myvol->GetName()).find("Tracker") 66 fTrackerList.push_back(new G4Region( 67 fTrackerList.back()->AddRootLogicalV 68 G4cout << G4endl << "tracker !!!" << 69 } 70 else if ((myvol->GetName()).find("HCal 71 fHCalList.push_back(new G4Region(myv 72 fHCalList.back()->AddRootLogicalVolu 73 G4cout << G4endl << "hcal !!!" << G4 74 } 75 else if ((myvol->GetName()).find("ECal 76 fECalList.push_back(new G4Region(myv 77 fECalList.back()->AddRootLogicalVolu 78 G4cout << G4endl << "ecal !!!" << G4 79 } 80 else if ((myvol->GetName()).find("Muon 81 fMuonList.push_back(new G4Region(myv 82 fMuonList.back()->AddRootLogicalVolu 83 } 84 else { 85 G4cout << G4endl << "NOT A KNOWN DET 86 } 87 } 88 } 89 } 90 for (G4int iterTracker = 0; iterTracker < G4 91 fTrackerList[iterTracker]->SetProductionCu 92 fTrackerList[iterTracker]->GetProductionCu 93 1.0 94 * ((*fTrackerList[iterTracker]->GetRootL 95 fTrackerList[iterTracker]->GetProductionCu 96 } 97 for (G4int iterECal = 0; iterECal < G4int(fE 98 fECalList[iterECal]->SetProductionCuts(new 99 fECalList[iterECal]->GetProductionCuts()-> 100 0.5 * ((*fECalList[iterECal]->GetRootLog 101 fECalList[iterECal]->GetProductionCuts()-> 102 } 103 for (G4int iterHCal = 0; iterHCal < G4int(fH 104 fHCalList[iterHCal]->SetProductionCuts(new 105 fHCalList[iterHCal]->GetProductionCuts()-> 106 0.5 * ((*fHCalList[iterHCal]->GetRootLog 107 fHCalList[iterHCal]->GetProductionCuts()-> 108 } 109 110 // Returns the pointer to the physical world 111 return parser.GetWorldVolume(); 112 } 113 114 //....oooOO0OOooo........oooOO0OOooo........oo 115 116 void Par02DetectorConstruction::ConstructSDand 117 { 118 for (G4int iterTracker = 0; iterTracker < G4 119 // Bound the fast simulation model for the 120 // to all the corresponding Geant4 regions 121 Par02FastSimModelTracker* fastSimModelTrac 122 "fastSimModelTracker", fTrackerList[iter 123 124 // Register the fast simulation model for 125 G4AutoDelete::Register(fastSimModelTracker 126 } 127 for (G4int iterECal = 0; iterECal < G4int(fE 128 // Bound the fast simulation model for the 129 // to all the corresponding Geant4 regions 130 Par02FastSimModelEMCal* fastSimModelEMCal 131 "fastSimModelEMCal", fECalList[iterECal] 132 133 // Register the fast simulation model for 134 G4AutoDelete::Register(fastSimModelEMCal); 135 } 136 for (G4int iterHCal = 0; iterHCal < G4int(fH 137 // Bound the fast simulation model for the 138 // to all the corresponding Geant4 regions 139 Par02FastSimModelHCal* fastSimModelHCal = 140 "fastSimModelHCal", fHCalList[iterHCal], 141 142 // Register the fast simulation model for 143 G4AutoDelete::Register(fastSimModelHCal); 144 } 145 // Currently we don't have a fast muon simul 146 // to all the corresponding Geant4 regions. 147 // But it could be added in future, in a sim 148 // the tracker subdetector and the electroma 149 150 // Add global magnetic field 151 G4ThreeVector fieldValue = G4ThreeVector(); 152 fMagFieldMessenger = new G4GlobalMagFieldMes 153 fMagFieldMessenger->SetVerboseLevel(1); 154 } 155 156 //....oooOO0OOooo........oooOO0OOooo........oo 157