Skip to content

Commit 5f895fa

Browse files
author
bquilain
committed
Found errors in automatic merging in ConstructPMT.
1 parent 0b02d02 commit 5f895fa

7 files changed

+135
-81
lines changed

CMakeLists.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ include(${ROOT_USE_FILE})
2929
# Locate sources and headers for this project
3030
# ## NOT NEEDED FOR DICT
3131
include_directories(${PROJECT_SOURCE_DIR}/include
32+
${PROJECT_SOURCE_DIR}/../shared/include
3233
${Geant4_INCLUDE_DIR}
3334
${ROOT_INCLUDE_DIRS})
3435

@@ -88,7 +89,6 @@ add_library(WCSimRoot SHARED
8889
./src/TNRooTrackerVtx.cc
8990
./src/WCSimRootTools.cc
9091
WCSimRootDict.cxx)
91-
9292
target_link_libraries(WCSimRoot ${ROOT_LIBRARIES})
9393

9494
# Create libWCSimRootDict.so (needed for ROOT6)
@@ -187,16 +187,14 @@ set(WCSIM_SCRIPTS
187187
mPMT-configfiles/mPMTconfig_34_22.5_2.txt
188188
mPMT-configfiles/mPMTconfig_34_22_2.txt
189189
)
190-
foreach(_file ${WCSIM_FILES})
190+
191+
foreach(_file ${WCSIM_SCRIPTS})
191192
configure_file(
192193
${PROJECT_SOURCE_DIR}/${_file}
193194
${PROJECT_BINARY_DIR}/${_file}
194195
COPYONLY
195196
)
196197
endforeach()
197-
else()
198-
message(STATUS "Note: building in-place, no need to copy anything.")
199-
endif()
200198

201199
#----------------------------------------------------------------------------
202200
# For internal Geant4 use - but has no effect if you build this

src/WCSimConstructPMT.cc

+64-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "G4SystemOfUnits.hh"
1919

2020
#include "G4LogicalSkinSurface.hh"
21-
21+
//#define MERGE
2222
//PMT logical volume construction.
2323
//WCSimDetectorConstruction::PMTMap_t WCSimDetectorConstruction::PMTLogicalVolumes;
2424

@@ -64,6 +64,9 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
6464
//Optional reflectorCone:
6565
G4double reflectorRadius = radius + id_reflector_height * tan(id_reflector_angle); // PMT radius+ r = h * tan (theta)
6666
G4double reflectorThickness = 0.344*CLHEP::mm; // the actual reflector thickness is 0.5 mm but due to solid works design, I am taking the horizontal component to calculate the reflector radius. Refer the CAD drawing.
67+
#ifdef MERGE
68+
reflectorThickness = 0.5*CLHEP::mm;
69+
#endif
6770
if((reflectorRadius - radius) < 1.*CLHEP::mm)
6871
reflectorThickness = 0.*CLHEP::mm;
6972

@@ -82,7 +85,9 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
8285
G4double wcpmt_z_offset = 0.; // for positioning single PMT support (mPMT)
8386
G4bool addPMTBase = false;
8487
G4double pmtModuleHeight = 59.62*CLHEP::mm; //includes puck and single PMT support, not PMT base. The height of pmt module for solid works design
85-
88+
#ifdef MERGE
89+
pmtModuleHeight = 54.*CLHEP::mm;
90+
#endif
8691
G4cout << "Number of PMTs per Vessel, in ConstructPMT = " << nIDPMTs << G4endl;
8792

