Skip to content

Commit

Permalink
_USE_PYRAMIDS_ bug fix; changes to SimpleRICH codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Kiselev committed Dec 27, 2024
1 parent cb740cf commit 82fe4a4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 21 deletions.
9 changes: 6 additions & 3 deletions epic/source/EpicDetectorConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ G4VPhysicalVolume *EpicDetectorConstruction::Construct( void )
alu_shape = new G4SubtractionSolid("AluFrame", alu_shape, alu_cut, 0, G4ThreeVector( 0.0, 0.0, 0.0));
alu_shape = new G4SubtractionSolid("AluFrame", alu_shape, alu_cut, 0, G4ThreeVector(-_HRPPD_CENTRAL_ROW_OFFSET_, 0.0, 0.0));

#ifndef _USE_PYRAMIDS_
//#ifndef _USE_PYRAMIDS_
#if (_USE_PYRAMIDS_ == false)
G4Box *grid_box = new G4Box("Dummy", dbox->m_PyramidMirrorWidth/2, dbox->m_PyramidMirrorWidth/2, _HRPPD_SUPPORT_GRID_BAR_HEIGHT_/2);
double value = dbox->m_PyramidMirrorWidth - _HRPPD_SUPPORT_GRID_BAR_WIDTH_;
G4Box *grid_cut = new G4Box("Dummy", value/2, value/2, _HRPPD_SUPPORT_GRID_BAR_HEIGHT_/2 + 0.01*mm);
Expand All @@ -248,14 +249,16 @@ G4VPhysicalVolume *EpicDetectorConstruction::Construct( void )

