Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honeycomb #212

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions source/geometries/Honeycomb.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
// ----------------------------------------------------------------------------
// nexus | Honeycomb.cc
//
// Support structure to the EP copper plate.
//
// The NEXT Collaboration
// ----------------------------------------------------------------------------

#include "Honeycomb.h"
#include "HoneycombBeam.h"
#include "MaterialsList.h"
#include "Visibilities.h"
#include "CylinderPointSampler.h"

#include <G4LogicalVolume.hh>
#include <G4RotationMatrix.hh>
#include <G4MultiUnion.hh>
#include <G4PVPlacement.hh>
#include <G4VisAttributes.hh>
#include <G4Trd.hh>
#include <G4TransportationManager.hh>

namespace nexus {

using namespace CLHEP;

Honeycomb::Honeycomb(): GeometryBase(),
angle_(pi / 6.),
beam_dist_(102.25 * mm),
beam_thickn_(6 * mm)
{
compl_angle_ = pi/2. - angle_;

/// Initializing the geometry navigator (used in vertex generation)
geom_navigator_ =
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
}

Honeycomb::~Honeycomb()
{
}

void Honeycomb::Construct()
{
G4double shorter_height = 117 * mm;
G4double longer_height = 130 * mm;
G4double longer_length = 1210.6*mm;

HoneycombBeam* short_beam =
new HoneycombBeam(beam_thickn_, 1085.9*mm, 184*mm, shorter_height);
HoneycombBeam* medium_beam =
new HoneycombBeam(beam_thickn_, 1170.2*mm, 273.5*mm, longer_height);
HoneycombBeam* long_beam =
new HoneycombBeam(beam_thickn_, longer_length, 407.4*mm, longer_height);

G4double short_displ = (longer_height-shorter_height)/2.;

short_beam->Construct();
medium_beam->Construct();
long_beam->Construct();


G4MultiUnion* struct_solid = new G4MultiUnion("HONEYCOMB");

G4RotationMatrix rot;
rot.rotateX(3*pi/2.);

G4ThreeVector ini_pos =
G4ThreeVector(-(beam_dist_+beam_thickn_)/2., 0., 0.);
struct_solid->AddNode(long_beam->GetSolidVol(),
G4Transform3D(rot, ini_pos));

G4RotationMatrix rot_left;
rot_left.rotateX(3*pi/2.);
rot_left.rotateY(-compl_angle_);
G4RotationMatrix rot_right;
rot_right.rotateX(3*pi/2.);
rot_right.rotateY(-(pi/2.+angle_));

G4double r_pos =
1/2*beam_dist_+ 2*(beam_dist_+beam_thickn_) + 1/2*beam_thickn_;
r_pos = r_pos + (beam_dist_ + beam_thickn_)/2.*cos(compl_angle_) + 2.75*cm;
G4double x = r_pos * sin(angle_);
G4double z = r_pos * cos(angle_);

struct_solid->AddNode(short_beam->GetSolidVol(),
G4Transform3D(rot_left,
G4ThreeVector(x, short_displ, z)));
struct_solid->AddNode(short_beam->GetSolidVol(),
G4Transform3D(rot_right,
G4ThreeVector(-x, short_displ, z)));
struct_solid->AddNode(short_beam->GetSolidVol(),
G4Transform3D(rot_left,
G4ThreeVector(-x, short_displ, -z)));
struct_solid->AddNode(short_beam->GetSolidVol(),
G4Transform3D(rot_right,
G4ThreeVector(x, short_displ, -z)));


x = (r_pos-(beam_dist_+beam_thickn_)) * sin(angle_);
z = (r_pos-(beam_dist_+beam_thickn_)) * cos(angle_);
struct_solid->AddNode(medium_beam->GetSolidVol(),
G4Transform3D(rot_left, G4ThreeVector(x, 0., z)));
struct_solid->AddNode(medium_beam->GetSolidVol(),
G4Transform3D(rot_left, G4ThreeVector(-x, 0., -z)));
struct_solid->AddNode(medium_beam->GetSolidVol(),
G4Transform3D(rot_right, G4ThreeVector(x, 0., -z)));

struct_solid->AddNode(medium_beam->GetSolidVol(),
G4Transform3D(rot_right, G4ThreeVector(-x, 0., z)));


x = (r_pos-2*(beam_dist_+beam_thickn_)) * sin(angle_);
z = (r_pos-2*(beam_dist_+beam_thickn_)) * cos(angle_);
struct_solid->AddNode(long_beam->GetSolidVol(),
G4Transform3D(rot_left, G4ThreeVector(x, 0., z)));


struct_solid->AddNode(long_beam->GetSolidVol(),
G4Transform3D(rot_left, G4ThreeVector(-x, 0., -z)));

struct_solid->AddNode(long_beam->GetSolidVol(),
G4Transform3D(rot_right, G4ThreeVector(x, 0., -z)));
struct_solid->AddNode(long_beam->GetSolidVol(),
G4Transform3D(rot_right, G4ThreeVector(-x, 0., z)));


x = ini_pos.x() - (beam_dist_+beam_thickn_);
struct_solid->AddNode(medium_beam->GetSolidVol(),
G4Transform3D(rot, G4ThreeVector(x, 0., 0.)));
x = ini_pos.x() - 2*(beam_dist_+beam_thickn_);
struct_solid->AddNode(short_beam->GetSolidVol(),
G4Transform3D(rot,
G4ThreeVector(x, short_displ, 0.)));
x = ini_pos.x() + (beam_dist_+beam_thickn_);
struct_solid->AddNode(long_beam->GetSolidVol(),
G4Transform3D(rot, G4ThreeVector(x, 0., 0.)));
x = ini_pos.x() + 2*(beam_dist_+beam_thickn_);
struct_solid->AddNode(medium_beam->GetSolidVol(),
G4Transform3D(rot, G4ThreeVector(x, 0., 0.)));
x = ini_pos.x() + 3*(beam_dist_+beam_thickn_);
struct_solid->AddNode(short_beam->GetSolidVol(),
G4Transform3D(rot,
G4ThreeVector(x, short_displ, 0.)));

struct_solid->Voxelize();

G4LogicalVolume* struct_logic =
new G4LogicalVolume(struct_solid, materials::Steel(), "HONEYCOMB");

G4RotationMatrix rot_placement;
rot_placement.rotateZ(-pi/2);
rot_placement.rotateY(-pi/2);

G4double hc_posz = end_of_EP_copper_plate_z_ + longer_height/2.;
new G4PVPlacement(G4Transform3D(rot_placement,
G4ThreeVector(0., 0., hc_posz)),
struct_logic, "HONEYCOMB", mother_logic_,
false, 0, false);

G4VisAttributes red_col = nexus::Red();
red_col.SetForceSolid(true);
struct_logic->SetVisAttributes(red_col);

// Vertex generator
gen_ =
new CylinderPointSampler(0., longer_length/2., longer_height/2.,
0., 360.*deg, 0,
G4ThreeVector(0., 0., hc_posz));

}

G4ThreeVector Honeycomb::GenerateVertex(const G4String& region) const
{
G4ThreeVector vertex(0, 0, 0);

if (region == "HONEYCOMB") {
G4VPhysicalVolume* VertexVolume;
do {
vertex = gen_->GenerateVertex(VOLUME);
G4ThreeVector glob_vtx(vertex);
glob_vtx = glob_vtx - GetCoordOrigin();
VertexVolume = geom_navigator_->LocateGlobalPointAndSetup(glob_vtx, 0, false);
} while (VertexVolume->GetName() != region);
}
else {
G4Exception("[Honeycomb]", "GenerateVertex()", FatalException,
"Unknown vertex generation region!");
}

return vertex;
}
}
64 changes: 64 additions & 0 deletions source/geometries/Honeycomb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// ----------------------------------------------------------------------------
// nexus | Honeycomb.h
//
// Support structure to the EP copper plate.
//
// The NEXT Collaboration
// ----------------------------------------------------------------------------