8893
if(nIDPMTs == 1){
@@ -133,15 +138,15 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
133138
// ToDo: extend the shell
134139
/////////////////////////////
135140

136-
G4cout << mPMT_vessel_radius_curv << ", " << mPMT_outer_material_d << ", " << expose << ", " << dist_pmt_vessel << G4endl;
141+
G4cout << mPMT_vessel_radius_curv << ", " << mPMT_outer_material_d << ", " << expose << ", " << dist_pmt_vessel << ", radius curv = " << mPMT_vessel_radius_curv << ", pmt module height = " << pmtModuleHeight << G4endl;
137142

138143
// for single PMTs no overlap issues and will rest on flat black sheets
139144
// Need spherical shell for curved top to better match (and reduce overlaps) with
140-
// gel layer ("container") and vessel.
145+
// gel layer ("container") and mPMT_vessel.
141146
solidWCPMT =
142147
new G4Sphere("WCPMT",
143-
vessel_radius_curv - mPMT_outer_material_d - pmtModuleHeight, //rMin = 342 - 10 - 59.62 = 272.38 mm, 59.62mm is position of support structure
144-
vessel_radius_curv - mPMT_outer_material_d, //rMax = 332 mm
148+
mPMT_vessel_radius_curv - mPMT_outer_material_d - pmtModuleHeight, //rMin = 342 - 10 - 59.62 = 272.38 mm, 59.62mm is position of support structure
149+
mPMT_vessel_radius_curv - mPMT_outer_material_d, //rMax = 332 mm
145150
0.0*deg, //phiStart
146151
360.0*deg, //Deltaphi
147152
0.0*deg, //thetaStart
@@ -344,6 +349,16 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
344349
* (KM3NeT support matrix value)
345350
* three degrees of freedom: height, z position and opening angle
346351
*/
352+
#ifdef MERGE
353+
G4Cons* reflectorCone =
354+
new G4Cons("WCPMT_reflect",
355+
radius + 1.1*CLHEP::mm, //rmin
356+
radius + 1.1*CLHEP::mm + reflectorThickness, //rmax
357+
reflectorRadius + 1.1*CLHEP::mm, //Rmin
358+
reflectorRadius + 1.1*CLHEP::mm + reflectorThickness, //Rmax
359+
id_reflector_height/2, //z/2
360+
0, 2*CLHEP::pi);
361+
#else
347362
G4Cons* reflectorCone =
348363
new G4Cons("WCPMT_reflect",
349364
radius - 4.715*CLHEP::mm, //rmin
@@ -352,7 +367,7 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
352367
reflectorRadius - 4.715*CLHEP::mm + reflectorThickness, //Rmax
353368
id_reflector_height/2, //z/2
354369
0, 2*CLHEP::pi);
355-
370+
#endif
356371

357372
G4LogicalVolume* logicReflector =
358373
new G4LogicalVolume( reflectorCone,
@@ -386,6 +401,37 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
386401
/// 1-PMT support //
387402
////////////////////
388403

404+
#ifdef MERGE
405+
//54mm is position of full PMT support wrt inside of pressure vessel.
406+
G4Cons * solidWCPMTsupport =
407+
new G4Cons("WCPMTsupport",
408+
0., //rmin1
409+
tan(mPMT_pmt_openingAngle)*(mPMT_vessel_radius_curv - mPMT_outer_material_d - pmtModuleHeight), //rmax1
410+
0., //rmin2
411+
tan(mPMT_pmt_openingAngle)*(mPMT_vessel_radius_curv - mPMT_outer_material_d
412+
-expose - dist_pmt_vessel), //rmax2
413+
(pmtModuleHeight - expose - dist_pmt_vessel)/2, //h/2
414+
0.0*deg, //phiStart
415+
360.0*deg); //Deltaphi
416+
417+
G4LogicalVolume* logicWCPMTsupport =
418+
new G4LogicalVolume(solidWCPMTsupport,
419+
G4Material::GetMaterial("Blacksheet"),
420+
"WCPMTsupport",
421+
0,0,0);
422+
423+
new G4LogicalSkinSurface("FoamLogSkinSurface",logicWCPMTsupport,OpGelFoamSurface);
424+
425+
new G4PVPlacement(0,
426+
G4ThreeVector(0, 0, wcpmt_z_offset+(pmtModuleHeight - expose - dist_pmt_vessel)/2),
427+
logicWCPMTsupport,
428+
"WCPMTsupport",
429+
logicWCPMT,
430+
false,
431+
0,
432+
checkOverlaps);
433+
434+
#endif
389435
// Visualize
390436
G4VisAttributes* WCPMTVisAtt_sup = new G4VisAttributes(G4Colour(0.3,0.3,0.3));
391437
WCPMTVisAtt_sup->SetForceSolid(true);
@@ -433,6 +479,7 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
433479
new G4LogicalSkinSurface("FoamLogSkinSurface2",logicWCPMTsupport2,OpGelFoamSurface);
434480
logicWCPMTsupport2->SetVisAttributes(WCPMTVisAtt_sup);
435481

482+
#ifdef MERGE
436483
double reflectorHolderZ = 272.36*mm; // position of z=0 of the reflector holder with respect to the origin of the mother volume
437484
new G4PVPlacement(0,
438485
G4ThreeVector(0, 0, reflectorHolderZ),
@@ -442,6 +489,16 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
442489
false,
443490
0,
444491
checkOverlaps);
492+
#else
493+
new G4PVPlacement(0,
494+
G4ThreeVector(0, 0, position_z_offset),
495+
logicWCPMTsupport2,
496+
"WCPMTsupport2",
497+
logicWCPMT,
498+
false,
499+
0,
500+
checkOverlaps);
501+
#endif
445502
}
446503

447504
}

src/WCSimDetectorConfigs.cc

+34-34
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,9 @@ void WCSimDetectorConstruction::SetNuPrism_mPMTGeometry()
759759
WCPMTRadius = PMT->GetRadius();
760760

761761
//mPMT params go first because detector depends on it:
762-
vessel_cyl_height = 38.*CLHEP::mm; //option A, option B would be 277 mm
763-
vessel_radius_curv = 342.*CLHEP::mm; //needs to include the vessel thickness, as we construct from outside inwards.
764-
vessel_radius = 254.*CLHEP::mm;
762+
mPMT_vessel_cyl_height = 38.*CLHEP::mm; //option A, option B would be 277 mm
763+
mPMT_vessel_radius_curv = 342.*CLHEP::mm; //needs to include the vessel thickness, as we construct from outside inwards.
764+
mPMT_vessel_radius = 254.*CLHEP::mm;
765765
dist_pmt_vessel = 8*CLHEP::mm;
766766
orientation = PERPENDICULAR;
767767
mPMT_outer_material = "G4_PLEXIGLASS";
@@ -774,7 +774,7 @@ void WCSimDetectorConstruction::SetNuPrism_mPMTGeometry()
774774
id_reflector_z_offset = 6.12*CLHEP::mm;
775775
id_reflector_angle = 46.5*CLHEP::deg;
776776
mPMT_pmt_openingAngle = 8.3*CLHEP::deg;
777-
G4double vessel_tot_height = vessel_radius + vessel_cyl_height;
777+
G4double mPMT_vessel_tot_height = mPMT_vessel_radius + mPMT_vessel_cyl_height;
778778

779779
// parameters related to filling the ID mPMT
780780
nID_PMTs = 19;
@@ -812,9 +812,9 @@ void WCSimDetectorConstruction::SetNuPrismBeamTest_mPMTGeometry()
812812
WCPMTRadius = PMT->GetRadius();
813813

814814
//mPMT params go first because detector depends on it:
815-
vessel_cyl_height = 38.*CLHEP::mm; //option A, option B would be 277 mm
816-
vessel_radius_curv = 342.*CLHEP::mm; //needs to include the vessel thickness, as we construct from outside inwards.
817-
vessel_radius = 254.*CLHEP::mm;
815+
mPMT_vessel_cyl_height = 38.*CLHEP::mm; //option A, option B would be 277 mm
816+
mPMT_vessel_radius_curv = 342.*CLHEP::mm; //needs to include the vessel thickness, as we construct from outside inwards.
817+
mPMT_vessel_radius = 254.*CLHEP::mm;
818818
dist_pmt_vessel = 8*CLHEP::mm;
819819
orientation = PERPENDICULAR;
820820
mPMT_outer_material = "G4_PLEXIGLASS";
@@ -827,7 +827,7 @@ void WCSimDetectorConstruction::SetNuPrismBeamTest_mPMTGeometry()
827827
id_reflector_z_offset = 6.12*CLHEP::mm;
828828
id_reflector_angle = 46.5*CLHEP::deg;
829829
mPMT_pmt_openingAngle = 8.3*CLHEP::deg;
830-
G4double vessel_tot_height = vessel_radius + vessel_cyl_height;
830+
G4double mPMT_vessel_tot_height = mPMT_vessel_radius + mPMT_vessel_cyl_height;
831831

832832
// parameters related to filling the ID mPMT
833833
nID_PMTs = 19;
@@ -864,9 +864,9 @@ void WCSimDetectorConstruction::SetNuPrismShort_mPMTGeometry()
864864
WCPMTRadius = PMT->GetRadius();
865865

866866
//mPMT params go first because detector depends on it:
867-
vessel_cyl_height = 38.*CLHEP::mm; //option A, option B would be 277 mm
868-
vessel_radius_curv = 342.*CLHEP::mm; //needs to include the vessel thickness, as we construct from outside inwards.
869-
vessel_radius = 254.*CLHEP::mm;
867+
mPMT_vessel_cyl_height = 38.*CLHEP::mm; //option A, option B would be 277 mm
868+
mPMT_vessel_radius_curv = 342.*CLHEP::mm; //needs to include the vessel thickness, as we construct from outside inwards.
869+
mPMT_vessel_radius = 254.*CLHEP::mm;
870870
dist_pmt_vessel = 8*CLHEP::mm;
871871
orientation = PERPENDICULAR;
872872
mPMT_outer_material = "G4_PLEXIGLASS";
@@ -879,7 +879,7 @@ void WCSimDetectorConstruction::SetNuPrismShort_mPMTGeometry()
879879
id_reflector_z_offset = 6.12*CLHEP::mm;
880880
id_reflector_angle = 46.5*CLHEP::deg;
881881
mPMT_pmt_openingAngle = 8.3*CLHEP::deg;
882-
G4double vessel_tot_height = vessel_radius + vessel_cyl_height;
882+
G4double mPMT_vessel_tot_height = mPMT_vessel_radius + mPMT_vessel_cyl_height;
883883

884884
// parameters related to filling the ID mPMT
885885
nID_PMTs = 19;
@@ -889,7 +889,7 @@ void WCSimDetectorConstruction::SetNuPrismShort_mPMTGeometry()
889889
WCIDDiameter = 8.0*CLHEP::m;
890890
WCIDVerticalPosition = 0.;
891891

892-
WCBarrelPMTOffset = vessel_tot_height;
892+
WCBarrelPMTOffset = mPMT_vessel_tot_height;
893893
WCPMTperCellHorizontal = 1.0;
894894
WCPMTperCellVertical = 1.0;
895895

@@ -918,9 +918,9 @@ void WCSimDetectorConstruction::SetTestSinglemPMTGeometry()
918918
WCPMTRadius = PMT->GetRadius();
919919

920920
//mPMT params
921-
vessel_cyl_height = 38.*CLHEP::mm;
922-
vessel_radius_curv = 300.*CLHEP::mm;
923-
vessel_radius = 254.*CLHEP::mm;
921+
mPMT_vessel_cyl_height = 38.*CLHEP::mm;
922+
mPMT_vessel_radius_curv = 300.*CLHEP::mm;
923+
mPMT_vessel_radius = 254.*CLHEP::mm;
924924
dist_pmt_vessel = 8*CLHEP::mm;
925925
orientation = PERPENDICULAR;
926926
mPMT_outer_material = "G4_PLEXIGLASS";
@@ -934,20 +934,20 @@ void WCSimDetectorConstruction::SetTestSinglemPMTGeometry()
934934
mPMT_pmt_openingAngle = 8.3*CLHEP::deg;
935935

936936
// BarrelPMTOffset/WCCapEdgeLimit needs PMT/mPMT height
937-
G4double vessel_tot_height = vessel_radius + vessel_cyl_height;
937+
G4double mPMT_vessel_tot_height = mPMT_vessel_radius + mPMT_vessel_cyl_height;
938938
// parameters related to filling the ID mPMT
939939
nID_PMTs = 33;
940940
config_file = wcsimdir_path+"/mPMT-configfiles/mPMTconfig_33_13_1.txt";
941941

942942
WCIDDiameter = 10.0*m;
943943
WCIDHeight = 30.0*m;
944-
WCBarrelPMTOffset = vessel_tot_height;
944+
WCBarrelPMTOffset = mPMT_vessel_tot_height;
945945
WCBarrelNumPMTHorizontal = 3;
946946
WCBarrelNRings = 3;
947947
WCPMTperCellHorizontal = 1;
948948
WCPMTperCellVertical = 1;
949949
WCPMTPercentCoverage = 10.;
950-
WCCapEdgeLimit = WCIDDiameter/2.0 - vessel_tot_height;
950+
WCCapEdgeLimit = WCIDDiameter/2.0 - mPMT_vessel_tot_height;
951951
WCCapPMTSpacing = WCIDDiameter*2.0;
952952
WCBlackSheetThickness = 2.0*cm;
953953
WCAddGd = false;
@@ -968,19 +968,19 @@ void WCSimDetectorConstruction::Cylinder_60x74_3inchmPMT_14perCent()
968968

969969

970970
//mPMT params go first because detector depends on it:
971-
vessel_cyl_height = 0.*CLHEP::mm; // the 50mm should exist only for OD and extends behind the iD wall
972-
vessel_radius_curv = 270.*CLHEP::mm;
973-
vessel_radius = 270.*CLHEP::mm;
971+
mPMT_vessel_cyl_height = 0.*CLHEP::mm; // the 50mm should exist only for OD and extends behind the iD wall
972+
mPMT_vessel_radius_curv = 270.*CLHEP::mm;
973+
mPMT_vessel_radius = 270.*CLHEP::mm;
974974
dist_pmt_vessel = 5*CLHEP::mm;
975975
orientation = PERPENDICULAR;
976976
mPMT_outer_material = "G4_PLEXIGLASS";
977977
mPMT_inner_material = "SilGel";
978-
mPMT_outer_material_d = 0.03*2* vessel_radius *CLHEP::mm; //using NEMO article safety margin of 0.03 for t/D
978+
mPMT_outer_material_d = 0.03*2* mPMT_vessel_radius *CLHEP::mm; //using NEMO article safety margin of 0.03 for t/D
979979
// Radius of cone at z=reflectorHeight
980980
id_reflector_height = 7.5*CLHEP::mm; //7.5mm from KM3Net JINST
981981
id_reflector_z_offset = 1.1*CLHEP::mm; //from KM3Net CAD drawings
982982
id_reflector_angle = CLHEP::pi/4*CLHEP::rad; // Based on KM3Net JINST: 45 deg wrt normal, so 7.5mm xtra
983-
G4double vessel_tot_height = vessel_radius + vessel_cyl_height;
983+
G4double mPMT_vessel_tot_height = mPMT_vessel_radius + mPMT_vessel_cyl_height;
984984

985985
// parameters related to filling the ID mPMT
986986
nID_PMTs = 33;
@@ -993,7 +993,7 @@ void WCSimDetectorConstruction::Cylinder_60x74_3inchmPMT_14perCent()
993993
// WCBarrelPMTOffset does not change total No. of modules, so use actual outer_module_radius.
994994
WCIDDiameter = 74.0*m;
995995
WCIDHeight = 60.0*m;
996-
WCBarrelPMTOffset = vessel_tot_height; //mPMT cylinder Radius //WCPMTRadius; //offset from vertical
996+
WCBarrelPMTOffset = mPMT_vessel_tot_height; //mPMT cylinder Radius //WCPMTRadius; //offset from vertical
997997
WCPMTperCellHorizontal= 4;
998998
WCPMTperCellVertical = 3;
999999
WCPMTPercentCoverage = 13.51;
@@ -1021,19 +1021,19 @@ void WCSimDetectorConstruction::Cylinder_60x74_3inchmPMT_40perCent()
10211021
WCPMTRadius = 0.254*m;
10221022

10231023
//mPMT params:
1024-
vessel_cyl_height = 0.*CLHEP::mm; // the 50mm should exist only for OD and extends behind the iD wall
1025-
vessel_radius_curv = 280.*CLHEP::mm;
1026-
vessel_radius = 280.*CLHEP::mm;
1024+
mPMT_vessel_cyl_height = 0.*CLHEP::mm; // the 50mm should exist only for OD and extends behind the iD wall
1025+
mPMT_vessel_radius_curv = 280.*CLHEP::mm;
1026+
mPMT_vessel_radius = 280.*CLHEP::mm;
10271027
dist_pmt_vessel = 5*CLHEP::mm;
10281028
orientation = PERPENDICULAR;
10291029
mPMT_outer_material = "G4_PLEXIGLASS";
10301030
mPMT_inner_material = "SilGel";
1031-
mPMT_outer_material_d = 0.03*2*vessel_radius*CLHEP::mm; //using NEMO article safety margin of 0.03 for t/D
1031+
mPMT_outer_material_d = 0.03*2*mPMT_vessel_radius*CLHEP::mm; //using NEMO article safety margin of 0.03 for t/D
10321032
// Radius of cone at z=reflectorHeight
10331033
id_reflector_height = 7.5*CLHEP::mm; //7.5mm from KM3Net JINST
10341034
id_reflector_z_offset = 1.1*CLHEP::mm; //from KM3Net CAD drawings
10351035
id_reflector_angle = CLHEP::pi/4*CLHEP::rad; // Based on KM3Net JINST: 45 deg wrt normal, so 7.5mm xtra
1036-
G4double vessel_tot_height = vessel_radius + vessel_cyl_height;
1036+
G4double mPMT_vessel_tot_height = mPMT_vessel_radius + mPMT_vessel_cyl_height;
10371037

10381038
// parameters related to filling the ID mPMT
10391039
nID_PMTs = 34;
@@ -1042,7 +1042,7 @@ void WCSimDetectorConstruction::Cylinder_60x74_3inchmPMT_40perCent()
10421042

10431043
WCIDDiameter = 74.0*m;
10441044
WCIDHeight = 60.0*m;
1045-
WCBarrelPMTOffset = vessel_tot_height; //mPMT cylinder Radius //WCPMTRadius; //offset from vertical
1045+
WCBarrelPMTOffset = mPMT_vessel_tot_height; //mPMT cylinder Radius //WCPMTRadius; //offset from vertical
10461046
WCPMTperCellHorizontal= 4;
10471047
WCPMTperCellVertical = 3;
10481048
WCPMTPercentCoverage = 40.0;
@@ -1112,9 +1112,9 @@ void WCSimDetectorConstruction::Cylinder_60x74_3inch_40perCent()
11121112

11131113
void WCSimDetectorConstruction::InitSinglePMT(){
11141114

1115-
vessel_cyl_height = 0.*mm;
1116-
vessel_radius_curv = 0.1*mm;
1117-
vessel_radius = 0.1*mm;
1115+
mPMT_vessel_cyl_height = 0.*mm;
1116+
mPMT_vessel_radius_curv = 0.1*mm;
1117+
mPMT_vessel_radius = 0.1*mm;
11181118
dist_pmt_vessel = 0.*mm;
11191119
orientation = PERPENDICULAR;
11201120
mPMT_ID_PMT = "";

src/WCSimPMTObject.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ G4String PMT20inch::GetPMTName() {G4String PMTName = "20inch"; return PMTName;}
8282
G4double PMT20inch::GetExposeHeight() {return .18*m;}
8383
G4double PMT20inch::GetRadius() {return .254*m;}
8484
G4double PMT20inch::GetPMTGlassThickness() {return 0.4*cm;}
85-
double PMT20inch::HitTimeSmearing(double Q, double TTSFF=1.0/*, double linearity = 0. /*meaning linearity default = false*/) {
85+
double PMT20inch::HitTimeSmearing(double Q, double TTSFF=1.0) {
8686
double timingConstant = 10.0;
8787
double timingResolution;
8888
double Smearing_factor;

0 commit comments

Comments
 (0)