// Cuts in the aluminum plate;
{
#ifndef _USE_PYRAMIDS_
//#ifndef _USE_PYRAMIDS_
#if (_USE_PYRAMIDS_ == false)
unsigned counter = 0;
#endif

for(auto xyptr: xycoord) {
alu_shape = new G4SubtractionSolid("AluFrame", alu_shape, alu_cut, 0, G4ThreeVector(xyptr.m_X, xyptr.m_Y, 0.0));

#ifndef _USE_PYRAMIDS_
//#ifndef _USE_PYRAMIDS_
#if (_USE_PYRAMIDS_ == false)
// Yes, they are part of the gas volume;
new G4PVPlacement(0, G4ThreeVector(xyptr.m_X, xyptr.m_Y, dbox->m_gas_volume_length/2 - _HRPPD_SUPPORT_GRID_BAR_HEIGHT_/2),
grid_log, "SupportGridBar", gas_volume_log, false, counter++);
Expand Down
5 changes: 4 additions & 1 deletion epic/source/Mirrors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ void EpicDetectorConstruction::DefineMirrors(CherenkovDetector *cdet, DarkBox *d
double mlen = dbox->m_gas_volume_length/2 - m_gzOffset - _BUILDING_BLOCK_CLEARANCE_;
//printf("%f\n", mlen - _BUILDING_BLOCK_CLEARANCE_ - _HRPPD_SUPPORT_GRID_BAR_HEIGHT_); exit(0);
double r1[2] = {_CONICAL_MIRROR_DS_INNER_RADIUS_, _CONICAL_MIRROR_DS_OUTER_RADIUS_};
#ifdef _USE_PYRAMIDS_
//#ifdef _USE_PYRAMIDS_
#if (_USE_PYRAMIDS_ == true)
// Adjust the mirror slope in this case;
double dLength = _BUILDING_BLOCK_CLEARANCE_ + _PYRAMID_MIRROR_HEIGHT_;
double a[2] = {
Expand Down Expand Up @@ -58,6 +59,8 @@ void EpicDetectorConstruction::DefineMirrors(CherenkovDetector *cdet, DarkBox *d
auto mshape = im ? new G4Cons(names[im], r0[im], r0[im] + thickness, r1[im], r1[im] + thickness,
mlen/2, 0*degree, 360*degree) :
new G4Cons(names[im], r0[im] - thickness, r0[im], r1[im] - thickness, r1[im], mlen/2, 0*degree, 360*degree);
printf("@M@ %d -> %7.2f %7.2f %7.3f -> slope %7.4f degrees\n", im, r0[im], r1[im], mlen,
atan((r1[im] - r0[im])/mlen)*180/M_PI);

// There should be a cutaway on the inner mirror because of the beam pipe flange;
G4LogicalVolume *solid_log = 0;
Expand Down
5 changes: 2 additions & 3 deletions scripts/reco-simple.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ void reco_simple(const char *dfname, const char *cfname = 0)
reco->SetSensorActiveAreaPixellation(400);

// [rad] (should match SPE sigma) & [ns];
//auto *a1 = reco->UseRadiator("Aerogel225", 0.0040);

auto *a1 = reco->UseRadiator("BelleIIAerogel3");
auto *a1 = reco->UseRadiator("Aerogel225");//, 0.0040);
//auto *a1 = reco->UseRadiator("BelleIIAerogel3");

//reco->SetSinglePhotonTimingResolution(0.030);
//reco->SetQuietMode();
Expand Down
26 changes: 16 additions & 10 deletions simple/include/simple.default.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// A simple pfRICH configuration;
//

#ifdef _STANDALONE_GEANT_CODE_
#include "G4SystemOfUnits.hh"
#endif

#ifndef _PFRICH_SIMPLE_
#define _PFRICH_SIMPLE_
Expand All @@ -12,43 +14,47 @@

// -- Primary particle(s) ---------------------------------------------------------------------
//
#define _PRIMARY_PARTICLE_TYPE_ ("pi+")
#define _PRIMARY_PARTICLE_TYPE_ ("pi+")
// Will toggle between the two types if defined;
//#define _ALTERNATIVE_PARTICLE_TYPE_ ("kaon+")

#define _PRIMARY_PARTICLE_ETA_ (2.40)
#define _PRIMARY_PARTICLE_ETA_ (2.40)
// If commented out: uniform phi;
//#define _PRIMARY_PARTICLE_PHI_ (90*degree)

#define _PRIMARY_PARTICLE_MOMENTUM_ (7.0*GeV)
#define _PRIMARY_PARTICLE_MOMENTUM_ (7.0*GeV)
// --------------------------------------------------------------------------------------------

// -- Vessel geometry -------------------------------------------------------------------------
//
#define _FIDUCIAL_VOLUME_LENGTH_SIMPLE_ (500.0*mm)
#define _FIDUCIAL_VOLUME_OFFSET_SIMPLE_ (1236.0*mm + _FIDUCIAL_VOLUME_LENGTH_SIMPLE_/2)
// Mimic ePIC pfRICH vessel length;
#define _FIDUCIAL_VOLUME_LENGTH_SIMPLE_ (500.0*mm)
// Choose ePIC dRICH location;
#define _FIDUCIAL_VOLUME_OFFSET_SIMPLE_ (1550.0*mm)
// This one does not really matter;
#define _FIDUCIAL_VOLUME_WIDTH_SIMPLE_ (2000.0*mm)

// FIXME: this is getting to be really obsolete; just want to be in sync with epic.default.h;
#define _VESSEL_FRONT_SIDE_THICKNESS_ (5.0*mm)
#define _VESSEL_FRONT_SIDE_THICKNESS_ (5.0*mm)

// Some moderately optimistic number for aerogel-to-aerogel, aerogel-to-acrylic,
// acrylic-to-mirror and such spacing;
#define _BUILDING_BLOCK_CLEARANCE_ (1.0*mm)
#define _BUILDING_BLOCK_CLEARANCE_ (1.0*mm)

// Can also use m_C2F6;
#define _GAS_RADIATOR_ m_Nitrogen
// --------------------------------------------------------------------------------------------

// -- Aerogel ---------------------------------------------------------------------------------
//
#define _AEROGEL_ _AEROGEL_BELLE_II_REFRACTIVE_INDEX_1_04_
#define _AEROGEL_THICKNESS_ (2.5*cm)
#define _AEROGEL_ _AEROGEL_CLAS12_DENSITY_225_MG_CM3_//_AEROGEL_BELLE_II_REFRACTIVE_INDEX_1_04_
#define _AEROGEL_THICKNESS_ (2.5*cm)
// --------------------------------------------------------------------------------------------

// -- Acrylic filter --------------------------------------------------------------------------
//
// If _ACRYLIC_THICKNESS_ is defined, a single layer right after the aerogel is installed;
#define _ACRYLIC_THICKNESS_ (3.0*mm)
#define _ACRYLIC_THICKNESS_ (3.0*mm)
// --------------------------------------------------------------------------------------------

#endif
10 changes: 6 additions & 4 deletions simple/source/SimpleDetectorConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define _GEANT_SOURCE_CODE_
#include <G4Object.h>

#define _STANDALONE_GEANT_CODE_
#include <simple.h>

#include "SimpleDetectorConstruction.h"
Expand Down Expand Up @@ -188,12 +189,13 @@ G4VPhysicalVolume *SimpleDetectorConstruction::Construct( void )

double fvOffset = _FIDUCIAL_VOLUME_OFFSET_SIMPLE_;
double fvLength = _FIDUCIAL_VOLUME_LENGTH_SIMPLE_;
double fvWidth = _FIDUCIAL_VOLUME_WIDTH_SIMPLE_, gvWidth = fvWidth - 1*mm, agWidth = gvWidth - 1*mm;

// No conical mirrors and no pyramids;
auto dbox = new DarkBox(false, false, false);

// Fiducial volume (air); has to be called "PFRICH";
auto *fiducial_volume_box = new G4Box("PFRICH", 1300.0*mm/2, 1300.0*mm/2, fvLength/2);
auto *fiducial_volume_box = new G4Box("PFRICH", fvWidth/2, fvWidth/2, fvLength/2);
auto fiducial_volume_log = new G4LogicalVolume(fiducial_volume_box, m_Air, "PFRICH", 0, 0, 0);
// All volumes are defined assuming EIC h-going endcap orientation;
dbox->m_fiducial_volume_phys =
Expand All @@ -204,7 +206,7 @@ G4VPhysicalVolume *SimpleDetectorConstruction::Construct( void )
// Gas container volume;
dbox->m_gas_volume_length = fvLength - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_;
double gas_volume_offset = -(_SENSOR_AREA_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_)/2;
auto gas_box = new G4Box("GasVolume", 1299.0*mm/2, 1299.0*mm/2, dbox->m_gas_volume_length/2);
auto gas_box = new G4Box("GasVolume", gvWidth/2, gvWidth/2, dbox->m_gas_volume_length/2);
auto gas_volume_log = new G4LogicalVolume(gas_box, _GAS_RADIATOR_, "GasVolume", 0, 0, 0);
dbox->m_gas_volume_phys = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, gas_volume_offset),
gas_volume_log, "GasVolume", fiducial_volume_log, false, 0);
Expand All @@ -231,7 +233,7 @@ G4VPhysicalVolume *SimpleDetectorConstruction::Construct( void )
{
gzOffset += agthick/2;

auto ag_tube = new G4Box(aerogel->GetName(), 1298.0*mm/2, 1298.0*mm/2, agthick/2);
auto ag_tube = new G4Box(aerogel->GetName(), agWidth/2, agWidth/2, agthick/2);
auto ag_log = new G4LogicalVolume(ag_tube, aerogel, aerogel->GetName(), 0, 0, 0);
{
TVector3 nx(1/**sign*/,0,0), ny(0,-1,0);
Expand Down Expand Up @@ -260,7 +262,7 @@ G4VPhysicalVolume *SimpleDetectorConstruction::Construct( void )
double acthick = _ACRYLIC_THICKNESS_;
gzOffset += acthick/2;

auto ac_box = new G4Box("Acrylic", 1298.0/2, 1298.0*mm/2, acthick/2);
auto ac_box = new G4Box("Acrylic", agWidth/2, agWidth/2, acthick/2);
auto ac_log = new G4LogicalVolume(ac_box, m_Acrylic, "Acrylic", 0, 0, 0);
{
TVector3 nx(1/**sign*/,0,0), ny(0,-1,0);
Expand Down

0 comments on commit 82fe4a4

Please sign in to comment.