File indexing completed on 2025-01-18 09:17:08
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
0031
0032
0033
0034
0035
0036
0037 #ifndef XrayFluoMercuryDetectorConstruction_hh
0038 #define XrayFluoMercuryDetectorConstruction_hh 1
0039
0040 #include "globals.hh"
0041 #include "G4VUserDetectorConstruction.hh"
0042 #include "G4RotationMatrix.hh"
0043 #include "G4Cache.hh"
0044 #include "XrayFluoSiLiDetectorType.hh"
0045 #include "XrayFluoHPGeDetectorType.hh"
0046 #include "XrayFluoSD.hh"
0047
0048 class G4Box;
0049 class G4Tubs;
0050 class G4Sphere;
0051 class G4LogicalVolume;
0052 class G4VPhysicalVolume;
0053 class G4Material;
0054 class XrayFluoMercuryDetectorMessenger;
0055 class XrayFluoNistMaterials;
0056
0057
0058
0059
0060
0061
0062 class XrayFluoMercuryDetectorConstruction : public G4VUserDetectorConstruction
0063 {
0064 public:
0065
0066
0067 ~XrayFluoMercuryDetectorConstruction();
0068
0069 public:
0070
0071 G4VPhysicalVolume* Construct();
0072
0073 void ConstructSDandField();
0074
0075 void UpdateGeometry();
0076
0077
0078 void SetMercuryMaterial(G4String newMaterial);
0079
0080 void SetDetectorType(G4String type);
0081
0082 static XrayFluoMercuryDetectorConstruction* GetInstance();
0083
0084 inline void SetOribitHeight(G4double size)
0085 {distDe = size;};
0086 inline void SetLatitude(G4double lat)
0087 {ThetaHPGe = 180.* CLHEP::deg - lat;};
0088
0089 void PrintApparateParameters();
0090
0091 XrayFluoVDetectorType* GetDetectorType() const;
0092
0093
0094 G4double GetWorldSizeZ() const {return WorldSizeZ;};
0095 G4double GetWorldSizeXY() const {return WorldSizeXY;};
0096
0097 G4double GetDeviceThickness() const {return DeviceThickness;};
0098 G4double GetDeviceSizeX() const {return DeviceSizeX;};
0099 G4double GetDeviceSizeY() const {return DeviceSizeY;};
0100 G4double GetPixelSizeXY() const {return PixelSizeXY;};
0101 G4double GetContactSizeXY() const {return ContactSizeXY;};
0102
0103 G4int GetNbOfPixels() const {return NbOfPixels;};
0104 G4int GetNbOfPixelRows() const {return NbOfPixelRows;};
0105 G4int GetNbOfPixelColumns() const {return NbOfPixelColumns;};
0106
0107 G4Material* GetOhmicPosMaterial() const {return OhmicPosMaterial;};
0108 G4double GetOhmicPosThickness() const {return OhmicPosThickness;};
0109
0110 G4Material* GetOhmicNegMaterial() const {return OhmicNegMaterial;};
0111 G4double GetOhmicNegThickness() const {return OhmicNegThickness;};
0112
0113 const G4VPhysicalVolume* GetphysiWorld() const {return physiWorld;};
0114 const G4VPhysicalVolume* GetHPGe() const {return physiHPGe;};
0115 const G4VPhysicalVolume* GetMercury() const {return physiMercury;};
0116
0117 const G4VPhysicalVolume* GetphysiPixel() const {return physiPixel;};
0118 const G4VPhysicalVolume* GetOhmicPos() const {return physiOhmicPos;};
0119 const G4VPhysicalVolume* GetOhmicNeg() const {return physiOhmicNeg;};
0120
0121 const G4VPhysicalVolume* GetOptic() const {return physiOptic;};
0122
0123 private:
0124
0125 XrayFluoMercuryDetectorConstruction();
0126
0127 static XrayFluoMercuryDetectorConstruction* instance;
0128
0129 XrayFluoVDetectorType* detectorType;
0130
0131 G4bool mercuryGranularity;
0132
0133 G4double DeviceSizeX;
0134 G4double DeviceSizeY;
0135 G4double DeviceThickness;
0136
0137 G4Box* solidWorld;
0138 G4LogicalVolume* logicWorld;
0139 G4VPhysicalVolume* physiWorld;
0140
0141 G4Box* solidHPGe;
0142 G4LogicalVolume* logicHPGe;
0143 G4VPhysicalVolume* physiHPGe;
0144
0145 G4Box* solidScreen;
0146 G4LogicalVolume* logicScreen;
0147 G4VPhysicalVolume* physiScreen;
0148
0149 G4Sphere* solidMercury;
0150 G4LogicalVolume* logicMercury;
0151 G4VPhysicalVolume* physiMercury;
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161 G4Box* solidOhmicPos;
0162 G4LogicalVolume* logicOhmicPos;
0163 G4VPhysicalVolume* physiOhmicPos;
0164
0165 G4Box* solidOhmicNeg;
0166 G4LogicalVolume* logicOhmicNeg;
0167 G4VPhysicalVolume* physiOhmicNeg;
0168
0169 G4Box* solidPixel;
0170 G4LogicalVolume* logicPixel;
0171 G4VPhysicalVolume* physiPixel;
0172
0173 G4Tubs* solidOptic;
0174 G4LogicalVolume* logicOptic;
0175 G4VPhysicalVolume* physiOptic;
0176
0177 G4LogicalVolume* logicGrain;
0178
0179
0180 XrayFluoNistMaterials* materials;
0181
0182 G4Material* screenMaterial;
0183 G4Material* OhmicPosMaterial;
0184 G4Material* OhmicNegMaterial;
0185 G4Material* pixelMaterial;
0186 G4Material* mercuryMaterial;
0187
0188 G4Material* defaultMaterial;
0189
0190
0191
0192 G4double OhmicPosThickness;
0193 G4double OhmicNegThickness;
0194
0195 G4double opticDia;
0196 G4double opticThickness;
0197
0198 G4double screenSizeXY;
0199 G4double screenThickness;
0200
0201 G4int PixelCopyNb;
0202 G4int grainCopyNb;
0203 G4int NbOfPixels;
0204 G4int NbOfPixelRows;
0205 G4int NbOfPixelColumns;
0206 G4double PixelThickness;
0207 G4double PixelSizeXY;
0208 G4double ContactSizeXY;
0209
0210 G4double opticAperture;
0211
0212 G4double mercuryDia;
0213 G4double sunDia;
0214
0215 G4double mercurySunDistance;
0216
0217 G4double ThetaHPGe;
0218
0219 G4double distDe;
0220 G4double distScreen;
0221 G4double distOptic;
0222
0223
0224 G4double PhiHPGe;
0225
0226 G4RotationMatrix zRotPhiHPGe;
0227
0228 G4double WorldSizeXY;
0229 G4double WorldSizeZ;
0230
0231
0232 XrayFluoMercuryDetectorMessenger* detectorMessenger;
0233
0234 G4Cache<XrayFluoSD*> HPGeSD;
0235
0236 public:
0237
0238 G4Material* GetMercuryMaterial() const {return mercuryMaterial;};
0239 G4Material* GetPixelMaterial() const {return pixelMaterial;};
0240
0241 G4double GetMercuryDia() const {return mercuryDia;};
0242 G4double GetSunDia() const {return sunDia;};
0243
0244
0245
0246 G4double GetOrbitInclination() const {return 180 * CLHEP::deg - ThetaHPGe;};
0247 G4double GetOrbitDistance() const {return distDe;};
0248 G4double GetOpticAperture() const {return opticAperture;};
0249
0250
0251
0252 private:
0253
0254 void DefineDefaultMaterials();
0255 G4VPhysicalVolume* ConstructApparate();
0256
0257
0258 void ComputeApparateParameters();
0259
0260 };
0261
0262
0263
0264 inline void XrayFluoMercuryDetectorConstruction::ComputeApparateParameters()
0265 {
0266
0267
0268 DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness;
0269
0270
0271
0272 DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY));
0273 DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY));
0274
0275 screenSizeXY = opticDia;
0276
0277 G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/CLHEP::cm <<G4endl;
0278 G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/CLHEP::cm << G4endl;
0279
0280
0281
0282
0283
0284 WorldSizeZ = 2 * mercurySunDistance ;
0285 WorldSizeXY = (2 * distDe) + 2000 * CLHEP::km ;
0286
0287 }
0288
0289 #endif