#ifndef HONEYCOMB_H
#define HONEYCOMB_H

#include "GeometryBase.h"

#include <G4Navigator.hh>

namespace nexus {
class CylinderPointSampler;

class Honeycomb: public GeometryBase
{
public:
/// Constructor
Honeycomb();

/// Destructor
~Honeycomb();

void Construct();

/// Generate a vertex within a given region of the geometry
G4ThreeVector GenerateVertex(const G4String& region) const;

/// Sets the logical volume where all inner elements are placed
void SetMotherLogicalVolume(G4LogicalVolume* mother_logic);

/// Sets the z position of the outer surface of the copper plate
void SetEndOfCopperPlateZ(G4double z);



private:

G4LogicalVolume* mother_logic_;

G4double end_of_EP_copper_plate_z_;

// Relationships among beams
G4double angle_, beam_dist_, beam_thickn_;
G4double compl_angle_;

CylinderPointSampler* gen_;

G4Navigator* geom_navigator_;
};

inline void Honeycomb::SetMotherLogicalVolume(G4LogicalVolume* mother_logic) {
mother_logic_ = mother_logic;}

inline void Honeycomb::SetEndOfCopperPlateZ(G4double z) {
end_of_EP_copper_plate_z_ = z;}

} // end namespace nexus

#endif
47 changes: 47 additions & 0 deletions source/geometries/HoneycombBeam.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// ----------------------------------------------------------------------------
// nexus | HoneycombBeam.cc
//
// Beam of the support structure to the EP copper plate.
//
// The NEXT Collaboration
// ----------------------------------------------------------------------------

