Skip to content
Snippets Groups Projects
Commit 7e060dad authored by myliu@ihep.ac.cn's avatar myliu@ihep.ac.cn
Browse files

Solve the overlap problem of Drift Chamber

parent 7a952504
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
<constant name="DC_inner_chamber_enabled" value="1"/> <constant name="DC_inner_chamber_enabled" value="1"/>
<constant name="DC_outer_chamber_enabled" value="1"/> <constant name="DC_outer_chamber_enabled" value="1"/>
<constant name="Salf_distance" value="0.02*mm"/>
</define> </define>
<detectors> <detectors>
......
...@@ -63,6 +63,8 @@ ...@@ -63,6 +63,8 @@
<constant name="DC_inner_chamber_enabled" value="1"/> <constant name="DC_inner_chamber_enabled" value="1"/>
<constant name="DC_outer_chamber_enabled" value="1"/> <constant name="DC_outer_chamber_enabled" value="1"/>
<constant name="Salf_distance" value="0.02*mm"/>
</define> </define>
<display> <display>
......
...@@ -41,9 +41,9 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, ...@@ -41,9 +41,9 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::SensitiveDetector sd = sens; dd4hep::SensitiveDetector sd = sens;
// - global // - global
double chamber_radius_min = theDetector.constant<double>("SDT_radius_min"); // double chamber_radius_min = theDetector.constant<double>("SDT_radius_min");
double chamber_radius_max = theDetector.constant<double>("SDT_radius_max"); // double chamber_radius_max = theDetector.constant<double>("SDT_radius_max");
double chamber_length = theDetector.constant<double>("SDT_length"); double chamber_length = theDetector.constant<double>("DC_length");
// - inner chamber // - inner chamber
double inner_chamber_radius_min = theDetector.constant<double>("SDT_inner_chamber_radius_min"); double inner_chamber_radius_min = theDetector.constant<double>("SDT_inner_chamber_radius_min");
...@@ -66,6 +66,9 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, ...@@ -66,6 +66,9 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
int inner_chamber_enabled = theDetector.constant<int>("DC_inner_chamber_enabled"); int inner_chamber_enabled = theDetector.constant<int>("DC_inner_chamber_enabled");
int outer_chamber_enabled = theDetector.constant<int>("DC_outer_chamber_enabled"); int outer_chamber_enabled = theDetector.constant<int>("DC_outer_chamber_enabled");
// - salf distance
double salf_diatance = theDetector.constant<double>("Salf_distance");
// ======================================================================= // =======================================================================
// Detector Construction // Detector Construction
// ======================================================================= // =======================================================================
...@@ -210,7 +213,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, ...@@ -210,7 +213,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::PlacedVolume module_phy = layer_vol.placeVolume(module_vol,transform_module); dd4hep::PlacedVolume module_phy = layer_vol.placeVolume(module_vol,transform_module);
// - Field wire // - Field wire
dd4hep::PlacedVolume Module_phy; dd4hep::PlacedVolume Module_phy;
double radius[9] = {rmid-chamber_layer_width*0.5,rmid-chamber_layer_width*0.5,rmid-chamber_layer_width*0.5,rmid-chamber_layer_width*0.5,rmid,rmid+chamber_layer_width*0.5,rmid+chamber_layer_width*0.5,rmid+chamber_layer_width*0.5,rmid+chamber_layer_width*0.5}; double radius[9] = {rmid-chamber_layer_width*0.5+salf_diatance,rmid-chamber_layer_width*0.5+salf_diatance,rmid-chamber_layer_width*0.5+salf_diatance,rmid-chamber_layer_width*0.5+salf_diatance,rmid,rmid+chamber_layer_width*0.5-salf_diatance,rmid+chamber_layer_width*0.5-salf_diatance,rmid+chamber_layer_width*0.5-salf_diatance,rmid+chamber_layer_width*0.5-salf_diatance};
double phi[9] = {wire_phi+layer_Phi*0.25,wire_phi,wire_phi-layer_Phi*0.25,wire_phi-layer_Phi*0.5,wire_phi-layer_Phi*0.5,wire_phi-layer_Phi*0.5,wire_phi-layer_Phi*0.25,wire_phi,wire_phi+layer_Phi*0.25}; double phi[9] = {wire_phi+layer_Phi*0.25,wire_phi,wire_phi-layer_Phi*0.25,wire_phi-layer_Phi*0.5,wire_phi-layer_Phi*0.5,wire_phi-layer_Phi*0.5,wire_phi-layer_Phi*0.25,wire_phi,wire_phi+layer_Phi*0.25};
int num = 5; int num = 5;
if(layer_id==(inner_chamber_layer_number-1)||layer_id==(outer_chamber_layer_number-1)) { num = 9; } if(layer_id==(inner_chamber_layer_number-1)||layer_id==(outer_chamber_layer_number-1)) { num = 9; }
...@@ -255,12 +258,12 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, ...@@ -255,12 +258,12 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::Position(0,0,0)); dd4hep::Position(0,0,0));
dd4hep::PlacedVolume phv = envelope.placeVolume(det_vol,transform); dd4hep::PlacedVolume phv = envelope.placeVolume(det_vol,transform);
// - place wall // - place wall
// dd4hep::PlacedVolume wall_phy; dd4hep::PlacedVolume wall_phy;
for(int i=0; i<4; i++) { for(int i=0; i<4; i++) {
dd4hep::Tube wall_solid(wall_rmin[i],wall_rmax[i],chamber_length*0.5); dd4hep::Tube wall_solid(wall_rmin[i],wall_rmax[i],chamber_length*0.5);
dd4hep::Volume wall_vol(det_name+"_wall_vol",wall_solid,wall_mat); dd4hep::Volume wall_vol(det_name+"_wall_vol",wall_solid,wall_mat);
wall_vol.setVisAttributes(theDetector,"VisibleGreen"); wall_vol.setVisAttributes(theDetector,"VisibleGreen");
dd4hep::PlacedVolume wall_phy = envelope.placeVolume(wall_vol,transform); wall_phy = envelope.placeVolume(wall_vol,transform);
} }
// - place Endcap // - place Endcap
...@@ -282,4 +285,4 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, ...@@ -282,4 +285,4 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
} }
DECLARE_DETELEMENT(DriftChamber, create_detector); DECLARE_DETELEMENT(DriftChamber, create_detector)
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