Skip to content

Commit

Permalink
More fixes of line length and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paolafer committed Jan 18, 2024
1 parent df473eb commit e9b433b
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 65 deletions.
3 changes: 2 additions & 1 deletion source/geometries/Next100.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ namespace nexus {
G4ThreeVector vessel_displacement =
shielding_->GetAirDisplacement(); // explained below

coord_origin_ = G4ThreeVector(fc_displ_x_, fc_displ_y_, vessel_->GetGateZpos());
coord_origin_ =
G4ThreeVector(fc_displ_x_, fc_displ_y_, vessel_->GetGateZpos());

// SHIELDING
shielding_->SetCoordOrigin(coord_origin_);
Expand Down
6 changes: 4 additions & 2 deletions source/geometries/Next100Ics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ namespace nexus {
geom_navigator_ = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();

/// Messenger
msg_ = new G4GenericMessenger(this, "/Geometry/Next100/", "Control commands of geometry Next100.");
msg_ = new G4GenericMessenger(this, "/Geometry/Next100/",
"Control commands of geometry Next100.");
msg_->DeclareProperty("ics_vis", visibility_, "ICS Visibility");

}
Expand Down Expand Up @@ -228,7 +229,8 @@ namespace nexus {

G4ThreeVector glob_vtx(vertex);
glob_vtx = glob_vtx - GetCoordOrigin();
VertexVolume = geom_navigator_->LocateGlobalPointAndSetup(glob_vtx, 0, false);
VertexVolume =
geom_navigator_->LocateGlobalPointAndSetup(glob_vtx, 0, false);
} while (VertexVolume->GetName() != "ICS");
}

Expand Down
84 changes: 48 additions & 36 deletions source/geometries/Next100SiPM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,21 @@ void Next100SiPM::Construct()
G4Material* coating_mt = materials::TPB();
coating_mt->SetMaterialPropertiesTable(opticalprops::TPB());

G4LogicalVolume* coating_logic_vol = new G4LogicalVolume(coating_solid_vol, coating_mt, coating_name);
G4LogicalVolume* coating_logic_vol =
new G4LogicalVolume(coating_solid_vol, coating_mt, coating_name);

G4double coating_zpos = sipm_thickn/2. - coating_thickn_/2;

new G4PVPlacement(nullptr, G4ThreeVector(0., 0., coating_zpos), coating_logic_vol,
new G4PVPlacement(nullptr, G4ThreeVector(0., 0., coating_zpos),
coating_logic_vol,
coating_name, sipm_logic_vol, false, 0, false);

G4OpticalSurface* coating_optSurf = new G4OpticalSurface(coating_name + "_OPSURF",
glisur, ground,
dielectric_dielectric, .01);
G4OpticalSurface* coating_optSurf =
new G4OpticalSurface(coating_name + "_OPSURF", glisur, ground,
dielectric_dielectric, .01);

new G4LogicalSkinSurface(coating_name + "_OPSURF", coating_logic_vol, coating_optSurf);
new G4LogicalSkinSurface(coating_name + "_OPSURF", coating_logic_vol,
coating_optSurf);

coating_logic_vol->SetVisAttributes(G4VisAttributes::GetInvisible());
}
Expand All @@ -119,7 +122,8 @@ void Next100SiPM::Construct()
new G4LogicalVolume(window_solid_vol, optical_silicone, window_name);

new G4PVPlacement(nullptr, G4ThreeVector(0., 0., window_zpos),
window_logic_vol, window_name, sipm_logic_vol, false, 0, false);
window_logic_vol, window_name, sipm_logic_vol, false,
0, false);


// SENSITIVE AREA ////////////////////////////////////////
Expand All @@ -144,35 +148,43 @@ void Next100SiPM::Construct()

// OPTICAL SURFACES //////////////////////////////////////
const G4int entries = 42;
G4double energies[entries] = {0.2 * eV, 1.0 * eV, 1.3 * eV,
1.3776022 * eV, 1.4472283 * eV, 1.52041305 * eV, 1.59290956 * eV, 1.66341179 * eV,
1.72546158 * eV, 1.78169885 * eV, 1.8473836 * eV, 1.90593775 * eV, 1.94918431 * eV,
1.99443901 * eV, 2.05580636 * eV, 2.12107005 * eV, 2.17476803 * eV, 2.23125551 * eV,
2.29951572 * eV, 2.37208426 * eV, 2.46950045 * eV, 2.75730000 * eV, 3.04467524 * eV,
3.14006977 * eV, 3.20705792 * eV, 3.2592052 * eV, 3.31307637 * eV, 3.38773724 * eV,
3.44597914 * eV, 3.50625866 * eV, 3.54763044 * eV, 3.58999021 * eV, 3.61155171 * eV,
3.65546116 * eV, 3.67781872 * eV, 3.72336446 * eV, 3.74656299 * eV, 3.79383824 * eV,
3.86703126 * eV, 4.0 * eV, 4.2 * eV, 11.5 * eV};

G4double reflectivity[entries] = {0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0};

G4double efficiency[entries] = {0.0, 0.0, 0.0,
0.03506431, 0.0560223 , 0.07944598, 0.10291004, 0.12607905,
0.14954693, 0.17061431, 0.193974 , 0.21740781, 0.23843982,
0.26178898, 0.28501443, 0.30860135, 0.33010702, 0.35361856,
0.37751412, 0.40109223, 0.42743901, 0.43779628, 0.41021884,
0.38111716, 0.36057765, 0.33517116, 0.31491576, 0.28931617,
0.26968918, 0.24455707, 0.22893024, 0.20156831, 0.18538152,
0.15444223, 0.12549548, 0.1040183 , 0.0902669 , 0.05498552,
0.02944706, 0.0, 0.0, 0.0};
G4double energies[entries] =
{0.2 * eV, 1.0 * eV, 1.3 * eV,
1.3776022 * eV, 1.4472283 * eV, 1.52041305 * eV, 1.59290956 * eV,
1.66341179 * eV, 1.72546158 * eV, 1.78169885 * eV, 1.8473836 * eV,
1.90593775 * eV, 1.94918431 * eV, 1.99443901 * eV, 2.05580636 * eV,
2.12107005 * eV, 2.17476803 * eV, 2.23125551 * eV, 2.29951572 * eV,
2.37208426 * eV, 2.46950045 * eV, 2.75730000 * eV, 3.04467524 * eV,
3.14006977 * eV, 3.20705792 * eV, 3.2592052 * eV, 3.31307637 * eV,
3.38773724 * eV, 3.44597914 * eV, 3.50625866 * eV, 3.54763044 * eV,
3.58999021 * eV, 3.61155171 * eV, 3.65546116 * eV, 3.67781872 * eV,
3.72336446 * eV, 3.74656299 * eV, 3.79383824 * eV, 3.86703126 * eV,
4.0 * eV, 4.2 * eV, 11.5 * eV};

G4double reflectivity[entries] =
{0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0};

G4double efficiency[entries] =
{0.0, 0.0, 0.0,
0.03506431, 0.0560223 , 0.07944598, 0.10291004,
0.12607905, 0.14954693, 0.17061431, 0.193974 , 0.21740781,
0.23843982, 0.26178898, 0.28501443, 0.30860135, 0.33010702,
0.35361856, 0.37751412, 0.40109223, 0.42743901, 0.43779628,
0.41021884, 0.38111716, 0.36057765, 0.33517116, 0.31491576,
0.28931617, 0.26968918, 0.24455707, 0.22893024, 0.20156831,
0.18538152, 0.15444223, 0.12549548, 0.1040183 , 0.0902669 ,
0.05498552, 0.02944706,
0.0, 0.0, 0.0};

G4MaterialPropertiesTable* sipm_mt = new G4MaterialPropertiesTable();
sipm_mt->AddProperty("EFFICIENCY", energies, efficiency, entries);
Expand Down
72 changes: 46 additions & 26 deletions source/geometries/Next100SiPMBoard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ void Next100SiPMBoard::Construct()
G4String board_name = "SIPM_BOARD";

G4Box* board_solid_vol =
new G4Box(board_name, size_/2., size_/2., (board_thickness_ + mask_thickness_)/2.);
new G4Box(board_name, size_/2., size_/2.,
(board_thickness_ + mask_thickness_)/2.);


G4Material* kapton = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON");
// In Geant4 11.0.0, a bug in treating the OpBoundaryProcess produced in the surface makes the code fail.
// This is avoided by setting an empty G4MaterialPropertiesTable of the G4Material.
G4Material* kapton =
G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON");
// In Geant4 11.0.0, a bug in treating the OpBoundaryProcess produced
// in the surface makes the code fail. This is avoided by setting an
// empty G4MaterialPropertiesTable of the G4Material.
kapton->SetMaterialPropertiesTable(new G4MaterialPropertiesTable());

G4LogicalVolume* board_logic_vol =
Expand All @@ -109,17 +112,21 @@ void Next100SiPMBoard::Construct()
G4Box* mask_solid_vol =
new G4Box(mask_name, size_/2., size_/2., mask_thickness_/2.);

G4Material* teflon = G4NistManager::Instance()->FindOrBuildMaterial("G4_TEFLON");
// teflon is the material used in the sipm-board masks which are covered by a G4LogicalSkinSurface
// In Geant4 11.0.0, a bug in treating the OpBoundaryProcess produced in the surface makes the code fail.
// This is avoided by setting an empty G4MaterialPropertiesTable of the G4Material.
G4Material* teflon =
G4NistManager::Instance()->FindOrBuildMaterial("G4_TEFLON");
// teflon is the material used in the sipm-board masks which are covered by
// a G4LogicalSkinSurface.
// In Geant4 11.0.0, a bug in treating the OpBoundaryProcess produced in the
// surface makes the code fail. This is avoided by setting an empty
// G4MaterialPropertiesTable of the G4Material.
teflon->SetMaterialPropertiesTable(new G4MaterialPropertiesTable());

G4LogicalVolume* mask_logic_vol =
new G4LogicalVolume(mask_solid_vol, teflon, mask_name);

new G4PVPlacement(nullptr, G4ThreeVector(0., 0., mask_zpos),
mask_logic_vol, mask_name, board_logic_vol, false, 0, false);
mask_logic_vol, mask_name, board_logic_vol, false,
0, false);

G4OpticalSurface* mask_opsurf =
new G4OpticalSurface(mask_name+"_OPSURF", unified, ground, dielectric_metal);
Expand Down Expand Up @@ -177,28 +184,36 @@ void Next100SiPMBoard::Construct()
G4String mask_wall_wls_name = "SIPM_BOARD_MASK_WALL_WLS";

G4Box* latwall_wls_solid_vol =
new G4Box(mask_wall_wls_name, wls_thickness/2., mask_hole_y/2., mask_hole_length/2.);
new G4Box(mask_wall_wls_name, wls_thickness/2., mask_hole_y/2.,
mask_hole_length/2.);

G4Box* uppwall_wls_solid_vol =
new G4Box(mask_wall_wls_name, mask_hole_x/2., wls_thickness/2., mask_hole_length/2.);
new G4Box(mask_wall_wls_name, mask_hole_x/2., wls_thickness/2.,
mask_hole_length/2.);

G4UnionSolid* wall_wls_solid_vol =
new G4UnionSolid(mask_wall_wls_name, latwall_wls_solid_vol, uppwall_wls_solid_vol, 0,
G4ThreeVector(mask_hole_x/2.-wls_thickness/2., -mask_hole_y/2. + wls_thickness/2., 0.));
new G4UnionSolid(mask_wall_wls_name, latwall_wls_solid_vol,
uppwall_wls_solid_vol, 0,
G4ThreeVector(mask_hole_x/2.-wls_thickness/2.,
-mask_hole_y/2. + wls_thickness/2., 0.));

