12 #include <phparameter/PHParameters.h>
16 #include <Geant4/G4Box.hh>
17 #include <Geant4/G4Color.hh>
18 #include <Geant4/G4LogicalVolume.hh>
19 #include <Geant4/G4Material.hh>
20 #include <Geant4/G4RotationMatrix.hh>
21 #include <Geant4/G4PVPlacement.hh>
22 #include <Geant4/G4SubtractionSolid.hh>
23 #include <Geant4/G4MultiUnion.hh>
24 #include <Geant4/G4UnionSolid.hh>
25 #include <Geant4/G4SystemOfUnits.hh>
26 #include <Geant4/G4VisAttributes.hh>
27 #include <Geant4/G4TwoVector.hh>
28 #include <Geant4/G4ExtrudedSolid.hh>
48 const std::string &dnam,
const int lyr)
50 , m_Params(parameters)
93 if (
Verbosity() > 1) { std::cout <<
"Creating Roman Pots" << std::endl; }
112 if( tenSigma_X < 0.01 *
cm || tenSigma_Y < 0.01 *
cm ) {
113 tenSigma_X = 0.01 *
cm;
114 tenSigma_Y = 0.01 *
cm;
117 double virtPlaneDepth = 0.001 *
cm;
120 int NsegmentsOffCenter =
int( (tenSigma_X - 0.5*sensorWidth) / sensorWidth + 0.5 );
121 int NhorizontalSegments = 4*NsegmentsOffCenter + 2;
123 double x1 = -sensorWidth/2.0;
124 double x2 = sensorWidth/2.0;
125 double y = tenSigma_Y;
128 std::vector<G4TwoVector> polygon;
130 if( NhorizontalSegments == 2 ) {
132 polygon.push_back({-tenSigma_X, y});
133 polygon.push_back({tenSigma_X, y});
134 polygon.push_back({tenSigma_X, -y});
135 polygon.push_back({-tenSigma_X, -y});
139 for(
int i = 1; i <= NhorizontalSegments; i++ ) {
142 else if( i <= 1 + NsegmentsOffCenter ) {
144 y = tenSigma_Y * sqrt(fabs( 1 - pow( x1/tenSigma_X, 2) ));
145 x2 = x1 + sensorWidth;
147 else if( i <= 1 + 2*NsegmentsOffCenter ) {
148 if( x1 > tenSigma_X ) { y *= -1; }
149 else { y = -tenSigma_Y * sqrt(fabs( 1 - pow( (x1-sensorWidth)/tenSigma_X, 2) ));}
150 x2 = x1 - sensorWidth;
152 else if( i == 2 + 2*NsegmentsOffCenter ) {
154 x2 = x1 - sensorWidth;
156 else if( i <= 2 + 3*NsegmentsOffCenter ) {
158 y = -tenSigma_Y * sqrt(fabs( 1 - pow( x1/tenSigma_X, 2) ));
159 x2 = x1 - sensorWidth;
162 if( x1 < -tenSigma_X ) { y *= -1; }
163 else { y = tenSigma_Y * sqrt(fabs( 1 - pow( (x1+sensorWidth)/tenSigma_X, 2) )); }
164 x2 = x1 + sensorWidth;
167 polygon.push_back({
x1, y});
168 polygon.push_back({
x2, y});
175 std::vector<G4ExtrudedSolid::ZSection> zsections = {
176 {-0.51*sensorDepth, {0,0}, 1.0}, {+0.51*sensorDepth, {0,0}, 1.0} };
180 G4Box *FullPlate =
new G4Box(
"FullPlate",overallSize_X/2., overallSize_Y/2., sensorDepth/2.);
197 center_Z - enclosureCenter );
210 std::vector<G4ExtrudedSolid::ZSection> zsectionsCu = {
211 {-0.51*CuDepth, {0,0}, 1.0}, {+0.51*CuDepth, {0,0}, 1.0} };
223 center_Z + sensorDepth + CuDepth/2.0 - enclosureCenter );
233 G4Box *VirtPlate =
new G4Box(
"VirtPlate",overallSize_X/2., overallSize_Y/2., virtPlaneDepth/2.);
244 center_Z - sensorDepth/2.0 - virtPlaneDepth - enclosureCenter );
258 std::cout <<
"EICG4RP Detector:" << std::endl;
259 if (what ==
"ALL" || what ==
"VOLUME")
261 std::cout <<
"Version 0.1" << std::endl;
262 std::cout <<
"Parameters:" << std::endl;