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

Initial commit on material #754

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
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
64 changes: 47 additions & 17 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,16 @@ 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)));

// auto aerogelMat = description.material("C4F10_PFRICH");
// auto filterMat = description.material("C4F10_PFRICH");
veprbl marked this conversation as resolved.
Show resolved Hide resolved

double vesselLength = dims.attr<double>(_Unicode(length));
auto originFront = Position(0., 0., vesselLength / 2.0);
Expand Down Expand Up @@ -152,6 +155,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 @@ -246,8 +254,8 @@ 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
Volume pfRICH_volume(detName + "_aaaaaaa__Vol", pfRICH_volume_shape,
vesselGas); // dimension of the pfRICH world in cm

pv = mother.placeVolume(pfRICH_volume, transform);

Expand All @@ -264,6 +272,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 +286,34 @@ 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);
Solid wallSolid;
wallSolid = vesselWall;

/*--------------------------------------------------*/
/// ag_name.Form("%s-%d-%02d", "aerogel", ir, ia);
///
/// Volume agtubeVol(ag_name.Data(), agtube, gasvolMat);
/// auto aerogelTilePlacement = Transform3D(r_aerogel_Z, Position(0.0, 0.0, -m_gzOffset));
/// auto aerogelTilePV = pfRICH_volume.placeVolume(agtubeVol, aerogelTilePlacement);
/// DetElement aerogelDE(sdet, "aerogel_de_" + std::to_string(kkcounter), 0);
/// aerogelDE.setPlacement(aerogelTilePV);

// Volume vesselVol(detName + "_bbbbbbbbbbbbbbbbbbbbbbbbbbb_vol", vesselSolid, vesselMat);
veprbl marked this conversation as resolved.
Show resolved Hide resolved
Volume vesselVol(detName + "_bbbbbbbbbbbbbbbbbbbbbbbbbbb_vol", wallSolid, vesselMat);
veprbl marked this conversation as resolved.
Show resolved Hide resolved
vesselVol.setVisAttributes(vesselVis);
gasvolVol.setVisAttributes(gasvolVis);

Volume mirrorVol(detName, mirrorSolid, mirrorMat);
mirrorVol.setVisAttributes(mirrorVis);
PlacedVolume vesselPV = pfRICH_volume.placeVolume(vesselVol, Position(0, 0, 0));
DetElement vesselDE(sdet, "vessel_de", 0);
vesselDE.setPlacement(vesselPV);

// place gas volume
PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0));
DetElement gasvolDE(sdet, "gasvol_de", 0);
gasvolDE.setPlacement(gasvolPV);
// Volume gasvolVol(detName + "_aaaaaaaaaaaaaaaaaaaaaaaaaaa_gas", gasvolSolid, gasvolMat);
// gasvolVol.setVisAttributes(gasvolVis);
//
// // place gas volume
// // PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0));
// PlacedVolume gasvolPV = pfRICH_volume.placeVolume(gasvolVol, Position(0, 0, 0));
// DetElement gasvolDE(sdet, "gasvol_de", 0);
// gasvolDE.setPlacement(gasvolPV);
veprbl marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down Expand Up @@ -319,6 +346,9 @@ 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;
Expand Down