diff --git a/Detector/DetCRD/compact/CRD_common_v02/VXD_StaggeredLadder_v02_01.xml b/Detector/DetCRD/compact/CRD_common_v02/VXD_StaggeredLadder_v02_01.xml
index db98f5e03805ad71c147cec869b05c29f4d45419..7d1839f2ae327273550b2874924911e0b439dcdc 100644
--- a/Detector/DetCRD/compact/CRD_common_v02/VXD_StaggeredLadder_v02_01.xml
+++ b/Detector/DetCRD/compact/CRD_common_v02/VXD_StaggeredLadder_v02_01.xml
@@ -39,6 +39,8 @@
sensitive_mat="G4_Si" support_mat="G4_C" sensitive_threshold_KeV="64*keV" />
<display ladder="SeeThrough" support="VXDSupportVis" flex="VXDFlexVis" sens_env="SeeThrough" sens="GrayVis" deadsensor="GreenVis" deadwire="RedVis"/>
+ <shell rmin="70*mm" rmax="72.5*mm" zhalf="510*mm" material="CFRP_CMS" vis="LightGrayVis"/>
+
<layer layer_id="0" ladder_radius="12.459*mm" ladder_offset="(8.7+0.235607)*mm" n_ladders="8" n_sensors_per_side="0">
<ladder isDoubleSided="true">
<ladderSupport height="1.7*mm" length="VXDLayer1_length" thickness="334*um" width="17.4*mm" mat="CFRP_CMS"/>
@@ -125,7 +127,7 @@
</layer>
</detector>
- <detector name="VXDShell" type="DD4hep_Solenoid_o1_v01" id="DetID_NOTUSED" insideTrackingVolume="true">
+ <!--detector name="VXDShell" type="DD4hep_Solenoid_o1_v01" id="DetID_NOTUSED" insideTrackingVolume="true">
<envelope>
<shape type="Tube" rmin="70*mm" rmax="72.5*mm" dz="510*mm" material="Air"/>
<position x="0" y="0" z="0*mm"/>
@@ -136,7 +138,7 @@
<layer id="0" inner_r="70*mm" outer_z="510*mm" vis="SeeThrough">
<slice material="CFRP_CMS" thickness="2.5*mm" vis="ShellVis"/>
</layer>
- </detector>
+ </detector-->
</detectors>
<readouts>
diff --git a/Detector/DetCRD/src/Tracker/SiTrackerStaggeredLadder_v01_geo.cpp b/Detector/DetCRD/src/Tracker/SiTrackerStaggeredLadder_v01_geo.cpp
index 1496aff196289e0d5700f48255054a38bcc5f3f9..895ca4aabe67c839a07dc3b2a584791fa24057ef 100644
--- a/Detector/DetCRD/src/Tracker/SiTrackerStaggeredLadder_v01_geo.cpp
+++ b/Detector/DetCRD/src/Tracker/SiTrackerStaggeredLadder_v01_geo.cpp
@@ -16,6 +16,7 @@
using namespace std;
using dd4hep::Box;
+using dd4hep::Tube;
using dd4hep::DetElement;
using dd4hep::Material;
using dd4hep::Position;
@@ -76,26 +77,47 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
if(theDetector.buildType()==dd4hep::BUILD_ENVELOPE) return vxd;
envelope.setVisAttributes(theDetector.visAttributes("SeeThrough"));
- sens.setType("tracker");
+ if (x_det.hasAttr(_U(sensitive))) {
+ xml_dim_t sd_typ = x_det.child(_U(sensitive));
+ sens.setType(sd_typ.typeStr());
+ }
+ else {
+ sens.setType("tracker");
+ }
std::cout << " ** building SiTrackerSkewBarrel_v01 ..." << std::endl ;
dd4hep::rec::ZPlanarData* zPlanarData = new dd4hep::rec::ZPlanarData;
- // fetch the global parameters
-
- //fetch the display parameters
- xml_comp_t x_display(x_det.child(_Unicode(display)));
- std::string ladderVis = x_display.attr<string>(_Unicode(ladder));
- std::string supportVis = x_display.attr<string>(_Unicode(support));
- std::string flexVis = x_display.attr<string>(_Unicode(flex));
- std::string sensEnvVis = x_display.attr<string>(_Unicode(sens_env));
- std::string sensVis = x_display.attr<string>(_Unicode(sens));
- std::string deadsensVis = x_display.attr<string>(_Unicode(deadsensor));
- std::string deadwireVis = x_display.attr<string>(_Unicode(deadwire));
-
-
- for(xml_coll_t layer_i(x_det,_U(layer)); layer_i; ++layer_i){
- xml_comp_t x_layer(layer_i);
+ // fetch the global parameters
+
+ //fetch the display parameters
+ xml_comp_t x_display(x_det.child(_Unicode(display)));
+ std::string ladderVis = x_display.attr<string>(_Unicode(ladder));
+ std::string supportVis = x_display.attr<string>(_Unicode(support));
+ std::string flexVis = x_display.attr<string>(_Unicode(flex));
+ std::string sensEnvVis = x_display.attr<string>(_Unicode(sens_env));
+ std::string sensVis = x_display.attr<string>(_Unicode(sens));
+ std::string deadsensVis = x_display.attr<string>(_Unicode(deadsensor));
+ std::string deadwireVis = x_display.attr<string>(_Unicode(deadwire));
+
+ //fetch the shell parameters
+ if (x_det.hasAttr(_Unicode(shell))) {
+ xml_comp_t x_shell(x_det.child(_Unicode(shell)));
+ double rmin_shell = x_shell.rmin();
+ double rmax_shell = x_shell.rmax();
+ double zhalf_shell = x_shell.zhalf();
+ Tube shellSolid(rmin_shell, rmax_shell, zhalf_shell);
+ Volume shellLogical(name + "_ShellLogical", shellSolid, theDetector.material(x_shell.materialStr()));
+ shellLogical.setVisAttributes(theDetector.visAttributes(x_shell.visStr()));
+ envelope.placeVolume(shellLogical);
+
+ zPlanarData->zHalfShell = zhalf_shell;
+ zPlanarData->rInnerShell = rmin_shell;
+ zPlanarData->rOuterShell = rmax_shell;
+ }
+
+ for(xml_coll_t layer_i(x_det,_U(layer)); layer_i; ++layer_i){
+ xml_comp_t x_layer(layer_i);
dd4hep::PlacedVolume pv;
int layer_id = x_layer.attr<int>(_Unicode(layer_id));
@@ -353,7 +375,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
std::cout << ladder_enum.str() << " done." << endl;
if(i==0) std::cout << "xy=" << ladder_radius*cos(ladder_phi0) << " " << ladder_radius*sin(ladder_phi0) << std::endl;
}
-
+
// package the reconstruction data
dd4hep::rec::ZPlanarData::LayerLayout topLayer;
dd4hep::rec::ZPlanarData::LayerLayout bottomLayer;