Skip to content

Commit

Permalink
corrected distances
Browse files Browse the repository at this point in the history
  • Loading branch information
martinunland committed Sep 6, 2024
1 parent 64ea9b3 commit 9a589ff
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 163 deletions.
223 changes: 112 additions & 111 deletions ...on/data/PMTs/measurement_matching_data/setup_stuff/mDOMPMT_PicoQuant_Scan_Zcorrection.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,111 +1,112 @@
0.0 26.8288
0.6710674700000041 26.831623
1.0240674699999985 26.831045
1.3760674700000024 26.830467000000002
1.729067470000004 26.829889
2.0810674700000007 26.829311
2.532067470000001 26.808510000000002
3.080067470000003 26.767490000000002
3.354067470000004 26.686790000000002
3.7850674700000013 26.70615
4.137067469999998 26.70557
4.49006747 26.704990000000002
4.87106747 26.584
5.19406747 26.583470000000002
5.547067470000002 26.582890000000003
5.8990674699999985 26.52213
6.163067470000001 26.46151
6.5650674700000025 26.44079
7.074067470000003 26.39983
7.387067469999998 26.31907
7.895067470000001 26.217930000000003
8.248067470000002 26.21735
8.600067469999999 26.096410000000002
8.992067470000002 26.0757
9.579067469999998 25.95437
10.166067470000002 25.833000000000002
10.753067469999998 25.7117
11.30106747 25.590400000000002
11.77006747 25.4693
12.24006747 25.348200000000002
12.70906747 25.227
13.17906747 25.105900000000002
13.707067469999998 24.9445
14.11806747 24.8837
14.54806747 24.7024
14.88006747 24.6417
15.291067470000002 24.5206
15.643067469999998 24.399700000000003
15.995067470000002 24.2787
16.34706747 24.1578
16.699067470000003 24.0368
17.05106747 23.9159
17.403067470000003 23.794900000000002
17.814067469999998 23.6538
18.04806747 23.493000000000002
18.34106747 23.4323
18.796067470000004 23.251
19.339067470000003 23.049500000000002
19.573067469999998 22.8886
19.96906747 22.7676
20.36506747 22.5864
20.790067470000004 22.4051
21.23406747 22.2038
21.449067470000003 22.042900000000003
21.845067470000004 21.9219
22.32906747 21.6804
22.79806747 21.4389
23.26706747 21.197400000000002
23.736067470000002 20.9559
24.205067469999996 20.7144
24.674067470000004 20.4728
25.103067470000006 20.2314
25.494067469999997 19.990000000000002
25.924067470000004 19.7486
26.314067470000005 19.5072
26.764067470000008 19.265700000000002
27.09606747 19.064600000000002
27.44706747 18.8232
27.799067470000004 18.5819
28.267067469999994 18.3003
28.619067469999997 18.059
28.970067469999996 17.817700000000002
29.361067470000002 17.576300000000003
29.653067470000003 17.3351
29.91706747 17.1842
30.151067469999994 16.9128
30.532067469999994 16.7318
31.000067469999998 16.3698
31.469067470000006 16.007800000000003
31.937067469999995 15.645800000000001
32.40606747 15.283800000000001
32.698067470000005 14.982800000000001
33.10806747 14.680800000000001
33.40006747 14.379800000000001
33.81006747 14.077800000000002
34.103067470000006 13.8368
34.51206747 13.354800000000001
35.01906747 12.872800000000002
35.39006747 12.5708
35.72106747 12.269800000000002
35.916067469999994 12.0288
36.42306747 11.6668
36.73506747 11.3048
37.02706747 10.943800000000001
37.37806747 10.581800000000001
37.690067469999995 10.2198
37.98206747 9.858800000000002
38.25406747 9.4968
38.449067469999996 9.1358
38.662067470000004 8.773800000000001
38.86606747 8.4128
39.03106747 8.050800000000002
39.16706747 7.689800000000002
39.38006747000001 7.328800000000001
39.51606747 6.966799999999999
39.592067469999996 6.605800000000002
39.689067470000005 6.2448000000000015
39.80406747 5.8828
39.82206747 5.5218000000000025
39.87906747 5.160800000000002
39.937067469999995 4.799800000000001
#r (distance to centre, mm) y (distance to be moved mm)
0.0 0.0
0.6710674700000041 0.0
1.0240674699999985 0.0
1.3760674700000024 0.0
1.729067470000004 0.0
2.0810674700000007 0.0
2.532067470000001 0.020290000000000002
3.080067470000003 0.06131
3.354067470000004 0.14201
3.7850674700000013 0.12265000000000001
4.137067469999998 0.12323
4.49006747 0.12381
4.87106747 0.2448
5.19406747 0.24533000000000002
5.547067470000002 0.24591
5.8990674699999985 0.30667
6.163067470000001 0.36729
6.5650674700000025 0.38800999999999997
7.074067470000003 0.4289700000000001
7.387067469999998 0.50973
7.895067470000001 0.61087
8.248067470000002 0.61145
8.600067469999999 0.73239
8.992067470000002 0.7531
9.579067469999998 0.87443
10.166067470000002 0.9958000000000001
10.753067469999998 1.1171
11.30106747 1.2384
11.77006747 1.3595
12.24006747 1.4806
12.70906747 1.6018
13.17906747 1.7228999999999999
13.707067469999998 1.8842999999999999
14.11806747 1.9450999999999998
14.54806747 2.1264000000000003
14.88006747 2.1871
15.291067470000002 2.3082000000000003
15.643067469999998 2.4291
15.995067470000002 2.5501
16.34706747 2.6710000000000003
16.699067470000003 2.7920000000000003
17.05106747 2.9129
17.403067470000003 3.0339
17.814067469999998 3.1750000000000003
18.04806747 3.3358000000000003
18.34106747 3.3965
18.796067470000004 3.5778000000000003
19.339067470000003 3.7793
19.573067469999998 3.9402
19.96906747 4.0612
20.36506747 4.2424
20.790067470000004 4.4237
21.23406747 4.625
21.449067470000003 4.7859
21.845067470000004 4.9069
22.32906747 5.1484000000000005
22.79806747 5.3899
23.26706747 5.6314
23.736067470000002 5.8729000000000005
24.205067469999996 6.1144
24.674067470000004 6.356
25.103067470000006 6.5974
25.494067469999997 6.8388
25.924067470000004 7.0802000000000005
26.314067470000005 7.3216
26.764067470000008 7.5631
27.09606747 7.7642
27.44706747 8.0056
27.799067470000004 8.2469
28.267067469999994 8.5285
28.619067469999997 8.7698
28.970067469999996 9.0111
29.361067470000002 9.2525
29.653067470000003 9.4937
29.91706747 9.6446
30.151067469999994 9.916
30.532067469999994 10.097
31.000067469999998 10.459
31.469067470000006 10.821
31.937067469999995 11.183
32.40606747 11.545
32.698067470000005 11.846
33.10806747 12.148
33.40006747 12.449
33.81006747 12.751
34.103067470000006 12.992
34.51206747 13.474
35.01906747 13.956
35.39006747 14.258000000000001
35.72106747 14.559
35.916067469999994 14.8
36.42306747 15.162
36.73506747 15.524000000000001
37.02706747 15.885
37.37806747 16.247
37.690067469999995 16.609
37.98206747 16.97
38.25406747 17.332
38.449067469999996 17.693
38.662067470000004 18.055
38.86606747 18.416
39.03106747 18.778
39.16706747 19.139
39.38006747000001 19.5
39.51606747 19.862000000000002
39.592067469999996 20.223
39.689067470000005 20.584
39.80406747 20.946
39.82206747 21.307
39.87906747 21.668
39.937067469999995 22.029
9 changes: 4 additions & 5 deletions common/geometry_construction/include/OMSimPMTConstruction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ private:
G4bool m_internalReflections = false;
G4bool m_HACoatingBool = false;
G4bool m_constructionFinished = false;

G4double m_centreToTipDistance;
std::tuple<G4VSolid *, G4VSolid *> getBulbSolid(G4String pSide);
std::tuple<G4VSolid *, G4VSolid *> simpleBulbConstruction(G4String pSide);
std::tuple<G4VSolid *, G4VSolid *> fullBulbConstruction(G4String pSide);
G4VSolid *frontalBulbConstruction(G4String pSide);

void readGlobalParameters(G4String pSide);

G4UnionSolid *sphereEllipsePhotocathode();
G4UnionSolid *sphereDoubleEllipsePhotocathode(G4String pSide);
G4UnionSolid *doubleEllipsePhotocathode(G4String pSide);
G4UnionSolid *ellipsePhotocathode();
G4VSolid *sphereEllipsePhotocathode(G4String p_side);
G4VSolid *doubleEllipsePhotocathode(G4String pSide);
G4VSolid *ellipsePhotocathode(G4String p_side);


void constructHAcoating();
Expand Down
70 changes: 31 additions & 39 deletions common/geometry_construction/src/OMSimPMTConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void OMSimPMTConstruction::construction()

m_photocathodeRegionVacuumPhysical = new G4PVPlacement(0, G4ThreeVector(0, 0, 0), m_photocathodeLV, "PhotocathodeRegionVacuum", tubeVacuum, false, 0, m_checkOverlaps);

if (m_internalReflections)
if (true)
{
m_vacuumBackPhysical = new G4PVPlacement(0, G4ThreeVector(0, 0, 0), vacuumBackLogical, "VacuumTubeBack", tubeVacuum, false, 0, m_checkOverlaps);
constructCADdynodeSystem(vacuumBackLogical);
Expand Down Expand Up @@ -324,13 +324,11 @@ G4VSolid *OMSimPMTConstruction::frontalBulbConstruction(G4String p_side)
G4String frontalShape = m_data->getValue<G4String>(m_selectedPMT, "jFrontalShape");
readGlobalParameters(p_side);
if (frontalShape == "SphereEllipse")
return sphereEllipsePhotocathode();
else if (frontalShape == "Sphere2Ellipses")
return sphereDoubleEllipsePhotocathode(p_side);
return sphereEllipsePhotocathode(p_side);
else if (frontalShape == "TwoEllipses")
return doubleEllipsePhotocathode(p_side);
else if (frontalShape == "SingleEllipse")
return ellipsePhotocathode();
return ellipsePhotocathode(p_side);
else
{
log_critical("Type of PMT frontal shape {} type not known!", frontalShape);
Expand All @@ -341,59 +339,47 @@ G4VSolid *OMSimPMTConstruction::frontalBulbConstruction(G4String p_side)

/**
* Construction of the frontal part of the PMT following the fits of the technical drawings. PMTs constructed with sphereEllipsePhotocathode were fitted with a sphere and an ellipse.
* @return G4UnionSolid bulbSolid the frontal solid of the PMT
* @return bulbSolid the frontal solid of the PMT
*/
G4UnionSolid *OMSimPMTConstruction::sphereEllipsePhotocathode()
G4VSolid *OMSimPMTConstruction::sphereEllipsePhotocathode(G4String p_side)
{
log_trace("Constructing photocathode with one ellipsoid and a sphere");
G4double sphereAngle = asin(m_sphereEllipseTransition_r / m_outRad);
// PMT frontal glass envelope as union of sphere and ellipse
G4Ellipsoid *bulbEllipsoid = new G4Ellipsoid("Solid Bulb Ellipsoid", m_ellipseXYaxis, m_ellipseXYaxis, m_ellipseZaxis);
G4Sphere *bulbSphere = new G4Sphere("Solid Bulb Ellipsoid", 0.0, m_outRad, 0, 2 * CLHEP::pi, 0, sphereAngle);
G4UnionSolid *bulbSolid = new G4UnionSolid("Solid Bulb", bulbEllipsoid, bulbSphere, 0, G4ThreeVector(0, 0, m_spherePosY - m_ellipsePosY));
return bulbSolid;
}

G4UnionSolid *OMSimPMTConstruction::ellipsePhotocathode()
{
log_trace("Constructing photocathode with one ellipsoid");
G4double sphereAngle = asin(m_sphereEllipseTransition_r / m_outRad);
// PMT frontal glass envelope as union of sphere and ellipse
G4Ellipsoid *bulbEllipsoid = new G4Ellipsoid("Solid Bulb Ellipsoid", m_ellipseXYaxis, m_ellipseXYaxis, m_ellipseZaxis);
G4Sphere *bulbSphere = new G4Sphere("Solid Bulb Ellipsoid", 0.0, 0.1, 0, 2 * CLHEP::pi, 0, sphereAngle);
G4UnionSolid *bulbSolid = new G4UnionSolid("Solid Bulb", bulbEllipsoid, bulbSphere, 0, G4ThreeVector(0, 0, m_spherePosY - m_ellipsePosY));
if (p_side=="jOuterShape")
{
m_centreToTipDistance = m_outRad + m_spherePosY - m_ellipsePosY;
}

return bulbSolid;
}

/**
* Construction of the frontal part of the PMT following the fits of the technical drawings. PMTs constructed with sphereDoubleEllipsePhotocathode were fitted with a sphere and two ellipses.
* @return G4UnionSolid bulbSolid the frontal solid of the PMT
* Construction of the frontal part of the PMT following the fits of the technical drawings. PMTs constructed with ellipsePhotocathode were fitted with an ellipse.
* @return bulbSolid the frontal solid of the PMT
*/
G4UnionSolid *OMSimPMTConstruction::sphereDoubleEllipsePhotocathode(G4String p_side)
G4VSolid *OMSimPMTConstruction::ellipsePhotocathode(G4String p_side)
{
log_trace("Constructing photocathode with two ellipses and a sphere");
G4double ellipseXYAxis2 = m_data->getValueWithUnit(m_selectedPMT, p_side + ".jEllipseXYaxis_2");
G4double ellipseZAxis2 = m_data->getValueWithUnit(m_selectedPMT, p_side + ".jEllipseZaxis_2");
G4double ellipseYpos2 = m_data->getValueWithUnit(m_selectedPMT, p_side + ".jEllipsePos_y_2");
log_trace("Constructing photocathode with one ellipsoid");
G4Ellipsoid *bulbSolid = new G4Ellipsoid("Solid Bulb Ellipsoid", m_ellipseXYaxis, m_ellipseXYaxis, m_ellipseZaxis);

G4double sphereAngle = asin(m_sphereEllipseTransition_r / m_outRad);
// PMT frontal glass envelope as union of sphere and ellipse
G4Ellipsoid *bulbEllipsoid = new G4Ellipsoid("Solid Bulb Ellipsoid", m_ellipseXYaxis, m_ellipseXYaxis, m_ellipseZaxis);
G4Sphere *bulbSphere = new G4Sphere("Solid Bulb Ellipsoid", 0.0, m_outRad, 0, 2 * CLHEP::pi, 0, sphereAngle);
G4UnionSolid *bulbSolid = new G4UnionSolid("Solid Bulb", bulbEllipsoid, bulbSphere, 0, G4ThreeVector(0, 0, m_spherePosY - m_ellipsePosY));
G4Ellipsoid *bulbEllipsoid2 = new G4Ellipsoid("Solid Bulb Ellipsoid 2", ellipseXYAxis2, ellipseXYAxis2, ellipseZAxis2);
G4double excess = m_ellipsePosY - ellipseYpos2;
G4Tubs *substractionTube = new G4Tubs("substracion_tube_large_ellipsoid", 0.0, ellipseXYAxis2 * 2, 0.5 * m_totalLenght, 0, 2 * CLHEP::pi);
G4SubtractionSolid *substractedLargeEllipsoid = new G4SubtractionSolid("Substracted Bulb Ellipsoid 2", bulbEllipsoid2, substractionTube, 0, G4ThreeVector(0, 0, excess - m_totalLenght * 0.5));
bulbSolid = new G4UnionSolid("Solid Bulb", bulbSolid, substractedLargeEllipsoid, 0, G4ThreeVector(0, 0, ellipseYpos2 - m_ellipsePosY));
if (p_side=="jOuterShape")
{
m_centreToTipDistance = m_ellipseZaxis;
}

return bulbSolid;
}


/**
* Construction of the frontal part of the PMT following the fits of the technical drawings. PMTs constructed with doubleEllipsePhotocathode were fitted with two ellipses.
* @return G4UnionSolid bulbSolid the frontal solid of the PMT
* @return bulbSolid the frontal solid of the PMT
*/
G4UnionSolid *OMSimPMTConstruction::doubleEllipsePhotocathode(G4String p_side)
G4VSolid *OMSimPMTConstruction::doubleEllipsePhotocathode(G4String p_side)
{
log_trace("Constructing photocathode with two ellipses");
G4double ellipseXYAxis2 = m_data->getValueWithUnit(m_selectedPMT, p_side + ".jEllipseXYaxis_2");
Expand All @@ -417,6 +403,12 @@ G4UnionSolid *OMSimPMTConstruction::doubleEllipsePhotocathode(G4String p_side)
substractionTube, 0, G4ThreeVector(0, 0, excess-ellipseZAxis2));

G4UnionSolid *bulbSolid = new G4UnionSolid("Solid Bulb", bulbEllipsoid, substractedLargeEllipsoid, 0, G4ThreeVector(0, 0, -m_ellipsePosY + ellipseYpos2));

if (p_side=="jOuterShape")
{
m_centreToTipDistance = ellipseYpos2 +ellipseZAxis2 - m_ellipsePosY;
}

return bulbSolid;
}

Expand All @@ -431,8 +423,8 @@ G4UnionSolid *OMSimPMTConstruction::doubleEllipsePhotocathode(G4String p_side)
*/
G4double OMSimPMTConstruction::getDistancePMTCenterToTip()
{
readGlobalParameters("jOuterShape");
return m_outRad + m_spherePosY - m_ellipsePosY;
log_trace("Distance from PMT center to tip {}", m_centreToTipDistance);
return m_centreToTipDistance;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions simulations/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_subdirectory(effective_area)
#add_subdirectory(effective_area)
#add_subdirectory(radioactive_decays)
#add_subdirectory(supernova)
#add_subdirectory(efficiency_calibration)
add_subdirectory(efficiency_calibration)
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void runXYZfrontalScan()
hitManager.reset();
}
}
scanner->runBeamPicoQuantSetup(0,0);
}


Expand Down
Loading

0 comments on commit 9a589ff

Please sign in to comment.