Skip to content
Snippets Groups Projects
Commit 7b503f39 authored by Marshall Scott's avatar Marshall Scott
Browse files

Current ci_HAL.cpp

parent 3569d20c
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
......@@ -10,9 +10,9 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
xml::DetElement detElem = handle;
std::string detName = "ci_HCAL";
int detID = 1;
int detID = 1000;
//xml::Component dims = detElem.dimensions();
xml::Component dims = detElem.dimensions();
//Envelope volume specs
double RIn = 0. * dd4hep::cm;
double ROut = 300. * dd4hep::cm;
......@@ -22,13 +22,14 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
double det_RIn = 80. * dd4hep::cm;
Material mat_iron = desc.material("Iron");
Material mat_air = desc.material("Air");
Material mat_vac = desc.material("Vacuum")
Material mat_vac = desc.material("Vacuum");
Tube ci_Hcal_Solid(RIn, ROut, SizeZ / 2., 0., 360 * deg);
Tube ci_Hcal_Solid(RIn, ROut, SizeZ / 2., 0., 360 * dd4hep::deg);
Volume envelopeVol("ci_Hcal_Logic", ci_Hcal_Solid, mat_vac);//check that this one is iron
envelopeVol.setVisAttributes(0.3, 0, 3.0, 0.1);
//envelopeVol.setVisAttributes(0.3, 0, 3.0, 0.1);
//Layer Specs
double det_ROut = ROut - 1. * dd4hep::cm;
......@@ -42,12 +43,12 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
//detVol.setVisAttributes(0.6, 0, 0.6, 1);
/*
//Adding layers to placed detector volume
for (int lNum = 0; lNum < Nlay; lNum++){
//xml_comp_t x_layer = c;
string layer_name = detName + _toString(lNum, "_layer%d");
double layer_Posz = -SizeZ / 2. + (lNum + 1) * det_ThicknessZ + (lNum + 1) * 5. * ddphep::cm;
std::string layer_name = detName + _toString(lNum, "_layer%d");
double layer_Posz = -SizeZ / 2. + (lNum + 1) * det_ThicknessZ + (lNum + 1) * 5. * dd4hep::cm;
Volume layer_vol(layer_name, ci_Hcal_detSolid, mat_iron);
Position layer_pos(0, 0, layer_Posz);
......@@ -55,15 +56,17 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
//layer.setVisAttributes(desc.visAttributes(det.visStr()));
//layer.setAttributes(desc, layer_vol, desc.region(), desc.limits(), );//(region, limits, visable).
PlacedVolume layer_phv = envelopeVol.placeVolume(layer_vol, layer_pos);
layer_phv.addPhysVolID("layer", layerNum);
layer_phv.addPhysVolID("layer", lNum);
}
*/
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
PlacedVolume detPV = motherVol.placeVolume(envelopeVol, RotationZYX(0,0,0));
Transform3D tr(RotationZYX(0,0,0), Position(0, 0, ShiftZ) );
PlacedVolume detPV = motherVol.placeVolume(envelopeVol, tr);
det.setPlacement(detPV);
/**/
//DetElement det(detName, detID);
return det;
}
// clang-format off
DECLARE_DETELEMENT(ci_GEM, createDetector)
DECLARE_DETELEMENT(ci_HCAL, createDetector)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment