Skip to content

Commit

Permalink
Initial commit on material (#754)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?


### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [x ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ x] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No
### Does this PR change default behavior?
No

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Kalinkin <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2024
1 parent 7e32143 commit 6fbf993
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 34 deletions.
2 changes: 2 additions & 0 deletions compact/display.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
</comment>
<vis name="TOF_envelope" ref="AnlBlue" drawingStyle="wireframe" showDaughters="true" visible="true" />

<vis name="PFRICH_vessel_vis" ref="AnlTeal" showDaughters="false" visible="true" alpha="0.5" />

<vis name="DRICH_vessel_vis" ref="AnlGray" showDaughters="true" visible="true" />
<vis name="DRICH_gas_vis" ref="AnlGreen" showDaughters="true" visible="true" alpha="0.5" />
<vis name="DRICH_aerogel_vis" ref="AnlTeal" showDaughters="true" visible="true" />
Expand Down
8 changes: 4 additions & 4 deletions compact/pid/pfrich.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
name="RICHEndcapN"
type="epic_PFRICH"
readout="RICHEndcapNHits"
gas="C4F10_PFRICH"
material="Aluminum"
vis_vessel="DRICH_vessel_vis"
gas="N2cherenkov"
material="CarbonFiber"
vis_vessel="PFRICH_vessel_vis"
vis_gas="DRICH_gas_vis"
>

Expand Down Expand Up @@ -235,7 +235,7 @@
</radiator>

<mirror
material="Acrylic_DRICH"
material="CarbonFiber"
surface="MirrorSurface_DRICH"
vis="DRICH_mirror_vis"
backplane="DRICH_window_thickness + 1.0*cm"
Expand Down
71 changes: 41 additions & 30 deletions src/PFRICH_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
xml_dim_t x_pos(x_det.child(_U(position), false));
xml_dim_t x_rot(x_det.child(_U(rotation), false));

auto vesselMat = description.material("VacuumOptical");

Tube pfRICH_air_volume(0.0, 65.0, 25.0); // dimension of the pfRICH world in cm

Rotation3D rot(RotationZYX(0, M_PI, 0));
Expand All @@ -91,9 +89,9 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se

int imod = 0; // module number

auto gasvolMat = description.material("C4F10_PFRICH");
auto gasvolMat = description.material(detElem.attr<std::string>(_Unicode(gas)));
auto gasvolVis = description.visAttributes("DRICH_gas_vis");
auto vesselVis = description.visAttributes("DRICH_gas_vis");
auto vesselVis = description.visAttributes(detElem.attr<std::string>(_Unicode(vis_vessel)));

double windowThickness = dims.attr<double>(_Unicode(window_thickness));
double wallThickness = dims.attr<double>(_Unicode(wall_thickness));
Expand All @@ -113,11 +111,13 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
double radiatorRmin = radiatorElem.attr<double>(_Unicode(rmin));
double radiatorRmax = radiatorElem.attr<double>(_Unicode(rmax));

auto filterElem = radiatorElem.child(_Unicode(filter));

double airgapThickness = 0.1;
double filterThickness = 1;

auto aerogelMat = description.material("C4F10_PFRICH");
auto filterMat = description.material("C4F10_PFRICH");
auto aerogelMat = description.material(aerogelElem.attr<std::string>(_Unicode(material)));
auto filterMat = description.material(filterElem.attr<std::string>(_Unicode(material)));

double vesselLength = dims.attr<double>(_Unicode(length));
auto originFront = Position(0., 0., vesselLength / 2.0);
Expand Down Expand Up @@ -152,6 +152,11 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
Cone mirror_cone(vesselLength / 2.0, vesselRmax1 - 7, vesselRmax1 - 7 + 0.3, vesselRmax1 - 13,
vesselRmax1 - 13 + 0.3);

/*--------------------------------------------------*/
// Vessel
auto vesselMat = description.material(detElem.attr<std::string>(_Unicode(material)));
auto vesselGas = description.material(detElem.attr<std::string>(_Unicode(gas)));

/*--------------------------------------------------*/
// Flange
float _FLANGE_EPIPE_DIAMETER_ = description.constant<double>("FLANGE_EPIPE_DIAMETER");
Expand Down Expand Up @@ -213,9 +218,6 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
_FIDUCIAL_VOLUME_LENGTH_ - _VESSEL_FRONT_SIDE_THICKNESS_ - _SENSOR_AREA_LENGTH_;
double m_gas_volume_radius = _VESSEL_OUTER_RADIUS_ - _VESSEL_OUTER_WALL_THICKNESS_;

//cout << "FLANGE_EPIPE_DIAMETER : " << _FLANGE_EPIPE_DIAMETER_ << endl;
//cout << "CONICAL_MIRROR_INNER_RADIUS : " << _CONICAL_MIRROR_INNER_RADIUS_ << endl;

/// Inner mirror cone
// A wedge bridging two cylinders;

Expand Down Expand Up @@ -247,7 +249,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
SubtractionSolid pfRICH_volume_shape(pfRICH_air_volume, flange_final_shape);

Volume pfRICH_volume(detName + "_Vol", pfRICH_volume_shape,
vesselMat); // dimension of the pfRICH world in cm
vesselGas); // dimension of the pfRICH world in cm

pv = mother.placeVolume(pfRICH_volume, transform);

Expand All @@ -264,6 +266,9 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
vesselRmax1 - wallThickness, vesselRmin0 + wallThickness,
vesselRmax0 - wallThickness);

Cone vesselWall(vesselLength / 2.0, vesselRmax1 - 0.1, vesselRmax1, vesselRmax0 - 0.1,
vesselRmax0);

Box gasvolBox(1000, 1000, 1000);

Solid gasvolSolid;
Expand All @@ -275,18 +280,15 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
Solid mirrorSolid;
mirrorSolid = mirror_cone;

Volume vesselVol(detName, vesselSolid, vesselMat);
Volume gasvolVol(detName + "_gas", gasvolSolid, gasvolMat);
vesselVol.setVisAttributes(vesselVis);
gasvolVol.setVisAttributes(gasvolVis);
Solid wallSolid;
wallSolid = vesselWall;

Volume mirrorVol(detName, mirrorSolid, mirrorMat);
mirrorVol.setVisAttributes(mirrorVis);
Volume vesselVol(detName + "_vesel_vol", wallSolid, vesselMat);
vesselVol.setVisAttributes(vesselVis);

// place gas volume
PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0));
DetElement gasvolDE(sdet, "gasvol_de", 0);
gasvolDE.setPlacement(gasvolPV);
PlacedVolume vesselPV = pfRICH_volume.placeVolume(vesselVol, Position(0, 0, 0));
DetElement vesselDE(sdet, "vessel_de", 0);
vesselDE.setPlacement(vesselPV);

// BUILD RADIATOR //////////////////////////////////////

Expand Down Expand Up @@ -319,18 +321,27 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
// Some "standard" value applied to all mirrors;
// At the downstream (sensor plane) location; upstream radii are calculated automatically;

Volume mirrorVol(detName, mirrorSolid, mirrorMat);
mirrorVol.setVisAttributes(mirrorVis);

double xysize = _HRPPD_TILE_SIZE_, wndthick = _HRPPD_WINDOW_THICKNESS_;

// HRPPD assembly container volume;
double hrppd_container_volume_thickness = _HRPPD_CONTAINER_VOLUME_HEIGHT_;

double _ACRYLIC_THICKNESS_ = 0.3;

// HRPPD
/*--------------------------------------------------*/
// HRPPD material definition:

auto HRPPD_WindowMat = description.material("Quartz");
auto HRPPD_PCBMat = description.material("G10");
auto HRPPD_MPDMat = description.material("SiliconDioxide");
auto HRPPD_ASICMat = description.material("SiliconCarbide");

Box hrppd_Solid(xysize / 2, xysize / 2, hrppd_container_volume_thickness / 2);

Volume hrppdVol_air(detName + "_air_hrppd", hrppd_Solid, air);
Volume hrppdVol(detName + "_hrppd", hrppd_Solid, sensorMat);

hrppdVol_air.setSensitiveDetector(sens);
hrppdVol_air.setVisAttributes(gasvolVis);
Expand All @@ -339,7 +350,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
// Quartz Window
Box wnd_Solid(xysize / 2, xysize / 2, wndthick / 2);

Volume wndVol(detName + "_wnd", wnd_Solid, gasvolMat);
Volume wndVol(detName + "_wnd", wnd_Solid, HRPPD_WindowMat);
wndVol.setVisAttributes(gasvolVis);

double accu = -hrppd_container_volume_thickness / 2;
Expand All @@ -362,7 +373,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se

SubtractionSolid ceramic(cerbox, cut_box, Position(0, 0, -_HRPPD_BASEPLATE_THICKNESS_));

Volume ceramicVol(detName + "_ceramic", ceramic, air);
Volume ceramicVol(detName + "_ceramic", ceramic, HRPPD_MPDMat);
ceramicVol.setVisAttributes(gasvolVis);

PlacedVolume ceramicPV =
Expand All @@ -373,7 +384,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
// Plating body

Box plating_solid(xyopen / 2, xyopen / 2, _HRPPD_PLATING_LAYER_THICKNESS_ / 2);
Volume platingVol(detName + "_plating", plating_solid, air);
Volume platingVol(detName + "_plating", plating_solid, HRPPD_MPDMat);

platingVol.setVisAttributes(gasvolVis);
PlacedVolume platingPV =
Expand All @@ -384,7 +395,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
// MCP body

Box mcp_solid(xyopen / 2, xyopen / 2, _EFFECTIVE_MCP_THICKNESS_ / 2);
Volume mcpVol(detName + "_mcp", mcp_solid, air);
Volume mcpVol(detName + "_mcp", mcp_solid, HRPPD_MPDMat);

mcpVol.setVisAttributes(gasvolVis);
PlacedVolume mcpPV = hrppdVol_air.placeVolume(
Expand All @@ -397,7 +408,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
double pdthick = 0.001;

Box pdbox_solid(xyactive / 2, xyactive / 2, pdthick / 2);
Volume pdboxVol(detName + "_pd", pdbox_solid, air);
Volume pdboxVol(detName + "_pd", pdbox_solid, HRPPD_MPDMat);

pdboxVol.setVisAttributes(gasvolVis);
PlacedVolume pdboxPV =
Expand All @@ -407,7 +418,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
pdboxDE.setPlacement(pdboxPV);

Box qdbox_solid(xyactive / 2, xyactive / 2, pdthick / 2);
Volume qdboxVol(detName + "_qd", qdbox_solid, air);
Volume qdboxVol(detName + "_qd", qdbox_solid, HRPPD_MPDMat);

qdboxVol.setVisAttributes(gasvolVis);
PlacedVolume qdboxPV = hrppdVol_air.placeVolume(qdboxVol, Position(0.0, 0.0, accu + pdthick / 2));
Expand All @@ -420,7 +431,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
/// PCB Board

Box pcb_solid(_READOUT_PCB_SIZE_ / 2, _READOUT_PCB_SIZE_ / 2, _READOUT_PCB_THICKNESS_ / 2);
Volume pcbVol(detName + "_pcb", pcb_solid, air);
Volume pcbVol(detName + "_pcb", pcb_solid, HRPPD_PCBMat);

pcbVol.setVisAttributes(gasvolVis);
PlacedVolume pcbPV =
Expand All @@ -434,7 +445,7 @@ static Ref_t createDetector(Detector& description, xml_h e, SensitiveDetector se
// ASIC Board

Box asic_solid(_ASIC_SIZE_XY_ / 2, _ASIC_SIZE_XY_ / 2, _ASIC_THICKNESS_ / 2);
Volume asicVol(detName + "_asic", asic_solid, mirrorMat);
Volume asicVol(detName + "_asic", asic_solid, HRPPD_ASICMat);
asicVol.setVisAttributes(mirrorVis);

double asic_pitch = _READOUT_PCB_SIZE_ / 2;
Expand Down

0 comments on commit 6fbf993

Please sign in to comment.