diff --git a/Detector/DetEcalMatrix/compact/det.xml b/Detector/DetEcalMatrix/compact/det.xml index ef4c0ed9e590b4eb9b8116e40f7215dc309ce285..bb4f486360a1c5bee3176f9ca2214653ddda0cf7 100644 --- a/Detector/DetEcalMatrix/compact/det.xml +++ b/Detector/DetEcalMatrix/compact/det.xml @@ -32,13 +32,18 @@ <detectors> <detector id="1" name="CaloDetector" type="EcalMatrix" readout="CaloHitsCollection" vis="VisibleGreen" sensitive="true"> - <position x="0" y="0" z="1800*mm"/> + <position x="0" y="0" z="1835*mm+30*cm"/> + <dimensions dx="30*cm" dy="30*cm" dz="30*cm"/> </detector> </detectors> <readouts> <readout name="CaloHitsCollection"> - <id>system:8</id> + <segmentation type="CartesianGridXYZ" + grid_size_x="1*cm" + grid_size_y="1*cm" + grid_size_z="1*cm"/> + <id>system:8,x:32:-6,y:-6,z:-6</id> </readout> </readouts> diff --git a/Detector/DetEcalMatrix/src/calorimeter/EcalMatrix.cpp b/Detector/DetEcalMatrix/src/calorimeter/EcalMatrix.cpp index 0869850674d7555030ff1c31715a9f5641350721..274330ba63acddec63b9c15abcdea8e8b3ac6d37 100644 --- a/Detector/DetEcalMatrix/src/calorimeter/EcalMatrix.cpp +++ b/Detector/DetEcalMatrix/src/calorimeter/EcalMatrix.cpp @@ -27,6 +27,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, MYDEBUGVAL(det_name); MYDEBUGVAL(det_type); xml_dim_t pos (x_det.child(_U(position))); + xml_dim_t dim (x_det.child(_U(dimensions))); dd4hep::DetElement sdet(det_name, x_det.id()); @@ -34,7 +35,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, dd4hep::Volume motherVol = theDetector.pickMotherVolume(sdet); dd4hep::Material det_mat(theDetector.material("G4_BGO")); - dd4hep::Volume det_vol(det_name+"_vol", dd4hep::Box(60, 60, 60), det_mat); + dd4hep::Volume det_vol(det_name+"_vol", dd4hep::Box(dim.dx(), dim.dy(), dim.dz()), det_mat); dd4hep::Transform3D transform(dd4hep::Rotation3D(), dd4hep::Position(pos.x(),pos.y(),pos.z()));