Skip to content
Snippets Groups Projects
Commit b18afbb7 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Removing hard-coding in backward ecal.

	modified:   compact/ecal_backward_hybrid.xml
	modified:   src/HybridCalorimeter_geo.cpp
parent b462d6af
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,8 @@
Backwards Endcap EM Calorimeter, placements generated by script
</documentation>
<detector id="ECalEndcapN_ID" name="EcalEndcapN" type="HybridCalorimeter" readout="EcalEndcapNHits">
<inner material="SciGlass"/>
<outer material="G4_PbWO4"/>
<position x="0" y="0" z="EcalEndcapN_z0"/>
<rotation x="0" y="0" z="0"/>
</detector>
......
......@@ -34,10 +34,23 @@ static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDete
int detID = detElem.id();
DetElement det(detName, detID);
sens.setType("calorimeter");
xml_det_t x_det = handle;
auto glass_material = desc.material("SciGlass");
auto crystal_material = desc.material("PbWO4");
auto air_material = desc.material("Air");
if(!x_det.hasChild("inner")){
//error
}
if(!x_det.hasChild("outer")){
//error
}
xml_comp_t x_inner_cal(x_det.child(_U(inner)));
xml_comp_t x_outer_cal(x_det.child(_U(outer)));
auto inner_cal_mat_name = x_inner_cal.materialStr();
auto outer_cal_mat_name = x_outer_cal.materialStr();
auto glass_material = desc.material(inner_cal_mat_name);
auto crystal_material = desc.material(outer_cal_mat_name);
auto air_material = desc.material("Air");
double ROut = desc.constantAsDouble("EcalEndcapN_rmax");
double RIn = desc.constantAsDouble("EcalEndcapN_rmin");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment