From cd9ab9f139f00c5b657f09eb1a9db5a140be24b7 Mon Sep 17 00:00:00 2001 From: Paola Ferrario Date: Mon, 6 Nov 2023 17:56:22 +0100 Subject: [PATCH] Use new class in FC code --- source/geometries/Next100FieldCage.cc | 215 +++++--------------------- source/geometries/Next100FieldCage.h | 8 +- 2 files changed, 45 insertions(+), 178 deletions(-) diff --git a/source/geometries/Next100FieldCage.cc b/source/geometries/Next100FieldCage.cc index 4f9df9010..87af76f4f 100644 --- a/source/geometries/Next100FieldCage.cc +++ b/source/geometries/Next100FieldCage.cc @@ -7,6 +7,7 @@ // ---------------------------------------------------------------------------- #include "Next100FieldCage.h" +#include "Next100Stave.h" #include "MaterialsList.h" #include "Visibilities.h" #include "IonizationSD.h" @@ -79,10 +80,11 @@ Next100FieldCage::Next100FieldCage(G4double grid_thickn): ring_int_diam_ (1014. * mm), ring_thickn_ (10. * mm), drift_ring_dist_ (24. * mm), - buffer_ring_dist_ (48. * mm), - holder_x_ (60. * mm), //x dimension of the holders - holder_long_y_ (9.1 * mm), //(9. * mm), // y dim of the base of the ring holders - holder_short_y_ (33.9 * mm), //(33.15 * mm),// y dim of the pieces added over the base of the ring holders + buffer_ring_dist_ (48. * mm), // distance between buffer rings + buffer_first_ring_dist_ (69. * mm), // distance of first ring from end of the stave + ring_drift_buffer_dist_ (72. * mm), // distance between last ring of buffer and first ring of drift part. + num_drift_rings_ (48), + num_buffer_rings_ (4), tpb_thickn_ (1 * micrometer), overlap_ (0.001*mm), //defined for G4UnionSolids to ensure a common volume within the two joined solids @@ -211,9 +213,6 @@ void Next100FieldCage::Construct() active_length_ = gate_cathode_dist_; buffer_length_ = gate_sapphire_wdw_dist_ - gate_cathode_dist_ - grid_thickn_; - /// Calculate radial position of the ring holders. - holder_r_ = (active_diam_+2.*teflon_thickn_+holder_long_y_)/2.; - /// Calculate relative z positions in mother volume /// All of them are calculated from GetELzCoord(), which is the position /// of the beginning of the ACTIVE volume and the end of the gate grid. @@ -257,9 +256,6 @@ void Next100FieldCage::DefineMaterials() /// High density polyethylene for the field cage hdpe_ = materials::HDPE(); - /// PE500 for the holders - pe500_ = materials::PE500(); - /// Copper for field rings copper_ = G4NistManager::Instance()->FindOrBuildMaterial("G4_Cu"); @@ -743,24 +739,15 @@ void Next100FieldCage::BuildFieldCage() G4LogicalVolume* ring_logic = new G4LogicalVolume(ring_solid, copper_, "FIELD_RING"); - G4double buffer_short_z = 37. * mm; // Thickness of holders in the buffer volume. - // Distance between the last ring of the buffer and the first ring of the drift part. - G4double ring_drift_buffer_dist = 72. * mm; - G4int num_drift_rings = 48; - G4int num_buffer_rings = 4; - // Placement of the buffer rings, in such a way that the holder ends // at the same z position as the teflon buffer reflector. - // The placements go from higher to lower z. - - // Distance of first ring from the end of the stave. - G4double buffer_first_ring_dist = 69. * mm; + // The placements go from higher to lower z. G4double first_ring_buff_z_pos = - teflon_buffer_zpos_ + teflon_buffer_length_/2. - buffer_first_ring_dist; + teflon_buffer_zpos_ + teflon_buffer_length_/2. - buffer_first_ring_dist_; G4double posz; - for (G4int i=0; i rotateZ((90-i) * deg); - new G4PVPlacement(rot, G4ThreeVector(holder_r_*cos(i*deg), holder_r_*sin(i*deg), - stave_buffer_zpos), buff_holder_logic, "BUFF_HOLDER", mother_logic_, - false, numbering, false); - numbering +=1; - } - - // ACTIVE holders. - G4double active_long_length = 1170.2 * mm; - G4double active_short_first_length = 8.5 * mm; // Thickness of first holder in the active volume. - G4double active_short_length = 13. * mm; // Thickness of holders in the active volume. - G4Box* active_short_first_solid = - new G4Box("ACT_SHORT", holder_x_/2., holder_short_y_/2.+overlap_/2., active_short_first_length/2.); - - G4double first_act_short_z = -active_long_length/2. + active_short_first_length/2.; - - G4Box* active_long_solid = - new G4Box("ACT_LONG", holder_x_/2., holder_long_y_/2., active_long_length/2.); - - G4UnionSolid* act_holder_solid = - new G4UnionSolid ("ACT_HOLDER", active_long_solid, active_short_first_solid, 0, - G4ThreeVector(0., holder_long_y_/2.+holder_short_y_/2.-overlap_/2., - first_act_short_z)); - - G4Box* active_short_solid = - new G4Box("ACT_SHORT", holder_x_/2., holder_short_y_/2.+overlap_/2., active_short_length/2.); - - for (G4int j=0; j rotateZ((90-i) *deg); - new G4PVPlacement(rot,G4ThreeVector(holder_r_*cos(i*deg),holder_r_*sin(i*deg), stave_drift_zpos), - act_holder_logic, "ACT_HOLDER", mother_logic_, - false, numbering, false); - numbering +=1; - } - - - // CATHODE holders. - // They are placed at the same z position as the cathode ring. - G4double cathode_long_y = 28.15 * mm;// 29.*mm (previous) - 0.85 * mm (what has been removed); - G4double cathode_long_length = 61 * mm; - G4double cathode_short_length = 22.75 * mm; // 24.5*mm - G4Box* cathode_large_solid = - new G4Box("CATHODE_LARGE", holder_x_/2., cathode_long_y/2., cathode_long_length/2.); - - G4Box* cathode_short_solid = - new G4Box("CATHODE_SHORT", holder_x_/2., holder_short_y_/2., cathode_short_length/2.); - - G4UnionSolid* cathode_holder_solid = - new G4UnionSolid ("CATHODE_HOLDER", cathode_large_solid, cathode_short_solid, 0, - G4ThreeVector(0.,-(holder_short_y_/2.-cathode_long_y/2), - cathode_long_length/2.-cathode_short_length/2.)); - - cathode_holder_solid = - new G4UnionSolid("CATHODE_HOLDER", cathode_holder_solid, cathode_short_solid, 0, - G4ThreeVector(0.,-(holder_short_y_/2.-cathode_long_y/2), - -(cathode_long_length/2.-cathode_short_length/2.))); - - G4LogicalVolume* cathode_holder_logic = - new G4LogicalVolume(cathode_holder_solid, pe500_, "CATHODE_HOLDER"); - - numbering=0; - G4double cathode_holder_r = (active_diam_+2*teflon_thickn_+ 2*holder_long_y_+ - 2*holder_short_y_)/2.-cathode_long_y/2.; - G4double cathode_holder_zpos = - stave_buffer_zpos - buffer_long_length/2. - cathode_opening/2.; - for (G4int i=10; i<360; i +=20){ - G4RotationMatrix* rot = new G4RotationMatrix(); - rot -> rotateZ((90-i) *deg); - new G4PVPlacement(rot, G4ThreeVector(cathode_holder_r*cos(i*deg), cathode_holder_r*sin(i*deg), - cathode_holder_zpos), cathode_holder_logic, "CATHODE_HOLDER", mother_logic_, + new G4PVPlacement(rot, G4ThreeVector(stave_r*cos(i*deg), stave_r *sin(i*deg), + stave_zpos), stave_logic, "STAVE", mother_logic_, false, numbering, false); numbering +=1; } - G4double total_stave_length = buffer_long_length + active_long_length + cathode_opening; - assert(total_stave_length == 1427. * mm); - G4double holder_gen_zpos = - (buffer_long_length*stave_buffer_zpos + active_long_length*stave_drift_zpos + - cathode_opening*cathode_zpos_)/total_stave_length; - + // Stave vertex generator + // Length is approximated to avoid complicated calculations. + // The correct positioning of vertices is checked at run time anyway. + G4double stave_gen_length = + teflon_buffer_zpos_ - GetELzCoord() + teflon_buffer_length_/2; holder_gen_ = - new CylinderPointSampler2020(holder_r_ - holder_long_y_/2., - holder_r_ + holder_long_y_/2. + holder_short_y_, - total_stave_length/2., 0., twopi, nullptr, - G4ThreeVector(0., 0., holder_gen_zpos)); + new CylinderPointSampler2020(active_diam_/2. + teflon_thickn_ , + active_diam_/2. + teflon_thickn_ + holder_long_y + holder_short_y, + stave_gen_length/2., 0., twopi, nullptr, + G4ThreeVector(0., 0., GetELzCoord() + stave_gen_length/2.)); - /// Visibilities + /// Visibilities if (visibility_) { G4VisAttributes ring_col = nexus::CopperBrown(); ring_col.SetForceSolid(true); @@ -943,19 +818,13 @@ void Next100FieldCage::BuildFieldCage() G4VisAttributes hdpe_col =nexus::WhiteAlpha(); hdpe_col.SetForceSolid(true); hdpe_tube_logic->SetVisAttributes(hdpe_col); - G4VisAttributes hold_col = nexus::LightGrey(); - hold_col.SetForceSolid(true); - G4VisAttributes hold_col_cath = nexus::Lilla(); - hold_col_cath.SetForceSolid(true); - act_holder_logic->SetVisAttributes(hold_col); - buff_holder_logic->SetVisAttributes(hold_col); - cathode_holder_logic->SetVisAttributes(hold_col_cath); + G4VisAttributes stave_col = nexus::LightGrey(); + stave_col.SetForceSolid(true); + stave_logic->SetVisAttributes(stave_col); } else { ring_logic->SetVisAttributes(G4VisAttributes::GetInvisible()); hdpe_tube_logic->SetVisAttributes(G4VisAttributes::GetInvisible()); - act_holder_logic->SetVisAttributes(G4VisAttributes::GetInvisible()); - buff_holder_logic->SetVisAttributes(G4VisAttributes::GetInvisible()); - cathode_holder_logic->SetVisAttributes(G4VisAttributes::GetInvisible()); + stave_logic->SetVisAttributes(G4VisAttributes::GetInvisible()); } } @@ -1079,9 +948,7 @@ G4ThreeVector Next100FieldCage::GenerateVertex(const G4String& region) const glob_vtx = glob_vtx + G4ThreeVector(0, 0, -GetELzCoord()); VertexVolume = geom_navigator_->LocateGlobalPointAndSetup(glob_vtx, 0, false); - } while ((VertexVolume->GetName() != "ACT_HOLDER") && - (VertexVolume->GetName() != "BUFF_HOLDER") && - (VertexVolume->GetName() != "CATHODE_HOLDER")); + } while (VertexVolume->GetName() != "STAVE"); } else { diff --git a/source/geometries/Next100FieldCage.h b/source/geometries/Next100FieldCage.h index a65e43ec1..6b5982842 100644 --- a/source/geometries/Next100FieldCage.h +++ b/source/geometries/Next100FieldCage.h @@ -56,8 +56,10 @@ namespace nexus { const G4double gate_ext_diam_, gate_int_diam_, gate_ring_thickn_; const G4double gate_teflon_dist_, gate_cathode_dist_; //cathode_sapphire_wdw_dist_; const G4double hdpe_tube_int_diam_, hdpe_tube_ext_diam_, hdpe_length_; - const G4double ring_ext_diam_, ring_int_diam_, ring_thickn_, drift_ring_dist_, buffer_ring_dist_; - const G4double holder_x_, holder_long_y_, holder_short_y_; + const G4double ring_ext_diam_, ring_int_diam_, ring_thickn_; + const G4double drift_ring_dist_, buffer_ring_dist_; + const G4double buffer_first_ring_dist_, ring_drift_buffer_dist_; + const G4int num_drift_rings_, num_buffer_rings_; const G4double tpb_thickn_; const G4double overlap_; @@ -81,7 +83,6 @@ namespace nexus { G4double active_length_, buffer_length_; G4double teflon_drift_length_, teflon_drift_zpos_,teflon_buffer_zpos_; - G4double holder_r_; G4double active_zpos_, cathode_zpos_, gate_zpos_, el_gap_zpos_, anode_zpos_; G4double gate_grid_zpos_, anode_grid_zpos_; @@ -116,7 +117,6 @@ namespace nexus { // Pointers to materials definition G4Material* hdpe_; - G4Material* pe500_; G4Material* tpb_; G4Material* teflon_; G4Material* copper_;