Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // >> 24 // $Id: XrayFluoMercuryDetectorConstruction.hh >> 25 // GEANT4 tag $Name:XrayFluo-V05-02-06 27 // 26 // 28 // Author: Alfonso Mantero (Alfonso.Mantero@ge 27 // Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it) 29 // 28 // 30 // History: 29 // History: 31 // ----------- 30 // ----------- 32 // 31 // 33 // 08 Sep 2003 Alfonso Mantero created 32 // 08 Sep 2003 Alfonso Mantero created 34 // 33 // 35 // ------------------------------------------- 34 // ------------------------------------------------------------------- 36 35 37 #ifndef XrayFluoMercuryDetectorConstruction_hh 36 #ifndef XrayFluoMercuryDetectorConstruction_hh 38 #define XrayFluoMercuryDetectorConstruction_hh 37 #define XrayFluoMercuryDetectorConstruction_hh 1 39 38 40 #include "globals.hh" << 41 #include "G4VUserDetectorConstruction.hh" << 42 #include "G4RotationMatrix.hh" << 43 #include "G4Cache.hh" << 44 #include "XrayFluoSiLiDetectorType.hh" 39 #include "XrayFluoSiLiDetectorType.hh" 45 #include "XrayFluoHPGeDetectorType.hh" 40 #include "XrayFluoHPGeDetectorType.hh" 46 #include "XrayFluoSD.hh" 41 #include "XrayFluoSD.hh" >> 42 #include "G4VUserDetectorConstruction.hh" >> 43 #include "globals.hh" >> 44 #include "G4RotationMatrix.hh" >> 45 47 46 48 class G4Box; 47 class G4Box; 49 class G4Tubs; 48 class G4Tubs; 50 class G4Sphere; 49 class G4Sphere; 51 class G4LogicalVolume; 50 class G4LogicalVolume; 52 class G4VPhysicalVolume; 51 class G4VPhysicalVolume; 53 class G4Material; 52 class G4Material; 54 class XrayFluoMercuryDetectorMessenger; 53 class XrayFluoMercuryDetectorMessenger; 55 class XrayFluoNistMaterials; << 54 class XrayFluoMaterials; 56 55 57 //class XrayFluoSD; 56 //class XrayFluoSD; 58 //class XrayFluoVDetectorType; 57 //class XrayFluoVDetectorType; 59 58 60 //....oooOO0OOooo........oooOO0OOooo........oo 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 61 60 62 class XrayFluoMercuryDetectorConstruction : pu 61 class XrayFluoMercuryDetectorConstruction : public G4VUserDetectorConstruction 63 { 62 { 64 public: 63 public: 65 64 66 65 67 ~XrayFluoMercuryDetectorConstruction(); 66 ~XrayFluoMercuryDetectorConstruction(); 68 67 69 public: 68 public: 70 69 71 G4VPhysicalVolume* Construct(); 70 G4VPhysicalVolume* Construct(); 72 << 73 void ConstructSDandField(); << 74 71 75 void UpdateGeometry(); 72 void UpdateGeometry(); 76 73 77 74 78 void SetMercuryMaterial(G4String newMaterial 75 void SetMercuryMaterial(G4String newMaterial); 79 76 80 void SetDetectorType(G4String type); 77 void SetDetectorType(G4String type); 81 78 82 static XrayFluoMercuryDetectorConstruction* 79 static XrayFluoMercuryDetectorConstruction* GetInstance(); 83 80 84 inline void SetOribitHeight(G4double size) 81 inline void SetOribitHeight(G4double size) 85 {distDe = size;}; 82 {distDe = size;}; 86 inline void SetLatitude(G4double lat) 83 inline void SetLatitude(G4double lat) 87 {ThetaHPGe = 180.* CLHEP::deg - lat;}; << 84 {ThetaHPGe = 180.* deg - lat;}; 88 85 89 void PrintApparateParameters(); 86 void PrintApparateParameters(); 90 87 91 XrayFluoVDetectorType* GetDetectorType() con << 88 XrayFluoVDetectorType* GetDetectorType(); 92 89 93 90 94 G4double GetWorldSizeZ() const {return W << 91 G4double GetWorldSizeZ() {return WorldSizeZ;}; 95 G4double GetWorldSizeXY() const {ret << 92 G4double GetWorldSizeXY() {return WorldSizeXY;}; 96 93 97 G4double GetDeviceThickness() const {ret << 94 G4double GetDeviceThickness() {return DeviceThickness;}; 98 G4double GetDeviceSizeX() const {ret << 95 G4double GetDeviceSizeX() {return DeviceSizeX;}; 99 G4double GetDeviceSizeY() const {ret << 96 G4double GetDeviceSizeY() {return DeviceSizeY;}; 100 G4double GetPixelSizeXY() const {ret << 97 G4double GetPixelSizeXY() {return PixelSizeXY;}; 101 G4double GetContactSizeXY() const {r << 98 G4double GetContactSizeXY() {return ContactSizeXY;}; 102 99 103 G4int GetNbOfPixels() const {return NbOfPix << 100 G4int GetNbOfPixels() {return NbOfPixels;}; //mandatory for XrayFluoSD 104 G4int GetNbOfPixelRows() const {return Nb << 101 G4int GetNbOfPixelRows() {return NbOfPixelRows;}; 105 G4int GetNbOfPixelColumns() const {re << 102 G4int GetNbOfPixelColumns() {return NbOfPixelColumns;}; 106 103 107 G4Material* GetOhmicPosMaterial() const {re << 104 G4Material* GetOhmicPosMaterial() {return OhmicPosMaterial;}; 108 G4double GetOhmicPosThickness() const {re << 105 G4double GetOhmicPosThickness() {return OhmicPosThickness;}; 109 106 110 G4Material* GetOhmicNegMaterial() const {re << 107 G4Material* GetOhmicNegMaterial() {return OhmicNegMaterial;}; 111 G4double GetOhmicNegThickness() const {re << 108 G4double GetOhmicNegThickness() {return OhmicNegThickness;}; 112 109 113 const G4VPhysicalVolume* GetphysiWorld() con << 110 const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;}; 114 const G4VPhysicalVolume* GetHPGe() const << 111 const G4VPhysicalVolume* GetHPGe() {return physiHPGe;}; 115 const G4VPhysicalVolume* GetMercury() const << 112 const G4VPhysicalVolume* GetMercury() {return physiMercury;}; 116 113 117 const G4VPhysicalVolume* GetphysiPixel() con << 114 const G4VPhysicalVolume* GetphysiPixel() {return physiPixel;}; 118 const G4VPhysicalVolume* GetOhmicPos() const << 115 const G4VPhysicalVolume* GetOhmicPos() {return physiOhmicPos;}; 119 const G4VPhysicalVolume* GetOhmicNeg() const << 116 const G4VPhysicalVolume* GetOhmicNeg() {return physiOhmicNeg;}; 120 117 121 const G4VPhysicalVolume* GetOptic() const << 118 const G4VPhysicalVolume* GetOptic() {return physiOptic;}; 122 119 123 private: 120 private: 124 121 125 XrayFluoMercuryDetectorConstruction(); 122 XrayFluoMercuryDetectorConstruction(); 126 123 127 static XrayFluoMercuryDetectorConstruction* 124 static XrayFluoMercuryDetectorConstruction* instance; 128 125 129 XrayFluoVDetectorType* detectorType; 126 XrayFluoVDetectorType* detectorType; 130 127 131 G4bool mercuryGranularity; 128 G4bool mercuryGranularity; 132 129 133 G4double DeviceSizeX; 130 G4double DeviceSizeX; 134 G4double DeviceSizeY; 131 G4double DeviceSizeY; 135 G4double DeviceThickness; 132 G4double DeviceThickness; 136 133 137 G4Box* solidWorld; //pointer 134 G4Box* solidWorld; //pointer to the solid World 138 G4LogicalVolume* logicWorld; //pointer 135 G4LogicalVolume* logicWorld; //pointer to the logical World 139 G4VPhysicalVolume* physiWorld; //pointer 136 G4VPhysicalVolume* physiWorld; //pointer to the physical World 140 137 141 G4Box* solidHPGe; //pointer to t 138 G4Box* solidHPGe; //pointer to the solid Sensor 142 G4LogicalVolume* logicHPGe; //pointer to t 139 G4LogicalVolume* logicHPGe; //pointer to the logical Sensor 143 G4VPhysicalVolume* physiHPGe; //pointer to t 140 G4VPhysicalVolume* physiHPGe; //pointer to the physical Sensor 144 141 145 G4Box* solidScreen; //pointer to 142 G4Box* solidScreen; //pointer to the solid Screen 146 G4LogicalVolume* logicScreen; //pointer to 143 G4LogicalVolume* logicScreen; //pointer to the logical Screen 147 G4VPhysicalVolume* physiScreen; //pointer to 144 G4VPhysicalVolume* physiScreen; //pointer to the physical Screen 148 145 149 G4Sphere* solidMercury; //poi 146 G4Sphere* solidMercury; //pointer to the solid Mercury 150 G4LogicalVolume* logicMercury; //pointe 147 G4LogicalVolume* logicMercury; //pointer to the logical Mercury 151 G4VPhysicalVolume* physiMercury; //pointe 148 G4VPhysicalVolume* physiMercury; //pointer to the physical Mercury 152 149 153 // G4Tubs* solidDia1; //pointer 150 // G4Tubs* solidDia1; //pointer to the solid Diaphragm 154 // G4LogicalVolume* logicDia1; //pointer 151 // G4LogicalVolume* logicDia1; //pointer to the logical Diaphragm 155 // G4VPhysicalVolume* physiDia1; //pointer 152 // G4VPhysicalVolume* physiDia1; //pointer to the physical Diaphragm 156 153 157 // G4Tubs* solidDia3; //pointer 154 // G4Tubs* solidDia3; //pointer to the solid Diaphragm 158 // G4LogicalVolume* logicDia3; //pointer 155 // G4LogicalVolume* logicDia3; //pointer to the logical Diaphragm 159 // G4VPhysicalVolume* physiDia3; //pointer 156 // G4VPhysicalVolume* physiDia3; //pointer to the physical Diaphragm 160 157 161 G4Box* solidOhmicPos; 158 G4Box* solidOhmicPos; 162 G4LogicalVolume* logicOhmicPos; 159 G4LogicalVolume* logicOhmicPos; 163 G4VPhysicalVolume* physiOhmicPos; 160 G4VPhysicalVolume* physiOhmicPos; 164 161 165 G4Box* solidOhmicNeg; 162 G4Box* solidOhmicNeg; 166 G4LogicalVolume* logicOhmicNeg; 163 G4LogicalVolume* logicOhmicNeg; 167 G4VPhysicalVolume* physiOhmicNeg; 164 G4VPhysicalVolume* physiOhmicNeg; 168 165 169 G4Box* solidPixel; 166 G4Box* solidPixel; 170 G4LogicalVolume* logicPixel; 167 G4LogicalVolume* logicPixel; 171 G4VPhysicalVolume* physiPixel; 168 G4VPhysicalVolume* physiPixel; 172 169 173 G4Tubs* solidOptic; 170 G4Tubs* solidOptic; 174 G4LogicalVolume* logicOptic; 171 G4LogicalVolume* logicOptic; 175 G4VPhysicalVolume* physiOptic; 172 G4VPhysicalVolume* physiOptic; 176 173 >> 174 G4Sphere* solidGrain; 177 G4LogicalVolume* logicGrain; 175 G4LogicalVolume* logicGrain; >> 176 G4VPhysicalVolume* physiGrain; 178 177 179 //materials management 178 //materials management 180 XrayFluoNistMaterials* materials; << 179 XrayFluoMaterials* materials; 181 180 182 G4Material* screenMaterial; 181 G4Material* screenMaterial; 183 G4Material* OhmicPosMaterial; 182 G4Material* OhmicPosMaterial; 184 G4Material* OhmicNegMaterial; 183 G4Material* OhmicNegMaterial; 185 G4Material* pixelMaterial; 184 G4Material* pixelMaterial; 186 G4Material* mercuryMaterial; 185 G4Material* mercuryMaterial; >> 186 G4Material* opticMaterial; 187 // G4Material* Dia3Material; 187 // G4Material* Dia3Material; 188 G4Material* defaultMaterial; 188 G4Material* defaultMaterial; 189 189 190 //apparate parameters 190 //apparate parameters 191 191 192 G4double OhmicPosThickness; 192 G4double OhmicPosThickness; 193 G4double OhmicNegThickness; 193 G4double OhmicNegThickness; 194 194 195 G4double opticDia; 195 G4double opticDia; 196 G4double opticThickness; 196 G4double opticThickness; 197 197 198 G4double screenSizeXY; 198 G4double screenSizeXY; 199 G4double screenThickness; 199 G4double screenThickness; 200 200 201 G4int PixelCopyNb; 201 G4int PixelCopyNb; 202 G4int grainCopyNb; 202 G4int grainCopyNb; 203 G4int NbOfPixels; 203 G4int NbOfPixels; 204 G4int NbOfPixelRows; 204 G4int NbOfPixelRows; 205 G4int NbOfPixelColumns; 205 G4int NbOfPixelColumns; 206 G4double PixelThickness; 206 G4double PixelThickness; 207 G4double PixelSizeXY; 207 G4double PixelSizeXY; 208 G4double ContactSizeXY; 208 G4double ContactSizeXY; 209 209 210 G4double opticAperture; 210 G4double opticAperture; 211 211 212 G4double mercuryDia; 212 G4double mercuryDia; 213 G4double sunDia; 213 G4double sunDia; 214 214 215 G4double mercurySunDistance; 215 G4double mercurySunDistance; 216 216 >> 217 G4double grainDia; >> 218 217 G4double ThetaHPGe; 219 G4double ThetaHPGe; 218 220 219 G4double distDe; 221 G4double distDe; 220 G4double distScreen; 222 G4double distScreen; 221 G4double distOptic; 223 G4double distOptic; 222 224 223 225 224 G4double PhiHPGe; 226 G4double PhiHPGe; 225 227 226 G4RotationMatrix zRotPhiHPGe; 228 G4RotationMatrix zRotPhiHPGe; 227 229 228 G4double WorldSizeXY; 230 G4double WorldSizeXY; 229 G4double WorldSizeZ; 231 G4double WorldSizeZ; 230 232 231 233 232 XrayFluoMercuryDetectorMessenger* detectorMe 234 XrayFluoMercuryDetectorMessenger* detectorMessenger; //pointer to the Messenger 233 235 234 G4Cache<XrayFluoSD*> HPGeSD; //pointer to t << 236 XrayFluoSD* HPGeSD; //pointer to the sensitive detector 235 << 237 >> 238 >> 239 236 public: 240 public: 237 241 238 G4Material* GetMercuryMaterial() const {retu << 242 G4Material* GetMercuryMaterial() {return mercuryMaterial;}; 239 G4Material* GetPixelMaterial() const {retur << 243 G4Material* GetPixelMaterial() {return pixelMaterial;}; 240 244 241 G4double GetMercuryDia() const {retur << 245 G4double GetMercuryDia() {return mercuryDia;}; 242 G4double GetSunDia() const {return sunDia;}; << 246 G4double GetSunDia() {return sunDia;}; 243 247 244 //Inclinaton of the orbit respect Mercury re 248 //Inclinaton of the orbit respect Mercury respect the equator (latitude) 245 249 246 G4double GetOrbitInclination() const {retur << 250 G4double GetOrbitInclination() {return 180 * deg - ThetaHPGe;}; 247 G4double GetOrbitDistance() const {retur << 251 G4double GetOrbitDistance() {return distDe;}; 248 G4double GetOpticAperture() const {return op << 252 G4double GetOpticAperture() {return opticAperture;}; 249 253 250 254 251 255 252 private: 256 private: 253 257 254 void DefineDefaultMaterials(); 258 void DefineDefaultMaterials(); 255 G4VPhysicalVolume* ConstructApparate(); 259 G4VPhysicalVolume* ConstructApparate(); 256 260 257 //calculates some quantities used to constru 261 //calculates some quantities used to construct geometry 258 void ComputeApparateParameters(); 262 void ComputeApparateParameters(); 259 263 260 }; 264 }; 261 265 262 //....oooOO0OOooo........oooOO0OOooo........oo 266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 263 267 264 inline void XrayFluoMercuryDetectorConstructio 268 inline void XrayFluoMercuryDetectorConstruction::ComputeApparateParameters() 265 { 269 { 266 // Compute derived parameters of the apparat 270 // Compute derived parameters of the apparate 267 271 268 DeviceThickness = PixelThickness+OhmicNegThi 272 DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness; 269 273 270 ///G4cout << "DeviceThickness(cm): "<< Devic << 274 ///G4cout << "DeviceThickness(cm): "<< DeviceThickness/cm << G4endl; 271 275 272 DeviceSizeY =(NbOfPixelRows * std::max(Conta 276 DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY)); 273 DeviceSizeX =(NbOfPixelColumns * std::max(Co 277 DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY)); 274 278 275 screenSizeXY = opticDia; 279 screenSizeXY = opticDia; 276 280 277 G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/ << 281 G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/cm <<G4endl; 278 G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/ << 282 G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/cm << G4endl; 279 283 280 //****************************************** 284 //********************************************************************* 281 //** Astronomical distances reduce by a fac 285 //** Astronomical distances reduce by a factor 10^-7 due to G4 Bug ** 282 //****************************************** 286 //********************************************************************* 283 287 284 WorldSizeZ = 2 * mercurySunDistance ; 288 WorldSizeZ = 2 * mercurySunDistance ; 285 WorldSizeXY = (2 * distDe) + 2000 * CLHEP::k << 289 WorldSizeXY = (2 * distDe) + 2000 * km ; 286 //WorldSizeZ = WorldSizeXY; 290 //WorldSizeZ = WorldSizeXY; 287 } 291 } 288 292 289 #endif 293 #endif >> 294 >> 295 >> 296 >> 297 >> 298 >> 299 290 300