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