wall_wls_solid_vol =
new G4UnionSolid(mask_wall_wls_name, wall_wls_solid_vol, uppwall_wls_solid_vol, 0,
G4ThreeVector(mask_hole_x/2.-wls_thickness/2., mask_hole_y/2. - wls_thickness/2., 0.));
new G4UnionSolid(mask_wall_wls_name, wall_wls_solid_vol,
uppwall_wls_solid_vol, 0,
G4ThreeVector(mask_hole_x/2.-wls_thickness/2.,
mask_hole_y/2. - wls_thickness/2., 0.));

wall_wls_solid_vol =
new G4UnionSolid(mask_wall_wls_name, wall_wls_solid_vol, latwall_wls_solid_vol, 0,
new G4UnionSolid(mask_wall_wls_name, wall_wls_solid_vol,
latwall_wls_solid_vol, 0,
G4ThreeVector(mask_hole_x-wls_thickness, 0., 0.));

G4LogicalVolume* wall_wls_logic_vol =
new G4LogicalVolume(wall_wls_solid_vol, tpb, mask_wall_wls_name);

G4VPhysicalVolume* wall_wls_phys_vol =
new G4PVPlacement(nullptr, G4ThreeVector(-mask_hole_x/2. + wls_thickness/2., 0., 0.), wall_wls_logic_vol,
new G4PVPlacement(nullptr, G4ThreeVector(-mask_hole_x/2. + wls_thickness/2.,
0., 0.), wall_wls_logic_vol,
mask_wall_wls_name, mask_hole_logic_vol, false, 0, false);

// MASK WLS GAS HOLE ///////////////////////////////////////////////
Expand Down Expand Up @@ -229,7 +244,8 @@ void Next100SiPMBoard::Construct()
G4double sipm_zpos = - mask_hole_length/2. + sipm_thickn/2.;

new G4PVPlacement(nullptr, G4ThreeVector(0., 0., sipm_zpos),
sipm_->GetLogicalVolume(), sipm_->GetLogicalVolume()->GetName(), mask_hole_logic_vol,
sipm_->GetLogicalVolume(),
sipm_->GetLogicalVolume()->GetName(), mask_hole_logic_vol,
false, 0, false);

////////////////////////////////////////////////////////////////////
Expand All @@ -254,26 +270,30 @@ void Next100SiPMBoard::Construct()

// Placement of the WLS gas hole
new G4PVPlacement(nullptr, G4ThreeVector(xpos, ypos, 0.),
mask_wls_hole_logic_vol, mask_wls_hole_name, mask_wls_logic_vol,
mask_wls_hole_logic_vol, mask_wls_hole_name,
mask_wls_logic_vol,
false, counter, false);
// Placement of the hole+SiPM
mask_hole_phys_vol = new G4PVPlacement(nullptr, G4ThreeVector(xpos, ypos, mask_hole_zpos),
mask_hole_logic_vol, mask_hole_name, mask_logic_vol,
false, counter, false);
mask_hole_phys_vol =
new G4PVPlacement(nullptr, G4ThreeVector(xpos, ypos, mask_hole_zpos),
mask_hole_logic_vol, mask_hole_name, mask_logic_vol,
false, counter, false);

new G4LogicalBorderSurface(mask_wall_wls_name+"_OPSURF",
mask_hole_phys_vol, wall_wls_phys_vol, mask_wls_opsurf);
mask_hole_phys_vol, wall_wls_phys_vol,
mask_wls_opsurf);
new G4LogicalBorderSurface(mask_wls_name+"_OPSURF",
wall_wls_phys_vol, mask_hole_phys_vol, mask_wls_opsurf);
wall_wls_phys_vol, mask_hole_phys_vol,
mask_wls_opsurf);

counter++;
}
}

// VERTEX GENERATOR ////////////////////////////////////////////////

vtxgen_ = new BoxPointSampler(size_, size_, board_thickness_+mask_thickness_, 0.,
G4ThreeVector(0., 0., 0));
vtxgen_ = new BoxPointSampler(size_, size_, board_thickness_+mask_thickness_,
0., G4ThreeVector(0., 0., 0));

// VISIBILITIES ////////////////////////////////////////////////////
if (visibility_) {
Expand Down

0 comments on commit e9b433b

Please sign in to comment.