#include "HoneycombBeam.h"
#include "MaterialsList.h"

#include <G4Trd.hh>
#include <G4Material.hh>
#include <G4LogicalVolume.hh>


namespace nexus {

using namespace CLHEP;

HoneycombBeam::HoneycombBeam(G4double thickn, G4double length_b,
G4double length_t, G4double height):
GeometryBase(),
length_b_(length_b),
length_t_(length_t),
height_(height),
thickn_(thickn)
{
}

HoneycombBeam::~HoneycombBeam()
{
}

void HoneycombBeam::Construct()
{
beam_solid_ =
new G4Trd("HONEYCOMB_BEAM", thickn_/2., thickn_/2., length_b_/2.,
length_t_/2., height_/2.);
G4Material* steel = materials::Steel();
G4LogicalVolume* beam_logic =
new G4LogicalVolume(beam_solid_, steel, "HONEYCOMB_BEAM");

this->SetLogicalVolume(beam_logic);
}

}
42 changes: 42 additions & 0 deletions source/geometries/HoneycombBeam.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// ----------------------------------------------------------------------------
// nexus | HoneycombBeam.h
//
// Beam of the support structure to the EP copper plate.
//
// The NEXT Collaboration
// ----------------------------------------------------------------------------

#ifndef HONEYCOMB_BEAM_H
#define HONEYCOMB_BEAM_H

#include "GeometryBase.h"

class G4Trd;

namespace nexus {

class HoneycombBeam: public GeometryBase
{
public:
/// Constructor
HoneycombBeam(G4double thickn, G4double length_b,
G4double length_t, G4double height);

/// Destructor
~HoneycombBeam();

void Construct();

G4Trd* GetSolidVol() const;


private:

G4double length_b_, length_t_, height_, thickn_;
G4Trd* beam_solid_;
};

inline G4Trd* HoneycombBeam::GetSolidVol() const {return beam_solid_;}
} // end namespace nexus

#endif
3 changes: 2 additions & 1 deletion source/geometries/Next100.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ namespace nexus {
(region == "FIELD_RING") ||
(region == "GATE_RING") ||
(region == "ANODE_RING") ||
(region == "RING_HOLDER")) {
(region == "RING_HOLDER") ||
(region == "HONEYCOMB")) {
vertex = inner_elements_->GenerateVertex(region);
}

Expand Down
Loading
Loading