Skip to content
Snippets Groups Projects
Commit a29e5ae9 authored by Whitney Armstrong's avatar Whitney Armstrong Committed by Sylvester Joosten
Browse files

Removed "barrel" from id spec for trackers

(cherry picked from commit eecf9628)
parent 7b42e5bc
No related branches found
No related tags found
1 merge request!214Removed "barrel" from id spec for trackers
...@@ -37,8 +37,7 @@ dd4hep_add_plugin(${a_lib_name} SOURCES ...@@ -37,8 +37,7 @@ dd4hep_add_plugin(${a_lib_name} SOURCES
src/MRich_geo.cpp src/MRich_geo.cpp
src/PolyhedraEndcapCalorimeter2_geo.cpp src/PolyhedraEndcapCalorimeter2_geo.cpp
src/ShashlikCalorimeter_geo.cpp src/ShashlikCalorimeter_geo.cpp
src/SimpleDiskTracker_geo.cpp src/SimpleDiskDetector_geo.cpp
src/SimpleRectangularTracker_geo.cpp
src/SolenoidCoil_geo.cpp src/SolenoidCoil_geo.cpp
src/TrapEndcapTracker_geo.cpp src/TrapEndcapTracker_geo.cpp
USES ActsCore ActsPluginDD4hep USES ActsCore ActsPluginDD4hep
......
...@@ -532,11 +532,11 @@ total X0 0.24% per disk layer (4 sectors per disk): ...@@ -532,11 +532,11 @@ total X0 0.24% per disk layer (4 sectors per disk):
<readouts> <readouts>
<readout name="TrackerBarrelHits"> <readout name="TrackerBarrelHits">
<segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" /> <segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-14,y:-18</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-14,y:-18</id>
</readout> </readout>
<readout name="TrackerEndcapHits"> <readout name="TrackerEndcapHits">
<segmentation type="CartesianGridXZ" grid_size_x="0.010*mm" grid_size_z="0.010*mm" /> <segmentation type="CartesianGridXZ" grid_size_x="0.010*mm" grid_size_z="0.010*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id>
</readout> </readout>
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<readouts> <readouts>
<readout name="DIRCBarHits"> <readout name="DIRCBarHits">
<segmentation type="CartesianGridXY" grid_size_x="3.0*mm" grid_size_y="3.0*mm" /> <segmentation type="CartesianGridXY" grid_size_x="3.0*mm" grid_size_y="3.0*mm" />
<id>system:8,barrel:2,layer:4,module:8,section:4,x:32:-16,y:-16</id> <id>system:8,layer:4,module:8,section:4,x:32:-16,y:-16</id>
</readout> </readout>
</readouts> </readouts>
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
<readouts> <readouts>
<readout name="GEMTrackerEndcapHits"> <readout name="GEMTrackerEndcapHits">
<segmentation type="CartesianGridXZ" grid_size_x="50*um" grid_size_z="250*um" /> <segmentation type="CartesianGridXZ" grid_size_x="50*um" grid_size_z="250*um" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id>
</readout> </readout>
</readouts> </readouts>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<readouts> <readouts>
<readout name="BarrelTOFHits"> <readout name="BarrelTOFHits">
<segmentation type="CartesianGridXY" grid_size_x="0.150*mm" grid_size_y="0.150*mm" /> <segmentation type="CartesianGridXY" grid_size_x="0.150*mm" grid_size_y="0.150*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
</readout> </readout>
</readouts> </readouts>
......
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
<readouts> <readouts>
<readout name="TOFEndcapHits"> <readout name="TOFEndcapHits">
<segmentation type="CartesianGridXY" grid_size_x="0.20*mm" grid_size_y="0.20*mm" /> <segmentation type="CartesianGridXZ" grid_size_x="0.20*mm" grid_size_z="0.20*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id>
</readout> </readout>
</readouts> </readouts>
......
...@@ -311,11 +311,11 @@ Simple carbon fiber support shell. ...@@ -311,11 +311,11 @@ Simple carbon fiber support shell.
<readouts> <readouts>
<readout name="VertexBarrelHits"> <readout name="VertexBarrelHits">
<segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" /> <segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
</readout> </readout>
<readout name="VertexEndcapHits"> <readout name="VertexEndcapHits">
<segmentation type="CartesianGridXZ" grid_size_x="0.20*mm" grid_size_z="0.20*mm" /> <segmentation type="CartesianGridXZ" grid_size_x="0.20*mm" grid_size_z="0.20*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id>
</readout> </readout>
</readouts> </readouts>
......
...@@ -241,7 +241,6 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h ...@@ -241,7 +241,6 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h
assembly.setVisAttributes(description.invisible()); assembly.setVisAttributes(description.invisible());
pv = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0, 0, dirc_pos.z())); pv = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0, 0, dirc_pos.z()));
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.
sdet.setPlacement(pv); sdet.setPlacement(pv);
return sdet; return sdet;
} }
......
...@@ -319,7 +319,6 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi ...@@ -319,7 +319,6 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi
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.
sdet.setPlacement(pv); sdet.setPlacement(pv);
return sdet; return sdet;
} }
......
...@@ -22,7 +22,7 @@ using namespace std; ...@@ -22,7 +22,7 @@ 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 SimpleDiskDetector_create_detector(Detector& description, xml_h e, SensitiveDetector sens)
{ {
xml_det_t x_det = e; xml_det_t x_det = e;
Material air = description.air(); Material air = description.air();
...@@ -126,6 +126,5 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -126,6 +126,5 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
return sdet; return sdet;
} }
DECLARE_DETELEMENT(athena_SimpleDiskTracker, create_detector) DECLARE_DETELEMENT(ref_SolenoidEndcap, SimpleDiskDetector_create_detector)
DECLARE_DETELEMENT(ref_DiskTracker, create_detector) DECLARE_DETELEMENT(athena_SolenoidEndcap, SimpleDiskDetector_create_detector)
DECLARE_DETELEMENT(ref_SolenoidEndcap, create_detector)
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
// Modified : W.Armstrong
//
//==========================================================================
//
// Specialized generic detector constructor
//
//==========================================================================
#include "DD4hep/DetFactoryHelper.h"
using namespace std;
using namespace dd4hep;
using namespace dd4hep::detail;
static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) {
xml_det_t x_det = e;
Material air = description.air();
string det_name = x_det.nameStr();
bool reflect = x_det.reflect();
DetElement sdet(det_name,x_det.id());
Assembly assembly(det_name);
PlacedVolume pv;
int l_num = 0;
xml::Component pos = x_det.position();
for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++l_num) {
xml_comp_t x_layer = i;
string l_nam = det_name + _toString(l_num, "_layer%d");
double x_lay = x_layer.x();
double y_lay = x_layer.y();
double z = 0;
double zmin = 0;
double layerWidth = 0.;
int s_num = 0;
for(xml_coll_t j(x_layer,_U(slice)); j; ++j) {
double thickness = xml_comp_t(j).thickness();
layerWidth += thickness;
}
Box l_box(x_lay/2.0, y_lay/2.0, layerWidth/2.0 );
Volume l_vol(l_nam, l_box, air);
l_vol.setVisAttributes(description, x_layer.visStr());
for (xml_coll_t j(x_layer, _U(slice)); j; ++j, ++s_num) {
xml_comp_t x_slice = j;
double thick = x_slice.thickness();
Material mat = description.material(x_slice.materialStr());
string s_nam = l_nam + _toString(s_num, "_slice%d");
Volume s_vol(s_nam, Box(x_lay/2.0, y_lay/2.0, thick/2.0), mat);
if (x_slice.isSensitive()) {
sens.setType("tracker");
s_vol.setSensitiveDetector(sens);
}
s_vol.setAttributes(description, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
pv = l_vol.placeVolume(s_vol, Position(0, 0, z - zmin - layerWidth / 2 + thick / 2));
pv.addPhysVolID("slice", s_num);
}
DetElement layer(sdet,l_nam+"_pos",l_num);
pv = assembly.placeVolume(l_vol,Position(0,0,zmin+layerWidth/2.));
pv.addPhysVolID("layer",l_num);
pv.addPhysVolID("barrel",1);
layer.setPlacement(pv);
if ( reflect ) {
pv = assembly.placeVolume(l_vol,Transform3D(RotationY(M_PI),Position(0,0,-zmin-layerWidth/2)));
pv.addPhysVolID("layer",l_num);
pv.addPhysVolID("barrel",2);
DetElement layerR = layer.clone(l_nam+"_neg");
sdet.add(layerR.setPlacement(pv));
}
}
if ( x_det.hasAttr(_U(combineHits)) ) {
sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
pv = description.pickMotherVolume(sdet).placeVolume(assembly,Position(pos.x(),pos.y(),pos.z()));
pv.addPhysVolID("system", x_det.id()); // Set the subdetector system ID.
sdet.setPlacement(pv);
return sdet;
}
DECLARE_DETELEMENT(ref_RectangularTracker,create_detector)
...@@ -224,11 +224,11 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -224,11 +224,11 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
if (reflect) { if (reflect) {
layer_pv = layer_pv =
assembly.placeVolume(layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z))); assembly.placeVolume(layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z)));
layer_pv.addPhysVolID("barrel", 3).addPhysVolID("layer", l_id); layer_pv.addPhysVolID("layer", l_id);
layer_name += "_N"; layer_name += "_N";
} else { } else {
layer_pv = assembly.placeVolume(layer_vol, Position(0, 0, layer_center_z)); layer_pv = assembly.placeVolume(layer_vol, Position(0, 0, layer_center_z));
layer_pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id); layer_pv.addPhysVolID("layer", l_id);
layer_name += "_P"; layer_name += "_P";
} }
DetElement layer_element(sdet, layer_name, l_id); DetElement layer_element(sdet, layer_name, l_id);
...@@ -262,7 +262,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -262,7 +262,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
DetElement module(layer_element, m_base + "_pos", det_id); DetElement module(layer_element, m_base + "_pos", det_id);
pv = layer_vol.placeVolume( pv = layer_vol.placeVolume(
m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz))); m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz)));
pv.addPhysVolID("barrel", 1).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); pv.addPhysVolID("module", mod_num);
module.setPlacement(pv); module.setPlacement(pv);
for (size_t ic = 0; ic < sensVols.size(); ++ic) { for (size_t ic = 0; ic < sensVols.size(); ++ic) {
PlacedVolume sens_pv = sensVols[ic]; PlacedVolume sens_pv = sensVols[ic];
...@@ -276,7 +276,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -276,7 +276,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
} else { } else {
pv = layer_vol.placeVolume( pv = layer_vol.placeVolume(
m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, -zstart - dz))); m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, -zstart - dz)));
pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); pv.addPhysVolID("module", mod_num);
DetElement r_module(layer_element, m_base + "_neg", det_id); DetElement r_module(layer_element, m_base + "_neg", det_id);
r_module.setPlacement(pv); r_module.setPlacement(pv);
for (size_t ic = 0; ic < sensVols.size(); ++ic) { for (size_t ic = 0; ic < sensVols.size(); ++ic) {
......
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