File indexing completed on 2025-01-30 10:30:45
0001
0002 #include <vector>
0003
0004 #ifndef _PFRICH_DETECTOR_CONSTRUCTION_
0005 #define _PFRICH_DETECTOR_CONSTRUCTION_
0006
0007 #include "G4VUserDetectorConstruction.hh"
0008
0009 #include "Materials.h"
0010
0011 class G4Colour;
0012 class G4PVPlacement;
0013 class G4Box;
0014 class G4OpticalSurface;
0015
0016 class CherenkovDetector;
0017 class CherenkovDetectorCollection;
0018 class OpticalBoundary;
0019 class CherenkovPhotonDetector;
0020
0021 struct MisalignedLocation2D {
0022 public:
0023 MisalignedLocation2D(double x, double y, double dx, double dy, double phi, bool pyramid):
0024 m_X(x), m_Y(y), m_dX(dx), m_dY(dy), m_Phi(phi), m_Pyramid(pyramid) {};
0025
0026
0027
0028 double m_X, m_Y, m_dX, m_dY, m_Phi;
0029
0030
0031 bool m_Pyramid;
0032 };
0033
0034 struct DarkBox {
0035 public:
0036 DarkBox(bool pyramids, bool poptics, bool cmoptics):
0037 m_fiducial_volume_phys(0), m_gas_volume_phys(0), m_gas_volume_length(0.0),
0038 m_PyramidMirrorWidth(0.0), m_PyramidMirrorHeight(0.0),
0039 m_UsePyramids(pyramids), m_UsePyramidOptics(poptics), m_UseConicalMirrorOptics(cmoptics) {
0040
0041
0042 m_mboundaries[0] = m_mboundaries[1] = 0;
0043 };
0044 ~DarkBox() {};
0045
0046 G4PVPlacement *m_fiducial_volume_phys, *m_gas_volume_phys;
0047 double m_gas_volume_length;
0048
0049 OpticalBoundary *m_mboundaries[2];
0050
0051 void DefinePyramidMirrorGeometry(double width, double height) {
0052 m_PyramidMirrorWidth = width;
0053 m_PyramidMirrorHeight = height;
0054 };
0055 double m_PyramidMirrorWidth, m_PyramidMirrorHeight;
0056 bool m_UsePyramids, m_UsePyramidOptics, m_UseConicalMirrorOptics;
0057 };
0058
0059 class DetectorConstruction : public Materials, public G4VUserDetectorConstruction
0060 {
0061 public:
0062 DetectorConstruction(CherenkovDetectorCollection *geometry);
0063 virtual ~DetectorConstruction() {};
0064
0065 protected:
0066
0067
0068 G4OpticalSurface *CreateLambertianMirrorSurface(const char *name,
0069 double reflectivity = 1.0, double roughness = 0.0);
0070
0071 void SetColor(G4LogicalVolume *lvol, const G4Colour &color, bool visible = true, bool solid = true);
0072
0073 CherenkovDetectorCollection *m_Geometry;
0074
0075 void BuildPhotonDetectorMatrix(CherenkovDetector *cdet, DarkBox *dbox, double fvzOffset, double wzOffset,
0076 const std::vector<MisalignedLocation2D> &xycoord);
0077
0078 std::vector<DarkBox*> m_DarkBoxes;
0079
0080 private:
0081 G4LogicalVolume *BuildHRPPD(G4LogicalVolume *wnd_log, G4Box *pd_box, CherenkovPhotonDetector *pd);
0082 };
0083
0084 #endif