Skip to content
Snippets Groups Projects
Commit 8ac6578c authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Attempt to fix default visibility

parent 9ed77bbb
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,8 @@ Overview ...@@ -4,8 +4,8 @@ Overview
The reference detector at IP6 for Electron-Ion Collider experiment. The reference detector at IP6 for Electron-Ion Collider experiment.
**Detector geometry viewer:** **Detector geometry viewer:**
- [Central detector geometry](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/geo/detector_geo.root?job=report&item=default;1&opt=clipxyz;transp30;zoom100;ROTY0;ROTZ0;trz100;trr0;ctrl&) - [Central detector geometry](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/geo/detector_geo.root?job=report&item=default;1&opt=clipxyz;transp30;zoom100;ROTY0;ROTZ0;trz100;trr0;ctrl;all&)
- [Full Detector geometry (including beamline)](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/geo/detector_geo_full.root?job=report&item=default;1&opt=clipxyz;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl&) - [Full Detector geometry (including beamline)](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/geo/detector_geo_full.root?job=report&item=default;1&opt=clipxyz;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all&)
<a href="https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/images/view01.pdf?job=report"> <a href="https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/images/view01.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/images/view01.png?job=report" width="400px" /> <img src="https://eicweb.phy.anl.gov/api/v4/projects/447/jobs/artifacts/master/raw/images/view01.png?job=report" width="400px" />
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<rphi_layout phi_tilt="0.0" nphi="1" phi0="0.0" rc="VtxRadius1" dr="0.0*mm" /> <rphi_layout phi_tilt="0.0" nphi="1" phi0="0.0" rc="VtxRadius1" dr="0.0*mm" />
<z_layout dr="0.0*mm" z0="0" nz="1" /> <z_layout dr="0.0*mm" z0="0" nz="1" />
</layer> </layer>
<layer module="Module2" id="AllSiliconVtx_ID" vis="AnlGreen"> <layer module="Module2" id="2" vis="AnlGreen">
<barrel_envelope inner_r="VtxRadius2" outer_r="VtxRadius2 + VtxThickness" z_length="VtxLength" /> <barrel_envelope inner_r="VtxRadius2" outer_r="VtxRadius2 + VtxThickness" z_length="VtxLength" />
<rphi_layout phi_tilt="0.0" nphi="1" phi0="0.0" rc="VtxRadius2" dr="0.0*mm" /> <rphi_layout phi_tilt="0.0" nphi="1" phi0="0.0" rc="VtxRadius2" dr="0.0*mm" />
<z_layout dr="0.0*mm" z0="0" nz="1" /> <z_layout dr="0.0*mm" z0="0" nz="1" />
......
...@@ -114,12 +114,15 @@ ...@@ -114,12 +114,15 @@
<include ref="eic/forward_ion_beamline.xml"/> <include ref="eic/forward_ion_beamline.xml"/>
<include ref="ip6/beampipe.xml"/> <include ref="ip6/beampipe.xml"/>
<include ref="compact/allsilicon_simplified.xml"/>
<include ref="compact/rwell_tracker_barrel.xml"/>
<include ref="compact/cb_DIRC.xml"/>
<include ref="compact/solenoid.xml"/> <include ref="compact/solenoid.xml"/>
<include ref="compact/ecal.xml"/> <include ref="compact/ecal.xml"/>
<include ref="compact/hcal.xml"/> <include ref="compact/hcal.xml"/>
<!--include ref="compact/ce_GEM.xml"/--> <!--include ref="compact/ce_GEM.xml"/-->
<!--include ref="compact/vertex_tracker.xml"/--> <!--include ref="compact/vertex_tracker.xml"/-->
<include ref="compact/allsilicon_simplified.xml"/>
<!--include ref="compact/gem_tracker_endcap.xml"/--> <!--include ref="compact/gem_tracker_endcap.xml"/-->
<include ref="compact/ce_mrich.xml"/> <include ref="compact/ce_mrich.xml"/>
<include ref="compact/tof_endcap.xml"/> <include ref="compact/tof_endcap.xml"/>
...@@ -136,8 +139,6 @@ ...@@ -136,8 +139,6 @@
<include ref="compact/cb_VTX_Barrel.xml"/> <include ref="compact/cb_VTX_Barrel.xml"/>
--> -->
<include ref="compact/rwell_tracker_barrel.xml"/>
<include ref="compact/cb_DIRC.xml"/>
<detectors> <detectors>
</detectors> </detectors>
......
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
#include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h" #include "DD4hep/Printout.h"
using namespace std; using namespace std;
using namespace dd4hep; using namespace dd4hep;
using namespace dd4hep::detail; using namespace dd4hep::detail;
static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)
{
typedef vector<PlacedVolume> Placements; typedef vector<PlacedVolume> Placements;
xml_det_t x_det = e; xml_det_t x_det = e;
Material air = description.air(); Material air = description.air();
int det_id = x_det.id(); int det_id = x_det.id();
string det_name = x_det.nameStr(); string det_name = x_det.nameStr();
DetElement sdet(det_name, det_id); DetElement sdet(det_name, det_id);
Acts::ActsExtension* barrelExtension = new Acts::ActsExtension(); Acts::ActsExtension* barrelExtension = new Acts::ActsExtension();
...@@ -38,15 +38,15 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -38,15 +38,15 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
xml_comp_t m_env = x_mod.child(_U(module_envelope)); xml_comp_t m_env = x_mod.child(_U(module_envelope));
string m_nam = x_mod.nameStr(); string m_nam = x_mod.nameStr();
Assembly module_assembly(_toString(n_modules, "mod_assembly_%d")); Assembly module_assembly(_toString(n_modules, "mod_assembly_%d"));
auto module_rmin = m_env.rmin(); auto module_rmin = m_env.rmin();
auto module_thickness = m_env.thickness(); auto module_thickness = m_env.thickness();
auto module_length = m_env.length(); auto module_length = m_env.length();
auto module_phi = getAttrOrDefault(m_env, _Unicode(phi), 90.0); auto module_phi = getAttrOrDefault(m_env, _Unicode(phi), 90.0);
Volume m_vol(m_nam, Tube(module_rmin , module_rmin + module_thickness, module_length/ 2 ), air); Volume m_vol(m_nam, Tube(module_rmin, module_rmin + module_thickness, module_length / 2), air);
int ncomponents = 0, sensor_number = 1; int ncomponents = 0, sensor_number = 1;
module_assembly.placeVolume(m_vol,Position(-module_rmin,0,0)); module_assembly.placeVolume(m_vol, Position(-module_rmin, 0, 0));
mod_volumes[m_nam] = module_assembly; mod_volumes[m_nam] = module_assembly;
m_vol.setVisAttributes(description.visAttributes(x_mod.visStr())); m_vol.setVisAttributes(description.visAttributes(x_mod.visStr()));
...@@ -63,8 +63,9 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -63,8 +63,9 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
auto comp_phi0 = getAttrOrDefault(x_comp, _Unicode(phi0), 0.0); auto comp_phi0 = getAttrOrDefault(x_comp, _Unicode(phi0), 0.0);
auto comp_length = getAttrOrDefault(x_comp, _Unicode(length), module_length); auto comp_length = getAttrOrDefault(x_comp, _Unicode(length), module_length);
Tube c_tube(comp_rmin, comp_rmin + comp_thickness, comp_length / 2 , -comp_phi/2.0+comp_phi0,comp_phi/2.0+comp_phi0); Tube c_tube(comp_rmin, comp_rmin + comp_thickness, comp_length / 2, -comp_phi / 2.0 + comp_phi0,
Volume c_vol(c_nam, c_tube, description.material(x_comp.materialStr())); comp_phi / 2.0 + comp_phi0);
Volume c_vol(c_nam, c_tube, description.material(x_comp.materialStr()));
PlacedVolume c_pv; PlacedVolume c_pv;
if (x_pos && x_rot) { if (x_pos && x_rot) {
...@@ -100,22 +101,22 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -100,22 +101,22 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2); Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2);
Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume. Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume.
lay_vol.setVisAttributes(description.visAttributes(x_layer.visStr())); lay_vol.setVisAttributes(description.visAttributes(x_layer.visStr()));
double phi0 = x_layout.phi0(); // Starting phi of first module. double phi0 = x_layout.phi0(); // Starting phi of first module.
double phi_tilt = x_layout.phi_tilt(); // Phi tilt of a module. double phi_tilt = x_layout.phi_tilt(); // Phi tilt of a module.
double rc = x_layout.rc(); // Radius of the module center. double rc = x_layout.rc(); // Radius of the module center.
int nphi = x_layout.nphi(); // Number of modules in phi. int nphi = x_layout.nphi(); // Number of modules in phi.
double rphi_dr = x_layout.dr(); // The delta radius of every other module. double rphi_dr = x_layout.dr(); // The delta radius of every other module.
double phi_incr = (M_PI * 2) / nphi; // Phi increment for one module. double phi_incr = (M_PI * 2) / nphi; // Phi increment for one module.
double phic = phi0; // Phi of the module center. double phic = phi0; // Phi of the module center.
double z0 = z_layout.z0(); // Z position of first module in phi. double z0 = z_layout.z0(); // Z position of first module in phi.
double nz = z_layout.nz(); // Number of modules to place in z. double nz = z_layout.nz(); // Number of modules to place in z.
double z_dr = z_layout.dr(); // Radial displacement parameter, of every other module. double z_dr = z_layout.dr(); // Radial displacement parameter, of every other module.
Volume m_env = mod_volumes[m_nam]; Volume m_env = mod_volumes[m_nam];
DetElement lay_elt(sdet, _toString(x_layer.id(), "layer%d"), lay_id); DetElement lay_elt(sdet, _toString(x_layer.id(), "layer%d"), lay_id);
Acts::ActsExtension* layerExtension = new Acts::ActsExtension(); Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
layerExtension->addType("sensitive cylinder", "layer"); layerExtension->addType("sensitive cylinder", "layer");
//layerExtension->addValue(10. * Acts::UnitConstants::mm, "r", "envelope"); // layerExtension->addValue(10. * Acts::UnitConstants::mm, "r", "envelope");
lay_elt.addExtension<Acts::ActsExtension>(layerExtension); lay_elt.addExtension<Acts::ActsExtension>(layerExtension);
Placements& sensVols = sensitives[m_nam]; Placements& sensVols = sensitives[m_nam];
...@@ -144,7 +145,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -144,7 +145,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
// tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z)); // tr(RotationZYX(0,-((M_PI/2)-phic-phi_tilt),M_PI/2),Position(x,y,module_z));
// NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the // NOTE (Nikiforos, 26/08 Rotations needed to be fixed so that component1 (silicon) is on the
// outside // outside
Transform3D tr(RotationZYX(phic - phi_tilt,0, 0), Position(x, y, module_z)); Transform3D tr(RotationZYX(phic - phi_tilt, 0, 0), Position(x, y, module_z));
pv = lay_vol.placeVolume(m_env, tr); pv = lay_vol.placeVolume(m_env, tr);
pv.addPhysVolID("module", module); pv.addPhysVolID("module", module);
...@@ -180,7 +181,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -180,7 +181,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
lay_elt.setPlacement(pv); lay_elt.setPlacement(pv);
} }
sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr()); sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr());
assembly.setVisAttributes(description.invisible()); // assembly.setVisAttributes(description.invisible());
pv = description.pickMotherVolume(sdet).placeVolume(assembly); pv = description.pickMotherVolume(sdet).placeVolume(assembly);
pv.addPhysVolID("system", det_id); // Set the subdetector system ID. pv.addPhysVolID("system", det_id); // Set the subdetector system ID.
pv.addPhysVolID("barrel", 1); // Flag this as a barrel subdetector. pv.addPhysVolID("barrel", 1); // Flag this as a barrel subdetector.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment